// File : SALOME_Actor.cxx
// Author : Nicolas REJNERI
// Module : SALOME
-// $Header$
//
/*!
\class SALOME_Actor SALOME_Actor.h
#include "SALOME_Actor.h"
+#include "SALOME_InteractiveObject.hxx"
#include "VTKViewer_Transform.h"
#include "VTKViewer_TransformFilter.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();
+ }
+ };
}
{
if ( !GetPickable() )
return false;
-
+
vtkRenderer *aRenderer = theInteractorStyle->GetCurrentRenderer();
//
myPreHighlightActor->SetVisibility( false );
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();