]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Rectangle selection
authorouv <ouv@opencascade.com>
Wed, 3 Aug 2005 06:58:01 +0000 (06:58 +0000)
committerouv <ouv@opencascade.com>
Wed, 3 Aug 2005 06:58:01 +0000 (06:58 +0000)
src/SVTK/SALOME_Actor.cxx
src/SVTK/SALOME_Actor.h
src/SVTK/SVTK_InteractorStyle.cxx
src/SVTK/SVTK_InteractorStyle.h
src/SVTK/SVTK_RenderWindowInteractor.cxx
src/SVTK/SVTK_RenderWindowInteractor.h

index b5caa8e5d2f390243e564c0ddbf5e3d99798e85b..2148371ccf6bc4f386f9f44b5e5a5a65289f6f5e 100644 (file)
@@ -38,7 +38,8 @@
 #include "VTKViewer_TransformFilter.h"
 #include "VTKViewer_PassThroughFilter.h"
 #include "VTKViewer_GeometryFilter.h"
+#include "VTKViewer_CellRectPicker.h"
+
 #include "SVTK_Actor.h"
 #include "SVTK_InteractorStyle.h"
 
 #include <vtkPolyDataMapper.h>
 #include <vtkProperty.h>
 
-//using namespace std;
+#include <TColStd_MapOfInteger.hxx>
+#include <TColStd_IndexedMapOfInteger.hxx>
 
+//using namespace std;
 
 #if defined __GNUC__
   #if __GNUC__ == 2
