57 #define SPLATCLOUDT_CC 78 typename T::const_iterator idxIter;
79 for( idxIter = _indices.begin(); idxIter != _indices.end(); ++idxIter )
82 int idx =
static_cast<int>( *idxIter );
85 if( (idx >= 0) && (idx <= maxIdx) )
115 indices.push_back( i );
119 unsigned int numDelete = numSplats_ - indices.size();
125 SplatPropertyMap::const_iterator splatPropertyIter;
127 splatPropertyIter->second.property_->crop( indices );
130 numSplats_ = indices.size();
141 template <
typename T>
147 std::vector<int> validIndices;
148 validIndices.reserve( _indices.size() );
151 typename T::const_iterator idxIter;
152 for( idxIter = _indices.begin(); idxIter != _indices.end(); ++idxIter )
155 int idx =
static_cast<int>( *idxIter );
158 if( (idx >= 0) && (idx <= maxIdx) )
159 validIndices.push_back( idx );
163 SplatPropertyMap::const_iterator splatPropertyIter;
165 splatPropertyIter->second.property_->crop( validIndices );
175 template <
typename T>
179 std::vector<T> newData;
180 newData.reserve( _indices.size() );
183 std::vector<int>::const_iterator idxIter;
184 for( idxIter = _indices.begin(); idxIter != _indices.end(); ++idxIter )
185 newData.push_back( data_[ *idxIter ] );
188 data_.swap( newData );
195 template <
typename T>
209 ++iter->second.numRequests_;
237 template <
typename T>
251 ++iter->second.numRequests_;
272 template <
typename T>
289 --iter->second.numRequests_;
292 if( iter->second.numRequests_ == 0 )
311 template <
typename T>
328 --iter->second.numRequests_;
331 if( iter->second.numRequests_ == 0 )
350 template <
typename T>
364 template <
typename T>
378 template <
typename T>
392 template <
typename T>
CloudPropertyT< T > * requestCloudProperty(const PropertyHandleT< T > &_handle)
Request a new property.
CloudPropertyT< T > * getCloudProperty(const PropertyHandleT< T > &_handle)
Get a pointer to a property.
unsigned int eraseSplatsByIndex(const T &_indices)
Delete the elements with given indices from the data vector of all splat-properties.
SplatPropertyT< T > * getSplatProperty(const PropertyHandleT< T > &_handle)
Get a pointer to a property.
void cropSplats(const T &_indices)
Keep only the elements with given indices in the data vector of all splat-properties. The splats will be rearranged depending on the order of the indices.
std::vector< T > data_
The actual stored data (one element per splat)
CloudPropertyMap cloudProperties_
Cloud-property map.
CloudPropertyT< T > * releaseCloudProperty(const PropertyHandleT< T > &_handle)
Release a property.
unsigned int numSplats_
Number of splats.
SplatPropertyMap splatProperties_
Splat-property map.
unsigned int eraseSplatsByFlag(const std::vector< T > &_flags)
Delete the elements with flag != 0 from the data vector of all splat-properties.
Index & indices(int _idx)
Get a reference of the predefined property's value.
virtual void crop(const std::vector< int > &_indices)
Keep only the elements with given indices in the data vector. The indices have to be valid...
SplatPropertyT< T > * releaseSplatProperty(const PropertyHandleT< T > &_handle)
Release a property.
SplatPropertyT< T > * requestSplatProperty(const PropertyHandleT< T > &_handle)
Request a new property.