From: ouv Date: Tue, 28 Dec 2010 12:24:41 +0000 (+0000) Subject: 0021105: EDF 1179 SMESH: Efficiency of clipping plane in VTK viewer X-Git-Tag: V6_3_0a1~103 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4488178dfa261a8ea0126ae1d82cf5e804afedf4;p=modules%2Fgui.git 0021105: EDF 1179 SMESH: Efficiency of clipping plane in VTK viewer --- diff --git a/src/SVTK/SVTK_Renderer.cxx b/src/SVTK/SVTK_Renderer.cxx index 9131259f8..6fd71280b 100644 --- a/src/SVTK/SVTK_Renderer.cxx +++ b/src/SVTK/SVTK_Renderer.cxx @@ -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(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(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(); } } diff --git a/src/SVTK/SVTK_Renderer.h b/src/SVTK/SVTK_Renderer.h index 3762af06c..6989bcd39 100644 --- a/src/SVTK/SVTK_Renderer.h +++ b/src/SVTK/SVTK_Renderer.h @@ -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* diff --git a/src/SVTK/SVTK_ViewWindow.cxx b/src/SVTK/SVTK_ViewWindow.cxx index a0118be86..d63b5d7e5 100755 --- a/src/SVTK/SVTK_ViewWindow.cxx +++ b/src/SVTK/SVTK_ViewWindow.cxx @@ -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); diff --git a/src/SVTK/SVTK_ViewWindow.h b/src/SVTK/SVTK_ViewWindow.h index 9c2f82700..6b939f0fc 100755 --- a/src/SVTK/SVTK_ViewWindow.h +++ b/src/SVTK/SVTK_ViewWindow.h @@ -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