]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Patch on Bug GVIEW10227
authorapo <apo@opencascade.com>
Tue, 18 Oct 2005 15:10:35 +0000 (15:10 +0000)
committerapo <apo@opencascade.com>
Tue, 18 Oct 2005 15:10:35 +0000 (15:10 +0000)
  Highlighted group of elements remains in 3D viewer.

src/SVTK/SALOME_Actor.cxx
src/SVTK/SALOME_Actor.h
src/SVTK/SVTK_InteractorStyle.cxx
src/SVTK/SVTK_RenderWindowInteractor.cxx
src/SVTK/SVTK_Renderer.cxx
src/SVTK/SVTK_Renderer.h
src/SVTK/SVTK_View.cxx
src/SVTK/SVTK_ViewWindow.cxx

index 43d8236af1f78b601266efffbfc3d5b5741af42f..646344064df306906098d776623af2bb73ed0c1d 100644 (file)
@@ -254,36 +254,6 @@ SALOME_Actor
 }
 
 
-//----------------------------------------------------------------------------
-bool
-SALOME_Actor
-::hasHighlight() 
-{ 
-  return false; 
-} 
-
-void
-SALOME_Actor
-::highlight(bool theHighlight) 
-{ 
-  highlight(theHighlight,mySelectionMode); 
-}  
-
-bool
-SALOME_Actor
-::isHighlighted() 
-{ 
-  return myIsHighlighted; 
-}
-
-void
-SALOME_Actor
-::SetPreSelected(bool thePreselect) 
-{ 
-  myIsPreselected = thePreselect;
-}
-
-
 //----------------------------------------------------------------------------
 void
 SALOME_Actor
@@ -729,79 +699,103 @@ SALOME_Actor
   Superclass::SetVisibility( theVisibility );
 
   myOutlineActor->SetVisibility( theVisibility && isHighlighted() && !hasHighlight() );
-  myHighlightActor->SetVisibility( theVisibility && isHighlighted() );
+
   myPreHighlightActor->SetVisibility( theVisibility && myIsPreselected );
+
+  if(mySelector.GetPointer()){
+    if(mySelector->SelectionMode() != ActorSelection){
+      int aHasIndex = mySelector->HasIndex( getIO() );
+      myHighlightActor->SetVisibility( theVisibility && isHighlighted() && aHasIndex);
+    }
+  }
 }
 
 
-//----------------------------------------------------------------
+//----------------------------------------------------------------------------
+bool
+SALOME_Actor
+::hasHighlight() 
+{ 
+  return false; 
+} 
+
+bool
+SALOME_Actor
+::isHighlighted() 
+{ 
+  return myIsHighlighted; 
+}
+
 void
 SALOME_Actor
