]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
IPAL9429: Import Field popup-menu item added for MED fields
authorjfa <jfa@opencascade.com>
Wed, 20 Jul 2005 06:38:02 +0000 (06:38 +0000)
committerjfa <jfa@opencascade.com>
Wed, 20 Jul 2005 06:38:02 +0000 (06:38 +0000)
src/VISUGUI/VISU_msg_en.po
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI_ActionsDef.h

index 19fe079eee6e220436ef2878194d5fb9956effc9..a5519dac31ad2234adb40ad8fc4235b44682b0d5 100644 (file)
@@ -242,9 +242,15 @@ msgstr "Global Selection"
 msgid "VisuGUI::MEN_PARTIAL_SELECTION"
 msgstr "Partial Selection"
 
-msgid "VisuGUI::MEN_IMPORT_MED"
+msgid "VisuGUI::MEN_IMPORT_MED_STRUCTURE"
 msgstr "Import Structure"
 
+msgid "VisuGUI::MEN_IMPORT_MED_TIMESTAMP"
+msgstr "Import TimeStamp"
+
+msgid "VisuGUI::MEN_IMPORT_MED_FIELD"
+msgstr "Import Field"
+
 msgid "VisuGUI::MEN_DELETE_OBJS"
 msgstr "Delete"
 
index 0d31866cc5e5156056dd4aa3af6cc6c77e4373f0..506f77e0127710af97a368ca46936788449b6260 100644 (file)
@@ -2114,8 +2114,16 @@ createActions()
   createAction( VISU_EXPORT_TABLE, tr("MEN_EXPORT_TABLE"), QIconSet(), tr("MEN_EXPORT_TABLE"), "", 0, aParent, false,
                this, SLOT(OnExportTableToFile()));
 
-  createAction( VISU_IMPORT_MED, tr("MEN_IMPORT_MED"), QIconSet(),
-                tr("MEN_IMPORT_MED"), "", 0, aParent, false,
+  createAction( VISU_IMPORT_MED_STRUCTURE, tr("MEN_IMPORT_MED_STRUCTURE"), QIconSet(),
+                tr("MEN_IMPORT_MED_STRUCTURE"), "", 0, aParent, false,
+               this, SLOT(OnImportMedField()));
+
+  createAction( VISU_IMPORT_MED_TIMESTAMP, tr("MEN_IMPORT_MED_TIMESTAMP"), QIconSet(),
+                tr("MEN_IMPORT_MED_TIMESTAMP"), "", 0, aParent, false,
+               this, SLOT(OnImportMedField()));
+
+  createAction( VISU_IMPORT_MED_FIELD, tr("MEN_IMPORT_MED_FIELD"), QIconSet(),
+                tr("MEN_IMPORT_MED_FIELD"), "", 0, aParent, false,
                this, SLOT(OnImportMedField()));
 
   //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
@@ -2374,7 +2382,7 @@ createPopupMenus()
   mgr->insert( action( VISU_IMPORT_TABLE ), -1, -1, -1 ); // import tables from file
   mgr->insert( action( VISU_PLOT2D ), -1, -1, -1 ); // create Plot2d View
 
-  mgr->insert( action( VISU_IMPORT_MED ), -1, -1, -1 ); // import MED structure from MED module
+  //mgr->insert( action( VISU_IMPORT_MED ), -1, -1, -1 ); // import MED structure from MED module
 
   // create
   mgr->insert( action( VISU_SCALAR_MAP ), -1, -1, -1 ); // scalar bar
@@ -2591,8 +2599,8 @@ createPopupMenus()
   mgr->setRule( action( VISU_CREATE_PRS ), aRule + " and selcount=1", true );
   mgr->setRule( action( VISU_CREATE_MANY_PRS ), aRule + " and selcount>1", true );
 
-  aRule = "client='ObjectBrowser' and type='MEDFIELD'";
-  mgr->setRule( action( VISU_IMPORT_MED ), aRule, true );
+  //aRule = "client='ObjectBrowser' and type='MEDFIELD'";
+  //mgr->setRule( action( VISU_IMPORT_MED ), aRule, true );
 }
 
 //***************************************************************************
@@ -2618,6 +2626,7 @@ void VisuGUI::contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, Q
   _PTR(SObject) SO = GetCStudy(GetAppStudy(this))->FindObjectID(anIO->getEntry());
   bool isExist;
   VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
+
   if (aType == VISU::TANIMATION) {
     action( VISU_SHOW_ANIMATION )->addTo(theMenu);
 
@@ -2631,17 +2640,23 @@ void VisuGUI::contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, Q
     if (!CORBA::is_nil(anObject)) {
       SALOME_MED::MED_var aMED = SALOME_MED::MED::_narrow(anObject);
       if (!CORBA::is_nil(aMED.in())) {
-        action( VISU_IMPORT_MED )->addTo(theMenu);
-      } else {
-       _PTR(SObject) aSFather = SO->GetFather();
-        if (aSFather) {
-         _PTR(GenericAttribute) anAttr;
-          aSFather->FindAttribute(anAttr, "AttributeName");
-          if (anAttr) {
-            _PTR(AttributeName) aName (anAttr);
-            std::string aValue = aName->Value();
-            if (strcmp(aValue.c_str(), "MEDFIELD") == 0)
-              action( VISU_IMPORT_MED )->addTo(theMenu);
+        action( VISU_IMPORT_MED_STRUCTURE )->addTo(theMenu);
+      }
+
+      SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(anObject); // "Import Structure"
+      if (!CORBA::is_nil(aField)) {
+        action( VISU_IMPORT_MED_TIMESTAMP )->addTo(theMenu); // "Import TimeStamp"
+      }
+    } else {
+      _PTR(SObject) aSFather = SO->GetFather();
+      if (aSFather) {
+       _PTR(GenericAttribute) anAttr;
+        aSFather->FindAttribute(anAttr, "AttributeName");
+        if (anAttr) {
+          _PTR(AttributeName) aName (anAttr);
+          std::string aValue = aName->Value();
+          if (strcmp(aValue.c_str(), "MEDFIELD") == 0) {
+            action( VISU_IMPORT_MED_FIELD )->addTo(theMenu); // "Import Field"
           }
         }
       }
index 416578ac8e99310bc0b86bb414484bb9ba1da938..94e1ed64a7d8248bba2a95229861e04e5f775e4e 100644 (file)
@@ -7,8 +7,10 @@
 //#define VISU_IMPORT_TABLE           199
 #define VISU_IMPORT_FROM_FILE       4002
 #define VISU_EXPLORE_MED            4003
-#define VISU_IMPORT_MED             4004
-#define VISU_IMPORT_TABLE           4005
+#define VISU_IMPORT_TABLE           4004
+#define VISU_IMPORT_MED_STRUCTURE   4005
+#define VISU_IMPORT_MED_TIMESTAMP   4006
+#define VISU_IMPORT_MED_FIELD       4007
 
 #define VISU_SCALAR_MAP             4011
 #define VISU_DEFORMED_SHAPE         4012