Open CASCADE Technology  7.0.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...
 
int Pick (double theX, double theY, double theZ, vtkRenderer *theRenderer=NULL)
 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...
 
vtkActorCollection * GetPickedActors (bool theIsAll=false) const
 Access to the list of actors picked. More...
 

Protected Member Functions

 IVtkTools_ShapePicker ()
 Constructs the picker with empty renderer and ready for point selection. More...
 
 ~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 ( )
protected

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

IVtkTools_ShapePicker::~IVtkTools_ShapePicker ( )
protected

Destructor.

Member Function Documentation

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

Convert display coordinates to world coordinates.

vtkActorCollection* IVtkTools_ShapePicker::GetPickedActors ( bool  theIsAll = false) const

Access to the list of actors picked.

Parameters
[in]allControls if all selected actors or just the only top one is returned, has no effect during area selection.
Returns
List of actors IDs
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]allControls if all selected shapes or just the only top one is returned, has no effect during area selection.
Returns
List of top-level shape IDs
IVtk_ShapeIdList IVtkTools_ShapePicker::GetPickedSubShapesIds ( const IVtk_IdType  theId,
bool  theIsAll = false 
) const

Access to the list of sub-shapes ids picked.

Parameters
[in]idtop-level shape ID
[in]allControls if all selected sub-shapes or just the only top one is returned, has no effect during area selection.
Returns
List of sub-shapes IDs
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
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
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.

Returns
Number of detected entities.
int IVtkTools_ShapePicker::Pick ( double  theX,
double  theY,
double  theZ,
vtkRenderer *  theRenderer = NULL 
)

Pick entities in the given point.

Returns
Number of detected entities.
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.
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.
void IVtkTools_ShapePicker::SetAreaSelection ( bool  theIsOn)

Sets area selection on/off.

Parameters
[in]theIsOntrue 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.

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
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]shapeActorshape presentation actor to set a selection mode for
[in]modeselection mode to be activated
[in]turnOnFlag 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.

Parameters
[in]theModeselection mode to be activated
[in]theIsTurnOnFlag to turn on/off the selection mode
void IVtkTools_ShapePicker::SetTolerance ( float  theTolerance)

Setter for tolerance of picking.

IVtkTools_ShapePicker::vtkTypeMacro ( IVtkTools_ShapePicker  ,
vtkAbstractPropPicker   
)

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