]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To improve a way to update actor (only if necessary)
authorapo <apo@opencascade.com>
Thu, 2 Nov 2006 09:37:19 +0000 (09:37 +0000)
committerapo <apo@opencascade.com>
Thu, 2 Nov 2006 09:37:19 +0000 (09:37 +0000)
src/OBJECT/VISU_Actor.cxx
src/OBJECT/VISU_Actor.h
src/VISU_I/VISU_Prs3d_i.cc

index bdd67e3807749b4a6b08f8d54582c231b82865a2..834744efd7e97d095c55cc91e800d92466e4d869 100644 (file)
@@ -195,7 +195,8 @@ void
 VISU_Actor
 ::UpdateFromFactory()
 {
-  if(GetMTime() < myActorFactory->GetMTime()){
+  if(myUpdateFromFactoryTime.GetMTime() < myActorFactory->GetMTime()){
+    myUpdateFromFactoryTime.Modified();
     myActorFactory->UpdateActor(this);
     Update();
   }
index 3651a0a2a5eba3341e43073bf304087c7e4102a5..30f719102e1f9521d3e90fd695bef5dbe1c573e2 100644 (file)
@@ -34,6 +34,7 @@
 #include "VISU_BoostSignals.h"
 
 #include <string>
+#include <vtkTimeStamp.h>
 #include <vtkSmartPointer.h>
 
 class vtkProp;
@@ -240,6 +241,7 @@ class VTKOCC_EXPORT VISU_Actor :
   vtkSmartPointer<vtkDataSetMapper> myMapper;
 
   VISU::TActorFactory* myActorFactory;
+  vtkTimeStamp myUpdateFromFactoryTime;
   boost::signal1<void,VISU_Actor*> myDestroySignal;
 
   vtkSmartPointer<VTKViewer_ShrinkFilter> myShrinkFilter;
index 6e6f942403430125cffa0431cb6d423c0e19d3b6..f40c1aa12a637d2b5df5381b96cc5ece46f2d6a5 100644 (file)
@@ -290,9 +290,6 @@ void
 VISU::Prs3d_i
 ::CheckDataSet() 
 {
-  if(GetMTime() < myUpdateTime.GetMTime())
-    return;
-
   vtkMapper *aMapper = GetPipeLine()->GetMapper();
   vtkDataSet *aDataSet = aMapper->GetInput();
   if (!aDataSet)
@@ -437,7 +434,6 @@ VISU::Prs3d_i
   if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActor - this = "<<this<<"; theActor = "<<theActor);
   theActor->SetPosition(myOffset[0],myOffset[1],myOffset[2]);
   theActor->ShallowCopyPL(GetPipeLine());
-  theActor->Modified();
 }
 
 void