-::highlight(bool theHighlight, 
-           Selection_Mode theSelectionMode)
-{
-  myHighlightActor->SetVisibility( false );
-  myOutlineActor->SetVisibility( false );
+::SetPreSelected(bool thePreselect) 
+{ 
+  myIsPreselected = thePreselect;
+}
 
-  if(hasHighlight() && theSelectionMode == ActorSelection)
-    highlight(theHighlight);
-  else{
-    myIsHighlighted = theHighlight; 
-    
-    if( !GetVisibility() )
-      return;
-    
-    if(theSelectionMode != ActorSelection)
-      myHighlightActor->SetVisibility( theHighlight );
 
-    myOutline->SetBounds( GetInput()->GetBounds() );
-    myOutlineActor->SetVisibility( theHighlight );
-  }
+//----------------------------------------------------------------
+void
+SALOME_Actor
+::SetSelector(SVTK_Selector* theSelector)
+{
+  mySelector = theSelector;
 }
 
 void
 SALOME_Actor
-::highlight(bool theIsHighlight, 
-           SVTK_Selector* theSelector)
+::Highlight(bool theIsHighlight)
 {
-  TColStd_IndexedMapOfInteger aMapIndex;
-  theSelector->GetIndex( getIO(), aMapIndex );
-  mySelectionMode = theSelector->SelectionMode();
+  mySelectionMode = mySelector->SelectionMode();
+  myHighlightActor->SetVisibility( false );
+  myOutlineActor->SetVisibility( false );
 
   if(MYDEBUG) MESSAGE("SALOME_Actor::highlight - this = "<<this<<
                      "; theIsHighlight = "<<theIsHighlight<<
                      "; mySelectionMode = "<<mySelectionMode);
-
-  switch( mySelectionMode )
-  {
-    case NodeSelection:
-      myHighlightActor->GetProperty()->SetRepresentationToPoints();
-      myHighlightActor->MapPoints( this, aMapIndex );
-      break;
-    case EdgeOfCellSelection:
-      myHighlightActor->GetProperty()->SetRepresentationToWireframe();
-      myHighlightActor->MapEdge( this, aMapIndex );
-      break;
-    case CellSelection:
-    case EdgeSelection:
-    case FaceSelection:
-    case VolumeSelection:
-      myHighlightActor->GetProperty()->SetRepresentationToSurface();
-      myHighlightActor->MapCells( this, aMapIndex );
-      break;
-    case ActorSelection:
-      break;
+    
+  if(mySelector.GetPointer()){
+    if(mySelectionMode != ActorSelection){
+      TColStd_IndexedMapOfInteger aMapIndex;
+      mySelector->GetIndex( getIO(), aMapIndex );
+      switch( mySelectionMode ){
+      case NodeSelection:
+       myHighlightActor->GetProperty()->SetRepresentationToPoints();
+       myHighlightActor->MapPoints( this, aMapIndex );
+       break;
+      case EdgeOfCellSelection:
+       myHighlightActor->GetProperty()->SetRepresentationToWireframe();
+       myHighlightActor->MapEdge( this, aMapIndex );
+       break;
+      case CellSelection:
+      case EdgeSelection:
+      case FaceSelection:
+      case VolumeSelection:
+       myHighlightActor->GetProperty()->SetRepresentationToSurface();
+       myHighlightActor->MapCells( this, aMapIndex );
+       break;
+      }
+      myHighlightActor->SetVisibility( GetVisibility() && theIsHighlight );
+    }
   }
 
-  highlight( theIsHighlight, mySelectionMode );
+  highlight(theIsHighlight);
+}
+
+void
+SALOME_Actor
+::highlight(bool theIsHighlight)
+{
+  myOutline->SetBounds( GetInput()->GetBounds() );
+  myOutlineActor->SetVisibility( GetVisibility() && theIsHighlight );
+  myIsHighlighted = theIsHighlight; 
 }
 
 
 //----------------------------------------------------------------
 bool
 SALOME_Actor
-::PreHighlight(SVTK_Selector* theSelector,
-              vtkInteractorStyle *theInteractorStyle, 
+::PreHighlight(vtkInteractorStyle *theInteractorStyle, 
               SVTK_SelectionEvent* theSelectionEvent,
               bool theIsHighlight)
 {
@@ -833,7 +827,7 @@ SALOME_Actor
       myPointPicker->Pick( x, y, z, aRenderer );
       
       int aVtkId = myPointPicker->GetPointId();
-      if( aVtkId >= 0 && theSelector->IsValid( this, aVtkId, true ) ) {
+      if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId, true ) ) {
        int anObjId = GetNodeObjId( aVtkId );
        if ( anObjId >= 0 ) {
          TColStd_IndexedMapOfInteger aMapIndex;
@@ -857,7 +851,7 @@ SALOME_Actor
       myCellPicker->Pick( x, y, z, aRenderer );
       
       int aVtkId = myCellPicker->GetCellId();
-      if ( aVtkId >= 0 && theSelector->IsValid( this, aVtkId ) && hasIO() ) {
+      if ( aVtkId >= 0 && mySelector->IsValid( this, aVtkId ) && hasIO() ) {
        int anObjId = GetElemObjId (aVtkId );
        if ( anObjId >= 0 ) {
          if ( CheckDimensionId(aSelectionMode,this,anObjId) ) {
@@ -880,7 +874,7 @@ SALOME_Actor
       myCellPicker->Pick( x, y, z, aRenderer );
       
       int aVtkId = myCellPicker->GetCellId();
-      if ( aVtkId >= 0 && theSelector->IsValid( this, aVtkId )) {
+      if ( aVtkId >= 0 && mySelector->IsValid( this, aVtkId )) {
        int anObjId = GetElemObjId( aVtkId );
        if ( anObjId >= 0 ) {
          int anEdgeId = GetEdgeId(this,myCellPicker.GetPointer(),anObjId);
@@ -900,7 +894,7 @@ SALOME_Actor
     }
     case ActorSelection : 
     {
-      if( !theSelector->IsSelected( myIO ) ) {
+      if( !mySelector->IsSelected( myIO ) ) {
        SetPreSelected( true );
 
        vtkActorCollection* theActors = aRenderer->GetActors();
@@ -928,8 +922,7 @@ SALOME_Actor
 //----------------------------------------------------------------
 bool
 SALOME_Actor
-::Highlight(SVTK_Selector* theSelector,
-           vtkInteractorStyle *theInteractorStyle, 
+::Highlight(vtkInteractorStyle *theInteractorStyle, 
            SVTK_SelectionEvent* theSelectionEvent,
            bool theIsHighlight)
 {
@@ -951,17 +944,17 @@ SALOME_Actor
       myPointPicker->Pick( x, y, z, aRenderer );
 
       int aVtkId = myPointPicker->GetPointId();
-      if( aVtkId >= 0 && theSelector->IsValid( this, aVtkId, true ) ) {
+      if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId, true ) ) {
        int anObjId = GetNodeObjId( aVtkId );
        if( anObjId >= 0 ) {
-         if( theSelector->IsSelected( myIO ) )
-           theSelector->AddOrRemoveIndex( myIO, anObjId, isShift );
+         if( mySelector->IsSelected( myIO ) )
+           mySelector->AddOrRemoveIndex( myIO, anObjId, isShift );
          else {
            if( !isShift ) {
-             theSelector->ClearIObjects();
+             mySelector->ClearIObjects();
            }
-           theSelector->AddOrRemoveIndex( myIO, anObjId, isShift );
-           theSelector->AddIObject( this );
+           mySelector->AddOrRemoveIndex( myIO, anObjId, isShift );
+           mySelector->AddIObject( this );
          }
        }
       }
@@ -975,18 +968,18 @@ SALOME_Actor
       myCellPicker->Pick( x, y, z, aRenderer );
     
       int aVtkId = myCellPicker->GetCellId();
-      if( aVtkId >= 0 && theSelector->IsValid( this, aVtkId ) ) {
+      if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId ) ) {
        int anObjId = GetElemObjId( aVtkId );
        if( anObjId >= 0 ) {
          if ( CheckDimensionId(aSelectionMode,this,anObjId) ) {
-           if( theSelector->IsSelected( myIO ) )
-             theSelector->AddOrRemoveIndex( myIO, anObjId, isShift );
+           if( mySelector->IsSelected( myIO ) )
+             mySelector->AddOrRemoveIndex( myIO, anObjId, isShift );
            else {
              if( !isShift ) {
-               theSelector->ClearIObjects();
+               mySelector->ClearIObjects();
              }
-             theSelector->AddOrRemoveIndex( myIO, anObjId, isShift );
-             theSelector->AddIObject( this );
+             mySelector->AddOrRemoveIndex( myIO, anObjId, isShift );
+             mySelector->AddIObject( this );
            }
          }
        }
@@ -998,17 +991,17 @@ SALOME_Actor
       myCellPicker->Pick( x, y, z, aRenderer );
     
       int aVtkId = myCellPicker->GetCellId();
-      if( aVtkId >= 0 && theSelector->IsValid( this, aVtkId ) ) {
+      if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId ) ) {
        int anObjId = GetElemObjId( aVtkId );
        if( anObjId >= 0 ) {
          if( !isShift ) {
-           theSelector->ClearIObjects();
+           mySelector->ClearIObjects();
          }
          int anEdgeId = GetEdgeId(this,myCellPicker.GetPointer(),anObjId);
          if( anEdgeId >= 0 ) {
-           theSelector->AddOrRemoveIndex( myIO, anObjId, false );
-           theSelector->AddOrRemoveIndex( myIO, -anEdgeId-1, true );
-           theSelector->AddIObject( this );
+           mySelector->AddOrRemoveIndex( myIO, anObjId, false );
+           mySelector->AddOrRemoveIndex( myIO, -anEdgeId-1, true );
+           mySelector->AddIObject( this );
          } 
        }
       }
@@ -1016,13 +1009,13 @@ SALOME_Actor
     }
     case ActorSelection : 
     {
-      if( theSelector->IsSelected( myIO ) && isShift )
-       theSelector->RemoveIObject( this );
+      if( mySelector->IsSelected( myIO ) && isShift )
+       mySelector->RemoveIObject( this );
       else {
        if( !isShift ) {
-         theSelector->ClearIObjects();
+         mySelector->ClearIObjects();
        }
-       theSelector->AddIObject( this );
+       mySelector->AddIObject( this );
       }
       break;
     }
@@ -1066,7 +1059,7 @@ SALOME_Actor
                  float aPickedPoint[3];
                  myPointPicker->GetMapperPosition( aPickedPoint );
                  vtkIdType aVtkId = aDataSet->FindPoint( aPickedPoint );
-                 if( aVtkId >= 0 && theSelector->IsValid( this, aVtkId, true ) ) {
+                 if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId, true ) ) {
                    int anObjId = GetNodeObjId( aVtkId );
                    anIndices.Add( anObjId );
                  }
@@ -1076,12 +1069,12 @@ SALOME_Actor
          }
        }
        if( !anIndices.IsEmpty() ) {
-         theSelector->AddOrRemoveIndex( myIO, anIndices, true );
-         theSelector->AddIObject( this );
+         mySelector->AddOrRemoveIndex( myIO, anIndices, true );
+         mySelector->AddIObject( this );
          anIndices.Clear();
        }
        else
-         theSelector->RemoveIObject( this );
+         mySelector->RemoveIObject( this );
       }
       break;
     }
@@ -1107,7 +1100,7 @@ SALOME_Actor
       }
 
       if( picked )
-       theSelector->AddIObject(this);
+       mySelector->AddIObject(this);
 
       break;
     }
@@ -1125,7 +1118,7 @@ SALOME_Actor
        VTKViewer_CellDataSet::iterator anIter = aCellList.begin();
        for(; anIter != aCellList.end(); ++anIter ) {
          int aCellId = anIter->cellId;
-         if ( !theSelector->IsValid( this, aCellId ) )
+         if ( !mySelector->IsValid( this, aCellId ) )
            continue;
 
          int anObjId = GetElemObjId( aCellId );
@@ -1135,8 +1128,8 @@ SALOME_Actor
            }
        }
       }
-      theSelector->AddOrRemoveIndex( myIO, anIndexes, true );
-      theSelector->AddIObject( this );
+      mySelector->AddOrRemoveIndex( myIO, anIndexes, true );
+      mySelector->AddIObject( this );
     }
     default:
       break;
index 9c1e5d2b554d3700ef720f01978eb8bcbb88e5a7..669d3b319c0c88af38be9cedd4a667b1485c963d 100644 (file)
@@ -102,34 +102,6 @@ class SVTK_EXPORT SALOME_Actor : public VTKViewer_Actor
   void
   setName(const char* theName);
 
-  //----------------------------------------------------------------------------
-  // To generate highlight automaticaly
-  virtual
-  bool
-  hasHighlight(); 
-
-  virtual
-  void
-  highlight(bool theHighlight, 
-           Selection_Mode theSelectionMode);
-
-  virtual
-  void
-  highlight(bool theHighlight, 
-           SVTK_Selector* theSelector);
-
-  virtual
-  void
-  highlight(bool theHighlight);  
-
-  virtual
-  bool
-  isHighlighted();
-
-  virtual
-  void
-  SetPreSelected(bool thePreselect = false);
-
   //----------------------------------------------------------------------------
   virtual
   void
@@ -316,17 +288,42 @@ class SVTK_EXPORT SALOME_Actor : public VTKViewer_Actor
   Update();
 
   //----------------------------------------------------------------------------
+  // To generate highlight automaticaly
   virtual
   bool
-  PreHighlight(SVTK_Selector* theSelector, 
-              vtkInteractorStyle* theInteractorStyle, 
+  hasHighlight(); 
+
+  virtual
+  bool
+  isHighlighted();
+
+  virtual
+  void
+  SetPreSelected(bool thePreselect = false);
+
+  //----------------------------------------------------------------------------
+  virtual
+  void
+  SetSelector(SVTK_Selector* theSelector);
+
+  virtual
+  void
+  highlight(bool theHighlight);  
+
+  virtual
+  void
+  Highlight(bool theHighlight);  
+
+  //----------------------------------------------------------------------------
+  virtual
+  bool
+  PreHighlight(vtkInteractorStyle* theInteractorStyle, 
               SVTK_SelectionEvent* theSelectionEvent,
               bool theIsHighlight);
 
   virtual 
   bool
-  Highlight(SVTK_Selector* theSelector, 
-           vtkInteractorStyle* theInteractorStyle, 
+  Highlight(vtkInteractorStyle* theInteractorStyle, 
            SVTK_SelectionEvent* theSelectionEvent,
            bool theIsHighlight);
 
@@ -361,11 +358,6 @@ class SVTK_EXPORT SALOME_Actor : public VTKViewer_Actor
   Handle(SALOME_InteractiveObject) myIO;
   std::string myName;
 
-  vtkProperty *PreviewProperty;
-  bool myIsPreselected;
-  bool myIsHighlighted;
-  Selection_Mode mySelectionMode;
-
   float myOpacity;
   int myDisplayMode;
   bool myIsInfinite;
@@ -385,6 +377,12 @@ class SVTK_EXPORT SALOME_Actor : public VTKViewer_Actor
   ~SALOME_Actor();
 
  protected:
+  vtkProperty *PreviewProperty;
+  bool myIsPreselected;
+  bool myIsHighlighted;
+  Selection_Mode mySelectionMode;
+  vtkSmartPointer<SVTK_Selector> mySelector;
+
   //----------------------------------------------------------------------------
   // Highlight/ Prehighlight devices
   vtkSmartPointer<vtkPointPicker> myPointPicker;
index eca3ee4a697a7f426bc51610fe839af6718e93de..aa59a165ec0de2bfc7744e5070ab24cfab59f076 100644 (file)
@@ -910,7 +910,7 @@ SVTK_InteractorStyle
            //if(SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(myPicker->GetActor())){
            if(aSActor->hasIO()){
              aSelectionEvent->myIsRectangle = false;
-             aSActor->Highlight( GetSelector(), this, aSelectionEvent, true );
+             aSActor->Highlight( this, aSelectionEvent, true );
            }
          }
          else{
@@ -931,7 +931,7 @@ SVTK_InteractorStyle
          while(vtkActor* aActor = aListActors->GetNextActor()){
            if(SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)){
              if(aSActor->hasIO()){
-               aSActor->Highlight( GetSelector(), this, aSelectionEvent, true );
+               aSActor->Highlight( this, aSelectionEvent, true );
              }
            }
          }
@@ -1033,7 +1033,7 @@ SVTK_InteractorStyle
   //
   GetFirstSALOMEActor(myPicker.GetPointer(), aLastActor);
   if (aLastActor){
-    anIsChanged |= aLastActor->PreHighlight( GetSelector(), this, aSelectionEvent, false );
+    anIsChanged |= aLastActor->PreHighlight( this, aSelectionEvent, false );
   }
   myPicker->Pick(aSelectionEvent->myX, 
                 aSelectionEvent->myY, 
@@ -1044,7 +1044,7 @@ SVTK_InteractorStyle
   //
   GetFirstSALOMEActor(myPicker.GetPointer(), anActor);
   if (anActor){
-    anIsChanged |= anActor->PreHighlight( GetSelector(), this, aSelectionEvent, true );
+    anIsChanged |= anActor->PreHighlight( this, aSelectionEvent, true );
   }
   
   if(anIsChanged)
index a07d4c3615ced39b4218ab52587f7dad68c2830e..000d592f2ff522c7707285b05770a26c35162bd3 100644 (file)
@@ -473,17 +473,13 @@ SVTK_RenderWindowInteractor
   if(theRenderer == myRenderer.GetPointer())
     return;
 
-  if(GetRenderer()){
+  if(GetRenderer())
     myRenderWindow->RemoveRenderer(getRenderer());
-    myRenderer->SetInteractor(NULL);
-  }
 
   myRenderer = theRenderer;
 
-  if(GetRenderer()){
+  if(GetRenderer())
     myRenderWindow->AddRenderer(getRenderer());
-    theRenderer->SetInteractor(GetDevice());
-  }
 }
 
 
index 6e811822a1af42b26b1e3fd80cfbc2735741035c..5e1e1eb060757397ef24d6359c04234bc382823f 100644 (file)
@@ -199,9 +199,11 @@ SVTK_Renderer
 
 void 
 SVTK_Renderer
-::SetInteractor(vtkRenderWindowInteractor* theInteractor)
+::Initialize(vtkRenderWindowInteractor* theInteractor,
+            SVTK_Selector* theSelector)
 {
   myInteractor = theInteractor;
+  mySelector = theSelector;
 }
 
 //----------------------------------------------------------------------------
@@ -211,8 +213,8 @@ SVTK_Renderer
 {
   if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(theActor)){
     anActor->SetInteractor(myInteractor);
-
     anActor->SetTransform(GetTransform());
+    anActor->SetSelector(mySelector.GetPointer());
 
     anActor->SetPointPicker(myPointPicker.GetPointer());
     anActor->SetCellPicker(myCellPicker.GetPointer());
@@ -235,6 +237,7 @@ SVTK_Renderer
     //   can leads do destruction of the actor
     anActor->SetInteractor(NULL);
     anActor->SetTransform(NULL);
+    anActor->SetSelector(NULL);
 
     anActor->SetPointPicker(NULL);
     anActor->SetCellPicker(NULL);
index 0093081dcbc2f68f3fc4f8b894bbfbb3dfb739ed..bdc7119d870c608896b8bdcc05f257bfb6d2b0c1 100644 (file)
@@ -49,7 +49,10 @@ class VTKViewer_Trihedron;
 class VTKViewer_Transform;
 class SVTK_CubeAxesActor2D;
 class VTKViewer_Actor;
+class SVTK_Selector;
 
+
+//----------------------------------------------------------------------------
 class SVTK_EXPORT SVTK_Renderer : public vtkObject
 {
  public:
@@ -62,7 +65,8 @@ class SVTK_EXPORT SVTK_Renderer : public vtkObject
 
   virtual
   void 
-  SetInteractor(vtkRenderWindowInteractor* theInteractor);
+  Initialize(vtkRenderWindowInteractor* theInteractor,
+            SVTK_Selector* theSelector);
 
   //----------------------------------------------------------------------------
   virtual
@@ -172,6 +176,7 @@ class SVTK_EXPORT SVTK_Renderer : public vtkObject
   
   vtkSmartPointer<vtkRenderer> myDevice;
   vtkRenderWindowInteractor* myInteractor;
+  vtkSmartPointer<SVTK_Selector> mySelector;
 
   //----------------------------------------------------------------------------
   vtkSmartPointer<VTKViewer_Transform> myTransform;
index 659809df911c6b98616bec6efeaa71d29cfa08f5..38e03833a2bb6adf600288523bf66cf77ad0e2eb 100644 (file)
@@ -125,37 +125,15 @@ SVTK_SignalHandler
 struct THighlightAction
 {
   bool myIsHighlight;
-  Selection_Mode mySelectionMode;
-  THighlightAction( bool theIsHighlight, 
-                   Selection_Mode theSelectionMode = ActorSelection ):
-    myIsHighlight( theIsHighlight ),
-    mySelectionMode( theSelectionMode ) 
+  THighlightAction( bool theIsHighlight ):
+    myIsHighlight( theIsHighlight )
   {}
 
   void
   operator()( SALOME_Actor* theActor) 
   {
     if(theActor->GetMapper() && theActor->hasIO()){
-      theActor->highlight( myIsHighlight, mySelectionMode );
-    }
-  }
-};
-
-struct TSelectionAction
-{
-  bool myIsHighlight;
-  SVTK_Selector* mySelector;
-  TSelectionAction( bool theIsHighlight, 
-                   SVTK_Selector* theSelector ):
-    myIsHighlight( theIsHighlight ),
-    mySelector( theSelector ) 
-  {}
-
-  void
-  operator()( SALOME_Actor* theActor) 
-  {
-    if(theActor->GetMapper()){
-      theActor->highlight( myIsHighlight, mySelector );
+      theActor->Highlight( myIsHighlight );
     }
   }
 };
@@ -175,7 +153,7 @@ SVTK_SignalHandler
   for(; anIter.More(); anIter.Next()){
     ForEachIf<SALOME_Actor>(anActors,
                            TIsSameIObject<SALOME_Actor>(anIter.Value()),
-                           TSelectionAction(true,aSelector));
+                           THighlightAction(true));
   }
 
   myMainWindow->Repaint(false);
@@ -215,13 +193,11 @@ SVTK_View
             bool theIsHighlight, 
             bool theIsUpdate ) 
 {
-  if(SVTK_Selector* aSelector = myMainWindow->GetSelector()){
-    using namespace VTK;
-    ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
-                           TIsSameIObject<SALOME_Actor>( theIO ),
-                           TSelectionAction(theIsHighlight,aSelector));
-    Repaint();
-  }
+  using namespace VTK;
+  ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
+                         TIsSameIObject<SALOME_Actor>( theIO ),
+                         THighlightAction(theIsHighlight));
+  Repaint();
 }
 
 //----------------------------------------------------------------------------
index ffcde4b02e7760a3daafc567d9ded0a2d8cc1432..187b42f785113afab81aa648051f90ea3b1fc948 100755 (executable)
@@ -61,10 +61,11 @@ SVTK_ViewWindow
     SVTK_RenderWindowInteractor* anIteractor = 
       new SVTK_RenderWindowInteractor(myMainWindow,"SVTK_RenderWindowInteractor");
 
-    SVTK_Renderer* aRenderer = SVTK_Renderer::New();
-
     SVTK_Selector* aSelector = SVTK_Selector::New();
 
+    SVTK_Renderer* aRenderer = SVTK_Renderer::New();
+    aRenderer->Initialize(anIteractor->GetDevice(),aSelector);
+
     SVTK_GenericRenderWindowInteractor* aDevice = 
       SVTK_GenericRenderWindowInteractor::New();
     aDevice->SetRenderWidget(anIteractor);