@@ -398,62 +401,35 @@ bool SALOME_Actor::Highlight( SVTK_InteractorStyle* theInteractorStyle,
                              bool theIsUpdate )
 {
   Selection_Mode aSelectionMode = theSelectionEvent.SelectionMode;
-  float x = theSelectionEvent.X;
-  float y = theSelectionEvent.Y;
-  float z = 0.0;
+  float x1 = theSelectionEvent.X;
+  float y1 = theSelectionEvent.Y;
+  float z1 = 0.0;
+  float x2 = theSelectionEvent.LastX;
+  float y2 = theSelectionEvent.LastY;
+  float z2 = 0.0;
   bool isShift = theSelectionEvent.IsShift;
-
-  if( aSelectionMode == NodeSelection )
+  bool isRectangle = theSelectionEvent.IsRectangle;
+  /*
+  cout << x1 << " " << y1;
+  if( isRectangle )
+    cout << " " << x2 << " " << y2;
+  cout << endl;
+  */
+  if( !isRectangle )
   {
-    //vtkSmartPointer<VTKViewer_CellRectPicker> picker = VTKViewer_CellRectPicker::New();
-    vtkPointPicker* aPicker = vtkPointPicker::New();
-
-    aPicker->Pick( x, y, z, theRenderer );
-
-    int aVtkId = aPicker->GetPointId();
-    if( aVtkId >= 0 && hasIO() && theInteractorStyle->IsValid( this, aVtkId, true ) )
+    if( aSelectionMode == NodeSelection )
     {
-      int anObjId = GetNodeObjId( aVtkId );
-      if( anObjId >= 0 )
-      {
-       if( theSelector->IsSelected( myIO ) )
-       {
-         // This IO is already in the selection
-         theSelector->AddOrRemoveIndex( myIO, anObjId, isShift );
-       }
-       else
-       {
-         if( !isShift )
-         {
-           theInteractorStyle->HighlightProp( NULL );
-           theSelector->ClearIObjects();
-         }
-         theSelector->AddOrRemoveIndex( myIO, anObjId, isShift );
-         theSelector->AddIObject( this );
-       }
-      }
-    }
-    aPicker->Delete();
-  }
-  else if( aSelectionMode == CellSelection )
-  {
-    vtkCellPicker* aPicker = vtkCellPicker::New();
+      vtkPointPicker* aPicker = vtkPointPicker::New();
+      aPicker->Pick( x1, y1, z1, theRenderer );
 
-    aPicker->Pick( x, y, z, theRenderer );
-    
-    int aVtkId = aPicker->GetCellId();
-    if( aVtkId >= 0 && hasIO() && theInteractorStyle->IsValid( this, aVtkId ) )
-    {
-      int anObjId = GetElemObjId( aVtkId );
-      if( anObjId >= 0 )
+      int aVtkId = aPicker->GetPointId();
+      if( aVtkId >= 0 && hasIO() && theInteractorStyle->IsValid( this, aVtkId, true ) )
       {
-       //if( theInteractorStyle->CheckDimensionId( aSelectionMode, this, anObjId ) )
+       int anObjId = GetNodeObjId( aVtkId );
+       if( anObjId >= 0 )
        {
          if( theSelector->IsSelected( myIO ) )
-         {
-           // This IO is already in the selection
            theSelector->AddOrRemoveIndex( myIO, anObjId, isShift );
-         }
          else
          {
            if( !isShift )
@@ -466,57 +442,174 @@ bool SALOME_Actor::Highlight( SVTK_InteractorStyle* theInteractorStyle,
          }
        }
       }
+      aPicker->Delete();
     }
-    aPicker->Delete();
-  }
-  else if( aSelectionMode == EdgeOfCellSelection )
-  {
-    vtkCellPicker* aPicker = vtkCellPicker::New();
-
-    aPicker->Pick( x, y, z, theRenderer );
-    
-    int aVtkId = aPicker->GetCellId();
-    if( aVtkId >= 0 && hasIO() && theInteractorStyle->IsValid( this, aVtkId ) )
+    else if( aSelectionMode == CellSelection )
     {
-      int anObjId = GetElemObjId( aVtkId );
-      if( anObjId >= 0 )
+      vtkCellPicker* aPicker = vtkCellPicker::New();
+      aPicker->Pick( x1, y1, z1, theRenderer );
+    
+      int aVtkId = aPicker->GetCellId();
+      if( aVtkId >= 0 && hasIO() && theInteractorStyle->IsValid( this, aVtkId ) )
       {
-       if( !isShift )
+       int anObjId = GetElemObjId( aVtkId );
+       if( anObjId >= 0 )
        {
-         theInteractorStyle->HighlightProp( NULL );
-         theSelector->ClearIObjects();
+         //if( theInteractorStyle->CheckDimensionId( aSelectionMode, this, anObjId ) )
+         {
+           if( theSelector->IsSelected( myIO ) )
+             theSelector->AddOrRemoveIndex( myIO, anObjId, isShift );
+           else
+           {
+             if( !isShift )
+             {
+               theInteractorStyle->HighlightProp( NULL );
+               theSelector->ClearIObjects();
+             }
+             theSelector->AddOrRemoveIndex( myIO, anObjId, isShift );
+             theSelector->AddIObject( this );
+           }
+         }
+       }
+      }
+      aPicker->Delete();
+    }
+    else if( aSelectionMode == EdgeOfCellSelection )
+    {
+      vtkCellPicker* aPicker = vtkCellPicker::New();
+      aPicker->Pick( x1, y1, z1, theRenderer );
+    
+      int aVtkId = aPicker->GetCellId();
+      if( aVtkId >= 0 && hasIO() && theInteractorStyle->IsValid( this, aVtkId ) )
+      {
+       int anObjId = GetElemObjId( aVtkId );
+       if( anObjId >= 0 )
+        {
+         if( !isShift )
+         {
+           theInteractorStyle->HighlightProp( NULL );
+           theSelector->ClearIObjects();
+         }
+         int anEdgeId = 0;//theInteractorStyle->GetEdgeId( aPicker, this, anObjId );
+         if( anEdgeId >= 0 )
+         {
+           theSelector->AddOrRemoveIndex( myIO, anObjId, false );
+           theSelector->AddOrRemoveIndex( myIO, -anEdgeId-1, true );
+           theSelector->AddIObject( this );
+         } 
        }
-       int anEdgeId = 0;//theInteractorStyle->GetEdgeId( aPicker, this, anObjId );
-       if( anEdgeId >= 0 )
+      }
+      aPicker->Delete();
+    }
+    else if( aSelectionMode == ActorSelection )
+    {
+      if ( hasIO() )
+      {
+       //theInteractorStyle->PropPicked++;
+       if( theSelector->IsSelected( myIO ) && isShift )
+         theSelector->RemoveIObject( this );
+       else
        {
-         theSelector->AddOrRemoveIndex( myIO, anObjId, false );
-         theSelector->AddOrRemoveIndex( myIO, -anEdgeId-1, true );
+         if( !isShift )
+         {
+           theInteractorStyle->HighlightProp( NULL );
+           theSelector->ClearIObjects();
+         }
          theSelector->AddIObject( this );
-       } 
+       }
       }
     }
-    aPicker->Delete();
   }
-  else if( aSelectionMode == ActorSelection )
+  else if( isRectangle )
   {
-    if ( hasIO() )
+    if( aSelectionMode == NodeSelection && hasIO() && !myIO.IsNull() )
     {
-      //theInteractorStyle->PropPicked++;
-      if( theSelector->IsSelected( myIO ) )
+      vtkPointPicker* aPicker = vtkPointPicker::New();
+      if( vtkDataSet* aDataSet = GetInput() )
       {
-       // This IO is already in the selection
-       if( isShift )
+       TColStd_MapOfInteger anIndices;
+       for( int i = 0; i < aDataSet->GetNumberOfPoints(); i++)
+       {
+         float aPoint[3];
+         aDataSet->GetPoint( i, aPoint );
+
+         float aPnt[3];
+         theRenderer->SetWorldPoint( aPoint[0], aPoint[1], aPoint[2], 1.0 );
+         theRenderer->WorldToDisplay();
+         theRenderer->GetDisplayPoint( aPnt );
+
+         if( aPnt[0] > x2 && aPnt[0] < x1 && aPnt[1] > y1 && aPnt[1] < y2 )
+         //if( theInteractorStyle->IsInRect( aPoint, x2, y2, x1, y1 ) )
+         {
+           float aDisp[3];
+           //theInteractorStyle->ComputeWorldToDisplay( aPoint[0], aPoint[1] ,aPoint[2], aDisp );
+           theRenderer->SetWorldPoint( aPoint[0], aPoint[1], aPoint[2], 1.0 );
+           theRenderer->WorldToDisplay();
+           theRenderer->GetDisplayPoint( aDisp );
+
+           if( aPicker->Pick( aDisp[0], aDisp[1], 0.0, theRenderer ) )
+           {
+             if( vtkActorCollection* anActorCollection = aPicker->GetActors() )
+             {
+               if( anActorCollection->IsItemPresent( this ) ) 
+               {
+                 float aPickedPoint[3];
+                 aPicker->GetMapperPosition( aPickedPoint );
+                 vtkIdType aVtkId = aDataSet->FindPoint( aPickedPoint );
+                 if( aVtkId >= 0 && theInteractorStyle->IsValid( this, aVtkId, true ) )
+                 {
+                   int anObjId = GetNodeObjId( aVtkId );
+                   anIndices.Add( anObjId );
+                 }
+               }
+             }
+           }
+         }
+       }
+       if( !anIndices.IsEmpty() )
+       {
+         theSelector->AddOrRemoveIndex( myIO, anIndices, false );
+         theSelector->AddIObject( this );
+         anIndices.Clear();
+       }
+       else
          theSelector->RemoveIObject( this );
       }
-      else
+      aPicker->Delete();
+    }
+    else if( aSelectionMode != ActorSelection && hasIO() )
+    {
+      VTKViewer_CellRectPicker* aPicker = VTKViewer_CellRectPicker::New();
+      aPicker->SetTolerance( 0.001 );
+      aPicker->Pick( x2, y2, z2, x1, y1, z1, theRenderer );
+
+      VTKViewer_CellDataSet cellList = aPicker->GetCellData( this );
+      TColStd_MapOfInteger anIndexes;
+      if( !cellList.empty() )
       {
-       if( !isShift )
+       VTKViewer_CellDataSet::iterator it;
+       for( it = cellList.begin(); it != cellList.end(); ++it )
        {
-         theInteractorStyle->HighlightProp( NULL );
-         theSelector->ClearIObjects();
+         int aCellId = (*it).cellId;
+         if ( !theInteractorStyle->IsValid( this, aCellId ) )
+           continue;
+
+         int anObjId = GetElemObjId( aCellId );
+         if( anObjId != -1 )
+         {
+           //if( CheckDimensionId( aSelectionMode, this ,anObjId ) )
+           anIndexes.Add( anObjId );
+         }
        }
-       theSelector->AddIObject( this );
       }
+      theSelector->AddOrRemoveIndex( myIO, anIndexes, true );
+      theSelector->AddIObject( this );
+
+      aPicker->Delete();
+    }
+    else if( aSelectionMode == ActorSelection && hasIO() )
+    {
+      theSelector->AddIObject( this );
     }
   }
 
@@ -535,10 +628,10 @@ bool SALOME_Actor::Highlight( SVTK_InteractorStyle* theInteractorStyle,
     case ActorSelection: cout << "Actor" << endl; break;
     default: cout << "Other" << endl; break;
   }
+  cout << "IsRectangle : " << ( isRectangle ? "true" : "false" ) << endl;
   cout << "IsHighlight : " << ( theIsHighlight ? "true" : "false" ) << endl;
   cout << "IsUpdate : " << ( theIsUpdate ? "true" : "false" ) << endl;
   */
-
   if( GetVisibility() && theIsHighlight )
     theInteractorStyle->HighlightProp( this );
   else if( !theIsHighlight )
@@ -584,3 +677,69 @@ bool SALOME_Actor::Unhighlight( SVTK_InteractorStyle* theInteractorStyle,
   theInteractorStyle->HighlightProp( NULL );
   theSelector->ClearIObjects();
 }
+
+/*
+/// Checks: is the given Actor within display coordinates?
+bool
+SVTK_InteractorStyle
+::IsInRect(vtkActor* theActor, 
+          const int left, const int top, 
+          const int right, const int bottom)
+{
+  float* aBounds = theActor->GetBounds();
+  float aMin[3], aMax[3];
+  ComputeWorldToDisplay(aBounds[0], aBounds[2], aBounds[4], aMin);
+  ComputeWorldToDisplay(aBounds[1], aBounds[3], aBounds[5], aMax);
+  if (aMin[0] > aMax[0]) {
+    float aBuf = aMin[0];
+    aMin[0] = aMax[0];
+    aMax[0] = aBuf;
+  }
+  if (aMin[1] > aMax[1]) {
+    float aBuf = aMin[1];
+    aMin[1] = aMax[1];
+    aMax[1] = aBuf;    
+  }
+
+  return ((aMin[0]>left) && (aMax[0]<right) && (aMin[1]>bottom) && (aMax[1]<top));
+}
+
+
+/// Checks: is the given Cell within display coordinates?
+bool
+SVTK_InteractorStyle
+::IsInRect(vtkCell* theCell, 
+          const int left, const int top, 
+          const int right, const int bottom)
+{
+  float* aBounds = theCell->GetBounds();
+  float aMin[3], aMax[3];
+  ComputeWorldToDisplay(aBounds[0], aBounds[2], aBounds[4], aMin);
+  ComputeWorldToDisplay(aBounds[1], aBounds[3], aBounds[5], aMax);
+  if (aMin[0] > aMax[0]) {
+    float aBuf = aMin[0];
+    aMin[0] = aMax[0];
+    aMax[0] = aBuf;
+  }
+  if (aMin[1] > aMax[1]) {
+    float aBuf = aMin[1];
+    aMin[1] = aMax[1];
+    aMax[1] = aBuf;    
+  }
+
+  return ((aMin[0]>left) && (aMax[0]<right) && (aMin[1]>bottom) && (aMax[1]<top));
+}
+
+
+bool
+SVTK_InteractorStyle
+::IsInRect(float* thePoint, 
+          const int left, const int top, 
+          const int right, const int bottom)
+{
+  float aPnt[3];
+  ComputeWorldToDisplay(thePoint[0], thePoint[1], thePoint[2], aPnt);
+
+  return ((aPnt[0]>left) && (aPnt[0]<right) && (aPnt[1]>bottom) && (aPnt[1]<top));
+}
+*/
index a9b6bccedd4591b66a158089ccb677cd05e7d05e..39633d3d752cc55dde6590ba24f38e89e695cd4c 100644 (file)
@@ -67,8 +67,6 @@ extern int SALOME_POINT_SIZE;
 #include "SVTK_Selector.h"
 #include "SVTK_SelectionEvent.h"
 
-#include <TColStd_IndexedMapOfInteger.hxx>
-
 #include <string>
 
 class vtkRenderer;
@@ -205,7 +203,18 @@ class SALOME_OBJECT_EXPORT SALOME_Actor : public VTKViewer_Actor {
 
   virtual bool Highlight( SVTK_InteractorStyle*, SVTK_Selector*, vtkRenderer*, SVTK_SelectionEvent, bool, bool );
   virtual bool Unhighlight( SVTK_InteractorStyle*, SVTK_Selector*, bool );
-
+  /*
+ protected:
+  bool IsInRect(vtkActor* theActor, 
+               const int left, const int top, 
+               const int right, const int bottom);
+  bool IsInRect(vtkCell* theCell, 
+               const int left, const int top, 
+               const int right, const int bottom);
+  bool IsInRect(float* thePoint, 
+               const int left, const int top, 
+               const int right, const int bottom);
+  */
  protected:
   vtkProperty* myPointProperty;
   vtkProperty* myCellProperty;
index 6627d9fb3afd78040ac8e3f339a9f332f74f71e1..89e522ea348baca857cf471c0c98192c5a32e3f1 100644 (file)
@@ -907,6 +907,7 @@ SVTK_InteractorStyle
 
          SVTK_SelectionEvent aSelectionEvent = myInteractor->GetSelectionEvent();
          aSelectionEvent.SelectionMode = aSelectionMode;
+         aSelectionEvent.IsRectangle = false;
 
          if( aSActor )
            aSActor->Highlight( this, GetSelector(), this->CurrentRenderer, aSelectionEvent, true, true );
@@ -940,6 +941,12 @@ SVTK_InteractorStyle
          x2 = rect.right(); 
          y2 = h - rect.bottom() - 1;
 
+         SVTK_SelectionEvent aSelectionEvent = myInteractor->GetSelectionEvent();
+         aSelectionEvent.SelectionMode = aSelectionMode;
+         aSelectionEvent.IsRectangle = true;
+         aSelectionEvent.LastX = x1;
+         aSelectionEvent.LastY = y1;
+         
          switch (aSelectionMode) {
          case NodeSelection: {
            if ( vtkPointPicker* aPointPicker = vtkPointPicker::SafeDownCast(myInteractor->GetPicker()) ) {
@@ -948,46 +955,8 @@ SVTK_InteractorStyle
              while (vtkActor* aActor = aListActors->GetNextActor()) {
                if (!aActor->GetVisibility()) 
                  continue;
-               if(SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)) {
-                 if (aSActor->hasIO()) {
-                   Handle(SALOME_InteractiveObject) anIO = aSActor->getIO();
-                   if (anIO.IsNull()) 
-                     continue;
-                   if (aSelActiveCompOnly && aComponentDataType != anIO->getComponentDataType())
-                     continue;
-                   if (vtkDataSet* aDataSet = aSActor->GetInput()) {
-                     TColStd_MapOfInteger anIndices;
-                     for(int i = 0; i < aDataSet->GetNumberOfPoints(); i++) {
-                       float aPoint[3];
-                       aDataSet->GetPoint(i,aPoint);
-                       if (IsInRect(aPoint,x1,y1,x2,y2)){
-                         float aDisp[3];
-                         ComputeWorldToDisplay(aPoint[0],aPoint[1],aPoint[2],aDisp);
-                         if(aPointPicker->Pick(aDisp[0],aDisp[1],0.0,CurrentRenderer)){
-                           if(vtkActorCollection *anActorCollection = aPointPicker->GetActors()){
-                             if(anActorCollection->IsItemPresent(aSActor)){
-                               float aPickedPoint[3];
-                               aPointPicker->GetMapperPosition(aPickedPoint);
-                               vtkIdType aVtkId = aDataSet->FindPoint(aPickedPoint);
-                               if ( aVtkId >= 0 && IsValid( aSActor, aVtkId, true ) ){
-                                 int anObjId = aSActor->GetNodeObjId(aVtkId);
-                                 anIndices.Add(anObjId);
-                               }
-                             }
-                           }
-                         }
-                       }
-                     }
-                     if (!anIndices.IsEmpty()) {
-                       GetSelector()->AddOrRemoveIndex(anIO,anIndices,false);
-                       GetSelector()->AddIObject(aSActor);
-                       anIndices.Clear();
-                     }else{
-                       GetSelector()->RemoveIObject(aSActor);
-                     }
-                   }
-                 }
-               }
+               if(SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor))
+                 aSActor->Highlight( this, GetSelector(), this->CurrentRenderer, aSelectionEvent, true, true );
              }
            }
            break;
@@ -1004,36 +973,9 @@ SVTK_InteractorStyle
              
              vtkActorCollection* aListActors = picker->GetActors();
              aListActors->InitTraversal();
-             while(vtkActor* aActor = aListActors->GetNextActor()) {
-               if (SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)) {
-                 if (aSActor->hasIO()) {
-                   Handle(SALOME_InteractiveObject) anIO = aSActor->getIO();
-                   if (aSelActiveCompOnly && aComponentDataType != anIO->getComponentDataType())
-                     continue;
-                   VTKViewer_CellDataSet cellList = picker->GetCellData(aActor);
-                   if ( !cellList.empty() ) {
-                     if(MYDEBUG) INFOS ( " NAME Actor : " << aSActor->getName() );
-                     TColStd_MapOfInteger anIndexes;
-                     VTKViewer_CellDataSet::iterator it;
-                     for ( it = cellList.begin(); it != cellList.end(); ++it ) {
-                       int aCellId = (*it).cellId;
-                       
-                       if ( !IsValid( aSActor, aCellId ) )
-                         continue;
-                       
-                       int anObjId = aSActor->GetElemObjId(aCellId);
-                       if (anObjId != -1){
-                         if ( CheckDimensionId(aSelectionMode,aSActor,anObjId) ) {
-                           anIndexes.Add(anObjId);
-                         }
-                       }
-                     }
-                     GetSelector()->AddOrRemoveIndex(anIO,anIndexes,true);
-                     GetSelector()->AddIObject(aSActor);
-                   }
-                 }
-               }
-             }
+             while(vtkActor* aActor = aListActors->GetNextActor())
+               if (SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor))
+                 aSActor->Highlight( this, GetSelector(), this->CurrentRenderer, aSelectionEvent, true, true );
            }
            break;          
          case ActorSelection: // objects selection
