From 4ab2da1e9fb9352011556d393e63bd7fea57d817 Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 2 Nov 2006 09:37:19 +0000 Subject: [PATCH] To improve a way to update actor (only if necessary) --- src/OBJECT/VISU_Actor.cxx | 3 ++- src/OBJECT/VISU_Actor.h | 2 ++ src/VISU_I/VISU_Prs3d_i.cc | 4 ---- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/OBJECT/VISU_Actor.cxx b/src/OBJECT/VISU_Actor.cxx index bdd67e38..834744ef 100644 --- a/src/OBJECT/VISU_Actor.cxx +++ b/src/OBJECT/VISU_Actor.cxx @@ -195,7 +195,8 @@ void VISU_Actor ::UpdateFromFactory() { - if(GetMTime() < myActorFactory->GetMTime()){ + if(myUpdateFromFactoryTime.GetMTime() < myActorFactory->GetMTime()){ + myUpdateFromFactoryTime.Modified(); myActorFactory->UpdateActor(this); Update(); } diff --git a/src/OBJECT/VISU_Actor.h b/src/OBJECT/VISU_Actor.h index 3651a0a2..30f71910 100644 --- a/src/OBJECT/VISU_Actor.h +++ b/src/OBJECT/VISU_Actor.h @@ -34,6 +34,7 @@ #include "VISU_BoostSignals.h" #include +#include #include class vtkProp; @@ -240,6 +241,7 @@ class VTKOCC_EXPORT VISU_Actor : vtkSmartPointer myMapper; VISU::TActorFactory* myActorFactory; + vtkTimeStamp myUpdateFromFactoryTime; boost::signal1 myDestroySignal; vtkSmartPointer myShrinkFilter; diff --git a/src/VISU_I/VISU_Prs3d_i.cc b/src/VISU_I/VISU_Prs3d_i.cc index 6e6f9424..f40c1aa1 100644 --- a/src/VISU_I/VISU_Prs3d_i.cc +++ b/src/VISU_I/VISU_Prs3d_i.cc @@ -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 = "<