]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for bug PAL13908 : Animation range is not saved.
authormkr <mkr@opencascade.com>
Thu, 23 Nov 2006 15:04:36 +0000 (15:04 +0000)
committermkr <mkr@opencascade.com>
Thu, 23 Nov 2006 15:04:36 +0000 (15:04 +0000)
src/VISU_I/VISU_ColoredPrs3d_i.cc
src/VISU_I/VISU_ScalarMap_i.cc
src/VISU_I/VISU_TimeAnimation.cxx

index ef82e36b9e2f559b8813bf0b542eb76c95e88f32..5d670d5d859bcc2853c49b7e9486b1a60883a6c8 100644 (file)
@@ -152,13 +152,11 @@ VISU::ColoredPrs3d_i
   myFieldName = theFieldName;
   myEntity = (VISU::TEntity)theEntity;
   myIteration = theIteration;
-  myIsFixedRange = theIsFixedRange;
 
-  //int anIteration = GetIteration();
   SameAs(theOrigin);
-  //myIteration = anIteration;
   
   myTitle = theTitle;  
+  myIsFixedRange = theIsFixedRange;
   
   Build(-1);
   Update();
index 1b20e9dfc9506b0af3c6111aa64963c13e9f9991..45abb66c777d8ba2cb652f507e476cffae0d4fe9 100644 (file)
@@ -131,7 +131,7 @@ VISU::ScalarMap_i
     ScalarMap_i* anOrigin = const_cast<ScalarMap_i*>(aPrs3d);
  
     SetRange(anOrigin->GetMin(), anOrigin->GetMax());
-    //myIsFixedRange = anOrigin->IsRangeFixed();
+    myIsFixedRange = anOrigin->IsRangeFixed();
 
     SetScaling(anOrigin->GetScaling());
     
@@ -258,7 +258,7 @@ VISU::ScalarMap_i
   myField = anInput->GetField(myMeshName,myEntity,myFieldName);
   if(!myField) 
     throw std::runtime_error("There is no Field with the parameters !!!");
-
+  
   VISU::PIDMapper anIDMapper =
     anInput->GetTimeStampOnMesh(myMeshName,myEntity,myFieldName,myIteration);
 
@@ -266,7 +266,12 @@ VISU::ScalarMap_i
     throw std::runtime_error("There is no TimeStamp with the parameters !!!");
 
   myScalarMapPL->SetIDMapper(anIDMapper);
-  myScalarMapPL->Init();
+  // mkr : 23.11.2006 - PAL13908 - save animation range if range is fixed -->
+  if ( myIsFixedRange )
+    myScalarMapPL->SetScalarMode(0);
+  else
+    myScalarMapPL->Init();
+  // mkr : 23.11.2006 <--
   myScalarMapPL->Build();
 }
 
index 697e32b0d46108a8d2569e67d17d32ab9daaf508..d3f51335eaf2c744bf05b1e55f58411c444aae95 100644 (file)
@@ -1574,7 +1574,7 @@ void VISU_TimeAnimation::restoreFromStudy(_PTR(SObject) theField)
     if (!aRefObj->ReferencedObject(aFieldObj) ) continue;
     addField(aFieldObj);
     FieldData& aData = getFieldData(getNbFields()-1);
-
+    
     // Get Presentation object
     _PTR(ChildIterator) anPrsIter = myStudy->NewChildIterator(aRefObj);
     anPrsIter->Init();
@@ -1649,7 +1649,6 @@ void VISU_TimeAnimation::ApplyProperties(CORBA::Long theFieldNum, VISU::ColoredP
 
   if ( !aPrs_i ) 
     throw SALOME_Exception(LOCALIZED("Error : invalid dynamic cast of the given presentation to VISU::ColoredPrs3d_i"));
-  printf("aPrs_i->GetMeshName() = %s; aPrs_i->GetFieldName() = %s\n",aPrs_i->GetMeshName().c_str(),aPrs_i->GetFieldName().c_str());
   
   if ( myAnimationMode == 0 ) { // parallel animation mode
     FieldData& aData = myFieldsLst[theFieldNum];
@@ -1680,8 +1679,6 @@ void VISU_TimeAnimation::ApplyProperties(CORBA::Long theFieldNum, VISU::ColoredP
        throw SALOME_Exception(LOCALIZED("Error : presentations for the given field is not yet created!"));
       
       for (int i = 0; i < aData.myNbFrames; i++) {
-       printf("aData.myPrs[%d]->GetMeshName() = %s; aData.myPrs[%d]->GetFieldName() = %s\n",
-              i,aData.myPrs[i]->GetMeshName().c_str(),i,aData.myPrs[i]->GetFieldName().c_str());
        aData.myPrs[i]->SameAsParams(aPrs_i,
                                     aData.myPrs[i]->GetMeshName(),aData.myPrs[i]->GetFieldName(),
                                     aData.myPrs[i]->GetEntity(), aData.myPrs[i]->GetIteration(),