]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
VVTK_Renderer now has it's own prehighlight and highlight properties, which are setti...
authorouv <ouv@opencascade.com>
Thu, 17 Nov 2005 13:22:55 +0000 (13:22 +0000)
committerouv <ouv@opencascade.com>
Thu, 17 Nov 2005 13:22:55 +0000 (13:22 +0000)
src/VVTK/VVTK_Renderer.cxx
src/VVTK/VVTK_Renderer.h

index 1502efa1cd81301b760b44c27f75a315d139989b..12ef67bbfa5094d0bf648c0984e05fdf03afd8d6 100644 (file)
@@ -140,7 +140,9 @@ VVTK_Renderer
 ::VVTK_Renderer():
   myFPSActor(VISU_FPSActor::New()),
   myPickingSettings(NULL),
-  myGaussPointPicker(vtkPointPicker::New())
+  myGaussPointPicker(vtkPointPicker::New()),
+  myGaussPreHighlightProperty(vtkProperty::New()),
+  myGaussHighlightProperty(vtkProperty::New())
 {
   if(MYDEBUG) INFOS("VVTK_Renderer() - "<<this);
 
@@ -159,9 +161,16 @@ VVTK_Renderer
   myFPSActor->SetMapper(aTextMapper);
   aTextMapper->Delete();
 
+  GetDevice()->AddActor2D(myFPSActor.GetPointer());
+
   myGaussPointPicker->Delete();
 
-  GetDevice()->AddActor2D(myFPSActor.GetPointer());
+  myGaussPreHighlightProperty->Delete();
+  myGaussPreHighlightProperty->SetColor(0,1,1);
+
+  myGaussHighlightProperty->Delete();
+  myGaussHighlightProperty->SetColor(1,1,0);
+
 }
 
 VVTK_Renderer
@@ -177,9 +186,11 @@ VVTK_Renderer
 {
   Superclass::AddActor(theActor);
   if(VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor)){
-    anActor->SetPickingSettings(myPickingSettings);
-
     anActor->SetPointPicker(myGaussPointPicker.GetPointer());
+    anActor->SetPreHighlightProperty(myGaussPreHighlightProperty.GetPointer());
+    anActor->SetHighlightProperty(myGaussHighlightProperty.GetPointer());
+
+    anActor->SetPickingSettings(myPickingSettings);
   }
 }
 
@@ -189,11 +200,12 @@ VVTK_Renderer
 ::RemoveActor(VTKViewer_Actor* theActor)
 {
   Superclass::RemoveActor(theActor);
-  using namespace VISU;  
-  if(VISU_GaussPtsAct1* anActor = dynamic_cast<VISU_GaussPtsAct1*>(theActor)){
-    anActor->SetPickingSettings(NULL);
-
+  if(VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor)){
     anActor->SetPointPicker(NULL);
+    anActor->SetPreHighlightProperty(NULL);
+    anActor->SetHighlightProperty(NULL);
+
+    anActor->SetPickingSettings(NULL);
   }
 }
 
index bcfc31ac644386e70fcf8b43279f8cf5dc953229..17db3c8772ecd1bf9ca032ca11e815e7223bd4b6 100644 (file)
@@ -72,7 +72,10 @@ class VVTK_EXPORT VVTK_Renderer : public SVTK_Renderer
 
   VISU_PickingSettings* myPickingSettings; //! Keeps reference of the VISU_PickingSettings
   vtkSmartPointer<VISU_FPSActor> myFPSActor; //!< To show FPS of the rendering at run-time
+
   vtkSmartPointer<vtkPointPicker> myGaussPointPicker;
+  vtkSmartPointer<vtkProperty>    myGaussPreHighlightProperty;
+  vtkSmartPointer<vtkProperty>    myGaussHighlightProperty;
 };