Open CASCADE Technology 7.8.0
|
VTK picker for OCC shapes with OCC selection algorithm. More...
#include <IVtkTools_ShapePicker.hxx>
Public Member Functions | |
vtkTypeMacro (IVtkTools_ShapePicker, vtkAbstractPropPicker) static IVtkTools_ShapePicker *New() | |
int | pick (double *thePos, vtkRenderer *theRenderer, const int theNbPoints=-1) |
Pick entities in the given point or area. | |
virtual int | Pick (double theX, double theY, double theZ, vtkRenderer *theRenderer=NULL) override |
Pick entities in the given point. | |
int | Pick (double theX0, double theY0, double theX1, double theY1, vtkRenderer *theRenderer=NULL) |
Pick entities in the given rectangle area. | |
int | Pick (double poly[][3], const int theNbPoints, vtkRenderer *theRenderer=NULL) |
Pick entities in the given polygonal area. | |
void | SetTolerance (float theTolerance) |
Setter for tolerance of picking. | |
float | GetTolerance () const |
Getter for tolerance of picking. | |
void | SetRenderer (vtkRenderer *theRenderer) |
Sets the renderer to be used by OCCT selection algorithm. | |
void | SetAreaSelection (bool theIsOn) |
Sets area selection on/off. | |
IVtk_SelectionModeList | GetSelectionModes (const IVtk_IShape::Handle &theShape) const |
Get activated selection modes for a shape. | |
IVtk_SelectionModeList | GetSelectionModes (vtkActor *theShapeActor) const |
Get activated selection modes for a shape actor. | |
void | SetSelectionMode (const IVtk_IShape::Handle &theShape, const IVtk_SelectionMode theMode, const bool theIsTurnOn=true) const |
Turn on/off a selection mode for a shape actor. | |
void | SetSelectionMode (vtkActor *theShapeActor, const IVtk_SelectionMode theMode, const bool theIsTurnOn=true) const |
Turn on/off a selection mode for a shape actor. | |
void | SetSelectionMode (const IVtk_SelectionMode theMode, const bool theIsTurnOn=true) const |
Sets the current selection mode for all visible shape objects. | |
IVtk_ShapeIdList | GetPickedShapesIds (bool theIsAll=false) const |
Access to the list of top-level shapes picked. If all argument is true, the picker returns the list of all OccShape objects found by the picking algorithm. e.g. all shapes under the mouse cursor. Otherwise, ID of the shape closest to the eye is returned. | |
IVtk_ShapeIdList | GetPickedSubShapesIds (const IVtk_IdType theId, bool theIsAll=false) const |
Access to the list of sub-shapes ids picked. | |
vtkSmartPointer< vtkActorCollection > | GetPickedActors (bool theIsAll=false) const |
Access to the list of actors picked. | |
void | RemoveSelectableObject (const IVtk_IShape::Handle &theShape) |
Remove selectable object from the picker (from internal maps). | |
void | RemoveSelectableActor (vtkActor *theShapeActor) |
Remove selectable object from the picker (from internal maps). | |
Protected Member Functions | |
IVtkTools_ShapePicker () | |
Constructs the picker with empty renderer and ready for point selection. | |
virtual | ~IVtkTools_ShapePicker () |
Destructor. | |
Static Protected Member Functions | |
static bool | convertDisplayToWorld (vtkRenderer *theRenderer, double theDisplayCoord[3], double theWorldCoord[3]) |
Convert display coordinates to world coordinates. | |
VTK picker for OCC shapes with OCC selection algorithm.
|
protected |
Constructs the picker with empty renderer and ready for point selection.
|
protectedvirtual |
Destructor.
|
staticprotected |
Convert display coordinates to world coordinates.
vtkSmartPointer< vtkActorCollection > IVtkTools_ShapePicker::GetPickedActors | ( | bool | theIsAll = false | ) | const |
Access to the list of actors picked.
[in] | theIsAll | Get all selected actors or just the only top one is returned, has no effect during area selection. |
IVtk_ShapeIdList IVtkTools_ShapePicker::GetPickedShapesIds | ( | bool | theIsAll = false | ) | const |
Access to the list of top-level shapes picked. If all argument is true, the picker returns the list of all OccShape objects found by the picking algorithm. e.g. all shapes under the mouse cursor. Otherwise, ID of the shape closest to the eye is returned.
[in] | theIsAll | Get all selected shapes or just the only top one is returned, has no effect during area selection. |
IVtk_ShapeIdList IVtkTools_ShapePicker::GetPickedSubShapesIds | ( | const IVtk_IdType | theId, |
bool | theIsAll = false |
||
) | const |
Access to the list of sub-shapes ids picked.
[in] | theId | top-level shape ID |
[in] | theIsAll | Get all selected sub-shapes or just the only top one is returned, has no effect during area selection. |
IVtk_SelectionModeList IVtkTools_ShapePicker::GetSelectionModes | ( | const IVtk_IShape::Handle & | theShape | ) | const |
Get activated selection modes for a shape.
[in] | theShape | a shape with activated selection mode(s) |
IVtk_SelectionModeList IVtkTools_ShapePicker::GetSelectionModes | ( | vtkActor * | theShapeActor | ) | const |
Get activated selection modes for a shape actor.
[in] | theShapeActor | an actor with activated selection mode(s) |
float IVtkTools_ShapePicker::GetTolerance | ( | ) | const |
Getter for tolerance of picking.
int IVtkTools_ShapePicker::pick | ( | double * | thePos, |
vtkRenderer * | theRenderer, | ||
const int | theNbPoints = -1 |
||
) |
Pick entities in the given point or area.
int IVtkTools_ShapePicker::Pick | ( | double | poly[][3], |
const int | theNbPoints, | ||
vtkRenderer * | theRenderer = NULL |
||
) |
Pick entities in the given polygonal area.
|
overridevirtual |
Pick entities in the given point.
int IVtkTools_ShapePicker::Pick | ( | double | theX0, |
double | theY0, | ||
double | theX1, | ||
double | theY1, | ||
vtkRenderer * | theRenderer = NULL |
||
) |
Pick entities in the given rectangle area.
void IVtkTools_ShapePicker::RemoveSelectableActor | ( | vtkActor * | theShapeActor | ) |
Remove selectable object from the picker (from internal maps).
[in] | theShapeActor | the shape presentation actor to be removed from the picker |
void IVtkTools_ShapePicker::RemoveSelectableObject | ( | const IVtk_IShape::Handle & | theShape | ) |
Remove selectable object from the picker (from internal maps).
[in] | theShape | the selectable shape |
void IVtkTools_ShapePicker::SetAreaSelection | ( | bool | theIsOn | ) |
Sets area selection on/off.
[in] | theIsOn | true if area selection is turned on, false otherwise. |
void IVtkTools_ShapePicker::SetRenderer | ( | vtkRenderer * | theRenderer | ) |
Sets the renderer to be used by OCCT selection algorithm.
void IVtkTools_ShapePicker::SetSelectionMode | ( | const IVtk_IShape::Handle & | theShape, |
const IVtk_SelectionMode | theMode, | ||
const bool | theIsTurnOn = true |
||
) | const |
Turn on/off a selection mode for a shape actor.
[in] | theShape | a shape to set a selection mode for |
[in] | theMode | selection mode to be activated |
[in] | theIsTurnOn | Flag to turn on/off the selection mode |
void IVtkTools_ShapePicker::SetSelectionMode | ( | const IVtk_SelectionMode | theMode, |
const bool | theIsTurnOn = true |
||
) | const |
Sets the current selection mode for all visible shape objects.
[in] | theMode | selection mode to be activated |
[in] | theIsTurnOn | Flag to turn on/off the selection mode |
void IVtkTools_ShapePicker::SetSelectionMode | ( | vtkActor * | theShapeActor, |
const IVtk_SelectionMode | theMode, | ||
const bool | theIsTurnOn = true |
||
) | const |
Turn on/off a selection mode for a shape actor.
[in] | theShapeActor | shape presentation actor to set a selection mode for |
[in] | theMode | selection mode to be activated |
[in] | theIsTurnOn | Flag to turn on/off the selection mode |
void IVtkTools_ShapePicker::SetTolerance | ( | float | theTolerance | ) |
Setter for tolerance of picking.
IVtkTools_ShapePicker::vtkTypeMacro | ( | IVtkTools_ShapePicker | , |
vtkAbstractPropPicker | |||
) |