Open CASCADE Technology  7.7.0
Public Member Functions | Protected Member Functions | Static Protected Member Functions

IVtkTools_ShapePicker Class Reference

VTK picker for OCC shapes with OCC selection algorithm. More...

#include <IVtkTools_ShapePicker.hxx>

Inheritance diagram for IVtkTools_ShapePicker:
Inheritance graph
[legend]

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. More...
 
virtual int Pick (double theX, double theY, double theZ, vtkRenderer *theRenderer=NULL) override
 Pick entities in the given point. More...
 
int Pick (double theX0, double theY0, double theX1, double theY1, vtkRenderer *theRenderer=NULL)
 Pick entities in the given rectangle area. More...
 
int Pick (double poly[][3], const int theNbPoints, vtkRenderer *theRenderer=NULL)
 Pick entities in the given polygonal area. More...
 
void SetTolerance (float theTolerance)
 Setter for tolerance of picking. More...
 
float GetTolerance () const
 Getter for tolerance of picking. More...
 
void SetRenderer (vtkRenderer *theRenderer)
 Sets the renderer to be used by OCCT selection algorithm. More...
 
void SetAreaSelection (bool theIsOn)
 Sets area selection on/off. More...
 
IVtk_SelectionModeList GetSelectionModes (const IVtk_IShape::Handle &theShape) const
 Get activated selection modes for a shape. More...
 
IVtk_SelectionModeList GetSelectionModes (vtkActor *theShapeActor) const
 Get activated selection modes for a shape actor. More...
 
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. More...
 
void SetSelectionMode (vtkActor *theShapeActor, const IVtk_SelectionMode theMode, const bool theIsTurnOn=true) const
 Turn on/off a selection mode for a shape actor. More...
 
void SetSelectionMode (const IVtk_SelectionMode theMode, const bool theIsTurnOn=true) const
 Sets the current selection mode for all visible shape objects. More...
 
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. More...
 
IVtk_ShapeIdList GetPickedSubShapesIds (const IVtk_IdType theId, bool theIsAll=false) const
 Access to the list of sub-shapes ids picked. More...
 
vtkSmartPointer< vtkActorCollection > GetPickedActors (bool theIsAll=false) const
 Access to the list of actors picked. More...
 
void RemoveSelectableObject (const IVtk_IShape::Handle &theShape)
 Remove selectable object from the picker (from internal maps). More...
 
void RemoveSelectableActor (vtkActor *theShapeActor)
 Remove selectable object from the picker (from internal maps). More...
 

Protected Member Functions

 IVtkTools_ShapePicker ()
 Constructs the picker with empty renderer and ready for point selection. More...
 
virtual ~IVtkTools_ShapePicker ()
 Destructor. More...
 

Static Protected Member Functions

static bool convertDisplayToWorld (vtkRenderer *theRenderer, double theDisplayCoord[3], double theWorldCoord[3])
 Convert display coordinates to world coordinates. More...
 

Detailed Description

VTK picker for OCC shapes with OCC selection algorithm.

Constructor & Destructor Documentation

◆ IVtkTools_ShapePicker()

IVtkTools_ShapePicker::IVtkTools_ShapePicker ( )
protected

Constructs the picker with empty renderer and ready for point selection.

◆ ~IVtkTools_ShapePicker()

virtual IVtkTools_ShapePicker::~IVtkTools_ShapePicker ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ convertDisplayToWorld()

static bool IVtkTools_ShapePicker::convertDisplayToWorld ( vtkRenderer *  theRenderer,
double  theDisplayCoord[3],
double  theWorldCoord[3] 
)
staticprotected

Convert display coordinates to world coordinates.

◆ GetPickedActors()

vtkSmartPointer<vtkActorCollection> IVtkTools_ShapePicker::GetPickedActors ( bool  theIsAll = false) const

Access to the list of actors picked.

Parameters
[in]theIsAllGet all selected actors or just the only top one is returned, has no effect during area selection.
Returns
List of actors IDs

◆ GetPickedShapesIds()

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.

Parameters
[in]theIsAllGet all selected shapes or just the only top one is returned, has no effect during area selection.
Returns
List of top-level shape IDs

◆ GetPickedSubShapesIds()

