From: mkr Date: Thu, 23 Nov 2006 15:04:36 +0000 (+0000) Subject: Fix for bug PAL13908 : Animation range is not saved. X-Git-Tag: mergefrom_ScalarMap_ON_GROUP_3_2_0_30Nov06~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7ae9dc31b77be208549bf75ed85b3861dddc9cb5;p=modules%2Fvisu.git Fix for bug PAL13908 : Animation range is not saved. --- diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.cc b/src/VISU_I/VISU_ColoredPrs3d_i.cc index ef82e36b..5d670d5d 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3d_i.cc @@ -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(); diff --git a/src/VISU_I/VISU_ScalarMap_i.cc b/src/VISU_I/VISU_ScalarMap_i.cc index 1b20e9df..45abb66c 100644 --- a/src/VISU_I/VISU_ScalarMap_i.cc +++ b/src/VISU_I/VISU_ScalarMap_i.cc @@ -131,7 +131,7 @@ VISU::ScalarMap_i ScalarMap_i* anOrigin = const_cast(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(); } diff --git a/src/VISU_I/VISU_TimeAnimation.cxx b/src/VISU_I/VISU_TimeAnimation.cxx index 697e32b0..d3f51335 100644 --- a/src/VISU_I/VISU_TimeAnimation.cxx +++ b/src/VISU_I/VISU_TimeAnimation.cxx @@ -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(),