]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
0021105: EDF 1179 SMESH: Efficiency of clipping plane in VTK viewer
authorouv <ouv@opencascade.com>
Tue, 28 Dec 2010 12:24:41 +0000 (12:24 +0000)
committerouv <ouv@opencascade.com>
Tue, 28 Dec 2010 12:24:41 +0000 (12:24 +0000)
src/SVTK/SVTK_Renderer.cxx
src/SVTK/SVTK_Renderer.h
src/SVTK/SVTK_ViewWindow.cxx
src/SVTK/SVTK_ViewWindow.h

index 9131259f8d81fab60e6831bfee72f10839cba4cc..6fd71280bae8110f1ee539eb0e4ee8607fba651d 100644 (file)
@@ -236,7 +236,7 @@ SVTK_Renderer
 */
 void
 SVTK_Renderer
-::AddActor(VTKViewer_Actor* theActor)
+::AddActor(VTKViewer_Actor* theActor, bool theIsAdjustActors)
 {
   if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(theActor)){
     anActor->SetInteractor(myInteractor);
@@ -254,7 +254,9 @@ SVTK_Renderer
 
     anActor->AddToRender(GetDevice());
     anActor->UpdateNameActors();
-    AdjustActors();
+
+    if(theIsAdjustActors)
+      AdjustActors();
   }
 }
 
@@ -263,7 +265,7 @@ SVTK_Renderer
 */
 void
 SVTK_Renderer
-::RemoveActor(VTKViewer_Actor* theActor)
+::RemoveActor(VTKViewer_Actor* theActor, bool theIsAdjustActors)
 {
   if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(theActor)){
     // Order of the calls are important because VTKViewer_Actor::RemoveFromRender
@@ -282,7 +284,9 @@ SVTK_Renderer
     anActor->SetHighlightProperty(NULL);
 
     anActor->RemoveFromRender(GetDevice());
-    AdjustActors();
+
+    if(theIsAdjustActors)
+      AdjustActors();
   }
 }
 
index 3762af06cdab409cbba097435b7f5e603db208be..6989bcd396a6e3fc280a785e1d11a6be939c91dc 100644 (file)
@@ -84,12 +84,12 @@ class SVTK_EXPORT SVTK_Renderer : public vtkObject
   //! Publishes pointed actor into the renderer
   virtual
   void 
-  AddActor(VTKViewer_Actor* theActor);
+  AddActor(VTKViewer_Actor* theActor, bool theIsAdjustActors = true);
 
   //! Removes pointed actor from the renderer
   virtual
   void 
-  RemoveActor(VTKViewer_Actor* theActor);
+  RemoveActor(VTKViewer_Actor* theActor, bool theIsAdjustActors = true);
 
   //! Get special container that keeps scaling of the scene 
   VTKViewer_Transform* 
index a0118be865f5ac2373de72d6313b144dd8746e9d..d63b5d7e538a254f642dd98b1e2c07411e2bccee 100755 (executable)
@@ -852,9 +852,10 @@ void SVTK_ViewWindow::onMouseDoubleClicked( QMouseEvent* event )
   Redirect the request to #SVTK_Renderer::AddActor
 */
 void SVTK_ViewWindow::AddActor( VTKViewer_Actor* theActor, 
-                                bool theUpdate )
+                                bool theUpdate,
+                                bool theIsAdjustActors )
 {
-  GetRenderer()->AddActor(theActor);
+  GetRenderer()->AddActor(theActor, theIsAdjustActors);
   if(theUpdate) 
     Repaint();
   emit actorAdded(theActor);
@@ -864,9 +865,10 @@ void SVTK_ViewWindow::AddActor( VTKViewer_Actor* theActor,
   Redirect the request to #SVTK_Renderer::RemoveActor
 */
 void SVTK_ViewWindow::RemoveActor( VTKViewer_Actor* theActor, 
-                                   bool theUpdate )
+                                   bool theUpdate,
+                                   bool theIsAdjustActors )
 {
-  GetRenderer()->RemoveActor(theActor);
+  GetRenderer()->RemoveActor(theActor, theIsAdjustActors);
   if(theUpdate) 
     Repaint();
   emit actorRemoved(theActor);
index 9c2f827009fccb05ea49371907ca9601518f7ebe..6b939f0fc1cc6f82fd3376aac963e55b1435dc6c 100755 (executable)
@@ -190,11 +190,13 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow
 
   //! Redirect the request to #SVTK_Renderer::AddActor
   virtual void AddActor(VTKViewer_Actor* theActor,
-                        bool theIsUpdate = false);
+                        bool theIsUpdate = false,
+                        bool theIsAdjustActors = true);
 
   //! Redirect the request to #SVTK_Renderer::RemoveActor
   virtual void RemoveActor(VTKViewer_Actor* theActor,
-                           bool theIsUpdate = false);
+                           bool theIsUpdate = false,
+                           bool theIsAdjustActors = true);
 
   //----------------------------------------------------------------------------
   //! Redirect the request to #SVTK_Renderer::AdjustActors