// File : SALOME_Actor.cxx
// Author : Nicolas REJNERI
// Module : SALOME
-// $Header$
//
/*!
\class SALOME_Actor SALOME_Actor.h
return false;
}
+ class TPickLimiter
+ {
+ vtkAbstractPicker* myPicker;
+ public:
+ /*!
+ Make picker work with this actor only
+ */
+ TPickLimiter(vtkAbstractPicker* picker, SALOME_Actor* actor):myPicker(picker)
+ {
+ myPicker->InitializePickList();
+ myPicker->AddPickList( actor );
+ myPicker->SetPickFromList( true );
+ }
+ /*!
+ Unlimit picking
+ */
+ ~TPickLimiter()
+ {
+ myPicker->SetPickFromList( false );
+ myPicker->InitializePickList();
+ }
+ };
}
anActor->SetPreSelected( false );
}else{
- switch(aSelectionMode){
+ switch(aSelectionMode) {
case NodeSelection:
{
+ TPickLimiter( myPointPicker, this );
myPointPicker->Pick( x, y, z, aRenderer );
int aVtkId = myPointPicker->GetPointId();
case FaceSelection:
case VolumeSelection:
{
+ TPickLimiter( myCellPicker, this );
myCellPicker->Pick( x, y, z, aRenderer );
int aVtkId = myCellPicker->GetCellId();
}
case EdgeOfCellSelection:
{
+ TPickLimiter( myCellPicker, this );
myCellPicker->Pick( x, y, z, aRenderer );
int aVtkId = myCellPicker->GetCellId();
if( !theSelectionEvent->myIsRectangle ) {
switch(aSelectionMode){
case NodeSelection: {
+ TPickLimiter( myPointPicker, this );
myPointPicker->Pick( x, y, z, aRenderer );
int aVtkId = myPointPicker->GetPointId();
case FaceSelection:
case VolumeSelection:
{
+ TPickLimiter( myCellPicker, this );
myCellPicker->Pick( x, y, z, aRenderer );
int aVtkId = myCellPicker->GetCellId();
}
case EdgeOfCellSelection:
{
+ TPickLimiter( myCellPicker, this );
myCellPicker->Pick( x, y, z, aRenderer );
int aVtkId = myCellPicker->GetCellId();
switch(aSelectionMode){
case NodeSelection: {
- myPointRectPicker->InitializePickList();
- myPointRectPicker->AddPickList(this);
+
+ TPickLimiter( myPointRectPicker, this );
myPointRectPicker->Pick( x1, y1, z1, x2, y2, z2, aRenderer );
const SVTK_RectPicker::TVectorIdsMap& aVectorIdsMap = myPointRectPicker->GetPointIdsMap();
case FaceSelection:
case VolumeSelection:
{
- myCellRectPicker->InitializePickList();
- myCellRectPicker->AddPickList(this);
+ TPickLimiter( myCellRectPicker, this );
myCellRectPicker->Pick( x1, y1, z1, x2, y2, z2, aRenderer );
const SVTK_RectPicker::TVectorIdsMap& aVectorIdsMap = myCellRectPicker->GetCellIdsMap();