@@ -1044,15 +986,9 @@ SVTK_InteractorStyle
 
              vtkActorCollection* aListActors = picker->GetActors();
              aListActors->InitTraversal();
-             while(vtkActor* aActor = aListActors->GetNextActor()) {
-               if (SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)) {
-                 if (aSActor->hasIO()) {
-                   Handle(SALOME_InteractiveObject) anIO = aSActor->getIO();
-                   GetSelector()->AddIObject(aSActor);
-                   this->PropPicked++;
-                 }
-               }
-             }
+             while(vtkActor* aActor = aListActors->GetNextActor())
+               if (SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor))
+                 aSActor->Highlight( this, GetSelector(), this->CurrentRenderer, aSelectionEvent, true, true );
            } // end case 4
          } //end switch
          myInteractor->EndPickCallback();
@@ -1357,71 +1293,6 @@ SVTK_InteractorStyle
                   motionVector[2] + viewPoint[2]);
 }
 
-
-/// Checks: is the given Actor within display coordinates?
-bool
-SVTK_InteractorStyle
-::IsInRect(vtkActor* theActor, 
-          const int left, const int top, 
-          const int right, const int bottom)
-{
-  float* aBounds = theActor->GetBounds();
-  float aMin[3], aMax[3];
-  ComputeWorldToDisplay(aBounds[0], aBounds[2], aBounds[4], aMin);
-  ComputeWorldToDisplay(aBounds[1], aBounds[3], aBounds[5], aMax);
-  if (aMin[0] > aMax[0]) {
-    float aBuf = aMin[0];
-    aMin[0] = aMax[0];
-    aMax[0] = aBuf;
-  }
-  if (aMin[1] > aMax[1]) {
-    float aBuf = aMin[1];
-    aMin[1] = aMax[1];
-    aMax[1] = aBuf;    
-  }
-
-  return ((aMin[0]>left) && (aMax[0]<right) && (aMin[1]>bottom) && (aMax[1]<top));
-}
-
-
-/// Checks: is the given Cell within display coordinates?
-bool
-SVTK_InteractorStyle
-::IsInRect(vtkCell* theCell, 
-          const int left, const int top, 
-          const int right, const int bottom)
-{
-  float* aBounds = theCell->GetBounds();
-  float aMin[3], aMax[3];
-  ComputeWorldToDisplay(aBounds[0], aBounds[2], aBounds[4], aMin);
-  ComputeWorldToDisplay(aBounds[1], aBounds[3], aBounds[5], aMax);
-  if (aMin[0] > aMax[0]) {
-    float aBuf = aMin[0];
-    aMin[0] = aMax[0];
-    aMax[0] = aBuf;
-  }
-  if (aMin[1] > aMax[1]) {
-    float aBuf = aMin[1];
-    aMin[1] = aMax[1];
-    aMax[1] = aBuf;    
-  }
-
-  return ((aMin[0]>left) && (aMax[0]<right) && (aMin[1]>bottom) && (aMax[1]<top));
-}
-
-
-bool
-SVTK_InteractorStyle
-::IsInRect(float* thePoint, 
-          const int left, const int top, 
-          const int right, const int bottom)
-{
-  float aPnt[3];
-  ComputeWorldToDisplay(thePoint[0], thePoint[1], thePoint[2], aPnt);
-
-  return ((aPnt[0]>left) && (aPnt[0]<right) && (aPnt[1]>bottom) && (aPnt[1]<top));
-}
-
 void
 SVTK_InteractorStyle
 ::SetFilter( const Handle(VTKViewer_Filter)& theFilter )
