79 if( _splatCloud == 0 )
82 if( _vertices.empty() )
90 unsigned int i, num = _splatCloud->
numSplats();
91 for( i=0; i<num; ++i )
95 int n_vertices = (int) _splatCloud->
numSplats();
98 for( i=0; i<_vertices.size(); ++i )
100 int v = _vertices[ i ];
101 if( (v >= 0) && (v < n_vertices) )
112 if( _splatCloud == 0 )
115 if( _vertices.empty() )
121 int n_vertices = (int) _splatCloud->
numSplats();
124 for( i=0; i<_vertices.size(); ++i )
126 int v = _vertices[ i ];
127 if( (v >= 0) && (v < n_vertices) )
138 if( _splatCloud == 0 )
147 unsigned int i, num = _splatCloud->
numSplats();
148 for( i=0; i<num; ++i )
158 if( _splatCloud == 0 )
164 unsigned int i, num = _splatCloud->
numSplats();
165 for( i=0; i<num; ++i )
175 if( _splatCloud == 0 )
180 unsigned int i, num = _splatCloud->
numSplats();
181 for( i=0; i<num; ++i )
189 unsigned int i, num = _splatCloud->
numSplats();
190 for( i=0; i<num; ++i )
199 static unsigned int countSelected(
const SplatCloud *_splatCloud )
201 unsigned int count = 0;
203 unsigned int i, num = _splatCloud->
numSplats();
204 for( i=0; i<num; ++i )
219 std::vector<int> vertices;
221 if( _splatCloud == 0 )
227 unsigned int numSelected = countSelected( _splatCloud );
229 vertices.reserve( numSelected );
231 unsigned int i, num = _splatCloud->
numSplats();
232 for( i=0; i<num; ++i )
235 vertices.push_back( i );
249 std::vector<int> vertices;
251 if( _splatCloud == 0 )
257 unsigned int numSelected = countSelected( _splatCloud );
258 unsigned int numUnselected = _splatCloud->
numSplats() - numSelected;
260 if( numSelected <= numUnselected )
262 vertices.reserve( numSelected );
264 unsigned int i, num = _splatCloud->
numSplats();
265 for( i=0; i<num; ++i )
268 vertices.push_back( i );
275 vertices.reserve( numUnselected );
277 unsigned int i, num = _splatCloud->
numSplats();
278 for( i=0; i<num; ++i )
281 vertices.push_back( i );
bool requestSelections()
Request the predefined property.
Selection & selections(int _idx)
Get a reference of the predefined property's value.
void selectAllVertices(MeshT *_mesh)
Select all vertices of a mesh.
void selectVertices(MeshT *_mesh, const std::vector< int > &_vertices)
Select given vertices of a mesh.
unsigned int numSplats() const
Get the number of splats.
void clearVertexSelection(MeshT *_mesh)
Set all vertices to unselected.
bool hasSelections() const
Return the availability of the predefined property.
std::vector< int > getVertexSelection(MeshT *_mesh)
Get the current vertex selection.
void invertVertexSelection(MeshT *_mesh)
invert vertex selection
Functions for selection on a SplatCloud.
void unselectVertices(MeshT *_mesh, const std::vector< int > &_vertices)
Unselect given vertices of a mesh.