]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
PAL12928 (It is impossible to create "SalarMapOnDeformedShape" after "import Structure")
authoreap <eap@opencascade.com>
Thu, 18 Jan 2007 11:42:15 +0000 (11:42 +0000)
committereap <eap@opencascade.com>
Thu, 18 Jan 2007 11:42:15 +0000 (11:42 +0000)
        use map to find timestamp ID by selected comboBox item

src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx
src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h

index b8949e9660f220c490a4fccac49bf4b0ba00ec6e..a2b331294b07150cff9620119c6e16941b7b812b 100644 (file)
@@ -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;
     }
   }
index 3151bd934c0a93859c38bb09e140c8ef9788f9a7..694c2c55d762d63dbbabd18d95436c377fae5173 100644 (file)
@@ -39,6 +39,7 @@
 #include <qpushbutton.h>
 
 #include <set>
+#include <vector>
 
 class SalomeApp_Module;
 class QComboBox;
@@ -98,6 +99,7 @@ private:
  QString myCurrMeshName;
  int myCurrScalarIter;
  bool myIsAnimation;
+ std::vector<int> myTimeStampID;
  
  _PTR(SObject) mySelectionObj;
  VISU::ScalarMapOnDeformedShape_i* myPrs;