From: apo Date: Fri, 27 Oct 2006 14:45:55 +0000 (+0000) Subject: To introduce Modified time X-Git-Tag: WP1_2_3_06-10-2006~32 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=296450390bf630efc5bd38b0f175d9b0b717a303;p=modules%2Fvisu.git To introduce Modified time --- diff --git a/src/VISU_I/VISU_Prs3d_i.cc b/src/VISU_I/VISU_Prs3d_i.cc index 9a97c36b..87ab1241 100644 --- a/src/VISU_I/VISU_Prs3d_i.cc +++ b/src/VISU_I/VISU_Prs3d_i.cc @@ -68,6 +68,8 @@ VISU::Prs3d_i } } + +//---------------------------------------------------------------------------- VISU::Prs3d_i ::Prs3d_i(Result_i* theResult, bool theAddToStudy) : @@ -87,6 +89,8 @@ VISU::Prs3d_i } } + +//---------------------------------------------------------------------------- void VISU::Prs3d_i ::SameAs(const Prs3d_i* theOrigin) @@ -97,6 +101,8 @@ VISU::Prs3d_i } } + +//---------------------------------------------------------------------------- VISU::Prs3d_i ::~Prs3d_i() { @@ -116,6 +122,8 @@ VISU::Prs3d_i return true; } + +//---------------------------------------------------------------------------- CORBA::Boolean VISU::Prs3d_i ::Apply() @@ -127,6 +135,8 @@ VISU::Prs3d_i return false; } + +//---------------------------------------------------------------------------- void VISU::Prs3d_i ::SetResultObject(VISU::Result_ptr theResult) @@ -139,9 +149,12 @@ VISU::Prs3d_i aResult->Register(); SetStudyDocument(aResult->GetStudyDocument()); myResult = aResult; + myInputTimeStamp.Modified(); } } + +//---------------------------------------------------------------------------- VISU::Result_ptr VISU::Prs3d_i ::GetResultObject() @@ -149,13 +162,20 @@ VISU::Prs3d_i return myResult->_this(); } + +//---------------------------------------------------------------------------- void VISU::Prs3d_i ::SetMeshName(const char* theMeshName) { - myMeshName = theMeshName; + if(myMeshName != theMeshName){ + myMeshName == theMeshName; + myInputTimeStamp.Modified(); + } } + +//---------------------------------------------------------------------------- char* VISU::Prs3d_i ::GetMeshName() @@ -164,6 +184,30 @@ VISU::Prs3d_i } +//---------------------------------------------------------------------------- +unsigned long int +VISU::Prs3d_i +::GetMTime() +{ + return max(GetInputMTime(),GetParamsMTime()); +} + +//---------------------------------------------------------------------------- +unsigned long int +VISU::Prs3d_i +::GetInputMTime() +{ + return myInputTimeStamp.GetMTime(); +} + +//---------------------------------------------------------------------------- +unsigned long int +VISU::Prs3d_i +::GetParamsMTime() +{ + return myParamsTimeStamp.GetMTime(); +} + //---------------------------------------------------------------------------- VISU::Storable* VISU::Prs3d_i @@ -173,6 +217,7 @@ VISU::Prs3d_i myOffset[0] = VISU::Storable::FindValue(theMap,"myOffset[0]").toFloat(); myOffset[1] = VISU::Storable::FindValue(theMap,"myOffset[1]").toFloat(); myOffset[2] = VISU::Storable::FindValue(theMap,"myOffset[2]").toFloat(); + myParamsTimeStamp.Modified(); return this; } @@ -422,6 +467,7 @@ VISU::Prs3d_i myOffset[0] = theOffsets[0]; myOffset[1] = theOffsets[1]; myOffset[2] = theOffsets[2]; + myParamsTimeStamp.Modified(); } void @@ -433,6 +479,7 @@ VISU::Prs3d_i myOffset[0] = theDx; myOffset[1] = theDy; myOffset[2] = theDz; + myParamsTimeStamp.Modified(); } void diff --git a/src/VISU_I/VISU_Prs3d_i.hh b/src/VISU_I/VISU_Prs3d_i.hh index a5e24053..caa92202 100644 --- a/src/VISU_I/VISU_Prs3d_i.hh +++ b/src/VISU_I/VISU_Prs3d_i.hh @@ -38,6 +38,7 @@ #include "VTKViewer.h" #include +#include class VISU_PipeLine; class VISU_Actor; @@ -231,6 +232,21 @@ namespace VISU CORBA::Float& theDz); //---------------------------------------------------------------------------- + //! Return modified time of the object + virtual + unsigned long int + GetMTime(); + + //! Return input's modified time + virtual + unsigned long int + GetInputMTime(); + + //! Return params's modified time + virtual + unsigned long int + GetParamsMTime(); + protected: virtual bool @@ -252,9 +268,12 @@ namespace VISU protected: Result_i *myResult; std::string myMeshName; + vtkTimeStamp myInputTimeStamp; - bool myAddToStudy; CORBA::Float myOffset[3]; + vtkTimeStamp myParamsTimeStamp; + + bool myAddToStudy; VISU_PipeLine *myPipeLine; SALOMEDS::SObject_var mySObject;