setFactor(myPrsCopy->GetScale());
myTimeStampsCombo->setDisabled(myIsAnimation);
- myCurrMeshName = myPrsCopy->GetCMeshName();
- CORBA::String_var aMeshName = myPrsCopy->GetMeshName();
- CORBA::String_var aFieldName(myPrsCopy->GetScalarCFieldName());
- float aIterFloat = GetFloatValueOfTimeStamp(aMeshName.in(),
+ CORBA::String_var aFieldName(myPrsCopy->GetScalarFieldName());
+ QString aIteration = GetFloatValueOfTimeStamp(myPrsCopy->GetScalarEntity(),
aFieldName.in(),
- myPrsCopy->GetScalarLIteration(),
- myPrsCopy->GetScalarEEntity());
- QString aIteration(QString("%1").arg(aIterFloat));
-
- if (myMeshFieldsTimes.size() == 0)
+ myPrsCopy->GetScalarTimeStampNumber());
+ if (myEntity2Fields.size() == 0)
{
// find all fields and time stamps on it
_PTR(Study) aActiveStudy = VISU::GetCStudy(VISU::GetAppStudy(myVisuGUI));
CORBA::String_var aName = myPrsCopy->GetMeshName();
if (aMeshName != aName.in())
continue;
- myCurrMeshName = aMeshName;
QString aFieldName = VISU::getValue(aChildSObj, "myFieldName");
QString aTimeIter = VISU::getValue(aChildSObj, "myTimeStampId");
QString aEntity = VISU::getValue(aChildSObj, "myEntityId");
case 2: anEntity = VISU::FACE; break;
case 3: anEntity = VISU::CELL; break;
}
- TFT &aFieldsMap = myMeshFieldsTimes[aMeshName.latin1()];
- TFE aKey (aFieldName.latin1(), anEntity);
- aFieldsMap[aKey][aTimeIter.toInt()] =
- GetFloatValueOfTimeStamp(aMeshName.latin1(),
- aFieldName.latin1(),
- aTimeIter.toInt(),
- anEntity);
+ TFieldName2TimeStamps& aFieldName2TimeStamps = myEntity2Fields[anEntity];
+ TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldName2TimeStamps[aFieldName];
+ aTimeStampNumber2Time[aTimeIter.toInt()] =
+ GetFloatValueOfTimeStamp(anEntity,
+ aFieldName.latin1(),
+ aTimeIter.toInt());
}
}
}
myPrsCopy->SetScale(getFactor());
- CORBA::String_var aMeshName = myPrsCopy->GetMeshName();
- myPrsCopy->SetScalarField(aMeshName.in(),
+ myPrsCopy->SetScalarField(myPrsCopy->GetScalarEntity(),
getCurrentScalarFieldName().latin1(),
- myTimeStampID[ myTimeStampsCombo->currentItem() ],
- myPrsCopy->GetScalarEEntity());
+ myTimeStampID[ myTimeStampsCombo->currentItem() ]);
if(myUpdateScalars)
SetScalarField( false );
VisuGUI_ScalarMapOnDeformedShapeDlg
::getCurrentScalarEntity()
{
- VISU::Entity anEntity;
- TFT::const_iterator aIterField = myMeshFieldsTimes[myCurrMeshName].begin();
- for(;aIterField != myMeshFieldsTimes[myCurrMeshName].end();aIterField++){
- if (aIterField->first.first == myFieldsCombo->currentText()){
- anEntity = aIterField->first.second;
- break;
+ VISU::Entity anEntity = VISU::Entity(-1);
+ TEntity2Fields::const_iterator anIter = myEntity2Fields.begin();
+ for(; anIter != myEntity2Fields.end(); anIter++){
+ const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second;
+ TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin();
+ for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
+ const QString& aFieldName = aFieldIter->first;
+ if (aFieldName == myFieldsCombo->currentText()) {
+ anEntity = anIter->first;
+ break;
+ }
}
}
return anEntity;
VISU::Entity anEntity = getCurrentScalarEntity();
- myPrsCopy->SetScalarField(myCurrMeshName.latin1(),
+ myPrsCopy->SetScalarField(anEntity,
aFieldName.latin1(),
- theIter,
- anEntity);
+ theIter);
if( save_scalar_pane )
UpdateScalarField();
}
void VisuGUI_ScalarMapOnDeformedShapeDlg::AddAllFieldNames(){
- TMF::const_iterator aIterMesh = myMeshFieldsTimes.begin();
- for(;aIterMesh != myMeshFieldsTimes.end();aIterMesh++){
- QString aMeshName = aIterMesh->first;
- TFT::const_iterator aIterField = (aIterMesh->second).begin();
- for(;aIterField != (aIterMesh->second).end(); aIterField++){
- QString aFieldName = aIterField->first.first;
+ TEntity2Fields::const_iterator anIter = myEntity2Fields.begin();
+ for(; anIter != myEntity2Fields.end(); anIter++){
+ const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second;
+ TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin();
+ for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
+ const QString& aFieldName = aFieldIter->first;
myFieldsCombo->insertItem(aFieldName);
}
}
}
void VisuGUI_ScalarMapOnDeformedShapeDlg::AddAllTimes(const QString& theFieldName){
- TMF::const_iterator aIterMesh = myMeshFieldsTimes.begin();
- for(;aIterMesh != myMeshFieldsTimes.end();aIterMesh++){
- QString aMeshName = aIterMesh->first;
- TFT::const_iterator aIterField = (aIterMesh->second).begin();
- for(;aIterField != (aIterMesh->second).end(); aIterField++){
- QString aFieldName = aIterField->first.first;
- if(theFieldName != aFieldName) continue;
- myTimeStampsCombo->clear();
+ TEntity2Fields::const_iterator anIter = myEntity2Fields.begin();
+ for(; anIter != myEntity2Fields.end(); anIter++){
+ const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second;
+ TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin();
+ for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
+ const QString& aFieldName = aFieldIter->first;
+ if(theFieldName != aFieldName)
+ continue;
+
myTimeStampID.clear();
- myTimeStampID.reserve( (aIterField->second).size() );
- TTL::const_iterator aTimeIter = (aIterField->second).begin();
- for(;aTimeIter != (aIterField->second).end(); aTimeIter++) {
- myTimeStampsCombo->insertItem(QString("%1").arg(aTimeIter->second));
- myTimeStampID.push_back(aTimeIter->first);
+ myTimeStampsCombo->clear();
+
+ const TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldIter->second;
+ TTimeStampNumber2Time::const_iterator aTimeStampIter = aTimeStampNumber2Time.begin();
+ for(; aTimeStampIter != aTimeStampNumber2Time.end(); aTimeStampIter++){
+ int aTimeStampNumber = aTimeStampIter->first;
+ myTimeStampID.push_back(aTimeStampNumber);
+
+ QString aTimeStampTime = aTimeStampIter->second;
+ myTimeStampsCombo->insertItem(aTimeStampTime);
}
return;
}
myScalarPane->initFromPrsObject(myPrsCopy);
}
-float
+QString
VisuGUI_ScalarMapOnDeformedShapeDlg
-::GetFloatValueOfTimeStamp(const char* theMeshName,
- const char* theFieldName,
- const int theIter,
- const VISU::Entity theEntity)
+::GetFloatValueOfTimeStamp(VISU::Entity theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber)
{
- float ret=1;
+ QString aTime("");
VISU::TEntity anEntity = VISU::TEntity(theEntity);
VISU::Result_i* theResult = myPrsCopy->GetCResult();
VISU::Result_i::TInput* anInput = theResult->GetInput();
- VISU::PField aField = anInput->GetField(theMeshName,
+ VISU::PField aField = anInput->GetField(myPrsCopy->GetCMeshName(),
anEntity,
theFieldName);
if(!aField)
- return ret;
+ return aTime;
+
VISU::TValField& aValField = aField->myValField;
- VISU::TValField::const_iterator aIter = aValField.find(theIter);
+ VISU::TValField::const_iterator aIter = aValField.find(theTimeStampNumber);
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;
- }
+ aTime = VISU_Convertor::GenerateName(aValForTime->myTime).c_str();
}
- return ret;
+ return aTime;
}
void VisuGUI_ScalarMapOnDeformedShapeDlg::keyPressEvent( QKeyEvent* e )
VISU::ColoredPrs3d_i
::GetTimeStampNumberByIndex( CORBA::Long theIndex )
{
- VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = GetTimeStampsRange();
+ VISU::ColoredPrs3dHolder::TimeStampsRange_var aTimeStampsRange = GetTimeStampsRange();
CORBA::Long aLength = aTimeStampsRange->length();
if( theIndex >= 0 && theIndex < aLength )
{
- VISU::ColoredPrs3d::TimeStampInfo anInfo = aTimeStampsRange[ theIndex ];
+ VISU::ColoredPrs3dHolder::TimeStampInfo anInfo = aTimeStampsRange[ theIndex ];
return anInfo.myNumber;
}
VISU::ColoredPrs3d_i
::GetTimeStampIndexByNumber( CORBA::Long theNumber )
{
- VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = GetTimeStampsRange();
+ VISU::ColoredPrs3dHolder::TimeStampsRange_var aTimeStampsRange = GetTimeStampsRange();
CORBA::Long aLength = aTimeStampsRange->length();
for( int index = 0; index < aLength; index++ )
{
- VISU::ColoredPrs3d::TimeStampInfo anInfo = aTimeStampsRange[ index ];
+ VISU::ColoredPrs3dHolder::TimeStampInfo anInfo = aTimeStampsRange[ index ];
if( anInfo.myNumber == theNumber )
return index;
//----------------------------------------------------------------------------
-VISU::ColoredPrs3d::TimeStampsRange*
+VISU::ColoredPrs3dHolder::TimeStampsRange*
VISU::ColoredPrs3d_i
::GetTimeStampsRange()
{
- VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = new VISU::ColoredPrs3d::TimeStampsRange();
+ VISU::ColoredPrs3dHolder::TimeStampsRange_var aTimeStampsRange =
+ new VISU::ColoredPrs3dHolder::TimeStampsRange();
VISU::TValField& aValField = GetField()->myValField;
if(IsTimeStampFixed()){
aTimeStampsRange->length(1);
PValForTime& aValForTime = aValField[GetTimeStampNumber()];
std::string aTime = VISU_Convertor::GenerateName(aValForTime->myTime);
- VISU::ColoredPrs3d::TimeStampInfo anInfo;
+ VISU::ColoredPrs3dHolder::TimeStampInfo anInfo;
anInfo.myNumber = GetTimeStampNumber();
anInfo.myTime = aTime.c_str();
aTimeStampsRange[0] = anInfo;
for(size_t aCounter = 0; anIter != aSortedRange.end(); anIter++, aCounter++){
vtkIdType aTimeStampNumber = anIter->first;
const std::string& aTime = anIter->second;
- VISU::ColoredPrs3d::TimeStampInfo anInfo;
+ VISU::ColoredPrs3dHolder::TimeStampInfo anInfo;
anInfo.myNumber = aTimeStampNumber;
anInfo.myTime = aTime.c_str();
aTimeStampsRange[aCounter] = anInfo;
SetEntity((VISU::Entity)VISU::Storable::FindValue(theMap,"myEntity").toInt());
SetFieldName(VISU::Storable::FindValue(theMap,"myFieldName").latin1());
SetTimeStampNumber(VISU::Storable::FindValue(theMap,"myIteration").toInt());
- myIsTimeStampFixed = VISU::Storable::FindValue(theMap,"myIsTimeStampFixed").toInt();
+ myIsTimeStampFixed = VISU::Storable::FindValue(theMap,"myIsTimeStampFixed", "1").toInt();
OnSetInput(false);
Build(ERestore);
throw;
}
#endif
+
if(anIsPublishInStudy)
aStudyBuilder->CommitCommand();
return this;