From: enk Date: Mon, 6 Feb 2006 09:07:45 +0000 (+0000) Subject: Correction for improvement PAL8685 (In Publish To Study of Animation) X-Git-Tag: mergeto_trunk_07Feb06~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f6ed2905da6be62370648717a18c5e730918a0aa;p=modules%2Fvisu.git Correction for improvement PAL8685 (In Publish To Study of Animation) --- diff --git a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc index 22826afa..3246f8f2 100644 --- a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc +++ b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc @@ -154,6 +154,24 @@ VISU::ScalarMapOnDeformedShape_i::~ScalarMapOnDeformedShape_i(){ if(MYDEBUG) MESSAGE("ScalarMapOnDeformedShape_i::~ScalarMapOnDeformedShape_i()"); } +void +VISU::ScalarMapOnDeformedShape_i +::SameAs(const Prs3d_i* theOrigin) +{ + TSuperClass::SameAs(theOrigin); + + if(const ScalarMapOnDeformedShape_i* aPrs3d = dynamic_cast(theOrigin)){ + ScalarMapOnDeformedShape_i* anOrigin = const_cast(aPrs3d); + + // increment the scalar iteration for using in VISU_TimeAnimation class implementation. + this->SetScalarField(anOrigin->GetScalarMeshName().c_str(), + anOrigin->GetScalarFieldName().c_str(), + anOrigin->GetScalarIteration() + 1, + anOrigin->GetScalarEntity()); + Update(); + } +} + void VISU::ScalarMapOnDeformedShape_i::SetScale(CORBA::Double theScale) { myScalarMapOnDeformedShapePL->SetScale(theScale); } @@ -228,12 +246,11 @@ void VISU::ScalarMapOnDeformedShape_i::SetScalarField(const char* theMeshName, theFieldName, theIteration)->GetVTKOutput(); myScalarMapOnDeformedShapePL->SetScalars(aOut); - - SetScalarMeshName(theMeshName); - SetScalarFieldName(theFieldName); - SetScalarIteration(theIteration); - SetScalarEntity(theEntity); } + this->SetScalarMeshName(theMeshName); + this->SetScalarFieldName(theFieldName); + this->SetScalarIteration(theIteration); + this->SetScalarEntity(theEntity); } diff --git a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh index 6cfd5afc..b7433720 100644 --- a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh +++ b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh @@ -74,6 +74,10 @@ namespace VISU{ virtual CORBA::Double GetSourceRangeMin(); virtual CORBA::Double GetSourceRangeMax(); + virtual + void + SameAs(const Prs3d_i* theOrigin); + VISU_ScalarMapOnDeformedShapePL* GetScalarMapOnDeformedShapePL(){ return myScalarMapOnDeformedShapePL;} protected: diff --git a/src/VISU_I/VISU_TimeAnimation.cxx b/src/VISU_I/VISU_TimeAnimation.cxx index 22733a95..34023596 100644 --- a/src/VISU_I/VISU_TimeAnimation.cxx +++ b/src/VISU_I/VISU_TimeAnimation.cxx @@ -857,7 +857,8 @@ void VISU_TimeAnimation::restoreFromStudy(_PTR(SObject) theField) aData.myPrs[0]->GetOffset(aData.myOffset); for (int i = 1; i < aData.myNbFrames; i++) { //jfa 03.08.2005:aData.myPrs[i]->SameAs(aData.myPrs[0]); - aData.myPrs[i]->SameAsParams(aData.myPrs[0]);//jfa 03.08.2005 + //enk 06.02.2006:aData.myPrs[i]->SameAsParams(aData.myPrs[0]);//jfa 03.08.2005 + aData.myPrs[i]->SameAsParams(aData.myPrs[i-1]);//enk 06.02.2006: initializing from previous presentation } } string aStr = aAnimSObject->GetID();