From 4488178dfa261a8ea0126ae1d82cf5e804afedf4 Mon Sep 17 00:00:00 2001 From: ouv Date: Tue, 28 Dec 2010 12:24:41 +0000 Subject: [PATCH] 0021105: EDF 1179 SMESH: Efficiency of clipping plane in VTK viewer --- src/SVTK/SVTK_Renderer.cxx | 12 ++++++++---- src/SVTK/SVTK_Renderer.h | 4 ++-- src/SVTK/SVTK_ViewWindow.cxx | 10 ++++++---- src/SVTK/SVTK_ViewWindow.h | 6 ++++-- 4 files changed, 20 insertions(+), 12 deletions(-) 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 -- 2.39.2