if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::Create:"<<__LINE__<<endl;
myIsColored = true;
myColor.R = myColor.G = myColor.B = 0.5;
- VISU::Storable* aRes = TSuperClass::Create(theMeshName,theEntity,theFieldName,theIteration);
- SetScalarFieldName(theFieldName);
- SetScalarIteration(theIteration);
- SetScalarMeshName(theMeshName);
- int anEntity = theEntity;
- SetScalarEntity(VISU::TEntity(anEntity));
- SetScalarField(myScalarMeshName.c_str(),myScalarFieldName.c_str(),myScalarIteration,myScalarEntity);
- return aRes;
+ SetScalarField(theMeshName, theFieldName, theIteration, VISU::TEntity(theEntity));
+ return TSuperClass::Create(theMeshName, theEntity, theFieldName, theIteration);
}
VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Restore(const Storable::TRestoringMap& theMap)
{
if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::Restore:"<<__LINE__<<endl;
+
+ SetScalarField(VISU::Storable::FindValue(theMap,"myScalarMeshName"),
+ VISU::Storable::FindValue(theMap,"myScalarFieldName"),
+ VISU::Storable::FindValue(theMap,"myScalarIteration").toInt(),
+ VISU::TEntity(VISU::Storable::FindValue(theMap,"myScalarEntity").toInt()));
+
TSuperClass::Restore(theMap);
-
- SetScalarFieldName(VISU::Storable::FindValue(theMap,"myScalarFieldName"));
- SetScalarMeshName(VISU::Storable::FindValue(theMap,"myScalarMeshName"));
- SetScalarIteration(VISU::Storable::FindValue(theMap,"myScalarIteration").toInt());
- SetScalarEntity(VISU::TEntity(VISU::Storable::FindValue(theMap,"myScalarEntity").toInt()));
- SetScalarField(GetScalarMeshName().c_str(),
- GetScalarFieldName().c_str(),
- GetScalarIteration(),
- GetScalarEntity());
-
+
SetScale(VISU::Storable::FindValue(theMap,"myFactor").toDouble());
myIsColored = VISU::Storable::FindValue(theMap,"myIsColored").toInt();
myColor.R = VISU::Storable::FindValue(theMap,"myColor.R").toDouble();
}
}
+void VISU::ScalarMapOnDeformedShape_i::SetTitle(const char* theTitle)
+{
+ std::strstream aStream;
+ const VISU::TValField& aValField = myScalarField->myValField;
+ const VISU::PValForTime aValForTime = aValField.find(myScalarIteration)->second;
+ aStream<<theTitle<<" "<<VISU_Convertor::GenerateName(aValForTime->myTime)<<std::ends;
+ std::string aScalarBarTitle = aStream.str();
+ if(myTitle != theTitle || myScalarBarTitle != aScalarBarTitle){
+ myScalarBarTitle = aScalarBarTitle;
+ myTitle = theTitle;
+ }
+}
+
void VISU::ScalarMapOnDeformedShape_i::SetScale(CORBA::Double theScale) {
myScalarMapOnDeformedShapePL->SetScale(theScale);
}
}
void VISU::ScalarMapOnDeformedShape_i::SetScalarFieldName(const char* theName){
- myScalarFieldName = theName;
+ if(myScalarFieldName != theName){
+ myScalarFieldName = theName;
+ SetTitle(theName);
+ }
}
std::string VISU::ScalarMapOnDeformedShape_i::GetScalarFieldName(){
}
void VISU::ScalarMapOnDeformedShape_i::SetScalarIteration(const int theValue){
- myScalarIteration = theValue;
+ if(myScalarIteration != theValue){
+ myScalarIteration = theValue;
+ SetTitle(GetScalarFieldName().c_str());
+ }
}