index 53039e86b4f07cd6166fca025b99bfb4294c92ba..e9896b6d85e03267548c48ed5cc994ac4a1a0e41 100644 (file)
@@ -126,15 +126,6 @@ class SVTK_EXPORT SVTK_InteractorStyle : public QObject,
   void fitRect(const int left, const int top, const int right, const int bottom);
   void Place(const int theX, const int theY);
   void TranslateView(int toX, int toY, int fromX, int fromY);
-  bool IsInRect(vtkActor* theActor, 
-               const int left, const int top, 
-               const int right, const int bottom);
-  bool IsInRect(vtkCell* theCell, 
-               const int left, const int top, 
-               const int right, const int bottom);
-  bool IsInRect(float* thePoint, 
-               const int left, const int top, 
-               const int right, const int bottom);
 
   float MotionFactor;
   float RadianToDegree;                 // constant: for conv from deg to rad
index 9eb6b667cb574f962286fd11077079bb642f93be..10e8cb5a479e103f0b9c0a4147f9a42b121320d4 100644 (file)
@@ -194,7 +194,7 @@ SVTK_RenderWindowInteractor
 
   myInteractorStyle->OnSelectionModeChanged();
 }
-/*
+
 void
 SVTK_RenderWindowInteractor
 ::SetSelectionProp(const double& theRed, 
@@ -202,11 +202,13 @@ SVTK_RenderWindowInteractor
                   const double& theBlue, 
                   const int& theWidth) 
 {
+  /*
   myCellActor->GetProperty()->SetColor(theRed, theGreen, theBlue);
   myCellActor->GetProperty()->SetLineWidth(theWidth);
 
   myPointActor->GetProperty()->SetColor(theRed, theGreen, theBlue);
   myPointActor->GetProperty()->SetPointSize(theWidth);
+  */
 }
 
 void
@@ -222,7 +224,7 @@ SVTK_RenderWindowInteractor
   myPointPicker->SetTolerance(myTolNodes);
 
 }
-*/
+
 // ================================== 
 void
 SVTK_RenderWindowInteractor
index d37b1c6cac5ddcc5ea471e12e01865c9bf439d6d..61ad36d5c776cef6629419692f67ec5fcc33ad75 100644 (file)
@@ -110,14 +110,13 @@ public:
   void rename(const Handle(SALOME_InteractiveObject)& IObject, QString newName);
 
   void SetSelectionMode(Selection_Mode mode);
-  /*
   void SetSelectionProp(const double& theRed = 1, 
                        const double& theGreen = 1,
                        const double& theBlue = 0, 
                        const int& theWidth = 5);
   void SetSelectionTolerance(const double& theTolNodes = 0.025, 
                             const double& theTolCell = 0.001);
-  */
+
   // Displaymode management
   int GetDisplayMode();
   void SetDisplayMode(int);