60 #include "SplatCloudObjectSelectionPlugin.hh"
79 if( _splatCloud == 0 )
82 unsigned int numDeleted = _splatCloud->
eraseSplatsByIndex( SplatCloudSelection::getVertexSelection( _splatCloud ) );
84 return (numDeleted != 0);
103 if( _splatCloud == 0 )
106 if( (_index >= _splatCloud->
numSplats()) )
114 unsigned int i, num = _splatCloud->
numSplats();
115 for( i=0; i<num; ++i )
122 emit scriptInfo(
"selectVertices(ObjectId , [" + QString::number( _index ) +
"])" );
124 emit scriptInfo(
"unselectVertices(ObjectId , [" + QString::number( _index ) +
"])" );
145 if( _splatCloud == 0 )
148 if( (_index >= _splatCloud->
numSplats()) )
162 unsigned int i, num = _splatCloud->
numSplats();
163 for( i=0; i<num; ++i )
170 double sqrRadius = _radius * _radius;
172 SplatCloud::Selection selection = !_deselection;
174 unsigned int i, num = _splatCloud->
numSplats();
175 for( i=0; i<num; ++i )
179 double dx = pos[0] - _hit_point[0];
180 double dy = pos[1] - _hit_point[1];
181 double dz = pos[2] - _hit_point[2];
183 double sqrDist = dx*dx + dy*dy + dz*dz;
185 if( sqrDist <= sqrRadius )
208 if( _splatCloud == 0 )
227 unsigned int i, num = _splatCloud->
numSplats();
228 for( i=0; i<num; ++i )
235 SplatCloud::Selection selection = !_deselection;
237 int i, num =
static_cast<int>(_splatCloud->
numSplats());
239 #pragma omp parallel for
241 for( i=0; i<num; ++i )
247 if( _region->contains( QPoint( (
int) proj[0], _state.
context_height() - (int) proj[1] ) ) )
277 if( _splatCloud == 0 )
287 unsigned int i, num = _splatCloud->
numSplats();
288 for( i=0; i<num; ++i )
289 _splatCloud->
colors( i ) = black;
295 unsigned char r = (_r < 0) ? 0 : (_r > 255) ? 255 : (
unsigned char) _r;
296 unsigned char g = (_g < 0) ? 0 : (_g > 255) ? 255 : (
unsigned char) _g;
297 unsigned char b = (_b < 0) ? 0 : (_b > 255) ? 255 : (
unsigned char) _b;
301 unsigned int i, num = _splatCloud->
numSplats();
302 for( i=0; i<num; ++i )
305 _splatCloud->
colors( i ) = color;
bool hasPositions() const
Return the availability of the predefined property.
int context_height() const
get gl context height
SelectionInterface::PrimitiveType vertexType_
Primitive type handle.
bool requestSelections()
Request the predefined property.
bool splatCloudVolumeSelection(SplatCloud *_splatCloud, ACG::GLState &_state, QRegion *_region, PrimitiveType _primitiveTypes, bool _deselection)
Surface volume selection tool.
Color & colors(int _idx)
Get a reference of the predefined property's value.
Selection & selections(int _idx)
Get a reference of the predefined property's value.
void splatCloudColorizeSelection(SplatCloud *_splatCloud, PrimitiveType _primitiveTypes, int _r, int _g, int _b, int _a)
Colorize the selection.
unsigned int numSplats() const
Get the number of splats.
bool splatCloudDeleteSelection(SplatCloud *_splatCloud, PrimitiveType _primitiveType)
Delete all selected elements of a SplatCloud.
unsigned int eraseSplatsByIndex(const T &_indices)
Delete the elements with given indices from the data vector of all splat-properties.
Position & positions(int _idx)
Get a reference of the predefined property's value.
void splatCloudToggleSelection(SplatCloud *_splatCloud, uint _index, ACG::Vec3d &_hit_point, PrimitiveType _primitiveType)
Toggle SplatCloud selection.
Functions for selection on a SplatCloud.
void splatCloudSphereSelection(SplatCloud *_splatCloud, uint _index, ACG::Vec3d &_hit_point, double _radius, PrimitiveType _primitiveTypes, bool _deselection)
Use the event to paint selection with a sphere.
bool requestColors()
Request the predefined property.
Vec3d project(const Vec3d &_point) const
project point in world coordinates to window coordinates
bool hasColors() const
Return the availability of the predefined property.
bool hasSelections() const
Return the availability of the predefined property.