From: apo Date: Mon, 23 Jul 2007 05:26:48 +0000 (+0000) Subject: Start to use SALOMEDS::Study::Modified() method X-Git-Tag: T_MULTIPR_INDUS_2007-07-23~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d527345c5cd8afa46a048e7e615eacc3d0a0f96b;p=modules%2Fvisu.git Start to use SALOMEDS::Study::Modified() method --- diff --git a/src/PIPELINE/VISU_ColoredPL.cxx b/src/PIPELINE/VISU_ColoredPL.cxx index d067adde..13c1de4b 100644 --- a/src/PIPELINE/VISU_ColoredPL.cxx +++ b/src/PIPELINE/VISU_ColoredPL.cxx @@ -57,11 +57,28 @@ VISU_ColoredPL } +//---------------------------------------------------------------------------- VISU_ColoredPL ::~VISU_ColoredPL() {} +//---------------------------------------------------------------------------- +unsigned long int +VISU_ColoredPL +::GetMTime() +{ + unsigned long int aTime = Superclass::GetMTime(); + + aTime = std::max(aTime, myMapperTable->GetMTime()); + aTime = std::max(aTime, myBarTable->GetMTime()); + aTime = std::max(aTime, myExtractor->GetMTime()); + aTime = std::max(aTime, myFieldTransform->GetMTime()); + + return aTime; +} + + //---------------------------------------------------------------------------- void VISU_ColoredPL @@ -135,6 +152,9 @@ VISU_ColoredPL { if(theRange[0] > theRange[1]) return; + + if(VISU::CheckIsSameRange(GetScalarRange(), theRange)) + return; myFieldTransform->SetScalarRange(theRange); myBarTable->SetRange(theRange); @@ -232,11 +252,13 @@ VISU_ColoredPL vtkFloatingPointType *aRange = GetScalarRange(); vtkFloatingPointType aScalarRange[2] = {aRange[0], aRange[1]}; if(myBarTable->GetScale() == VTK_SCALE_LOG10) - VISU_LookupTable::ComputeLogRange(aRange,aScalarRange); - myMapperTable->SetRange(aScalarRange); + VISU_LookupTable::ComputeLogRange(aRange, aScalarRange); - myMapperTable->Build(); - myBarTable->Build(); + if(!VISU::CheckIsSameRange(myMapperTable->GetRange(), aScalarRange)){ + myMapperTable->SetRange(aScalarRange); + myMapperTable->Build(); + myBarTable->Build(); + } Superclass::Update(); } diff --git a/src/PIPELINE/VISU_ColoredPL.hxx b/src/PIPELINE/VISU_ColoredPL.hxx index 045db348..3743750a 100644 --- a/src/PIPELINE/VISU_ColoredPL.hxx +++ b/src/PIPELINE/VISU_ColoredPL.hxx @@ -43,6 +43,10 @@ class VISU_ColoredPL : public VISU_PipeLine public: vtkTypeMacro(VISU_ColoredPL, VISU_PipeLine); + virtual + unsigned long int + GetMTime(); + //---------------------------------------------------------------------------- virtual int diff --git a/src/PIPELINE/VISU_CutLinesPL.hxx b/src/PIPELINE/VISU_CutLinesPL.hxx index 6a1d391b..58116834 100644 --- a/src/PIPELINE/VISU_CutLinesPL.hxx +++ b/src/PIPELINE/VISU_CutLinesPL.hxx @@ -122,7 +122,6 @@ public: protected: VISU_CutLinesPL(); - VISU_CutLinesPL(const VISU_CutLinesPL&); virtual void @@ -135,6 +134,10 @@ protected: vtkFloatingPointType myBasePnt[3]; vtkFloatingPointType myPosition; int myCondition; + +private: + VISU_CutLinesPL(const VISU_CutLinesPL&); // Not implemented. + void operator=(const VISU_CutLinesPL&); // Not implemented. }; diff --git a/src/PIPELINE/VISU_CutPlanesPL.cxx b/src/PIPELINE/VISU_CutPlanesPL.cxx index 3abaeeea..22493a10 100644 --- a/src/PIPELINE/VISU_CutPlanesPL.cxx +++ b/src/PIPELINE/VISU_CutPlanesPL.cxx @@ -70,6 +70,19 @@ VISU_CutPlanesPL } +//---------------------------------------------------------------------------- +unsigned long int +VISU_CutPlanesPL +::GetMTime() +{ + unsigned long int aTime = Superclass::GetMTime(); + + aTime = std::max(aTime, myAppendPolyData->GetMTime()); + + return aTime; +} + + //---------------------------------------------------------------------------- void VISU_CutPlanesPL diff --git a/src/PIPELINE/VISU_CutPlanesPL.hxx b/src/PIPELINE/VISU_CutPlanesPL.hxx index f59d3eb1..27d377fd 100644 --- a/src/PIPELINE/VISU_CutPlanesPL.hxx +++ b/src/PIPELINE/VISU_CutPlanesPL.hxx @@ -40,11 +40,16 @@ class VISU_PIPELINE_EXPORT VISU_CutPlanesPL : public VISU_ScalarMapPL { public: vtkTypeMacro(VISU_CutPlanesPL, VISU_ScalarMapPL); - static VISU_CutPlanesPL* New(); + + static + VISU_CutPlanesPL* + New(); virtual - ~VISU_CutPlanesPL(); + unsigned long int + GetMTime(); + //---------------------------------------------------------------------------- enum PlaneOrientation {XY, YZ, ZX}; virtual @@ -176,9 +181,12 @@ public: const std::vector& thePlanePosition, const std::vector& thePlaneCondition, vtkFloatingPointType theDisplacement); + protected: VISU_CutPlanesPL(); - VISU_CutPlanesPL(const VISU_CutPlanesPL&); + + virtual + ~VISU_CutPlanesPL(); virtual vtkDataSet* @@ -198,6 +206,10 @@ protected: vtkAppendPolyData *myAppendPolyData; std::vector myPartPosition; std::vector myPartCondition; + +private: + VISU_CutPlanesPL(const VISU_CutPlanesPL&); // Not implemented. + void operator=(const VISU_CutPlanesPL&); // Not implemented. }; #endif diff --git a/src/PIPELINE/VISU_DeformedShapePL.cxx b/src/PIPELINE/VISU_DeformedShapePL.cxx index 16896392..6631af08 100644 --- a/src/PIPELINE/VISU_DeformedShapePL.cxx +++ b/src/PIPELINE/VISU_DeformedShapePL.cxx @@ -58,6 +58,20 @@ VISU_DeformedShapePL } +//---------------------------------------------------------------------------- +unsigned long int +VISU_DeformedShapePL +::GetMTime() +{ + unsigned long int aTime = Superclass::GetMTime(); + + aTime = std::max(aTime, myWarpVector->GetMTime()); + aTime = std::max(aTime, myCellDataToPointData->GetMTime()); + + return aTime; +} + + //---------------------------------------------------------------------------- void VISU_DeformedShapePL diff --git a/src/PIPELINE/VISU_DeformedShapePL.hxx b/src/PIPELINE/VISU_DeformedShapePL.hxx index e09b4cf7..6011e501 100644 --- a/src/PIPELINE/VISU_DeformedShapePL.hxx +++ b/src/PIPELINE/VISU_DeformedShapePL.hxx @@ -44,6 +44,11 @@ public: VISU_DeformedShapePL* New(); + virtual + unsigned long int + GetMTime(); + + //---------------------------------------------------------------------------- virtual void SetScale(vtkFloatingPointType theScale); @@ -80,7 +85,6 @@ public: protected: VISU_DeformedShapePL(); - VISU_DeformedShapePL(const VISU_DeformedShapePL&); virtual ~VISU_DeformedShapePL(); @@ -97,6 +101,10 @@ protected: vtkFloatingPointType myScaleFactor; vtkWarpVector *myWarpVector; vtkCellDataToPointData* myCellDataToPointData; + +private: + VISU_DeformedShapePL(const VISU_DeformedShapePL&); // Not implemented. + void operator=(const VISU_DeformedShapePL&); // Not implemented. }; diff --git a/src/PIPELINE/VISU_GaussPointsPL.cxx b/src/PIPELINE/VISU_GaussPointsPL.cxx index 1d8bcbe5..d56391a2 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.cxx +++ b/src/PIPELINE/VISU_GaussPointsPL.cxx @@ -89,6 +89,24 @@ VISU_GaussPointsPL } +//---------------------------------------------------------------------------- +unsigned long int +VISU_GaussPointsPL +::GetMTime() +{ + unsigned long int aTime = Superclass::GetMTime(); + + aTime = std::max(aTime, myWarpVector->GetMTime()); + aTime = std::max(aTime, myGlyph->GetMTime()); + aTime = std::max(aTime, mySphereSource->GetMTime()); + + for(int i = 0; i < 3; i++) + aTime = std::max(aTime, myPassFilter[i]->GetMTime()); + + return aTime; +} + + //---------------------------------------------------------------------------- void VISU_GaussPointsPL diff --git a/src/PIPELINE/VISU_GaussPointsPL.hxx b/src/PIPELINE/VISU_GaussPointsPL.hxx index d8cd2f59..905cdc36 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.hxx +++ b/src/PIPELINE/VISU_GaussPointsPL.hxx @@ -64,6 +64,10 @@ public: VISU_GaussPointsPL* New(); + virtual + unsigned long int + GetMTime(); + //---------------------------------------------------------------------------- void SetGaussPtsIDMapper(const VISU::PGaussPtsIDMapper& theGaussPtsIDMapper); @@ -302,6 +306,10 @@ private: vtkSphereSource* mySphereSource; vtkFloatingPointType myMagnificationIncrement; + +private: + VISU_GaussPointsPL(const VISU_GaussPointsPL&); // Not implemented. + void operator=(const VISU_GaussPointsPL&); // Not implemented. }; #endif diff --git a/src/PIPELINE/VISU_IsoSurfacesPL.cxx b/src/PIPELINE/VISU_IsoSurfacesPL.cxx index 8f92a1cb..bea9854f 100644 --- a/src/PIPELINE/VISU_IsoSurfacesPL.cxx +++ b/src/PIPELINE/VISU_IsoSurfacesPL.cxx @@ -62,6 +62,20 @@ VISU_IsoSurfacesPL } +//---------------------------------------------------------------------------- +unsigned long int +VISU_IsoSurfacesPL +::GetMTime() +{ + unsigned long int aTime = Superclass::GetMTime(); + + aTime = std::max(aTime, myCellDataToPointData->GetMTime()); + aTime = std::max(aTime, myContourFilter->GetMTime()); + + return aTime; +} + + //---------------------------------------------------------------------------- void VISU_IsoSurfacesPL diff --git a/src/PIPELINE/VISU_IsoSurfacesPL.hxx b/src/PIPELINE/VISU_IsoSurfacesPL.hxx index d53aeb35..83a646dd 100644 --- a/src/PIPELINE/VISU_IsoSurfacesPL.hxx +++ b/src/PIPELINE/VISU_IsoSurfacesPL.hxx @@ -44,6 +44,11 @@ public: VISU_IsoSurfacesPL* New(); + virtual + unsigned long int + GetMTime(); + + //---------------------------------------------------------------------------- virtual int GetNbParts(); @@ -92,7 +97,6 @@ public: protected: VISU_IsoSurfacesPL(); - VISU_IsoSurfacesPL(const VISU_IsoSurfacesPL&); virtual ~VISU_IsoSurfacesPL(); @@ -106,6 +110,11 @@ protected: vtkFloatingPointType myRange[2]; vtkCellDataToPointData* myCellDataToPointData; vtkContourFilter *myContourFilter; + +private: + VISU_IsoSurfacesPL(const VISU_IsoSurfacesPL&);; // Not implemented. + void operator=(const VISU_IsoSurfacesPL&); // Not implemented. + }; diff --git a/src/PIPELINE/VISU_PipeLine.cxx b/src/PIPELINE/VISU_PipeLine.cxx index 06661f01..ea165bc0 100644 --- a/src/PIPELINE/VISU_PipeLine.cxx +++ b/src/PIPELINE/VISU_PipeLine.cxx @@ -274,7 +274,11 @@ void VISU_PipeLine ::SetIsShrinkable(bool theIsShrinkable) { + if(myIsShrinkable == theIsShrinkable) + return; + myIsShrinkable = theIsShrinkable; + Modified(); } diff --git a/src/PIPELINE/VISU_Plot3DPL.cxx b/src/PIPELINE/VISU_Plot3DPL.cxx index 60244568..7696d62e 100644 --- a/src/PIPELINE/VISU_Plot3DPL.cxx +++ b/src/PIPELINE/VISU_Plot3DPL.cxx @@ -75,7 +75,23 @@ VISU_Plot3DPL //---------------------------------------------------------------------------- VISU_Plot3DPL ::~VISU_Plot3DPL() +{} + + +//---------------------------------------------------------------------------- +unsigned long int +VISU_Plot3DPL +::GetMTime() { + unsigned long int aTime = Superclass::GetMTime(); + + aTime = std::max(aTime, myCellDataToPointData->GetMTime()); + aTime = std::max(aTime, myAppendPolyData->GetMTime()); + aTime = std::max(aTime, myGeometryFilter->GetMTime()); + aTime = std::max(aTime, myContourFilter->GetMTime()); + aTime = std::max(aTime, myWarpScalar->GetMTime()); + + return aTime; } diff --git a/src/PIPELINE/VISU_Plot3DPL.hxx b/src/PIPELINE/VISU_Plot3DPL.hxx index 82d0855f..2cb63767 100644 --- a/src/PIPELINE/VISU_Plot3DPL.hxx +++ b/src/PIPELINE/VISU_Plot3DPL.hxx @@ -47,9 +47,11 @@ public: VISU_Plot3DPL* New(); - virtual - ~VISU_Plot3DPL(); + virtual + unsigned long int + GetMTime(); + //---------------------------------------------------------------------------- VISU_CutPlanesPL::PlaneOrientation GetPlaneOrientation(); @@ -126,7 +128,8 @@ public: protected: VISU_Plot3DPL(); - VISU_Plot3DPL(const VISU_Plot3DPL&); + virtual + ~VISU_Plot3DPL(); virtual vtkDataSet* @@ -147,6 +150,10 @@ protected: vtkSmartPointer myGeometryFilter; vtkSmartPointer myContourFilter; vtkSmartPointer myWarpScalar; + +private: + VISU_Plot3DPL(const VISU_Plot3DPL&);; // Not implemented. + void operator=(const VISU_Plot3DPL&); // Not implemented. }; #endif diff --git a/src/PIPELINE/VISU_ScalarMapPL.cxx b/src/PIPELINE/VISU_ScalarMapPL.cxx index 2856a298..77761421 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.cxx +++ b/src/PIPELINE/VISU_ScalarMapPL.cxx @@ -69,6 +69,20 @@ VISU_ScalarMapPL {} +//---------------------------------------------------------------------------- +unsigned long int +VISU_ScalarMapPL +::GetMTime() +{ + unsigned long int aTime = Superclass::GetMTime(); + + aTime = std::max(aTime, myAppendFilter->GetMTime()); + aTime = std::max(aTime, myMergeFilter->GetMTime()); + + return aTime; +} + + //---------------------------------------------------------------------------- void VISU_ScalarMapPL diff --git a/src/PIPELINE/VISU_ScalarMapPL.hxx b/src/PIPELINE/VISU_ScalarMapPL.hxx index 13020793..eaa1aae7 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.hxx +++ b/src/PIPELINE/VISU_ScalarMapPL.hxx @@ -48,6 +48,11 @@ public: VISU_ScalarMapPL* New(); + virtual + unsigned long int + GetMTime(); + + //---------------------------------------------------------------------------- virtual void Update(); @@ -83,7 +88,6 @@ public: protected: //---------------------------------------------------------------------------- VISU_ScalarMapPL(); - VISU_ScalarMapPL(const VISU_ScalarMapPL&); virtual ~VISU_ScalarMapPL(); @@ -106,6 +110,9 @@ protected: bool theIsCopyInput); private: + VISU_ScalarMapPL(const VISU_ScalarMapPL&); // Not implemented. + void operator=(const VISU_ScalarMapPL&); // Not implemented. + vtkSmartPointer myAppendFilter; vtkSmartPointer myMergeFilter; }; diff --git a/src/PIPELINE/VISU_StreamLinesPL.cxx b/src/PIPELINE/VISU_StreamLinesPL.cxx index 97d9abfb..a56299e4 100644 --- a/src/PIPELINE/VISU_StreamLinesPL.cxx +++ b/src/PIPELINE/VISU_StreamLinesPL.cxx @@ -88,6 +88,23 @@ VISU_StreamLinesPL } +//---------------------------------------------------------------------------- +unsigned long int +VISU_StreamLinesPL +::GetMTime() +{ + unsigned long int aTime = Superclass::GetMTime(); + + aTime = std::max(aTime, myStream->GetMTime()); + aTime = std::max(aTime, mySource->GetMTime()); + aTime = std::max(aTime, myCenters->GetMTime()); + aTime = std::max(aTime, myGeomFilter->GetMTime()); + aTime = std::max(aTime, myPointsFilter->GetMTime()); + + return aTime; +} + + //---------------------------------------------------------------------------- void VISU_StreamLinesPL diff --git a/src/PIPELINE/VISU_StreamLinesPL.hxx b/src/PIPELINE/VISU_StreamLinesPL.hxx index ed762a9b..1e26676a 100644 --- a/src/PIPELINE/VISU_StreamLinesPL.hxx +++ b/src/PIPELINE/VISU_StreamLinesPL.hxx @@ -47,6 +47,11 @@ public: VISU_StreamLinesPL* New(); + virtual + unsigned long int + GetMTime(); + + //---------------------------------------------------------------------------- virtual size_t SetParams(vtkFloatingPointType theIntStep, @@ -191,7 +196,6 @@ public: protected: VISU_StreamLinesPL(); - VISU_StreamLinesPL(const VISU_StreamLinesPL&); virtual ~VISU_StreamLinesPL(); @@ -237,6 +241,10 @@ protected: VTKViewer_GeometryFilter *myGeomFilter; VISU_UsedPointsFilter *myPointsFilter; vtkFloatingPointType myPercents; + +private: + VISU_StreamLinesPL(const VISU_StreamLinesPL&); // Not implemented. + void operator=(const VISU_StreamLinesPL&); // Not implemented. }; diff --git a/src/PIPELINE/VISU_VectorsPL.cxx b/src/PIPELINE/VISU_VectorsPL.cxx index 36a3014f..acc3657f 100644 --- a/src/PIPELINE/VISU_VectorsPL.cxx +++ b/src/PIPELINE/VISU_VectorsPL.cxx @@ -79,6 +79,25 @@ VISU_VectorsPL } +//---------------------------------------------------------------------------- +unsigned long int +VISU_VectorsPL +::GetMTime() +{ + unsigned long int aTime = Superclass::GetMTime(); + + aTime = std::max(aTime, myBaseGlyph->GetMTime()); + aTime = std::max(aTime, myTransformedGlyph->GetMTime()); + aTime = std::max(aTime, myCenters->GetMTime()); + aTime = std::max(aTime, myGlyphSource->GetMTime()); + aTime = std::max(aTime, myConeSource->GetMTime()); + aTime = std::max(aTime, myLineSource->GetMTime()); + aTime = std::max(aTime, myTransformFilter->GetMTime()); + + return aTime; +} + + //---------------------------------------------------------------------------- void VISU_VectorsPL diff --git a/src/PIPELINE/VISU_VectorsPL.hxx b/src/PIPELINE/VISU_VectorsPL.hxx index cbdcd300..8a388375 100644 --- a/src/PIPELINE/VISU_VectorsPL.hxx +++ b/src/PIPELINE/VISU_VectorsPL.hxx @@ -51,6 +51,11 @@ public: VISU_VectorsPL* New(); + virtual + unsigned long int + GetMTime(); + + //---------------------------------------------------------------------------- virtual void SetScale(vtkFloatingPointType theScale); @@ -114,7 +119,6 @@ public: protected: VISU_VectorsPL(); - VISU_VectorsPL(const VISU_VectorsPL&); virtual ~VISU_VectorsPL(); @@ -139,6 +143,10 @@ protected: vtkCellCenters* myCenters; VTKViewer_TransformFilter *myTransformFilter; + +private: + VISU_VectorsPL(const VISU_VectorsPL&); // Not implemented. + void operator=(const VISU_VectorsPL&); // Not implemented. }; diff --git a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx index 02ff6a74..6a66425d 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx +++ b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx @@ -319,6 +319,8 @@ void VisuGUI_GaussScalarBarPane::onGlobalScalarBar() RBFieldRange->setEnabled( false ); MinEdit->setEnabled( false ); MaxEdit->setEnabled( false ); + + myPrsCopy->SetIsActiveLocalScalarBar(false); } @@ -333,6 +335,8 @@ void VisuGUI_GaussScalarBarPane::onLocalScalarBar() MinEdit->setEnabled( true ); MaxEdit->setEnabled( true ); } + + myPrsCopy->SetIsActiveLocalScalarBar(true); } diff --git a/src/VISU_I/Makefile.am b/src/VISU_I/Makefile.am index 7b370157..184ad65a 100644 --- a/src/VISU_I/Makefile.am +++ b/src/VISU_I/Makefile.am @@ -62,6 +62,7 @@ libVISUEngineImpl_la_SOURCES = \ VISU_CorbaMedConvertor.cxx \ VISU_PrsObject_i.cc \ VISU_Prs3d_i.cc \ + VISU_Prs3dUtils.cc \ VISU_ColoredPrs3d_i.cc \ VISU_ScalarMap_i.cc \ VISU_GaussPoints_i.cc \ diff --git a/src/VISU_I/VISU_ColoredPrs3dCache_i.cc b/src/VISU_I/VISU_ColoredPrs3dCache_i.cc index 595fd30a..d6bbf477 100644 --- a/src/VISU_I/VISU_ColoredPrs3dCache_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3dCache_i.cc @@ -420,6 +420,7 @@ VISU::ColoredPrs3dCache_i } myMemoryMode = theMode; + GetStudyDocument()->Modified(); } VISU::ColoredPrs3dCache::MemoryMode @@ -447,6 +448,7 @@ VISU::ColoredPrs3dCache_i ClearCache(theMemorySize); myLimitedMemory = theMemorySize; + GetStudyDocument()->Modified(); } CORBA::Float diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.cc b/src/VISU_I/VISU_ColoredPrs3d_i.cc index 46b613e2..488db156 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3d_i.cc @@ -25,6 +25,7 @@ // Module : VISU #include "VISU_ColoredPrs3d_i.hh" +#include "VISU_Prs3dUtils.hh" #include "VISU_Result_i.hh" #include "VISU_ColoredPL.hxx" @@ -183,7 +184,7 @@ VISU::ColoredPrs3d_i GetSpecificPL()->Init(); // To update scalar range according to the new input - if(!IsTimeStampFixed() && !IsRangeFixed() || theReInit) + if(!IsRangeFixed() || theReInit) SetSourceRange(); GetCResult()->ConnectObserver(this, myResultConnection); @@ -214,10 +215,13 @@ void VISU::ColoredPrs3d_i ::SetEntity(VISU::Entity theEntity) { - if(myEntity != theEntity){ - myEntity = theEntity; - myParamsTime.Modified(); - } + if(myEntity == theEntity) + return; + + VISU::TSetModified aModified(this); + + myEntity = theEntity; + myParamsTime.Modified(); } @@ -244,10 +248,13 @@ void VISU::ColoredPrs3d_i ::SetFieldName(const char* theFieldName) { - if(myFieldName != theFieldName){ - myFieldName = theFieldName; - myParamsTime.Modified(); - } + if(myFieldName == theFieldName) + return; + + VISU::TSetModified aModified(this); + + myFieldName = theFieldName; + myParamsTime.Modified(); } @@ -292,10 +299,13 @@ void VISU::ColoredPrs3d_i ::SetTimeStampNumber(CORBA::Long theTimeStampNumber) { - if(myTimeStampNumber != theTimeStampNumber){ - myTimeStampNumber = theTimeStampNumber; - myParamsTime.Modified(); - } + if(myTimeStampNumber == theTimeStampNumber) + return; + + VISU::TSetModified aModified(this); + + myTimeStampNumber = theTimeStampNumber; + myParamsTime.Modified(); } @@ -515,8 +525,11 @@ VISU::ColoredPrs3d_i SetNbColors(anOrigin->GetNbColors()); SetBarOrientation(anOrigin->GetBarOrientation()); + // "SetRange" function changes "myIsFixedRange" attribute, + // so, it is necessary pay a special attention if "this" equal to "theOrigin" + bool anIsFixedRange = anOrigin->IsRangeFixed(); SetRange(anOrigin->GetMin(), anOrigin->GetMax()); - UseFixedRange(anOrigin->IsRangeFixed()); + UseFixedRange(anIsFixedRange); SetPosition(anOrigin->GetPosX(), anOrigin->GetPosY()); SetSize(anOrigin->GetWidth(), anOrigin->GetHeight()); @@ -553,6 +566,7 @@ VISU::ColoredPrs3d_i return myColoredPL->GetScalarMode(); } + //---------------------------------------------------------------------------- void VISU::ColoredPrs3d_i @@ -564,6 +578,8 @@ VISU::ColoredPrs3d_i else if(theScalarMode > aNbComp) theScalarMode = 0; + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TVoidMemFun1ArgEvent (GetSpecificPL(), &VISU_ColoredPL::SetScalarMode, theScalarMode)); } @@ -589,6 +605,8 @@ void VISU::ColoredPrs3d_i ::SetRange(CORBA::Double theMin, CORBA::Double theMax) { + VISU::TSetModified aModified(this); + vtkFloatingPointType aScalarRange[2] = {theMin, theMax}; ProcessVoidEvent(new TVoidMemFun1ArgEvent (GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange)); @@ -602,6 +620,8 @@ void VISU::ColoredPrs3d_i ::SetSourceRange() { + VISU::TSetModified aModified(this); + if(IsTimeStampFixed()){ GetSpecificPL()->SetSourceRange(); ProcessVoidEvent(new TVoidMemFunEvent @@ -650,6 +670,8 @@ void VISU::ColoredPrs3d_i ::SetNbColors(CORBA::Long theNbColors) { + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TVoidMemFun1ArgEvent (GetSpecificPL(), &VISU_ColoredPL::SetNbColors, theNbColors)); } @@ -667,10 +689,13 @@ void VISU::ColoredPrs3d_i ::SetBarOrientation(VISU::ColoredPrs3d::Orientation theOrientation) { - if(myOrientation != theOrientation){ - myOrientation = theOrientation; - myParamsTime.Modified(); - } + if(myOrientation == theOrientation) + return; + + VISU::TSetModified aModified(this); + + myOrientation = theOrientation; + myParamsTime.Modified(); } //---------------------------------------------------------------------------- @@ -691,6 +716,8 @@ VISU::ColoredPrs3d_i if(anIsSameValue) return; + VISU::TSetModified aModified(this); + myPosition[0] = theX; myPosition[1] = theY; myParamsTime.Modified(); @@ -722,6 +749,8 @@ VISU::ColoredPrs3d_i if(anIsSameValue) return; + VISU::TSetModified aModified(this); + myWidth = theWidth; myHeight = theHeight; myParamsTime.Modified(); @@ -748,10 +777,13 @@ void VISU::ColoredPrs3d_i ::SetLabels(CORBA::Long theNbLabels) { - if(myNumberOfLabels != theNbLabels){ - myNumberOfLabels = theNbLabels; - myParamsTime.Modified(); - } + if(myNumberOfLabels == theNbLabels) + return; + + VISU::TSetModified aModified(this); + + myNumberOfLabels = theNbLabels; + myParamsTime.Modified(); } //---------------------------------------------------------------------------- @@ -779,6 +811,8 @@ VISU::ColoredPrs3d_i aStream< (GetSpecificPL(), &VISU_CutLinesPL::SetDisplacement, theDisp, 0)); } @@ -376,6 +382,8 @@ void VISU::CutLines_i ::SetDisplacement2(CORBA::Double theDisp) { + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TVoidMemFun2ArgEvent (GetSpecificPL(), &VISU_CutLinesPL::SetDisplacement, theDisp, 1)); } @@ -403,6 +411,8 @@ void VISU::CutLines_i ::SetBasePlanePosition(CORBA::Double thePlanePosition) { + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TVoidMemFun1ArgEvent (GetSpecificPL(), &VISU_CutLinesPL::SetPosition, thePlanePosition)); } @@ -421,6 +431,8 @@ VISU::CutLines_i ::SetLinePosition(CORBA::Long thePlaneNumber, CORBA::Double thePlanePosition) { + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TVoidMemFun2ArgEvent (GetSpecificPL(), &VISU_CutLinesPL::SetPartPosition, thePlaneNumber, thePlanePosition)); } @@ -439,6 +451,8 @@ void VISU::CutLines_i ::SetDefault() { + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TVoidMemFunEvent (GetSpecificPL(), &VISU_CutLinesPL::SetDefault)); } @@ -456,6 +470,8 @@ void VISU::CutLines_i ::SetDefaultPosition(CORBA::Long thePlaneNumber) { + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TVoidMemFun1ArgEvent (GetSpecificPL(), &VISU_CutLinesPL::SetPartDefault, thePlaneNumber)); } @@ -506,6 +522,8 @@ VISU::CutLines_i if(myMapCurvesInverted[theCurveNumber] == theInvert) return; + VISU::TSetModified aModified(this); + myMapCurvesInverted[theCurveNumber] = theInvert; myParamsTime.Modified(); } @@ -533,6 +551,8 @@ VISU::CutLines_i if(myUseAbsLength == theAbsLength) return; + VISU::TSetModified aModified(this); + myUseAbsLength = theAbsLength; myParamsTime.Modified(); } @@ -550,6 +570,8 @@ void VISU::CutLines_i ::SetNbLines(CORBA::Long theNb) { + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TVoidMemFun1ArgEvent (GetSpecificPL(), &VISU_CutLinesPL::SetNbParts, theNb)); } diff --git a/src/VISU_I/VISU_CutPlanes_i.cc b/src/VISU_I/VISU_CutPlanes_i.cc index f899ee38..a0f724b7 100644 --- a/src/VISU_I/VISU_CutPlanes_i.cc +++ b/src/VISU_I/VISU_CutPlanes_i.cc @@ -25,8 +25,10 @@ // Module : VISU #include "VISU_CutPlanesPL.hxx" -#include "VISU_Result_i.hh" +#include "VISU_Prs3dUtils.hh" #include "VISU_CutPlanes_i.hh" + +#include "VISU_Result_i.hh" #include "VISU_Actor.h" #include "SUIT_ResourceMgr.h" @@ -195,6 +197,8 @@ VISU::CutPlanes_i } }; + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TEvent(GetSpecificPL(), VISU_CutPlanesPL::PlaneOrientation(theOrient), theXAngle, @@ -231,6 +235,8 @@ void VISU::CutPlanes_i ::SetDisplacement(CORBA::Double theDisp) { + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TVoidMemFun2ArgEvent (GetSpecificPL(), &VISU_CutPlanesPL::SetDisplacement, theDisp, 0)); } @@ -250,6 +256,8 @@ VISU::CutPlanes_i ::SetPlanePosition(CORBA::Long thePlaneNumber, CORBA::Double thePlanePosition) { + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TVoidMemFun2ArgEvent (GetSpecificPL(), &VISU_CutPlanesPL::SetPartPosition, thePlaneNumber, thePlanePosition)); } @@ -268,6 +276,8 @@ void VISU::CutPlanes_i ::SetDefault(CORBA::Long thePlaneNumber) { + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TVoidMemFun1ArgEvent (GetSpecificPL(), &VISU_CutPlanesPL::SetPartDefault, thePlaneNumber)); } @@ -286,6 +296,8 @@ void VISU::CutPlanes_i ::SetNbPlanes(CORBA::Long theNb) { + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TVoidMemFun1ArgEvent (GetSpecificPL(), &VISU_CutPlanesPL::SetNbParts, theNb)); } diff --git a/src/VISU_I/VISU_DeformedShape_i.cc b/src/VISU_I/VISU_DeformedShape_i.cc index cea988c3..5e8ae25d 100644 --- a/src/VISU_I/VISU_DeformedShape_i.cc +++ b/src/VISU_I/VISU_DeformedShape_i.cc @@ -25,6 +25,7 @@ // Module : VISU #include "VISU_DeformedShape_i.hh" +#include "VISU_Prs3dUtils.hh" #include "VISU_Result_i.hh" #include "VISU_ScalarMapAct.h" @@ -204,6 +205,8 @@ void VISU::DeformedShape_i ::SetScale(CORBA::Double theScale) { + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TVoidMemFun1ArgEvent (GetSpecificPL(), &VISU_DeformedShapePL::SetScale, theScale)); } @@ -258,6 +261,8 @@ VISU::DeformedShape_i if(anIsSameValue) return; + VISU::TSetModified aModified(this); + myColor = theColor; myParamsTime.Modified(); } @@ -298,6 +303,8 @@ void VISU::DeformedShape_i ::SetMapScale(double theMapScale) { + VISU::TSetModified aModified(this); + myDeformedShapePL->SetMapScale(theMapScale); } diff --git a/src/VISU_I/VISU_GaussPoints_i.cc b/src/VISU_I/VISU_GaussPoints_i.cc index 06ce70a3..47ddbf40 100644 --- a/src/VISU_I/VISU_GaussPoints_i.cc +++ b/src/VISU_I/VISU_GaussPoints_i.cc @@ -26,6 +26,7 @@ #include "VISU_GaussPoints_i.hh" #include "VISU_ScalarMap_i.hh" +#include "VISU_Prs3dUtils.hh" #include "VISU_Result_i.hh" #include "VISU_GaussPtsAct.h" @@ -363,10 +364,13 @@ void VISU::GaussPoints_i ::SetFaceLimit( CORBA::Long theFaceLimit ) { - if( myFaceLimit != theFaceLimit ){ - myFaceLimit = theFaceLimit; - myParamsTime.Modified(); - } + if( myFaceLimit == theFaceLimit ) + return; + + VISU::TSetModified aModified(this); + + myFaceLimit = theFaceLimit; + myParamsTime.Modified(); } //---------------------------------------------------------------------------- @@ -374,6 +378,8 @@ void VISU::GaussPoints_i ::SetIsDeformed( CORBA::Boolean theIsDeformed ) { + VISU::TSetModified aModified(this); + myGaussPointsPL->SetIsDeformed( theIsDeformed ); } @@ -389,6 +395,8 @@ void VISU::GaussPoints_i ::SetScaleFactor( CORBA::Double theScaleFactor ) { + VISU::TSetModified aModified(this); + myGaussPointsPL->SetScale( theScaleFactor ); } @@ -427,6 +435,8 @@ VISU::GaussPoints_i if(myColor == theColor) return; + VISU::TSetModified aModified(this); + myColor = theColor; myParamsTime.Modified(); } @@ -444,6 +454,8 @@ void VISU::GaussPoints_i ::SetIsColored( bool theIsColored ) { + VISU::TSetModified aModified(this); + myGaussPointsPL->SetIsColored( theIsColored ); } @@ -459,9 +471,15 @@ bool VISU::GaussPoints_i ::SetMainTexture( const QString& theMainTexture ) { - bool update = myMainTexture != theMainTexture; - myMainTexture = theMainTexture; - return update; + if(myMainTexture != theMainTexture){ + VISU::TSetModified aModified(this); + + myMainTexture = theMainTexture; + myParamsTime.Modified(); + return true; + } + + return false; } QString @@ -484,9 +502,15 @@ bool VISU::GaussPoints_i ::SetAlphaTexture( const QString& theAlphaTexture ) { - bool update = myAlphaTexture != theAlphaTexture; - myAlphaTexture = theAlphaTexture; - return update; + if(myAlphaTexture != theAlphaTexture){ + VISU::TSetModified aModified(this); + + myAlphaTexture = theAlphaTexture; + myParamsTime.Modified(); + return true; + } + + return false; } QString @@ -509,6 +533,8 @@ void VISU::GaussPoints_i ::SetAlphaThreshold( CORBA::Double theAlphaThreshold ) { + VISU::TSetModified aModified(this); + myGaussPointsPL->SetAlphaThreshold( theAlphaThreshold ); } @@ -524,6 +550,8 @@ void VISU::GaussPoints_i ::SetResolution( CORBA::Long theResolution ) { + VISU::TSetModified aModified(this); + myGaussPointsPL->SetResolution( theResolution ); } @@ -539,6 +567,8 @@ void VISU::GaussPoints_i ::SetPrimitiveType(VISU::GaussPoints::PrimitiveType thePrimitiveType) { + VISU::TSetModified aModified(this); + myGaussPointsPL->SetPrimitiveType( thePrimitiveType ); } @@ -570,6 +600,8 @@ void VISU::GaussPoints_i ::SetClamp(CORBA::Double theClamp) { + VISU::TSetModified aModified(this); + myGaussPointsPL->SetClamp( theClamp ); } @@ -585,6 +617,8 @@ void VISU::GaussPoints_i ::SetGeomSize( CORBA::Double theGeomSize ) { + VISU::TSetModified aModified(this); + myGaussPointsPL->SetSize( theGeomSize ); } @@ -600,6 +634,8 @@ void VISU::GaussPoints_i ::SetMinSize( CORBA::Double theMinSize ) { + VISU::TSetModified aModified(this); + myGaussPointsPL->SetMinSize( theMinSize ); } @@ -615,6 +651,8 @@ void VISU::GaussPoints_i ::SetMaxSize( CORBA::Double theMaxSize ) { + VISU::TSetModified aModified(this); + myGaussPointsPL->SetMaxSize( theMaxSize ); } @@ -630,6 +668,8 @@ void VISU::GaussPoints_i ::SetMagnification( CORBA::Double theMagnification ) { + VISU::TSetModified aModified(this); + myGaussPointsPL->SetMagnification( theMagnification ); } @@ -645,6 +685,8 @@ void VISU::GaussPoints_i ::SetMagnificationIncrement( CORBA::Double theIncrement ) { + VISU::TSetModified aModified(this); + myGaussPointsPL->SetMagnificationIncrement( theIncrement ); } @@ -830,9 +872,15 @@ VISU::GaussPoints_i anActor->SetBarVisibility(true); GetPipeLine()->GetMapper()->SetScalarVisibility(1); - vtkFloatingPointType* aRange = GetSpecificPL()->GetScalarRange(); - aScalarBarCtrl->SetRangeLocal(aRange); - + if(IsRangeFixed()){ + vtkFloatingPointType* aRange = GetSpecificPL()->GetScalarRange(); + aScalarBarCtrl->SetRangeLocal(aRange); + }else{ + vtkFloatingPointType aRange[2]; + GetSpecificPL()->GetSourceRange(aRange); + aScalarBarCtrl->SetRangeLocal(aRange); + } + TMinMax aTMinMax(-VTK_LARGE_FLOAT,VTK_LARGE_FLOAT); bool anIsMinMaxDone = IsGlobalRangeDefined(); if(anIsMinMaxDone) @@ -921,8 +969,10 @@ VISU::GaussPoints_i if( !updateMainTexture && !updateAlphaTexture ) return; + VISU::TSetModified aModified(this); + using namespace VISU; - TTextureValue aTextureValue = GetTexture(theMainTexture,theAlphaTexture); + TTextureValue aTextureValue = GetTexture(theMainTexture, theAlphaTexture); myGaussPointsPL->SetImageData( aTextureValue.GetPointer() ); } @@ -940,10 +990,13 @@ void VISU::GaussPoints_i ::SetIsActiveLocalScalarBar(CORBA::Boolean theIsActiveLocalScalarBar) { - if(myIsActiveLocalScalarBar != theIsActiveLocalScalarBar){ - myIsActiveLocalScalarBar = theIsActiveLocalScalarBar; - myParamsTime.Modified(); - } + if(myIsActiveLocalScalarBar == theIsActiveLocalScalarBar) + return; + + VISU::TSetModified aModified(this); + + myIsActiveLocalScalarBar = theIsActiveLocalScalarBar; + myParamsTime.Modified(); } CORBA::Boolean @@ -957,10 +1010,13 @@ void VISU::GaussPoints_i ::SetIsDispGlobalScalarBar(CORBA::Boolean theIsDispGlobalScalarBar) { - if(myIsDispGlobalScalarBar != theIsDispGlobalScalarBar){ - myIsDispGlobalScalarBar = theIsDispGlobalScalarBar; - myParamsTime.Modified(); - } + if(myIsDispGlobalScalarBar == theIsDispGlobalScalarBar) + return; + + VISU::TSetModified aModified(this); + + myIsDispGlobalScalarBar = theIsDispGlobalScalarBar; + myParamsTime.Modified(); } bool @@ -975,6 +1031,8 @@ void VISU::GaussPoints_i ::SetSourceRange() { + VISU::TSetModified aModified(this); + if(IsTimeStampFixed() || GetIsActiveLocalScalarBar()) ProcessVoidEvent(new TVoidMemFunEvent (GetSpecificPL(), &VISU_ColoredPL::SetSourceRange)); @@ -1029,6 +1087,8 @@ void VISU::GaussPoints_i ::SetBiColor(CORBA::Boolean theIsBiColor) { + VISU::TSetModified aModified(this); + GetSpecificPL()->SetBicolor(theIsBiColor); } @@ -1043,10 +1103,13 @@ void VISU::GaussPoints_i ::SetSpacing(CORBA::Double theSpacing) { - if(!VISU::CheckIsSameValue(mySpacing, theSpacing)){ - mySpacing = theSpacing; - myParamsTime.Modified(); - } + if(VISU::CheckIsSameValue(mySpacing, theSpacing)) + return; + + VISU::TSetModified aModified(this); + + mySpacing = theSpacing; + myParamsTime.Modified(); } CORBA::Double diff --git a/src/VISU_I/VISU_IsoSurfaces_i.cc b/src/VISU_I/VISU_IsoSurfaces_i.cc index 769e48de..96377ac7 100644 --- a/src/VISU_I/VISU_IsoSurfaces_i.cc +++ b/src/VISU_I/VISU_IsoSurfaces_i.cc @@ -24,9 +24,11 @@ // Author : Alexey PETROV // Module : VISU +#include "VISU_IsoSurfaces_i.hh" +#include "VISU_Prs3dUtils.hh" + #include "VISU_IsoSurfacesPL.hxx" #include "VISU_Result_i.hh" -#include "VISU_IsoSurfaces_i.hh" #include "VISU_Actor.h" #include "SUIT_ResourceMgr.h" @@ -152,6 +154,8 @@ void VISU::IsoSurfaces_i ::SetNbSurfaces(CORBA::Long theNb) { + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TVoidMemFun1ArgEvent (GetSpecificPL(), &VISU_IsoSurfacesPL::SetNbParts, theNb)); } @@ -170,6 +174,8 @@ void VISU::IsoSurfaces_i ::SetSubRange(CORBA::Double theMin, CORBA::Double theMax) { + VISU::TSetModified aModified(this); + vtkFloatingPointType aRange[2] = {theMin, theMax}; ProcessVoidEvent(new TVoidMemFun1ArgEvent (GetSpecificPL(), &VISU_IsoSurfacesPL::SetRange, aRange)); diff --git a/src/VISU_I/VISU_Mesh_i.cc b/src/VISU_I/VISU_Mesh_i.cc index 01496c58..6b9f8660 100644 --- a/src/VISU_I/VISU_Mesh_i.cc +++ b/src/VISU_I/VISU_Mesh_i.cc @@ -25,6 +25,7 @@ // Module : VISU #include "VISU_Mesh_i.hh" +#include "VISU_Prs3dUtils.hh" #include "VISU_Result_i.hh" @@ -323,6 +324,8 @@ VISU::Mesh_i if(IsSameColor(myCellColor, theColor)) return; + VISU::TSetModified aModified(this); + myCellColor = theColor; myParamsTime.Modified(); } @@ -345,6 +348,8 @@ VISU::Mesh_i if(IsSameColor(myNodeColor, theColor)) return; + VISU::TSetModified aModified(this); + myNodeColor = theColor; myParamsTime.Modified(); } @@ -367,6 +372,8 @@ VISU::Mesh_i if(IsSameColor(myLinkColor, theColor)) return; + VISU::TSetModified aModified(this); + myLinkColor = theColor; myParamsTime.Modified(); } @@ -389,6 +396,8 @@ VISU::Mesh_i if(myPresentType == theType) return; + VISU::TSetModified aModified(this); + myPresentType = theType; myParamsTime.Modified(); } diff --git a/src/VISU_I/VISU_MultiResult_i.cc b/src/VISU_I/VISU_MultiResult_i.cc index 8f211473..7639c4e2 100644 --- a/src/VISU_I/VISU_MultiResult_i.cc +++ b/src/VISU_I/VISU_MultiResult_i.cc @@ -1068,8 +1068,8 @@ VISU::MultiResult_i if(!myIsPartsDone) // If corresponding data is not ready yet return TSuperClass::GetInput(); - if(UseInitialInput(myPartName2FileName, myPartName2Resolution)) - return TSuperClass::GetInput(); + //if(UseInitialInput(myPartName2FileName, myPartName2Resolution)) + // return TSuperClass::GetInput(); MultiResult_i::TRepresentationKey aRepresentationKey = GetRepresentation(myPartName2FileName, myPartName2Resolution); diff --git a/src/VISU_I/VISU_Plot3D_i.cc b/src/VISU_I/VISU_Plot3D_i.cc index cf2b8ebb..a8de05e6 100644 --- a/src/VISU_I/VISU_Plot3D_i.cc +++ b/src/VISU_I/VISU_Plot3D_i.cc @@ -19,6 +19,7 @@ // #include "VISU_Plot3D_i.hh" +#include "VISU_Prs3dUtils.hh" #include "VISU_Result_i.hh" #include "VISU_Plot3DPL.hxx" @@ -188,6 +189,8 @@ VISU::Plot3D_i } }; + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TEvent(GetSpecificPL(), VISU_CutPlanesPL::PlaneOrientation(theOrient), theXAngle, @@ -228,6 +231,8 @@ VISU::Plot3D_i ::SetPlanePosition(CORBA::Double thePlanePosition, CORBA::Boolean theIsRelative) { + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TVoidMemFun2ArgEvent (GetSpecificPL(), &VISU_Plot3DPL::SetPlanePosition, thePlanePosition, theIsRelative)); } @@ -256,6 +261,8 @@ void VISU::Plot3D_i ::SetScaleFactor(CORBA::Double theScaleFactor) { + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TVoidMemFun1ArgEvent (GetSpecificPL(), &VISU_Plot3DPL::SetScaleFactor, theScaleFactor)); } @@ -275,6 +282,8 @@ void VISU::Plot3D_i ::SetNbOfContours(CORBA::Long theNb) { + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TVoidMemFun1ArgEvent (GetSpecificPL(), &VISU_Plot3DPL::SetNumberOfContours, theNb)); } @@ -294,6 +303,8 @@ void VISU::Plot3D_i ::SetContourPrs(CORBA::Boolean theIsContourPrs) { + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TVoidMemFun1ArgEvent (GetSpecificPL(), &VISU_Plot3DPL::SetContourPrs, theIsContourPrs)); } diff --git a/src/VISU_I/VISU_Prs3dUtils.cc b/src/VISU_I/VISU_Prs3dUtils.cc new file mode 100644 index 00000000..feb2bd40 --- /dev/null +++ b/src/VISU_I/VISU_Prs3dUtils.cc @@ -0,0 +1,57 @@ +// VISU OBJECT : interactive object for VISU entities implementation +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File : VISU_Prs3dUtils.cc +// Author : Alexey PETROV +// Module : VISU + +#include "VISU_Prs3dUtils.hh" +#include "VISU_PipeLine.hxx" + + +namespace VISU +{ + //---------------------------------------------------------------------------- + TSetModified + ::TSetModified(VISU::Prs3d_i* thePrs3d): + myPrs3d(thePrs3d) + { + this->Modified(); + } + + + //---------------------------------------------------------------------------- + TSetModified + ::~TSetModified() + { + if(myPrs3d->GetActorEntry() == "") + return; + + if(myPrs3d->GetMTime() > this->GetMTime()){ + SALOMEDS::Study_var aStudy = myPrs3d->GetStudyDocument(); + aStudy->Modified(); + } + } + + + //---------------------------------------------------------------------------- +}; diff --git a/src/VISU_I/VISU_Prs3dUtils.hh b/src/VISU_I/VISU_Prs3dUtils.hh new file mode 100644 index 00000000..2f4bf8b9 --- /dev/null +++ b/src/VISU_I/VISU_Prs3dUtils.hh @@ -0,0 +1,52 @@ +// VISU OBJECT : interactive object for VISU entities implementation +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File : VISU_Prs3dUtils.hh +// Author : Alexey PETROV +// Module : VISU + +#ifndef __VISU_PRS3D_UTILS_H__ +#define __VISU_PRS3D_UTILS_H__ + +#include "VISU_Prs3d_i.hh" + +#include + + +namespace VISU +{ + //---------------------------------------------------------------------------- + struct TSetModified: vtkTimeStamp + { + VISU::Prs3d_i* myPrs3d; + + TSetModified(VISU::Prs3d_i* thePrs3d); + + ~TSetModified(); + }; + + + //---------------------------------------------------------------------------- +} + + +#endif // __VISU_PRS3D_UTILS_H__ diff --git a/src/VISU_I/VISU_Prs3d_i.cc b/src/VISU_I/VISU_Prs3d_i.cc index e80b960a..0c2acd0b 100644 --- a/src/VISU_I/VISU_Prs3d_i.cc +++ b/src/VISU_I/VISU_Prs3d_i.cc @@ -24,8 +24,9 @@ // Author : Alexey PETROV // Module : VISU -#include "VISU_PipeLine.hxx" #include "VISU_Prs3d_i.hh" +#include "VISU_Prs3dUtils.hh" +#include "VISU_PipeLine.hxx" #include "VISU_Result_i.hh" #include "VISU_Actor.h" @@ -65,6 +66,8 @@ VISU::Prs3d_i ::SameAs(const Prs3d_i* theOrigin) { if(Prs3d_i* anOrigin = const_cast(theOrigin)){ + VISU::TSetModified aModified(this); + GetPipeLine()->SameAs(anOrigin->GetPipeLine()); anOrigin->GetOffset(myOffset); } @@ -153,12 +156,16 @@ void VISU::Prs3d_i ::SetCResult(VISU::Result_i* theResult) { - if(GetCResult() != theResult){ - if(theResult) - SetStudyDocument(theResult->GetStudyDocument()); - myResult = theResult; - myParamsTime.Modified(); - } + if(GetCResult() == theResult) + return; + + if(theResult) + SetStudyDocument(theResult->GetStudyDocument()); + + VISU::TSetModified aModified(this); + + myResult = theResult; + myParamsTime.Modified(); } //---------------------------------------------------------------------------- @@ -211,10 +218,13 @@ void VISU::Prs3d_i ::SetMeshName(const char* theMeshName) { - if(myMeshName != theMeshName){ - myMeshName = theMeshName; - myParamsTime.Modified(); - } + if(myMeshName == theMeshName) + return; + + VISU::TSetModified aModified(this); + + myMeshName = theMeshName; + myParamsTime.Modified(); } @@ -243,7 +253,7 @@ VISU::Prs3d_i { unsigned long int aTime = myParamsTime.GetMTime(); if(IsPipeLineExists()) - aTime = std::max(aTime,GetPipeLine()->GetMTime()); + aTime = std::max(aTime, GetPipeLine()->GetMTime()); return aTime; } diff --git a/src/VISU_I/VISU_Prs3d_i.hh b/src/VISU_I/VISU_Prs3d_i.hh index 969772a7..5471eef6 100644 --- a/src/VISU_I/VISU_Prs3d_i.hh +++ b/src/VISU_I/VISU_Prs3d_i.hh @@ -277,6 +277,11 @@ namespace VISU Handle(SALOME_InteractiveObject) GetIO(); + //! Used in derived classes to initilize the IO for actors + virtual + std::string + GetActorEntry(); + protected: /*! Used in Apply method to get know whether it is possible to create presentation @@ -314,11 +319,6 @@ namespace VISU vtkTimeStamp myUpdateTime; vtkTimeStamp myParamsTime; - //! Used in derived classes to initilize the IO for actors - virtual - std::string - GetActorEntry(); - private: void SetResultEntry(const std::string& theResultEntry); diff --git a/src/VISU_I/VISU_Result_i.cc b/src/VISU_I/VISU_Result_i.cc index 12fad523..d7af2d03 100644 --- a/src/VISU_I/VISU_Result_i.cc +++ b/src/VISU_I/VISU_Result_i.cc @@ -178,6 +178,16 @@ VISU::Result_i {} +//--------------------------------------------------------------- +VISU::Result_i +::~Result_i() +{ + MESSAGE("Result_i::~Result_i() - this = "< -//--------------------------------------------------------------- -VISU::Result_i -::~Result_i() -{ - MESSAGE("Result_i::~Result_i() - this = "< (GetSpecificPL(), &VISU_ScalarMapOnDeformedShapePL::SetScale, theScale)); } @@ -331,6 +335,8 @@ VISU::ScalarMapOnDeformedShape_i if(!anIsModified) return; + VISU::TSetModified aModified(this); + VISU::TEntity aEntity = VISU::TEntity(theEntity); VISU::Result_i::PInput anInput = GetCResult()->GetInput(GetCMeshName(), theEntity, diff --git a/src/VISU_I/VISU_ScalarMap_i.cc b/src/VISU_I/VISU_ScalarMap_i.cc index 3d978644..8a719f63 100644 --- a/src/VISU_I/VISU_ScalarMap_i.cc +++ b/src/VISU_I/VISU_ScalarMap_i.cc @@ -25,6 +25,7 @@ // Module : VISU #include "VISU_ScalarMap_i.hh" +#include "VISU_Prs3dUtils.hh" #include "VISU_Result_i.hh" @@ -301,6 +302,8 @@ void VISU::ScalarMap_i ::SetScaling(VISU::Scaling theScaling) { + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TVoidMemFun1ArgEvent (GetSpecificPL(), &VISU_ColoredPL::SetScaling, theScaling)); } diff --git a/src/VISU_I/VISU_StreamLines_i.cc b/src/VISU_I/VISU_StreamLines_i.cc index 2d0ad30e..0d8fe904 100644 --- a/src/VISU_I/VISU_StreamLines_i.cc +++ b/src/VISU_I/VISU_StreamLines_i.cc @@ -25,6 +25,7 @@ // Module : VISU #include "VISU_StreamLines_i.hh" +#include "VISU_Prs3dUtils.hh" #include "VISU_Result_i.hh" #include "VISU_Actor.h" @@ -309,15 +310,18 @@ VISU::StreamLines_i ::SetSource(VISU::Prs3d_i* thePrs3d) { mySourceEntry = ""; - if(thePrs3d){ - SALOMEDS::SObject_var aSObject = thePrs3d->GetSObject(); - CORBA::String_var aString = aSObject->GetID(); - if(mySourceEntry == aString.in()) - return; - - mySourceEntry = aString.in(); - myParamsTime.Modified(); - } + if(!thePrs3d) + return; + + SALOMEDS::SObject_var aSObject = thePrs3d->GetSObject(); + CORBA::String_var aString = aSObject->GetID(); + if(mySourceEntry == aString.in()) + return; + + VISU::TSetModified aModified(this); + + mySourceEntry = aString.in(); + myParamsTime.Modified(); } //--------------------------------------------------------------- @@ -327,8 +331,10 @@ VISU::StreamLines_i { if(!myStreamLinesPL->GetSource() && mySourceEntry == "") return; + if(myStreamLinesPL->GetSource() == myAppendFilter->GetOutput()) return; + VISU::Prs3d_var aPrs3d = GetSource(); SetParams(GetIntegrationStep(), GetPropagationTime(), diff --git a/src/VISU_I/VISU_Vectors_i.cc b/src/VISU_I/VISU_Vectors_i.cc index 65a84d24..9aca7084 100644 --- a/src/VISU_I/VISU_Vectors_i.cc +++ b/src/VISU_I/VISU_Vectors_i.cc @@ -25,6 +25,7 @@ // Module : VISU #include "VISU_Vectors_i.hh" +#include "VISU_Prs3dUtils.hh" #include "VISU_Result_i.hh" #include "VISU_VectorsAct.h" @@ -206,6 +207,8 @@ VISU::Vectors_i if(VISU::CheckIsSameValue(myLineWidth, theWidth)) return; + VISU::TSetModified aModified(this); + myLineWidth = theWidth; myParamsTime.Modified(); } @@ -224,6 +227,8 @@ void VISU::Vectors_i ::SetGlyphType(VISU::Vectors::GlyphType theType) { + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TVoidMemFun1ArgEvent (GetSpecificPL(), &VISU_VectorsPL::SetGlyphType, VISU_VectorsPL::GlyphType(theType))); } @@ -242,6 +247,8 @@ void VISU::Vectors_i ::SetGlyphPos(VISU::Vectors::GlyphPos thePos) { + VISU::TSetModified aModified(this); + ProcessVoidEvent(new TVoidMemFun1ArgEvent (GetSpecificPL(), &VISU_VectorsPL::SetGlyphPos, VISU_VectorsPL::GlyphPos(thePos))); }