#include "VisuGUI_ScalarMapOnDeformedShapeDlg.h"
#include "VisuGUI_Tools.h"
+#include "VISU_Result_i.hh"
#include "VISU_ScalarMapOnDeformedShape_i.hh"
#include "VISU_ScalarMapOnDeformedShapePL.hxx"
#include "SalomeApp_Module.h"
myTimeStampsCombo->setDisabled(isAnim);
QString aFieldName(thePrs->GetScalarFieldName());
- float aIterFloat = GetFloatValueOfTimeStamp(thePrs->GetScalarIteration());
+ float aIterFloat = GetFloatValueOfTimeStamp(thePrs->GetMeshName().c_str(),
+ thePrs->GetScalarFieldName().c_str(),
+ thePrs->GetScalarIteration(),
+ thePrs->GetScalarEntity());
QString aIteration(QString("%1").arg(aIterFloat));
if (myMeshFieldsTimes.size() == 0)
}
TFT &aFieldsMap = myMeshFieldsTimes[aMeshName.latin1()];
TFE aKey(aFieldName.latin1(),anEntity);
- aFieldsMap[aKey][aTimeIter.toInt()] = GetFloatValueOfTimeStamp(aTimeIter.toInt());
+ aFieldsMap[aKey][aTimeIter.toInt()] =
+ GetFloatValueOfTimeStamp(myPrs->GetMeshName().c_str(),
+ aFieldName.latin1(),
+ aTimeIter.toInt(),
+ anEntity);
}
}
}
myScalarPane->setRange(aDoubleRange[0],aDoubleRange[1],myScalarPane->isIRange());
}
-float VisuGUI_ScalarMapOnDeformedShapeDlg::GetFloatValueOfTimeStamp(int theIter){
+float VisuGUI_ScalarMapOnDeformedShapeDlg::GetFloatValueOfTimeStamp(const char* theMeshName,
+ const char* theFieldName,
+ const int theIter,
+ const VISU::TEntity theEntity){
float ret=1;
- VISU::PField aField = myPrs->GetField();
+ VISU::Result_i* theResult = myPrs->GetResult();
+ VISU::PField aField = theResult->GetInput()->GetField(theMeshName,theEntity,theFieldName);
+ if(!aField) return ret;
VISU::TValField& aValField = aField->myValField;
- VISU::PValForTime aValForTime = aValField.find(theIter)->second;
- if(aValForTime)
+ VISU::TValField::const_iterator aIter = aValField.find(theIter);
+ if(aIter != aValField.end()){
+ VISU::PValForTime aValForTime = aIter->second;
ret = float(aValForTime->myTime.first);
+ } else {
+ if(MYDEBUG){
+ cout << "Where are no aValForTime with iteration:"<<theIter<<endl;
+ cout << "\tThe possible interations is aValField.keys():";
+ VISU::TValField::const_iterator aTmp = aValField.begin();
+ for(;aTmp != aValField.end(); aTmp++)
+ cout << aTmp->first << ",";
+ cout << endl;
+ }
+ }
return ret;
}