From: eap Date: Thu, 18 Jan 2007 11:42:15 +0000 (+0000) Subject: PAL12928 (It is impossible to create "SalarMapOnDeformedShape" after "import Structure") X-Git-Tag: V3_2_5~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f97caf7a0f0e3dfbefa0315bfbff4bb8a0ef1988;p=modules%2Fvisu.git PAL12928 (It is impossible to create "SalarMapOnDeformedShape" after "import Structure") use map to find timestamp ID by selected comboBox item --- diff --git a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx index b8949e96..a2b33129 100644 --- a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx +++ b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx @@ -311,7 +311,8 @@ int VisuGUI_ScalarMapOnDeformedShapeDlg::storeToPrsObject else thePrs->SetScalarField(myPrs->GetScalarMeshName().c_str(), getCurrentScalarFieldName().latin1(), - myTimeStampsCombo->currentItem() + 1, + // PAL12928 myTimeStampsCombo->currentItem() + 1, + myTimeStampID[ myTimeStampsCombo->currentItem() ], myPrs->GetScalarEntity()); if (theUpdateScalars) SetScalarField( false ); @@ -350,7 +351,8 @@ VISU::TEntity VisuGUI_ScalarMapOnDeformedShapeDlg::getCurrentScalarEntity(){ } void VisuGUI_ScalarMapOnDeformedShapeDlg::SetScalarField( const bool save_scalar_pane ){ - SetScalarField( myTimeStampsCombo->currentItem()+1, "", save_scalar_pane ); + // PAL12928 SetScalarField( myTimeStampsCombo->currentItem()+1, "", save_scalar_pane ); + SetScalarField( myTimeStampID[ myTimeStampsCombo->currentItem() ], "", save_scalar_pane ); } void VisuGUI_ScalarMapOnDeformedShapeDlg::SetScalarField(int theIter,QString theFieldName, const bool save_scalar_pane ){ @@ -425,9 +427,13 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::AddAllTimes(const QString& theFieldNam QString aFieldName = aIterField->first.first; if(theFieldName != aFieldName) continue; myTimeStampsCombo->clear(); + myTimeStampID.clear(); + myTimeStampID.reserve( (aIterField->second).size() ); TTL::const_iterator aTimeIter = (aIterField->second).begin(); - for(;aTimeIter != (aIterField->second).end(); aTimeIter++) + for(;aTimeIter != (aIterField->second).end(); aTimeIter++) { myTimeStampsCombo->insertItem(QString("%1").arg(aTimeIter->second)); + myTimeStampID.push_back(aTimeIter->first); + } return; } } diff --git a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h index 3151bd93..694c2c55 100644 --- a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h +++ b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h @@ -39,6 +39,7 @@ #include #include +#include class SalomeApp_Module; class QComboBox; @@ -98,6 +99,7 @@ private: QString myCurrMeshName; int myCurrScalarIter; bool myIsAnimation; + std::vector myTimeStampID; _PTR(SObject) mySelectionObj; VISU::ScalarMapOnDeformedShape_i* myPrs;