From 3822f70b9620892a5a01e75bb409b773655e18da Mon Sep 17 00:00:00 2001 From: rnv Date: Thu, 18 Nov 2010 11:47:33 +0000 Subject: [PATCH] Fix for the TC6.1.0: operations in Representation and Properties do not activate save --- src/VISU_I/VISU_PointMap3d_i.cc | 1 + src/VISU_I/VISU_Prs3dUtils.cc | 34 +++++++++++++++++++++++---------- src/VISU_I/VISU_Prs3dUtils.hh | 14 +++++++------- src/VISU_I/VISU_Prs3d_i.cc | 2 ++ 4 files changed, 34 insertions(+), 17 deletions(-) diff --git a/src/VISU_I/VISU_PointMap3d_i.cc b/src/VISU_I/VISU_PointMap3d_i.cc index 97391826..f151528b 100644 --- a/src/VISU_I/VISU_PointMap3d_i.cc +++ b/src/VISU_I/VISU_PointMap3d_i.cc @@ -712,6 +712,7 @@ void VISU::PointMap3d_i::RemoveFromStudy() //---------------------------------------------------------------- void VISU::PointMap3d_i::SetOffset(CORBA::Float theDx, CORBA::Float theDy, CORBA::Float theDz) { + VISU::TSetModified aModified(this); myOffset[0] = theDx; myOffset[1] = theDy; myOffset[2] = theDz; diff --git a/src/VISU_I/VISU_Prs3dUtils.cc b/src/VISU_I/VISU_Prs3dUtils.cc index 60781b56..77675648 100644 --- a/src/VISU_I/VISU_Prs3dUtils.cc +++ b/src/VISU_I/VISU_Prs3dUtils.cc @@ -23,6 +23,8 @@ // Module : VISU // #include "VISU_Prs3dUtils.hh" +#include "VISU_Prs3d_i.hh" +#include "VISU_PointMap3d_i.hh" #include "SalomeApp_Study.h" #include "SALOME_Event.h" @@ -31,8 +33,8 @@ namespace VISU { //---------------------------------------------------------------------------- TSetModified - ::TSetModified(VISU::Prs3d_i* thePrs3d): - myPrs3d(thePrs3d) + ::TSetModified(VISU::PrsObject_i* thePrsObject): + myPrsObject(thePrsObject) { this->Modified(); } @@ -53,17 +55,29 @@ namespace VISU void Execute() { - VISU::Prs3d_i* aPrs3d = mySetModified->myPrs3d; - - if(!aPrs3d || aPrs3d->GetActorEntry() == "") - return; + VISU::PrsObject_i* aPrsObject = mySetModified->myPrsObject; + if(!aPrsObject) + return; + + VISU::Prs3d_i* aPrs3d; + VISU::PointMap3d_i* aPntMap; + SalomeApp_Study* aStudy; + unsigned long int time; + if( (aPrs3d = dynamic_cast(aPrsObject)) && aPrs3d->GetActorEntry() != "" ) { + aStudy = aPrs3d->GetGUIStudy(); + time = aPrs3d->GetMTime(); + } else if ( aPntMap = dynamic_cast(aPrsObject) ) { + aStudy = aPntMap->GetGUIStudy(); + time = aPntMap->GetMTime(); + } else + return; - if(aPrs3d->GetMTime() > mySetModified->GetMTime()){ - if(SalomeApp_Study* aStudy = aPrs3d->GetGUIStudy()) + if(time > mySetModified->GetMTime()){ + if(aStudy) aStudy->Modified(); } - } - }; + } + }; ProcessVoidEvent(new TEvent(this)); } diff --git a/src/VISU_I/VISU_Prs3dUtils.hh b/src/VISU_I/VISU_Prs3dUtils.hh index 13d3abb1..51d32575 100644 --- a/src/VISU_I/VISU_Prs3dUtils.hh +++ b/src/VISU_I/VISU_Prs3dUtils.hh @@ -25,7 +25,7 @@ #ifndef __VISU_PRS3D_UTILS_H__ #define __VISU_PRS3D_UTILS_H__ -#include "VISU_Prs3d_i.hh" +#include "VISU_PrsObject_i.hh" #include @@ -34,16 +34,16 @@ namespace VISU //---------------------------------------------------------------------------- struct TSetModified: vtkTimeStamp { - VISU::Prs3d_i* myPrs3d; + VISU::PrsObject_i* myPrsObject; - TSetModified(VISU::Prs3d_i* thePrs3d); + TSetModified(VISU::PrsObject_i* thePrsObject); ~TSetModified(); }; - - Standard_EXPORT std::string ToFormat( const int thePrec ); - Standard_EXPORT int ToPrecision( const char* theFormat ); - + + VISU_I_EXPORT std::string ToFormat( const int thePrec ); + VISU_I_EXPORT int ToPrecision( const char* theFormat ); + //---------------------------------------------------------------------------- } diff --git a/src/VISU_I/VISU_Prs3d_i.cc b/src/VISU_I/VISU_Prs3d_i.cc index 21a797ae..2741f328 100644 --- a/src/VISU_I/VISU_Prs3d_i.cc +++ b/src/VISU_I/VISU_Prs3d_i.cc @@ -675,6 +675,7 @@ void VISU::Prs3d_i ::SetOffset(const CORBA::Float* theOffsets) { + VISU::TSetModified aModified(this); myOffset[0] = theOffsets[0]; myOffset[1] = theOffsets[1]; myOffset[2] = theOffsets[2]; @@ -688,6 +689,7 @@ VISU::Prs3d_i CORBA::Float theDy, CORBA::Float theDz) { + VISU::TSetModified aModified(this); myOffset[0] = theDx; myOffset[1] = theDy; myOffset[2] = theDz; -- 2.39.2