]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Correction for improvement PAL8685 (In Publish To Study of Animation)
authorenk <enk@opencascade.com>
Mon, 6 Feb 2006 09:07:45 +0000 (09:07 +0000)
committerenk <enk@opencascade.com>
Mon, 6 Feb 2006 09:07:45 +0000 (09:07 +0000)
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh
src/VISU_I/VISU_TimeAnimation.cxx

index 22826afa05ab63ecdf37a056a3380d3c3f79f7ae..3246f8f2997de4061a96aaa81cec0540b35bba70 100644 (file)
@@ -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<const ScalarMapOnDeformedShape_i*>(theOrigin)){
+    ScalarMapOnDeformedShape_i* anOrigin = const_cast<ScalarMapOnDeformedShape_i*>(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);
 }
 
 
index 6cfd5afcc1460c0a21cdf3c5d754183a431f0939..b7433720fc83292ecdd45f07bebc6c3a9e7b6270 100644 (file)
@@ -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:
index 22733a9504170d353cb4444335ba004404f6291e..34023596aa871814ea0b000a1f356459c69f4c96 100644 (file)
@@ -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();