IVtk_ShapeIdList IVtkTools_ShapePicker::GetPickedSubShapesIds ( const IVtk_IdType  theId,
bool  theIsAll = false 
) const

Access to the list of sub-shapes ids picked.

Parameters
[in]theIdtop-level shape ID
[in]theIsAllGet all selected sub-shapes or just the only top one is returned, has no effect during area selection.
Returns
List of sub-shapes IDs

◆ GetSelectionModes() [1/2]

IVtk_SelectionModeList IVtkTools_ShapePicker::GetSelectionModes ( const IVtk_IShape::Handle theShape) const

Get activated selection modes for a shape.

Parameters
[in]theShapea shape with activated selection mode(s)
Returns
list of active selection modes

◆ GetSelectionModes() [2/2]

IVtk_SelectionModeList IVtkTools_ShapePicker::GetSelectionModes ( vtkActor *  theShapeActor) const

Get activated selection modes for a shape actor.

Parameters
[in]theShapeActoran actor with activated selection mode(s)
Returns
list of active selection modes

◆ GetTolerance()

float IVtkTools_ShapePicker::GetTolerance ( ) const

Getter for tolerance of picking.

◆ pick()

int IVtkTools_ShapePicker::pick ( double *  thePos,
vtkRenderer *  theRenderer,
const int  theNbPoints = -1 
)

Pick entities in the given point or area.

Returns
Number of detected entities.

◆ Pick() [1/3]

int IVtkTools_ShapePicker::Pick ( double  poly[][3],
const int  theNbPoints,
vtkRenderer *  theRenderer = NULL 
)

Pick entities in the given polygonal area.

Returns
Number of detected entities.

◆ Pick() [2/3]

virtual int IVtkTools_ShapePicker::Pick ( double  theX,
double  theY,
double  theZ,
vtkRenderer *  theRenderer = NULL 
)
overridevirtual

Pick entities in the given point.

Returns
Number of detected entities.

◆ Pick() [3/3]

int IVtkTools_ShapePicker::Pick ( double  theX0,
double  theY0,
double  theX1,
double  theY1,
vtkRenderer *  theRenderer = NULL 
)

Pick entities in the given rectangle area.

Returns
Number of detected entities.

◆ RemoveSelectableActor()

void IVtkTools_ShapePicker::RemoveSelectableActor ( vtkActor *  theShapeActor)

Remove selectable object from the picker (from internal maps).

Parameters
[in]theShapeActorthe shape presentation actor to be removed from the picker

◆ RemoveSelectableObject()

void IVtkTools_ShapePicker::RemoveSelectableObject ( const IVtk_IShape::Handle theShape)

Remove selectable object from the picker (from internal maps).

Parameters
[in]theShapethe selectable shape

◆ SetAreaSelection()

void IVtkTools_ShapePicker::SetAreaSelection ( bool  theIsOn)

Sets area selection on/off.

Parameters
[in]theIsOntrue if area selection is turned on, false otherwise.

◆ SetRenderer()

void IVtkTools_ShapePicker::SetRenderer ( vtkRenderer *  theRenderer)

Sets the renderer to be used by OCCT selection algorithm.

◆ SetSelectionMode() [1/3]

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.

Parameters
[in]theShapea shape to set a selection mode for
[in]theModeselection mode to be activated
[in]theIsTurnOnFlag to turn on/off the selection mode

◆ SetSelectionMode() [2/3]

void IVtkTools_ShapePicker::SetSelectionMode ( const IVtk_SelectionMode  theMode,
const bool  theIsTurnOn = true 
) const

Sets the current selection mode for all visible shape objects.

Parameters
[in]theModeselection mode to be activated
[in]theIsTurnOnFlag to turn on/off the selection mode

◆ SetSelectionMode() [3/3]

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.

Parameters
[in]theShapeActorshape presentation actor to set a selection mode for
[in]theModeselection mode to be activated
[in]theIsTurnOnFlag to turn on/off the selection mode

◆ SetTolerance()

void IVtkTools_ShapePicker::SetTolerance ( float  theTolerance)

Setter for tolerance of picking.

◆ vtkTypeMacro()

IVtkTools_ShapePicker::vtkTypeMacro ( IVtkTools_ShapePicker  ,
vtkAbstractPropPicker   
)

The documentation for this class was generated from the following file: