]> SALOME platform Git repositories - modules/med.git/commitdiff
Salome HOME
Merge 'abn/V8_1_fix' branch into V8_1_BR.
authorabn <adrien.bruneton@cea.fr>
Tue, 30 Aug 2016 12:52:36 +0000 (14:52 +0200)
committerrnv <rnv@opencascade.com>
Thu, 8 Sep 2016 10:32:14 +0000 (13:32 +0300)
46 files changed:
idl/MEDDataManager.idl
idl/MEDPresentationManager.idl
idl/MED_Gen.idl
resources/SalomeApp.xml.in
src/MEDCalc/cmp/MED.cxx
src/MEDCalc/cmp/MED.hxx
src/MEDCalc/cmp/MEDDataManager_i.cxx
src/MEDCalc/cmp/MEDDataManager_i.hxx
src/MEDCalc/cmp/MEDPresentation.cxx
src/MEDCalc/cmp/MEDPresentation.hxx
src/MEDCalc/cmp/MEDPresentationContour.cxx
src/MEDCalc/cmp/MEDPresentationContour.hxx
src/MEDCalc/cmp/MEDPresentationDeflectionShape.cxx
src/MEDCalc/cmp/MEDPresentationDeflectionShape.hxx
src/MEDCalc/cmp/MEDPresentationManager_i.cxx
src/MEDCalc/cmp/MEDPresentationManager_i.hxx
src/MEDCalc/cmp/MEDPresentationManager_i.txx
src/MEDCalc/cmp/MEDPresentationMeshView.cxx
src/MEDCalc/cmp/MEDPresentationMeshView.hxx
src/MEDCalc/cmp/MEDPresentationPointSprite.cxx
src/MEDCalc/cmp/MEDPresentationPointSprite.hxx
src/MEDCalc/cmp/MEDPresentationScalarMap.cxx
src/MEDCalc/cmp/MEDPresentationSlices.cxx
src/MEDCalc/cmp/MEDPresentationVectorField.cxx
src/MEDCalc/cmp/MEDPresentationVectorField.hxx
src/MEDCalc/gui/DatasourceController.cxx
src/MEDCalc/gui/MEDModule.cxx
src/MEDCalc/gui/MEDModule.hxx
src/MEDCalc/gui/MEDWidgetHelper.cxx
src/MEDCalc/gui/MED_msg_en.ts
src/MEDCalc/gui/MED_msg_fr.ts
src/MEDCalc/gui/PresentationController.cxx
src/MEDCalc/gui/PresentationController.hxx
src/MEDCalc/gui/PresentationEvent.hxx
src/MEDCalc/gui/ProcessingController.cxx
src/MEDCalc/gui/WorkspaceController.cxx
src/MEDCalc/gui/dialogs/DlgChangeUnderlyingMesh.cxx
src/MEDCalc/gui/dialogs/DlgInterpolateField.cxx
src/MEDCalc/gui/dialogs/WidgetPresentationParameters.cxx
src/MEDCalc/gui/dialogs/WidgetPresentationParameters.hxx
src/MEDCalc/gui/dialogs/WidgetPresentationParameters.ui
src/MEDCalc/test/tui/mesh_view.py
src/MEDCalc/tui/__init__.py
src/MEDCalc/tui/medcorba.py
src/MEDCalc/tui/medio.py
src/MEDCalc/tui/medpresentation.py

index c18cc2d384d7fa813ddbc0703b57810efc78254b..b1e80d3db21d8985844b2ec07b385caa06e46a53 100644 (file)
@@ -124,8 +124,8 @@ module MEDCALC
     // Mesh data management
     //==========================================================
 
-    MeshHandler     getMesh(in long meshId) raises (SALOME::SALOME_Exception);
-    MeshHandlerList getMeshList(in long datasourceId);
+    MeshHandler     getMeshHandler(in long meshId) raises (SALOME::SALOME_Exception);
+    MeshHandlerList getMeshHandlerList(in long datasourceId);
 
     //==========================================================
     // Field data management
@@ -168,6 +168,8 @@ module MEDCALC
 
     // Print out server data
     void serverlog();
+
+    void cleanUp() raises (SALOME::SALOME_Exception);
   };
 };
 
index b86b63e450947f3935dfe4f6fd259ece3681c04e..006d89dddfee679e612afdf809d5ec838bda7c2e 100644 (file)
@@ -84,14 +84,18 @@ module MEDCALC
 //  const long SCALAR_BAR_RANGE_VAL_MAX_DEFAULT = -1;
   const string DISPLAY_DEFAULT = DISPLAY_EUCLIDEAN_NORM;
   const SliceOrientationType SLICE_ORIENTATION_DEFAULT = SLICE_NORMAL_TO_X;
+
   const long NB_CONTOURS_DEFAULT = 10;
   const long NB_SLICES_DEFAULT = 1;
 
+  const long NB_CONTOURS_MAX = 50;
+  const long NB_SLICES_MAX = 20;
+
   /* Structs */
 
   // Just showing the mesh 
   struct MeshViewParameters {
-    long fieldHandlerId;   // TODO should be a meshHandlerId really ...
+    long meshHandlerId;
     MeshModeType mode;
   };
 
@@ -185,6 +189,8 @@ module MEDCALC
 //    ViewModeType getPresentationViewMode(in long presId);
     
     PresentationsList getAllPresentations();
+
+    void cleanUp()   raises (SALOME::SALOME_Exception);
   };
 };
 
index beefb0e19ebb03141e1a444879c08b10fe9d4863..7b13765e5910815b1a341de52cc0c1f8b5131d55 100644 (file)
@@ -43,7 +43,7 @@ module MED_ORB
                                 in MEDCALC::DatasourceHandler datasourceHandler)
       raises (SALOME::SALOME_Exception);
 
-    status registerPresentation(in SALOMEDS::Study study,
+    status registerPresentationField(in SALOMEDS::Study study,
                                 in long fieldId,
                                 in string name,
                                 in string type,
@@ -51,17 +51,31 @@ module MED_ORB
                                 in long presentationId)
       raises (SALOME::SALOME_Exception);
 
+    status registerPresentationMesh(in SALOMEDS::Study study,
+                                    in long meshId,
+                                    in string name,
+                                    in string type,
+                                    in string ico,
+                                    in long presentationId)
+          raises (SALOME::SALOME_Exception);
+
     status unregisterPresentation(in SALOMEDS::Study study,
                                   in long presentationId)
       raises (SALOME::SALOME_Exception);
 
-    PresentationsList getSiblingPresentations(in SALOMEDS::Study study,
-                                              in long presentationId)
-      raises (SALOME::SALOME_Exception);
+//    PresentationsList getSiblingPresentations(in SALOMEDS::Study study,
+//                                              in long presentationId)
+//      raises (SALOME::SALOME_Exception);
 
     // Get all presentations in study:
     PresentationsList getStudyPresentations(in SALOMEDS::Study study)
       raises (SALOME::SALOME_Exception);
+
+    string getStudyPresentationEntry(in SALOMEDS::Study study,
+                                                in long presentationId)
+      raises (SALOME::SALOME_Exception);
+
+    void cleanUp();
   };
 };
 
index eeeb7e6e65de1b7fcecaec5f2455190bc08abde0..a690d07193bae590c8f8811fb3fd2d0e0cc63fe5 100644 (file)
@@ -42,7 +42,7 @@
     <parameter name="MED"  value="%MED_ROOT_DIR%/share/salome/resources/med"/>
   </section>
  <section name="windows_geometry">
-  <parameter name="MED" value="#00 #00 #00 #FF #00 #00 #00 #00 #FD #00 #00 #00 #02 #00 #00 #00 #00 #00 #00 #01 #00 #00 #00 #02 #C6 #FC #02 #00 #00 #00 #02 #FB #00 #00 #00 #22 #00 #6F #00 #62 #00 #6A #00 #65 #00 #63 #00 #74 #00 #42 #00 #72 #00 #6F #00 #77 #00 #73 #00 #65 #00 #72 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #59 #00 #00 #01 #CD #00 #00 #00 #53 #00 #FF #FF #FF #FB #00 #00 #00 #20 #00 #6D #00 #65 #00 #64 #00 #57 #00 #6F #00 #72 #00 #6B #00 #73 #00 #70 #00 #61 #00 #63 #00 #65 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #02 #2E #00 #00 #00 #F1 #00 #00 #00 #DE #00 #FF #FF #FF #00 #00 #00 #03 #00 #00 #04 #38 #00 #00 #00 #53 #FC #01 #00 #00 #00 #01 #FB #00 #00 #00 #22 #00 #70 #00 #79 #00 #74 #00 #68 #00 #6F #00 #6E #00 #43 #00 #6F #00 #6E #00 #73 #00 #6F #00 #6C #00 #65 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #01 #08 #00 #00 #04 #38 #00 #00 #00 #46 #00 #FF #FF #FF #00 #00 #04 #38 #00 #00 #02 #6B #00 #00 #00 #04 #00 #00 #00 #04 #00 #00 #00 #01 #00 #00 #00 #02 #FC #00 #00 #00 #02 #00 #00 #00 #02 #00 #00 #00 #02 #00 #00 #00 #1C #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #1A #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #CE #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #01 #00 #00 #00 #06 #00 #4D #00 #45 #00 #44 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00"/>
+  <parameter name="MED" value="@ByteArray[#00 #00 #00 #FF #00 #00 #00 #00 #FD #00 #00 #00 #02 #00 #00 #00 #00 #00 #00 #01 #2C #00 #00 #02 #DD #FC #02 #00 #00 #00 #03 #FB #00 #00 #00 #22 #00 #6F #00 #62 #00 #6A #00 #65 #00 #63 #00 #74 #00 #42 #00 #72 #00 #6F #00 #77 #00 #73 #00 #65 #00 #72 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #5B #00 #00 #00 #FE #00 #00 #00 #53 #00 #FF #FF #FF #FB #00 #00 #00 #20 #00 #6D #00 #65 #00 #64 #00 #57 #00 #6F #00 #72 #00 #6B #00 #73 #00 #70 #00 #61 #00 #63 #00 #65 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #01 #61 #00 #00 #00 #F1 #00 #00 #00 #DE #00 #FF #FF #FF #FB #00 #00 #00 #2E #00 #50 #00 #72 #00 #65 #00 #73 #00 #65 #00 #6E #00 #74 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #20 #00 #70 #00 #61 #00 #72 #00 #61 #00 #6D #00 #65 #00 #74 #00 #65 #00 #72 #00 #73 #01 #00 #00 #02 #5A #00 #00 #00 #DE #00 #00 #00 #DE #00 #FF #FF #FF #00 #00 #00 #03 #00 #00 #04 #CC #00 #00 #00 #53 #FC #01 #00 #00 #00 #01 #FB #00 #00 #00 #22 #00 #70 #00 #79 #00 #74 #00 #68 #00 #6F #00 #6E #00 #43 #00 #6F #00 #6E #00 #73 #00 #6F #00 #6C #00 #65 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #01 #34 #00 #00 #04 #CC #00 #00 #00 #46 #00 #FF #FF #FF #00 #00 #04 #CC #00 #00 #02 #82 #00 #00 #00 #04 #00 #00 #00 #04 #00 #00 #00 #01 #00 #00 #00 #02 #FC #00 #00 #00 #02 #00 #00 #00 #02 #00 #00 #00 #02 #00 #00 #00 #1C #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #1A #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #CE #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #0F #00 #00 #00 #26 #00 #4D #00 #61 #00 #69 #00 #6E #00 #43 #00 #6F #00 #6E #00 #74 #00 #72 #00 #6F #00 #6C #00 #73 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #1E #00 #76 #00 #61 #00 #72 #00 #69 #00 #61 #00 #62 #00 #6C #00 #65 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #2A #00 #72 #00 #65 #00 #70 #00 #72 #00 #65 #00 #73 #00 #65 #00 #6E #00 #74 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #1A #00 #63 #00 #61 #00 #6D #00 #65 #00 #72 #00 #61 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #16 #00 #61 #00 #78 #00 #65 #00 #73 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #1A #00 #4D #00 #61 #00 #63 #00 #72 #00 #6F #00 #73 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #0C #00 #43 #00 #6F #00 #6D #00 #6D #00 #6F #00 #6E #00 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #18 #00 #44 #00 #61 #00 #74 #00 #61 #00 #41 #00 #6E #00 #61 #00 #6C #00 #79 #00 #73 #00 #69 #00 #73 #00 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #22 #00 #44 #00 #61 #00 #74 #00 #61 #00 #73 #00 #6F #00 #75 #00 #72 #00 #63 #00 #65 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #20 #00 #57 #00 #6F #00 #72 #00 #6B #00 #73 #00 #70 #00 #61 #00 #63 #00 #65 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #4C #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #1E #00 #56 #00 #69 #00 #65 #00 #77 #00 #4D #00 #6F #00 #64 #00 #65 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #98 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #26 #00 #50 #00 #72 #00 #65 #00 #73 #00 #65 #00 #6E #00 #74 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #F4 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #22 #00 #50 #00 #72 #00 #6F #00 #63 #00 #65 #00 #73 #00 #73 #00 #69 #00 #6E #00 #67 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #01 #DB #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #14 #00 #56 #00 #43 #00 #52 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #02 #27 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #24 #00 #63 #00 #75 #00 #72 #00 #72 #00 #65 #00 #6E #00 #74 #00 #54 #00 #69 #00 #6D #00 #65 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #02 #EF #00 #00 #03 #11 #00 #00 #00 #00 #00 #00 #00 #00]"/>
  </section>
  <section name="windows_visibility">
   <parameter name="MED" value="#00 #00 #00 #00 #05 #00 #00 #00 #06 #00 #4D #00 #45 #00 #44 #01 #00 #00 #00 #0E #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #1A #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #1C #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #10 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #01 #00 #00 #00 #03 #00 #00 #00 #20 #00 #6D #00 #65 #00 #64 #00 #57 #00 #6F #00 #72 #00 #6B #00 #73 #00 #70 #00 #61 #00 #63 #00 #65 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #22 #00 #6F #00 #62 #00 #6A #00 #65 #00 #63 #00 #74 #00 #42 #00 #72 #00 #6F #00 #77 #00 #73 #00 #65 #00 #72 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #22 #00 #70 #00 #79 #00 #74 #00 #68 #00 #6F #00 #6E #00 #43 #00 #6F #00 #6E #00 #73 #00 #6F #00 #6C #00 #65 #00 #44 #00 #6F #00 #63 #00 #6B #01"/>
index 4b0ce7df08c5c8226bca8b6ae680a8c1b5a23dc2..5ce6dac6f840f1c426a8d4e84e72908c01387807 100644 (file)
@@ -50,7 +50,8 @@ MED::MED(CORBA::ORB_ptr orb,
          const char* instanceName,
          const char* interfaceName)
   : Engines_Component_i(orb, poa, contId, instanceName, interfaceName),
-    _fieldSeriesEntries()
+    _fieldSeriesEntries(),
+    _meshEntries()
 {
   _thisObj = this;
   _id = _poa->activate_object(_thisObj); // register and activate this servant object
@@ -109,11 +110,12 @@ MED::addDatasourceToStudy(SALOMEDS::Study_ptr study,
 
       // We can add the meshes as children of the datasource
       MEDCALC::MeshHandlerList* meshHandlerList =
-        MEDFactoryClient::getDataManager()->getMeshList(datasourceHandler.id);
+        MEDFactoryClient::getDataManager()->getMeshHandlerList(datasourceHandler.id);
 
       for(CORBA::ULong iMesh=0; iMesh<meshHandlerList->length(); iMesh++) {
         MEDCALC::MeshHandler meshHandler = (*meshHandlerList)[iMesh];
         SALOMEDS::SObject_var soMesh = studyBuilder->NewObject(soDatasource);
+        _meshEntries[meshHandler.id] = soMesh->GetID();
         soMesh->SetAttrString("AttributeName", meshHandler.name);
         soMesh->SetAttrString("AttributePixMap", "ICO_DATASOURCE_MESH");
         anAttr = studyBuilder->FindOrCreateAttribute(soMesh, "AttributeParameter");
@@ -157,7 +159,7 @@ MED::addDatasourceToStudy(SALOMEDS::Study_ptr study,
 }
 
 MED_ORB::status
-MED::registerPresentation(SALOMEDS::Study_ptr study,
+MED::registerPresentationField(SALOMEDS::Study_ptr study,
                           CORBA::Long fieldId,
                           const char* name,
                           const char* type,
@@ -170,12 +172,12 @@ MED::registerPresentation(SALOMEDS::Study_ptr study,
   MEDCALC::FieldHandler_var fldHandler = MEDFactoryClient::getDataManager()->getFieldHandler(fieldId);
   int fieldSeriesId = fldHandler->fieldseriesId;
   if (fieldSeriesId < 0){
-      std::cerr << "MED::registerPresentation(): Error getting field handler\n";
+      std::cerr << "MED::registerPresentationField(): Error getting field handler\n";
       return MED_ORB::OP_ERROR ;
     }
 
   if (_fieldSeriesEntries.find(fieldSeriesId) == _fieldSeriesEntries.end()) {
-    std::cerr << "MED::registerPresentation(): Field series not found\n";
+    std::cerr << "MED::registerPresentationField(): Field series not found\n";
     return MED_ORB::OP_ERROR ;
   }
   std::string entry = _fieldSeriesEntries[fieldSeriesId];
@@ -183,7 +185,7 @@ MED::registerPresentation(SALOMEDS::Study_ptr study,
   SALOMEDS::SObject_ptr soFieldseries = sobject._retn();
 
   if (soFieldseries->IsNull()) {
-    std::cerr << "MED::registerPresentation(): Entry not found\n";
+    std::cerr << "MED::registerPresentationField(): Entry not found\n";
     return MED_ORB::OP_ERROR;
   }
 
@@ -207,6 +209,57 @@ MED::registerPresentation(SALOMEDS::Study_ptr study,
   return MED_ORB::OP_OK;
 }
 
+MED_ORB::status
+MED::registerPresentationMesh(SALOMEDS::Study_ptr study,
+                          CORBA::Long meshId,
+                          const char* name,
+                          const char* type,
+                          const char* ico,
+                          CORBA::Long presentationId)
+{
+  // set exception handler to catch unexpected CORBA exceptions
+  Unexpect aCatch(SALOME_SalomeException);
+
+  MEDCALC::MeshHandler_var meshHandler = MEDFactoryClient::getDataManager()->getMeshHandler(meshId);
+  if (meshHandler->id < 0){
+      std::cerr << "MED::registerPresentationMesh(): Error getting mesh handler\n";
+      return MED_ORB::OP_ERROR ;
+    }
+
+  if (_meshEntries.find(meshHandler->id) == _meshEntries.end()) {
+    std::cerr << "MED::registerPresentationMesh(): mesh not found\n";
+    return MED_ORB::OP_ERROR ;
+  }
+  std::string entry = _meshEntries[meshHandler->id];
+  SALOMEDS::SObject_var sobject = study->FindObjectID(entry.c_str());
+  SALOMEDS::SObject_ptr soMesh = sobject._retn();
+
+  if (soMesh->IsNull()) {
+    std::cerr << "MED::registerPresentationMesh(): Entry not found\n";
+    return MED_ORB::OP_ERROR;
+  }
+
+  SALOMEDS::StudyBuilder_var studyBuilder = study->NewBuilder();
+  SALOMEDS::UseCaseBuilder_var useCaseBuilder = study->GetUseCaseBuilder();
+  SALOMEDS::SObject_var soPresentation = studyBuilder->NewObject(soMesh);
+  useCaseBuilder->AppendTo(soPresentation->GetFather(), soPresentation);
+
+  soPresentation->SetAttrString("AttributeName", name);
+  soPresentation->SetAttrString("AttributePixMap", ico);
+
+  SALOMEDS::GenericAttribute_var anAttr;
+  SALOMEDS::AttributeParameter_var aParam;
+  anAttr = studyBuilder->FindOrCreateAttribute(soPresentation, "AttributeParameter");
+  aParam = SALOMEDS::AttributeParameter::_narrow(anAttr);
+  aParam->SetInt(MESH_ID, meshId);
+  aParam->SetBool(IS_PRESENTATION, true);
+  aParam->SetInt(PRESENTATION_ID, presentationId);
+  aParam->SetString(PRESENTATION_TYPE, type);
+
+  return MED_ORB::OP_OK;
+}
+
+
 MED_ORB::status
 MED::unregisterPresentation(SALOMEDS::Study_ptr study,
                             CORBA::Long presentationId)
@@ -271,9 +324,8 @@ MED::getStudyPresentations(SALOMEDS::Study_ptr study)
   return presList;
 }
 
-
-MED_ORB::PresentationsList*
-MED::getSiblingPresentations(SALOMEDS::Study_ptr study, CORBA::Long presentationId)
+char*
+MED::getStudyPresentationEntry(SALOMEDS::Study_ptr study, int presentationId)
 {
   // set exception handler to catch unexpected CORBA exceptions
   Unexpect aCatch(SALOME_SalomeException);
@@ -286,48 +338,29 @@ MED::getSiblingPresentations(SALOMEDS::Study_ptr study, CORBA::Long presentation
   SALOMEDS::GenericAttribute_var anAttribute;
   SALOMEDS::SComponent_var father = study->FindComponent("MED");
   SALOMEDS::ChildIterator_var it = study->NewChildIterator(father);
-  for (it->InitEx(true); it->More(); it->Next()) {
-    SALOMEDS::SObject_var child(it->Value());
-
-    if (child->FindAttribute(anAttribute, "AttributeParameter")) {
-      SALOMEDS::AttributeParameter_var attrParam = SALOMEDS::AttributeParameter::_narrow(anAttribute);
-      if (!attrParam->IsSet(IS_PRESENTATION, PT_BOOLEAN) || !attrParam->GetBool(IS_PRESENTATION) || !attrParam->IsSet(PRESENTATION_ID, PT_INTEGER))
-        continue;
+  for (it->InitEx(true); it->More(); it->Next())
+    {
+      SALOMEDS::SObject_var child(it->Value());
+      if (child->FindAttribute(anAttribute, "AttributeParameter"))
+        {
+          SALOMEDS::AttributeParameter_var attrParam = SALOMEDS::AttributeParameter::_narrow(anAttribute);
+          if (!attrParam->IsSet(IS_PRESENTATION, PT_BOOLEAN) || !attrParam->GetBool(IS_PRESENTATION) || !attrParam->IsSet(PRESENTATION_ID, PT_INTEGER))
+            continue;
 
-      if (presentationId == attrParam->GetInt(PRESENTATION_ID)) {
-        // get siblings
-        SALOMEDS::ChildIterator_var siblItr = study->NewChildIterator(child->GetFather());
-        for (siblItr->InitEx(true); siblItr->More(); siblItr->Next()) {
-          SALOMEDS::SObject_var sibl(siblItr->Value());
-
-          if (sibl->FindAttribute(anAttribute, "AttributeParameter")) {
-            SALOMEDS::AttributeParameter_var attrParam = SALOMEDS::AttributeParameter::_narrow(anAttribute);
-            if (!attrParam->IsSet(IS_PRESENTATION, PT_BOOLEAN) || !attrParam->GetBool(IS_PRESENTATION) || !attrParam->IsSet(PRESENTATION_ID, PT_INTEGER))
-              continue;
-
-            if (attrParam->GetInt(PRESENTATION_ID) != presentationId) {
-              CORBA::ULong size = presList->length();
-              presList->length(size+1);
-              (*presList)[size] = attrParam->GetInt(PRESENTATION_ID);
-            }
-          }
+          if (attrParam->GetInt(PRESENTATION_ID) == presentationId)
+            return CORBA::string_dup(child->GetID());
         }
-        return presList;
-      }
     }
-  }
-
-  return presList;
+  return CORBA::string_dup("");
 }
 
+
 Engines::TMPFile*
 MED::DumpPython(CORBA::Object_ptr theStudy,
                 CORBA::Boolean isPublished,
                 CORBA::Boolean isMultiFile,
                 CORBA::Boolean& isValidScript)
 {
-  std::cout << "In MED::DumpPython\n";
-
   SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow(theStudy);
   if(CORBA::is_nil(aStudy)) {
     std::cerr << "Error: Cannot find the study\n";
@@ -433,6 +466,12 @@ MED::getObjectInfo(CORBA::Long studyId, const char* entry)
   return CORBA::string_dup(oss.str().c_str());
 }
 
+void MED::cleanUp()
+{
+  _fieldSeriesEntries.clear();
+  _meshEntries.clear();
+}
+
 extern "C"
 {
   /*!
index 57a3cc381385511efa38b67ee2eacca74f70b418..fb78501ca39d2606d69dac884bb55b8f3a42f4a4 100644 (file)
@@ -55,23 +55,34 @@ public:
   MED_ORB::status addDatasourceToStudy(SALOMEDS::Study_ptr study,
                                        const MEDCALC::DatasourceHandler& datasourceHandler);
 
-  MED_ORB::status registerPresentation(SALOMEDS::Study_ptr study,
+  MED_ORB::status registerPresentationField(SALOMEDS::Study_ptr study,
                                        CORBA::Long fieldId,
                                        const char* name,
                                        const char* type,
                                        const char* ico,
                                        CORBA::Long presentationId);
 
+  MED_ORB::status registerPresentationMesh(SALOMEDS::Study_ptr study,
+                                         CORBA::Long meshId,
+                                         const char* name,
+                                         const char* type,
+                                         const char* ico,
+                                         CORBA::Long presentationId);
+
   MED_ORB::status unregisterPresentation(SALOMEDS::Study_ptr study,
                                          CORBA::Long presentationId);
 
-  // Caller owns the returned list, and is responsible for the list deletion.
-  MED_ORB::PresentationsList* getSiblingPresentations(SALOMEDS::Study_ptr study,
-                                                      CORBA::Long presentationId);
+//  // Caller owns the returned list, and is responsible for the list deletion.
+//  MED_ORB::PresentationsList* getSiblingPresentations(SALOMEDS::Study_ptr study,
+//                                                      CORBA::Long presentationId);
 
   // Get all presentations registered in the study
   MED_ORB::PresentationsList* getStudyPresentations(SALOMEDS::Study_ptr study);
 
+  char* getStudyPresentationEntry(SALOMEDS::Study_ptr study, int presentationId);
+
+  void cleanUp();
+
   /*! Dump the study as a Python file */
   virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
                                        CORBA::Boolean isPublished,
@@ -84,6 +95,7 @@ public:
 
  private:
   std::map<long, std::string> _fieldSeriesEntries;
+  std::map<long, std::string> _meshEntries;
 };
 
 extern "C"
index f4b6243231a0034d5afdcfc00f0947712f47605c..6a703eabb8e7aa9f80e54ad51e44ef388862b1aa 100644 (file)
@@ -52,11 +52,30 @@ MEDDataManager_i::MEDDataManager_i()
   _meshLastId = 0;
   _fieldseriesLastId = 0;
 }
+
 MEDDataManager_i::~MEDDataManager_i()
 {
   LOG("Deleting MEDDataManager_i instance");
 }
 
+void MEDDataManager_i::cleanUp()
+{
+  _fieldLastId = 0;
+  _sourceLastId = 0;
+  _meshLastId = 0;
+  _fieldseriesLastId = 0;
+
+  // [ABN] Is it the proper way?
+  _datasourceHandlerMap.clear();
+  _meshHandlerMap.clear();
+  _fieldseriesHandlerMap.clear();
+  _fieldHandlerMap.clear();
+  _fieldDoubleMap.clear();
+  _meshMap.clear();
+  _fieldPersistencyMap.clear();
+}
+
+
 std::string MEDDataManager_i::file_to_source(const char * filepath)
 {
   string source("file://");
@@ -236,7 +255,7 @@ MEDDataManager_i::getDatasourceHandlerFromID(CORBA::Long sourceid)
   return NULL;
 }
 
-MEDCALC::MeshHandler * MEDDataManager_i::getMesh(CORBA::Long meshId) {
+MEDCALC::MeshHandler * MEDDataManager_i::getMeshHandler(CORBA::Long meshId) {
   if ( _meshHandlerMap.count(meshId) == 0 ) {
     std::string message =
       std::string("The mesh of id=") + ToString(meshId) +
@@ -253,7 +272,7 @@ MEDCALC::MeshHandler * MEDDataManager_i::getMesh(CORBA::Long meshId) {
  * specified datasource. It corresponds to the list ofmeshes defined
  * in the datasource.
  */
-MEDCALC::MeshHandlerList * MEDDataManager_i::getMeshList(CORBA::Long datasourceId) {
+MEDCALC::MeshHandlerList * MEDDataManager_i::getMeshHandlerList(CORBA::Long datasourceId) {
 
   // We initiate a list with the maximum lentgh
   MEDCALC::MeshHandlerList_var meshHandlerList = new MEDCALC::MeshHandlerList();
index fdab5af40a3e1d2553b16ef5dc7df31de2389269..f6a5611b03b50a1f9cb3a270a0da74779c49c4e9 100644 (file)
@@ -75,8 +75,8 @@ public:
 
   // -----------------------------------------------------------
   // Mesh management
-  MEDCALC_EXPORT MEDCALC::MeshHandlerList * getMeshList(CORBA::Long datasourceId);
-  MEDCALC_EXPORT MEDCALC::MeshHandler * getMesh(CORBA::Long meshId);
+  MEDCALC_EXPORT MEDCALC::MeshHandlerList * getMeshHandlerList(CORBA::Long datasourceId);
+  MEDCALC_EXPORT MEDCALC::MeshHandler * getMeshHandler(CORBA::Long meshId);
 
   // -----------------------------------------------------------
   // Field management
@@ -107,6 +107,8 @@ public:
 
   MEDCALC_EXPORT void serverlog();
 
+  MEDCALC_EXPORT void cleanUp();
+
   //
   // ===========================================================
   // Other public functions (non available via CORBA)
index a0beac5428599fdebb551654272d874e15e159e5..84b74bc672eea5cb9fd6fd16fb92bf5e11cec4ba 100644 (file)
@@ -36,37 +36,20 @@ const std::string MEDPresentation::PROP_COMPONENT = "component_";
 const std::string MEDPresentation::PROP_COLOR_MAP = "colorMap";
 const std::string MEDPresentation::PROP_SCALAR_BAR_RANGE = "scalarBarRange";
 
-MEDPresentation::MEDPresentation(MEDPresentation::TypeID fieldHandlerId, const std::string& name,
+MEDPresentation::MEDPresentation(MEDPresentation::TypeID handlerId, const std::string& name,
                                  const MEDCALC::ViewModeType viewMode,
                                  const MEDCALC::ColorMapType colorMap,
                                  const MEDCALC::ScalarBarRangeType sbRange)
-    : _fieldHandlerId(fieldHandlerId), _propertiesStr(),
-      //_pipeline(0), _display(0)
+    : _handlerId(handlerId), _propertiesStr(),
+      _mcFieldType(MEDCoupling::ON_CELLS),
+      _pvFieldType(""), _meshName(""), _fieldName(""), _fileName(""),
       _selectedComponentIndex(-1),
       _viewMode(viewMode),
       _colorMap(colorMap),
       _sbRange(sbRange),
-      _renderViewPyId(-1),  // will be set by getRenderViewCommand()
+      _renderViewPyId(-1),  // will be set by MEDPresentationManager_i::_makePresentation()
       _globalDict(0)
 {
-  MEDCALC::MEDDataManager_ptr dataManager(MEDFactoryClient::getDataManager());
-  MEDCALC::FieldHandler* fieldHandler = dataManager->getFieldHandler(fieldHandlerId);
-  MEDCALC::MeshHandler* meshHandler = dataManager->getMesh(fieldHandler->meshid);
-  MEDCALC::DatasourceHandler* dataSHandler = dataManager->getDatasourceHandlerFromID(meshHandler->sourceid);
-
-  _fileName = dataSHandler->uri;
-  _fieldName = fieldHandler->fieldname;
-  _mcFieldType = (MEDCoupling::TypeOfField) fieldHandler->type;
-  _pvFieldType = getPVFieldTypeString(_mcFieldType);
-  _meshName = meshHandler->name;
-
-  if (_fileName.substr(0, 7) != std::string("file://")) {
-    const char* msg = "MEDPresentation(): Data source is not a file! Can not proceed.";
-    STDLOG(msg);
-    throw MEDPresentationException(msg);
-  }
-  _fileName = _fileName.substr(7, _fileName.size());
-
   setStringProperty(MEDPresentation::PROP_NAME, name);
 
   setIntProperty(MEDPresentation::PROP_NB_COMPONENTS, 0);
@@ -90,17 +73,51 @@ MEDPresentation::MEDPresentation(MEDPresentation::TypeID fieldHandlerId, const s
   _rangeVar = oss_r.str();
 }
 
+/**
+ * For most of the presentations the field name etc is required.
+ * For the MEDPresentationMeshView however, the handler ID is a mesh handler ID, not a field, and the
+ * treatment is specific.
+ */
+void
+MEDPresentation::initFieldMeshInfos()
+{
+  MEDCALC::MEDDataManager_ptr dataManager(MEDFactoryClient::getDataManager());
+  MEDCALC::FieldHandler* fieldHandler = dataManager->getFieldHandler(_handlerId);
+  MEDCALC::MeshHandler* meshHandler = dataManager->getMeshHandler(fieldHandler->meshid);
+  MEDCALC::DatasourceHandler* dataSHandler = dataManager->getDatasourceHandlerFromID(meshHandler->sourceid);
+
+  extractFileName(std::string(dataSHandler->uri));
+
+  _fieldName = fieldHandler->fieldname;
+  _mcFieldType = (MEDCoupling::TypeOfField) fieldHandler->type;
+  _pvFieldType = getPVFieldTypeString(_mcFieldType);
+  _colorByType = _pvFieldType;  // by default the same; overriden in DeflectionShape, VectorField, PointSprite and Contour
+  _meshName = meshHandler->name;
+}
+
+void
+MEDPresentation::extractFileName(const std::string& name)
+{
+  _fileName = name;
+  if (_fileName.substr(0, 7) != std::string("file://")) {
+    const char* msg = "MEDPresentation(): Data source is not a file! Can not proceed.";
+    STDLOG(msg);
+    throw MEDPresentationException(msg);
+  }
+  _fileName = _fileName.substr(7, _fileName.size());
+}
+
 MEDPresentation::~MEDPresentation()
 {
   STDLOG("~MEDPresentation(): clear display");
   {
     MEDPyLockWrapper lock;
-    std::ostringstream oss_v, oss;
-    oss_v << "__view" << _renderViewPyId;
-    oss << "pvs.Hide(" << _objVar <<  ", view=" << oss_v.str() << ");";
-    oss << "pvs.Render();";
+    std::ostringstream oss;
 
-    PyRun_SimpleString(oss.str().c_str());
+    oss << "pvs.Hide(" << _objVar <<  ", view=" << getRenderViewVar() << ");";
+    execPyLine(oss.str());
+    execPyLine(getRenderViewVar() + ".ResetCamera();");
+    execPyLine("pvs.Render();");
   }
 }
 
@@ -280,9 +297,14 @@ MEDPresentation::createSource()
   oss << "medcalc.SelectSourceField(" << _srcObjVar << ", '" << _meshName << "', '"
       << _fieldName << "', '" << typ << "');";
   pushAndExecPyLine(oss.str()); oss.str("");
+  // Generate complete vector fields: fields with 2 components will copied into <name>_vector and
+  // have a third null component added.
   oss << _srcObjVar << ".GenerateVectors = 1;";
   pushAndExecPyLine(oss.str()); oss.str("");
 
+  // Make sure this is set so we stick to time steps:
+  pushAndExecPyLine("pvs.GetAnimationScene().PlayMode = 'Snap To TimeSteps'");
+
   // Deal with GAUSS fields:
   if(_mcFieldType == MEDCoupling::ON_GAUSS_PT)
     {
@@ -316,7 +338,7 @@ MEDPresentation::setOrCreateRenderView()
   pushAndExecPyLine(oss2.str()); oss2.str("");
   if (_viewMode == MEDCALC::VIEW_MODE_OVERLAP) {
       // this might potentially re-assign to an existing view variable, but this is OK, we
-      // normally reassign exaclty the same RenderView object.
+      // normally reassign exactly the same RenderView object.
       oss2 << view << " = pvs.GetActiveViewOrCreate('RenderView');";
       pushAndExecPyLine(oss2.str()); oss2.str("");
   } else if (_viewMode == MEDCALC::VIEW_MODE_REPLACE) {
@@ -432,10 +454,10 @@ MEDPresentation::showScalarBar()
 }
 
 void
-MEDPresentation::colorBy(const std::string & fieldType)
+MEDPresentation::colorBy()
 {
   std::ostringstream oss;
-  oss << "pvs.ColorBy(" << _dispVar << ", ('" << fieldType << "', '" << _fieldName << "'));";
+  oss << "pvs.ColorBy(" << _dispVar << ", ('" << _colorByType << "', '" << _fieldName << "'));";
   pushAndExecPyLine(oss.str());
 }
 
@@ -473,13 +495,46 @@ MEDPresentation::GeneratePythonId()
   return INIT_ID++;
 }
 
-void
+bool
 MEDPresentation::activateView()
 {
   MEDPyLockWrapper lock;
-  pushAndExecPyLine("pvs.SetActiveView(" + getRenderViewVar() + ");");
+
+  execPyLine("__alive = " + getRenderViewVar() + " in pvs.GetRenderViews()");
+  PyObject * obj = getPythonObjectFromMain("__alive");
+  bool alive = true;
+  if (obj && PyBool_Check(obj))
+    alive = (obj == Py_True);
+
+  if (alive)
+    // The view is still there,just activate it:
+    pushAndExecPyLine("pvs.SetActiveView(" + getRenderViewVar() + ");");
+  else
+    {
+      // The view disappeared, recreate it in a new layout. The transfer of the objects is to be done by the caller.
+      std::ostringstream oss;
+      oss <<  "pvs.servermanager.misc.ViewLayout(registrationGroup='layouts');";
+      pushAndExecPyLine(oss.str()); oss.str("");
+      oss << getRenderViewVar() << " = pvs.CreateView('RenderView');";
+      pushAndExecPyLine(oss.str()); oss.str("");
+    }
+  return alive;
 }
 
+/**!
+ * Called when the view has been recreated (because the user closed it).
+ * All the objects and set up are re-shown in the new view (which is stored in the same Python variable).
+ */
+void
+MEDPresentation::recreateViewSetup()
+{
+  showObject();
+  colorBy();
+  showScalarBar();
+  selectColorMap();
+  rescaleTransferFunction();
+  resetCameraAndRender();
+}
 
 std::string
 MEDPresentation::paravisDump() const
index dc05e9fca24fdacfa45f4de5dfc1ce16c4aa9153..800b7cd91c86e4a74a2bc52819548418e34f6027 100644 (file)
@@ -40,6 +40,8 @@ class MEDCALC_EXPORT MEDPresentation
 public:
   typedef ::CORBA::Long TypeID;
 
+  virtual void initFieldMeshInfos();
+
   virtual ~MEDPresentation();
 
   static const std::string PROP_NAME;                 // name of the presentation
@@ -55,7 +57,10 @@ public:
   virtual void setIntProperty(const std::string& propName, const int propValue);
   int getIntProperty(const std::string& propName) const;
 
-  void activateView();  // non const because generates a Python trace
+  // returns True if the view was still alive, False if it must have been recreated
+  // because the user closed it.
+  bool activateView();
+  virtual void recreateViewSetup();
 
   void dumpIntProperties() const;
   void dumpStringProperties() const;
@@ -69,7 +74,7 @@ protected:
   typedef std::pair<int, PyObject *> PyObjectId;
   static int GeneratePythonId();
 
-  MEDPresentation(MEDPresentation::TypeID fieldHandlerId, const std::string& name,
+  MEDPresentation(MEDPresentation::TypeID handlerId, const std::string& name,
                   const MEDCALC::ViewModeType viewMode,
                   const MEDCALC::ColorMapType colorMap,
                   const MEDCALC::ScalarBarRangeType sbRange);
@@ -80,7 +85,7 @@ protected:
   void createSource();
   void selectFieldComponent();
   void showObject();
-  void colorBy(const std::string & fieldType);
+  void colorBy();
   void showScalarBar();
   void rescaleTransferFunction();
   void selectColorMap();
@@ -92,14 +97,13 @@ protected:
   void execPyLine(const std::string & lin);
   void pushAndExecPyLine(const std::string & lin);
 
-  MEDPresentation::TypeID getID() const { return _fieldHandlerId; }
+  MEDPresentation::TypeID getID() const { return _handlerId; }
 
   void fillAvailableFieldComponents();
   void applyCellToPointIfNeeded();
+  void extractFileName(const std::string& name);
 //  void convertTo3DVectorField();
 
-//  virtual MEDCALC::ViewModeType getViewMode() = 0;
-
   template<typename PresentationType, typename PresentationParameters>
   void updateComponent(const std::string& newCompo);
 
@@ -133,8 +137,10 @@ protected:
   MEDCoupling::TypeOfField _mcFieldType;
   ///! ParaView field type: "CELLS" or "POINTS"
   std::string _pvFieldType;
+  ///! ParaView field type: "CELLS" or "POINTS" used in the ColorBy method. Not necessarily equal to _pvFieldType.
+  std::string _colorByType;
 
-  MEDPresentation::TypeID _fieldHandlerId;
+  MEDPresentation::TypeID _handlerId;  // either a field or a mesh id (a field ID though, most of the time)
 
   int _selectedComponentIndex;
   MEDCALC::ViewModeType _viewMode;
index ee4628505aef623b148b0ff522c007eebc8cff3b..5a25cef588e767135542626893aba67c3184e48d 100644 (file)
@@ -36,6 +36,13 @@ MEDPresentationContour::MEDPresentationContour(const MEDCALC::ContourParameters&
   setIntProperty(MEDPresentationContour::PROP_NB_CONTOUR, params.nbContours);
 }
 
+void
+MEDPresentationContour::initFieldMeshInfos()
+{
+  MEDPresentation::initFieldMeshInfos();
+  _colorByType = "POINTS";
+}
+
 void
 MEDPresentationContour::setNumberContours()
 {
@@ -73,7 +80,7 @@ MEDPresentationContour::internalGeneratePipeline()
       throw KERNEL::createSalomeException(mes);
     }
 
-  setOrCreateRenderView(); // instanciate __viewXXX
+  setOrCreateRenderView(); // instanciate __viewXXX, needs to be after the exception above otherwise previous elements in the view will be hidden.
 
   // Contour needs point data:
   applyCellToPointIfNeeded();
@@ -90,7 +97,7 @@ MEDPresentationContour::internalGeneratePipeline()
   // Set number of contours
   setNumberContours();
 
-  colorBy("POINTS");    // necessarily POINTS because of the conversion above
+  colorBy();    // see initFieldInfo() - necessarily POINTS because of the conversion above
   showScalarBar();
   selectColorMap();
   rescaleTransferFunction();
index d7fbc19defb74583d06ce790ed3ececcd72237de..404dba155cf324f2f296804aef2a778a9d142570 100644 (file)
@@ -32,6 +32,8 @@ public:
   MEDPresentationContour(const MEDCALC::ContourParameters& params, const MEDCALC::ViewModeType viewMode);
   virtual ~MEDPresentationContour() {}
 
+  virtual void initFieldMeshInfos();
+
   void updatePipeline(const MEDCALC::ContourParameters& params);
 
   void getParameters(MEDCALC::ContourParameters & params) const { params = _params; } ;
index fdb5d5c3ac34bb467228e02b0d810ff1dbf7dfd6..e727bc327128741ca8cea0527a9edcf781da5d08 100644 (file)
@@ -36,6 +36,13 @@ MEDPresentationDeflectionShape::MEDPresentationDeflectionShape(const MEDCALC::De
 {
 }
 
+void
+MEDPresentationDeflectionShape::initFieldMeshInfos()
+{
+  MEDPresentation::initFieldMeshInfos();
+  _colorByType = "POINTS";
+}
+
 void
 MEDPresentationDeflectionShape::autoScale()
 {
@@ -54,18 +61,20 @@ MEDPresentationDeflectionShape::internalGeneratePipeline()
 
   MEDPyLockWrapper lock;
 
-  setOrCreateRenderView();
   createSource();
 
   // Populate internal array of available components:
   fillAvailableFieldComponents();
-  if (getIntProperty(MEDPresentation::PROP_NB_COMPONENTS) <= 1)
+  int nbCompo = getIntProperty(MEDPresentation::PROP_NB_COMPONENTS);
+  if (nbCompo <= 1)
     {
       const char * msg = "Deflection shape presentation does not work for scalar field!"; // this message will appear in GUI too
       STDLOG(msg);
       throw KERNEL::createSalomeException(msg);
     }
 
+  setOrCreateRenderView(); // needs to be after the exception above otherwise previous elements in the view will be hidden.
+
   // Warp needs point data:
   applyCellToPointIfNeeded();
 
@@ -75,10 +84,11 @@ MEDPresentationDeflectionShape::internalGeneratePipeline()
 
   showObject(); // to be done first so that the scale factor computation properly works
 
-  oss << _objVar << ".Vectors = ['POINTS', '" << _fieldName << "'];";
+  std::string fieldName = nbCompo <= 2 ? _fieldName + "_Vector" : _fieldName;
+  oss << _objVar << ".Vectors = ['POINTS', '" << fieldName << "'];";
   pushAndExecPyLine(oss.str()); oss.str("");
 
-  colorBy("POINTS");
+  colorBy();    // see initFieldInfo() - necessarily POINTS
   showScalarBar();
   selectColorMap();
   rescaleTransferFunction();
index f4ead11e30767e501668bce77ec949e6bd01be21..f1d8814657a7265193ddfe3f5b534e23b940ccad 100644 (file)
@@ -31,6 +31,8 @@ public:
   MEDPresentationDeflectionShape(const MEDCALC::DeflectionShapeParameters& params, const MEDCALC::ViewModeType viewMode);
   virtual ~MEDPresentationDeflectionShape() {}
 
+  virtual void initFieldMeshInfos();
+
   void updatePipeline(const MEDCALC::DeflectionShapeParameters& params);
 
   void getParameters(MEDCALC::DeflectionShapeParameters & params) const { params = _params; } ;
index 63ffed2af6aa972488d95ffa52c172946317043d..6317ed3e44952dbcb99300aaa5add7b6fb89ee72 100644 (file)
@@ -295,7 +295,17 @@ MEDPresentationManager_i::activateView(MEDPresentation::TypeID presentationID)
   }
   MEDPresentation* presentation = (*citr).second;
 
-  presentation->activateView();
+  if (!presentation->activateView())
+    {
+      // The view has been recreated - transfer all presentations that were in the deleted view to this new one
+      int viewId = presentation->getPyViewID();
+      std::map<MEDPresentation::TypeID, MEDPresentation*>::iterator citr = _presentations.begin();
+      for (; citr != _presentations.end(); ++citr)
+        {
+          if(citr->second->getPyViewID() == viewId)
+            citr->second->recreateViewSetup();
+        }
+    }
   _activeViewPythonId = presentation->getPyViewID();
   STDLOG("Activated view " << _activeViewPythonId);
   return true;
@@ -346,3 +356,13 @@ MEDPresentationManager_i::getAllPresentations()
     (*presList)[i] = it->first;
   return presList;
 }
+
+void
+MEDPresentationManager_i::cleanUp()
+{
+  _activeViewPythonId = -1;
+  std::map<MEDPresentation::TypeID, MEDPresentation*>::iterator it;
+  for (it = _presentations.begin(); it != _presentations.end(); ++it)
+    delete(it->second);
+  _presentations.clear();
+}
index cd2549494524840b067c8939b3b58e8b060a88de..cc2ae289eab3fdb3f22a466eb8a3ae0d7aacd359 100644 (file)
@@ -75,6 +75,7 @@ class MEDPresentationManager_i: public POA_MEDCALC::MEDPresentationManager,
 //  MEDCALC_EXPORT MEDCALC::ViewModeType getPresentationViewMode(MEDPresentation::TypeID);
   MEDCALC_EXPORT char * getParavisDump(MEDPresentation::TypeID presentationID);
   MEDCALC_EXPORT MEDCALC::PresentationsList* getAllPresentations();
+  MEDCALC_EXPORT void cleanUp();
 
  private:
   MEDPresentationManager_i();
index f147554a3cfcb9460cbb143d69d1deb2ceee7080..e4b6cf8e9b9897f70d90ed3dfbf883c5bc806610 100644 (file)
@@ -32,8 +32,7 @@ MEDPresentationManager_i::_makePresentation(const PresentationParameters params,
   std::vector<int> to_del;
   if (viewMode == MEDCALC::VIEW_MODE_REPLACE)
     {
-      // Remove all presentations from this view:
-      STDLOG("About to remove all presentations from view " << activeViewId);
+      // Prepare all presentations to be removed from this view:
       std::map<MEDPresentation::TypeID, MEDPresentation*>::const_iterator it;
       for (it = _presentations.begin(); it != _presentations.end(); ++it)
         {
@@ -49,6 +48,7 @@ MEDPresentationManager_i::_makePresentation(const PresentationParameters params,
   STDLOG("Generated presentation ID: " << newID);
   try {
     presentation = new PresentationType(params, viewMode);  // on stack or on heap?? heap for now
+    presentation->initFieldMeshInfos();
     // In replace or overlap mode we force the display in the active view:
     if(activeViewId != -1 && (viewMode == MEDCALC::VIEW_MODE_REPLACE || viewMode == MEDCALC::VIEW_MODE_OVERLAP))
       presentation->setPyViewID(activeViewId);
@@ -65,6 +65,7 @@ MEDPresentationManager_i::_makePresentation(const PresentationParameters params,
   presentation->generatePipeline();
 
   // If generatePipeline didn't throw, we can actually remove presentations to be deleted:
+  STDLOG("About to remove all presentations from view " << activeViewId);
   for (std::vector<int>::const_iterator it2 = to_del.begin(); it2 != to_del.end(); ++it2)
     removePresentation(*it2);
 
index 60ce767e6a3e2b15bd160134b53d9e6d3614b6b2..d68454c3b6374a1005f349e3751c78119a1c257c 100644 (file)
@@ -18,6 +18,7 @@
 //
 
 #include "MEDPresentationMeshView.hxx"
+#include "MEDFactoryClient.hxx"
 
 #include <SALOME_KernelServices.hxx>
 #undef LOG  // should be fixed in KERNEL - double definition
@@ -31,13 +32,25 @@ const std::string MEDPresentationMeshView::PROP_MESH_MODE = "meshMode";
 MEDPresentationMeshView::MEDPresentationMeshView(const MEDCALC::MeshViewParameters& params,
                                                const MEDCALC::ViewModeType viewMode) :
         // Cheating a bit here - a mesh view doesn't need a color map or a range:
-        MEDPresentation(params.fieldHandlerId, TYPE_NAME, viewMode, MEDCALC::COLOR_MAP_DEFAULT,
+        MEDPresentation(params.meshHandlerId, TYPE_NAME, viewMode, MEDCALC::COLOR_MAP_DEFAULT,
                         MEDCALC::SCALAR_BAR_RANGE_DEFAULT),
         _params(params)
 {
   setIntProperty(MEDPresentationMeshView::PROP_MESH_MODE, params.mode);
 }
 
+void
+MEDPresentationMeshView::initFieldMeshInfos()
+{
+  MEDCALC::MEDDataManager_ptr dataManager(MEDFactoryClient::getDataManager());
+  MEDCALC::MeshHandler* meshHandler = dataManager->getMeshHandler(_handlerId);
+  MEDCALC::DatasourceHandler* dataSHandler = dataManager->getDatasourceHandlerFromID(meshHandler->sourceid);
+
+  extractFileName(std::string(dataSHandler->uri));
+
+  _meshName = meshHandler->name;
+}
+
 void
 MEDPresentationMeshView::representationType()
 {
@@ -76,6 +89,12 @@ MEDPresentationMeshView::internalGeneratePipeline()
   oss << _objVar << " = " << _srcObjVar << ";";
   pushAndExecPyLine(oss.str()); oss.str("");
 
+  recreateViewSetup();
+}
+
+void
+MEDPresentationMeshView::recreateViewSetup()
+{
   showObject();
   representationType();
   resetCameraAndRender();
@@ -84,8 +103,8 @@ MEDPresentationMeshView::internalGeneratePipeline()
 void
 MEDPresentationMeshView::updatePipeline(const MEDCALC::MeshViewParameters& params)
 {
-  if (params.fieldHandlerId != _params.fieldHandlerId)
-    throw KERNEL::createSalomeException("Unexpected updatePipeline error! Mismatching fieldHandlerId!");
+  if (params.meshHandlerId != _params.meshHandlerId)
+    throw KERNEL::createSalomeException("Unexpected updatePipeline error! Mismatching meshHandlerId!");
 
   if (params.mode != _params.mode)
     updateMeshMode(params.mode);
index 9eb9ecede68f48611603db2fa7a8b6092343e983..0075e216d849072be54d1c2a65d8c0bea107b883 100644 (file)
@@ -30,6 +30,7 @@ public:
   static const std::string PROP_MESH_MODE;
 
   MEDPresentationMeshView(const MEDCALC::MeshViewParameters& params, const MEDCALC::ViewModeType viewMode);
+  virtual void initFieldMeshInfos();
   virtual ~MEDPresentationMeshView() {}
 
   void updatePipeline(const MEDCALC::MeshViewParameters& params);
@@ -37,6 +38,8 @@ public:
   void getParameters(MEDCALC::MeshViewParameters & params) const { params = _params; } ;
   void setParameters(const MEDCALC::MeshViewParameters & params) { _params = params; } ;
 
+  virtual void recreateViewSetup();
+
 protected:
   void updateMeshMode(const MEDCALC::MeshModeType mode);
   virtual void internalGeneratePipeline();
index e748b46fc55b9e3ceabfd5cd7283a2bef5fe497d..ad58b265da17c255106c0dc585113224e703fbee 100644 (file)
@@ -36,6 +36,22 @@ MEDPresentationPointSprite::MEDPresentationPointSprite(const MEDCALC::PointSprit
 {
 }
 
+void
+MEDPresentationPointSprite::initFieldMeshInfos()
+{
+  MEDPresentation::initFieldMeshInfos();
+  _colorByType = "POINTS";
+}
+
+void
+MEDPresentationPointSprite::scaleBallRadius()
+{
+  std::ostringstream oss;
+  oss << _dispVar << ".RadiusVectorComponent = " << _selectedComponentIndex << ";";
+  pushAndExecPyLine(oss.str()); oss.str("");
+}
+
+
 void
 MEDPresentationPointSprite::internalGeneratePipeline()
 {
@@ -62,7 +78,7 @@ MEDPresentationPointSprite::internalGeneratePipeline()
   oss << "__avgSize = medcalc.ComputeCellAverageSize(" << _srcObjVar << ");";
   pushAndExecPyLine(oss.str()); oss.str("");
 
-  colorBy("POINTS");  // like in Contour
+  colorBy();    // see initFieldInfo() - necessarily POINTS like in Contour
 
   // Set point sprite:
   oss << _dispVar << ".SetRepresentationType('Point Sprite');";
@@ -74,8 +90,7 @@ MEDPresentationPointSprite::internalGeneratePipeline()
   oss << _dispVar << ".RadiusMode = 'Scalar';";
   pushAndExecPyLine(oss.str()); oss.str("");
 
-  oss << _dispVar << ".RadiusVectorComponent = " << _selectedComponentIndex << ";";
-  pushAndExecPyLine(oss.str()); oss.str("");
+  scaleBallRadius();
   oss << _dispVar << ".RadiusIsProportional = 0 ;";
   pushAndExecPyLine(oss.str()); oss.str("");
   oss << _dispVar << ".RadiusTransferFunctionEnabled = 1 ;";
@@ -98,7 +113,11 @@ MEDPresentationPointSprite::updatePipeline(const MEDCALC::PointSpriteParameters&
     throw KERNEL::createSalomeException("Unexpected updatePipeline error! Mismatching fieldHandlerId!");
 
   if (std::string(params.displayedComponent) != std::string(_params.displayedComponent))
-    updateComponent<MEDPresentationPointSprite, MEDCALC::PointSpriteParameters>(std::string(params.displayedComponent));
+    {
+      updateComponent<MEDPresentationPointSprite, MEDCALC::PointSpriteParameters>(std::string(params.displayedComponent));
+      scaleBallRadius();
+      pushAndExecPyLine("pvs.Render();");
+    }
   if (params.scalarBarRange != _params.scalarBarRange)
     updateScalarBarRange<MEDPresentationPointSprite, MEDCALC::PointSpriteParameters>(params.scalarBarRange);
   if (params.colorMap != _params.colorMap)
index e38b9ea1f5c668b1458c5e027c072804b4635a01..03b68346afe08eff7815ce9544b5953835fe4419 100644 (file)
@@ -31,6 +31,8 @@ public:
   MEDPresentationPointSprite(const MEDCALC::PointSpriteParameters& params, const MEDCALC::ViewModeType viewMode);
   virtual ~MEDPresentationPointSprite() {}
 
+  virtual void initFieldMeshInfos();
+
   void updatePipeline(const MEDCALC::PointSpriteParameters& params);
 
   void getParameters(MEDCALC::PointSpriteParameters & params) const { params = _params; } ;
@@ -38,6 +40,7 @@ public:
 
 protected:
   virtual void internalGeneratePipeline();
+  void scaleBallRadius();
 
 private:
   MEDCALC::PointSpriteParameters _params;
index ef8804a4ef083f2650a67e4c4be27414e11991c2..f308b539b1711f38ddc2281bf25967176eed4615 100644 (file)
@@ -54,7 +54,7 @@ MEDPresentationScalarMap::internalGeneratePipeline()
 
   showObject();
 
-  colorBy(_pvFieldType);
+  colorBy();
   showScalarBar();
   selectColorMap();
   rescaleTransferFunction();
index 8654e25bc27f59d40cb6890ab3b3393e67757456..aa4f6e34ca332356da2c5af379a2e948961b3efd 100644 (file)
@@ -93,13 +93,7 @@ MEDPresentationSlices::generateAndDisplay()
   adaptNumberOfSlices();
   setSliceParametersAndGroup();
 
-  showObject();
-
-  colorBy(_pvFieldType);
-  showScalarBar();
-  selectColorMap();
-  rescaleTransferFunction();
-  resetCameraAndRender();
+  recreateViewSetup();
 }
 
 std::string
index 92b857761d5d8aed46ba286c33a49955c0fddd5b..e7f69dcf8b56d3ee76dfefeb182eaa24187b6079 100644 (file)
@@ -36,6 +36,13 @@ MEDPresentationVectorField::MEDPresentationVectorField(const MEDCALC::VectorFiel
 {
 }
 
+void
+MEDPresentationVectorField::initFieldMeshInfos()
+{
+  MEDPresentation::initFieldMeshInfos();
+  _colorByType = "POINTS";
+}
+
 void
 MEDPresentationVectorField::autoScale()
 {
@@ -54,18 +61,20 @@ MEDPresentationVectorField::internalGeneratePipeline()
 
   MEDPyLockWrapper lock;
 
-  setOrCreateRenderView();
   createSource();
 
   // Populate internal array of available components:
   fillAvailableFieldComponents();
-  if (getIntProperty(MEDPresentation::PROP_NB_COMPONENTS) <= 1)
+  int nbCompo = getIntProperty(MEDPresentation::PROP_NB_COMPONENTS);
+  if (nbCompo <= 1)
     {
       const char * msg = "Vector field presentation does not work for scalar field!"; // this message will appear in GUI too
       STDLOG(msg);
       throw KERNEL::createSalomeException(msg);
     }
 
+  setOrCreateRenderView();  // instanciate __viewXXX, needs to be after the exception above otherwise previous elements in the view will be hidden.
+
   std::ostringstream oss;
   oss << _objVar << " = pvs.Glyph(Input=" << _srcObjVar << ", GlyphType='Arrow');";
   pushAndExecPyLine(oss.str()); oss.str("");
@@ -74,7 +83,10 @@ MEDPresentationVectorField::internalGeneratePipeline()
 
   oss << _objVar << ".Scalars = ['"<< _pvFieldType << "', 'None'];";
   pushAndExecPyLine(oss.str()); oss.str("");
-  oss << _objVar << ".Vectors = ['"<< _pvFieldType << "', '" << _fieldName << "'];";
+
+  std::string fieldName = nbCompo <= 2 ? _fieldName + "_Vector" : _fieldName;
+  oss << _objVar << ".Vectors = ['"<< _pvFieldType << "', '" << fieldName << "'];";
+
   pushAndExecPyLine(oss.str()); oss.str("");
   oss << _objVar << ".ScaleMode = 'vector';";
   pushAndExecPyLine(oss.str()); oss.str("");
@@ -83,7 +95,7 @@ MEDPresentationVectorField::internalGeneratePipeline()
   oss << _objVar << "GlyphTransform = 'Transform2';";  // not sure this is really needed?
   pushAndExecPyLine(oss.str()); oss.str("");
 
-  colorBy("POINTS");
+  colorBy();    // see initFieldInfo() - necessarily POINTS
   showScalarBar();
   selectColorMap();
   rescaleTransferFunction();
index 339bf02a0087914ce18fba56d26fe9dba87502ac..f8d5ef00b56b63205fe87acd0a936ad4039d4734 100644 (file)
@@ -31,6 +31,8 @@ public:
   MEDPresentationVectorField(const MEDCALC::VectorFieldParameters& params, const MEDCALC::ViewModeType viewMode);
   virtual ~MEDPresentationVectorField() {}
 
+  virtual void initFieldMeshInfos();
+
   void updatePipeline(const MEDCALC::VectorFieldParameters& params);
 
   void getParameters(MEDCALC::VectorFieldParameters & params) const { params = _params; } ;
index cbf2649d569ba10c203f8032c055f6dd8b62c991..dda57da3db4d9206c9725a240d2f4b2ef1445932 100644 (file)
@@ -230,10 +230,19 @@ void DatasourceController::OnExpandField()
   SALOME_StudyEditor::SObjectList* listOfSObject = _studyEditor->getSelectedObjects();
   for (int i=0; i<listOfSObject->size(); i++) {
     SALOMEDS::SObject_var soFieldseries = listOfSObject->at(i);
+    std::string name(_studyEditor->getName(soFieldseries));
+    if (soFieldseries->_is_nil() || name == "MEDCalc")
+      return;
 
     // First retrieve the fieldseries id associated to this study object
-    long fieldseriesId = _studyEditor->getParameterInt(soFieldseries,FIELD_SERIES_ID);
-    //long fieldseriesId = _studyEditor->getParameterInt(soFieldseries,FIELD_ID);
+    SALOMEDS::GenericAttribute_var anAttr;
+    SALOMEDS::AttributeParameter_var aParam;
+    if ( soFieldseries->FindAttribute(anAttr,"AttributeParameter") ) {
+      aParam = SALOMEDS::AttributeParameter::_narrow(anAttr);
+      if (! aParam->IsSet(FIELD_SERIES_ID, PT_INTEGER))
+        return;
+    }
+    long fieldseriesId = aParam->GetInt(FIELD_SERIES_ID);
     STDLOG("Expand the field timeseries "<<fieldseriesId);
 
     // If fieldseriesId equals -1, then it means that it is not a
@@ -279,8 +288,17 @@ void DatasourceController::OnUseInWorkspace() {
     // <<<
 
     SALOMEDS::SObject_var soField = listOfSObject->at(0);
-
-    bool isInWorkspace = _studyEditor->getParameterBool(soField,IS_IN_WORKSPACE);
+    std::string name(_studyEditor->getName(soField));
+    if (soField->_is_nil() || name == "MEDCalc")
+      return;
+    SALOMEDS::GenericAttribute_var anAttr;
+    SALOMEDS::AttributeParameter_var aParam;
+    if ( soField->FindAttribute(anAttr,"AttributeParameter") ) {
+      aParam = SALOMEDS::AttributeParameter::_narrow(anAttr);
+      if (! aParam->IsSet(IS_IN_WORKSPACE, PT_BOOLEAN))
+        return;
+    }
+    bool isInWorkspace = aParam->GetBool(IS_IN_WORKSPACE);
     if ( isInWorkspace ) {
       QMessageBox::warning(_salomeModule->getApp()->desktop(),
          tr("Operation not allowed"),
@@ -288,7 +306,9 @@ void DatasourceController::OnUseInWorkspace() {
       return;
     }
 
-    int fieldId = _studyEditor->getParameterInt(soField,FIELD_ID);
+    if (! aParam->IsSet(FIELD_ID, PT_INTEGER))
+      return;
+    int fieldId = aParam->GetInt(FIELD_ID);
 
     // If fieldId equals -1, then it means that it is not a field
     // managed by the MED module, and we stop this function process.
@@ -338,10 +358,20 @@ void DatasourceController::OnUseInWorkspace() {
     // each item, we just import the whole set of items.
     for (int i=0; i<listOfSObject->size(); i++) {
       SALOMEDS::SObject_var soField = listOfSObject->at(i);
-
-      bool isInWorkspace = _studyEditor->getParameterBool(soField,IS_IN_WORKSPACE);
+      if (soField->_is_nil())
+        continue;
+      SALOMEDS::GenericAttribute_var anAttr;
+      SALOMEDS::AttributeParameter_var aParam;
+      if ( soField->FindAttribute(anAttr,"AttributeParameter") ) {
+        aParam = SALOMEDS::AttributeParameter::_narrow(anAttr);
+        if (! aParam->IsSet(IS_IN_WORKSPACE, PT_BOOLEAN))
+          return;
+      }
+      bool isInWorkspace = aParam->GetBool(IS_IN_WORKSPACE);
       if ( !isInWorkspace ) {
-        int fieldId = _studyEditor->getParameterInt(soField,FIELD_ID);
+        if (! aParam->IsSet(FIELD_ID, PT_INTEGER))
+          continue;
+        int fieldId = aParam->GetInt(FIELD_ID);
         MEDCALC::FieldHandler* fieldHandler =
           MEDFactoryClient::getDataManager()->getFieldHandler(fieldId);
         DatasourceEvent* event = new DatasourceEvent();
index 3a9cc15dbf9906f6b49ff3ed5b6d59664da69d1a..d7fe92a037602ce0072bb5dd8e332a39651b911d 100644 (file)
@@ -96,7 +96,11 @@ MEDModule::init()
   if ( CORBA::is_nil( _MED_engine ) ) {
     Engines::EngineComponent_var comp =
       SalomeApp_Application::lcc()->FindOrLoad_Component( "FactoryServer", "MED" );
+    if (CORBA::is_nil( comp ))
+        STDLOG("Could not FindOrLoad_Component MED");
     _MED_engine = MED_ORB::MED_Gen::_narrow( comp );
+    if (CORBA::is_nil( _MED_engine ))
+        STDLOG("Could not narrow MED engine");
   }
 }
 
@@ -127,6 +131,10 @@ MEDModule::initialize( CAM_Application* app )
   // The following initializes the GUI widget and associated actions
   this->createModuleWidgets();
   this->createModuleActions();
+
+  // Now that the workspace controller is created, ParaView core application has normally been started,
+  // and hidden GUI elements have been created.  We can fire the VCR toolbar activation:
+  initToolbars();
 }
 
 QString
@@ -214,6 +222,12 @@ MEDModule::activateModule( SUIT_Study* theStudy )
 bool
 MEDModule::deactivateModule( SUIT_Study* theStudy )
 {
+ // Clean up engine:
+  STDLOG("MEDModule::deactivateModule(): cleaning up engine side.");
+  _MED_engine->cleanUp();
+  MEDFactoryClient::getFactory()->getPresentationManager()->cleanUp();
+  MEDFactoryClient::getFactory()->getDataManager()->cleanUp();
+
   _workspaceController->showDockWidgets(false);
   _presentationController->showDockWidgets(false);
   //this->unsetDockLayout();
@@ -269,11 +283,6 @@ MEDModule::createModuleWidgets() {
 
   connect(_workspaceController, SIGNAL(workspaceSignal(const MEDCALC::MedEvent*)),
     _presentationController, SLOT(processWorkspaceEvent(const MEDCALC::MedEvent*)));
-
-
-  // Now that the workspace controller is created, ParaView core application has normally been started,
-  // and hidden GUI elements have been created.  We can fire the VCR toolbar activation:
-  initToolbars();
 }
 
 void
@@ -379,8 +388,12 @@ MEDModule::addActionInPopupMenu(int actionId,const QString& menus,const QString&
 //}
 
 
+/**
+ * Returns presentation name, type and ID from the currently selected presentation in the object
+ * browser.
+ */
 bool
-MEDModule::itemClickGeneric(const QModelIndex & index, std::string & name, std::string & type, int & fieldId, int & presId) const
+MEDModule::itemClickGeneric(std::string & name, std::string & type, int & presId) const
 {
   DataObjectList dol = getApp()->objectBrowser()->getSelected();
   if (dol.isEmpty())
@@ -409,9 +422,9 @@ MEDModule::itemClickGeneric(const QModelIndex & index, std::string & name, std::
       || ! attrParam->GetBool(IS_PRESENTATION)) { // Not a presentation
       return false;
   }
-  if (!attrParam->IsSet(FIELD_ID, PT_INTEGER))
-    return false;
-  fieldId = attrParam->GetInt(FIELD_ID);
+//  if (!attrParam->IsSet(FIELD_ID, PT_INTEGER))
+//    return false;
+//  fieldId = attrParam->GetInt(FIELD_ID);
   if (!attrParam->IsSet(PRESENTATION_ID, PT_INTEGER))
       return false;
   presId = attrParam->GetInt(PRESENTATION_ID);
@@ -424,9 +437,9 @@ MEDModule::itemClickGeneric(const QModelIndex & index, std::string & name, std::
 void
 MEDModule::onClick(const QModelIndex & index)
 {
-  int fieldId, presId;
+  int presId;
   std::string name, type;
-  if (!itemClickGeneric(index, name, type, fieldId, presId))
+  if (!itemClickGeneric(name, type, presId))
     {
       // Not a presentation - clear widget:
       emit presentationSelected(-1, QString(""), QString(""));
@@ -446,26 +459,20 @@ MEDModule::onClick(const QModelIndex & index)
 void
 MEDModule::onDblClick(const QModelIndex& index)
 {
-  int fieldId, presId;
+  int presId;
   std::string name, type;
-  if (!itemClickGeneric(index, name, type, fieldId, presId))
+  if (!itemClickGeneric(name, type, presId))
     return;
 
-  STDLOG("Presentation edition: NOT IMPLEMENTED YET");
-  STDLOG("  Presentation infos:");
+//  STDLOG("Presentation double click");
+//  STDLOG("  Presentation infos:");
 //  STDLOG("    - Component:         " + item->componentDataType().toStdString());
 //  STDLOG("    - Item entry:        " + item->entry().toStdString());
 //  STDLOG("    - Item name:         " + item->name().toStdString());
-  std::ostringstream oss;
-  oss << fieldId;
-  STDLOG("    - Field id:          " + oss.str());
-  STDLOG("    - Presentation name: " + name);
-
-  // :TODO:
-  // get edited values from a popup widget
-  // get presentation
-  // call presentation edit function
-
+//  std::ostringstream oss;
+//  oss << fieldId;
+//  STDLOG("    - Field id:          " + oss.str());
+//  STDLOG("    - Presentation name: " + name);
 }
 
 void
index c53e6458a93e641367a016acdb9986db4143e8aa..fa38c17903518259bf8ac33ced21a41f5961995f 100644 (file)
@@ -87,6 +87,8 @@ public:
   inline SALOME_AppStudyEditor* getStudyEditor() { return _studyEditor; }
   void requestSALOMETermination() const;
 
+  bool itemClickGeneric(std::string & name, std::string & type, int & presId) const;
+
 signals:
   void presentationSelected(int presId, const QString& presType, const QString& presName);
 
@@ -101,9 +103,6 @@ private:
   void createModuleActions();
   void initToolbars();
 
-  bool itemClickGeneric(const QModelIndex & index, std::string & name,
-                        std::string & type, int & fieldId, int & presId) const;
-
   static void init();
 
 private:
@@ -118,9 +117,6 @@ private:
 
   static MED_ORB::MED_Gen_var _MED_engine;
 
-  // GUI needs to talk directly to the pres manager to activate a view, get some params, etc ...:
-  static MEDCALC::MEDPresentationManager_ptr _presManager;
-
 #ifdef MED_HAS_QTTESTING
   TestController * _testController;
 #endif
index 8935a3adeed524a01f18194eaa6a4e81ec98ea0d..c1ee040a5500edb60423c0af1e4b9429323f5235 100644 (file)
@@ -64,7 +64,9 @@ void MEDWidgetHelper::updateWidget(bool connect)
   loadParametersFromEngine();
 
   // Set properly color map and scalar bar range
+  STDLOG("MEDWidgetHelper::udpateWidget() colorMap is " << _colorMap);
   _paramWidget->setColorMap(_colorMap);
+  STDLOG("MEDWidgetHelper::udpateWidget() scalarBarRange is " << _scalarBarRange);
   _paramWidget->setScalarBarRange(_scalarBarRange);
 
   if (connect)
index 8e55b5ecbf4dfd99307befcea570a2a76b063a59..69f0b813b5cf17d052420292f2ee16aeebc5a7b8 100644 (file)
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
-<TS version="2.0">
-  <context>
+<TS version="2.0" language="en_GB">
+<context>
     <name>PresentationController</name>
     <message>
-      <source>TITLE_PRESENTATION_PARAMETERS</source>
-      <translation>Presentation parameters</translation>
+        <source>TITLE_PRESENTATION_PARAMETERS</source>
+        <translation>Presentation parameters</translation>
     </message>
     <message>
-      <source>LAB_PRESENTATION_MESH_VIEW</source>
-      <translation>Mesh</translation>
+        <source>LAB_PRESENTATION_MESH_VIEW</source>
+        <translation>Mesh</translation>
     </message>
     <message>
-      <source>TIP_PRESENTATION_MESH_VIEW</source>
-      <translation>Mesh</translation>
+        <source>TIP_PRESENTATION_MESH_VIEW</source>
+        <translation>Mesh</translation>
     </message>
     <message>
-      <source>LAB_PRESENTATION_SCALAR_MAP</source>
-      <translation>Scalar map</translation>
+        <source>LAB_PRESENTATION_SCALAR_MAP</source>
+        <translation>Scalar map</translation>
     </message>
     <message>
-      <source>TIP_PRESENTATION_SCALAR_MAP</source>
-      <translation>Scalar map</translation>
+        <source>TIP_PRESENTATION_SCALAR_MAP</source>
+        <translation>Scalar map</translation>
     </message>
     <message>
-      <source>LAB_PRESENTATION_CONTOUR</source>
-      <translation>Contour</translation>
+        <source>LAB_PRESENTATION_CONTOUR</source>
+        <translation>Contour</translation>
     </message>
     <message>
-      <source>TIP_PRESENTATION_CONTOUR</source>
-      <translation>Contour</translation>
+        <source>TIP_PRESENTATION_CONTOUR</source>
+        <translation>Contour</translation>
     </message>
     <message>
-      <source>LAB_PRESENTATION_VECTOR_FIELD</source>
-      <translation>Vector field</translation>
+        <source>LAB_PRESENTATION_VECTOR_FIELD</source>
+        <translation>Vector field</translation>
     </message>
     <message>
-      <source>TIP_PRESENTATION_VECTOR_FIELD</source>
-      <translation>Vector field</translation>
+        <source>TIP_PRESENTATION_VECTOR_FIELD</source>
+        <translation>Vector field</translation>
     </message>
     <message>
-      <source>LAB_PRESENTATION_SLICES</source>
-      <translation>Slices</translation>
+        <source>LAB_PRESENTATION_SLICES</source>
+        <translation>Slices</translation>
     </message>
     <message>
-      <source>TIP_PRESENTATION_SLICES</source>
-      <translation>Slices</translation>
+        <source>TIP_PRESENTATION_SLICES</source>
+        <translation>Slices</translation>
     </message>
     <message>
-      <source>LAB_PRESENTATION_DEFLECTION_SHAPE</source>
-      <translation>Deflection shape</translation>
+        <source>LAB_PRESENTATION_DEFLECTION_SHAPE</source>
+        <translation>Deflection shape</translation>
     </message>
     <message>
-      <source>TIP_PRESENTATION_DEFLECTION_SHAPE</source>
-      <translation>Deflection shape</translation>
+        <source>TIP_PRESENTATION_DEFLECTION_SHAPE</source>
+        <translation>Deflection shape</translation>
     </message>
     <message>
-      <source>LAB_PRESENTATION_POINT_SPRITE</source>
-      <translation>Point sprite</translation>
+        <source>LAB_PRESENTATION_POINT_SPRITE</source>
+        <translation>Point sprite</translation>
     </message>
     <message>
-      <source>TIP_PRESENTATION_POINT_SPRITE</source>
-      <translation>Point sprite</translation>
+        <source>TIP_PRESENTATION_POINT_SPRITE</source>
+        <translation>Point sprite</translation>
     </message>
     <message>
-      <source>LAB_DELETE_PRESENTATION</source>
-      <translation>Delete presentation</translation>
+        <source>LAB_DELETE_PRESENTATION</source>
+        <translation>Delete presentation</translation>
     </message>
     <message>
-      <source>TIP_DELETE_PRESENTATION</source>
-      <translation>Delete selected presentation</translation>
+        <source>TIP_DELETE_PRESENTATION</source>
+        <translation>Delete selected presentation</translation>
     </message>
     <message>
-      <source>LAB_PARAVIS_DUMP</source>
-      <translation>Dump pipeline</translation>
+        <source>LAB_PARAVIS_DUMP</source>
+        <translation>Dump pipeline</translation>
     </message>
     <message>
-      <source>TIP_PARAVIS_DUMP</source>
-      <translation>Dump the low level Python commands of the presentation</translation>
-    </message> 
+        <source>TIP_PARAVIS_DUMP</source>
+        <translation>Dump the low level Python commands of the presentation</translation>
+    </message>
     <message>
-      <source>MENU_PRESENTATIONS</source>
-      <translation>Presentations</translation>
+        <source>MENU_PRESENTATIONS</source>
+        <translation>Presentations</translation>
     </message>
     <message>
-      <source>MEDPresentationMeshView</source>
-      <translation>Mesh view</translation>
+        <source>MEDPresentationMeshView</source>
+        <translation>Mesh view</translation>
     </message>
     <message>
-      <source>MEDPresentationScalarMap</source>
-      <translation>Scalar map</translation>
+        <source>MEDPresentationScalarMap</source>
+        <translation>Scalar map</translation>
     </message>
     <message>
-      <source>MEDPresentationContour</source>
-      <translation>Contour</translation>
+        <source>MEDPresentationContour</source>
+        <translation>Contour</translation>
     </message>
     <message>
-      <source>MEDPresentationVectorField</source>
-      <translation>Vector field</translation>
+        <source>MEDPresentationVectorField</source>
+        <translation>Vector field</translation>
     </message>
     <message>
-      <source>MEDPresentationSlices</source>
-      <translation>Slices</translation>
+        <source>MEDPresentationSlices</source>
+        <translation>Slices</translation>
     </message>
     <message>
-      <source>MEDPresentationDeflectionShape</source>
-      <translation>Deflection shape</translation>
+        <source>MEDPresentationDeflectionShape</source>
+        <translation>Deflection shape</translation>
     </message>
     <message>
-      <source>MEDPresentationPointSprite</source>
-      <translation>Point sprite</translation>
+        <source>MEDPresentationPointSprite</source>
+        <translation>Point sprite</translation>
     </message>
-  </context>
-  <context>
+</context>
+<context>
     <name>ProcessingController</name>
     <message>
-      <source>MENU_PROCESSING</source>
-      <translation>Processing</translation>
+        <source>MENU_PROCESSING</source>
+        <translation>Processing</translation>
     </message>
     <message>
-      <source>LAB_PROCESSING_CHANGE_MESH</source>
-      <translation>Change underlying mesh</translation>
+        <source>LAB_PROCESSING_CHANGE_MESH</source>
+        <translation>Change underlying mesh</translation>
     </message>
     <message>
-      <source>LAB_PROCESSING_INTERPOLATE_FIELD</source>
-      <translation>Interpolate field</translation>
+        <source>LAB_PROCESSING_INTERPOLATE_FIELD</source>
+        <translation>Interpolate field</translation>
     </message>
-  </context>
-  <context>
+</context>
+<context>
     <name>DatasourceController</name>
     <message>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="45"/>
-      <source>LAB_ADD_DATA_SOURCE</source>
-      <translation>Add Data Source</translation>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="45"/>
+        <source>LAB_ADD_DATA_SOURCE</source>
+        <translation>Add Data Source</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="46"/>
-      <source>TIP_ADD_DATA_SOURCE</source>
-      <translation>Add a file data source (file providing med data)</translation>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="46"/>
+        <source>TIP_ADD_DATA_SOURCE</source>
+        <translation>Add a file data source (file providing med data)</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="52"/>
-      <source>LAB_ADD_IMAGE_SOURCE</source>
-      <translation>Add Image Source</translation>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="52"/>
+        <source>LAB_ADD_IMAGE_SOURCE</source>
+        <translation>Add Image Source</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="53"/>
-      <source>TIP_ADD_IMAGE_SOURCE</source>
-      <translation>Create a Data Source from an image file</translation>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="53"/>
+        <source>TIP_ADD_IMAGE_SOURCE</source>
+        <translation>Create a Data Source from an image file</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="62"/>
-      <source>LAB_EXPAND_FIELD</source>
-      <translation>Expand field timeseries</translation>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="62"/>
+        <source>LAB_EXPAND_FIELD</source>
+        <translation>Expand field timeseries</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="75"/>
-      <source>LAB_USE_IN_WORKSPACE</source>
-      <translation>Use in workspace</translation>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="75"/>
+        <source>LAB_USE_IN_WORKSPACE</source>
+        <translation>Use in workspace</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="157"/>
-      <source>IMPORT_MED_FIELDS</source>
-      <translation>Import MED fields</translation>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="157"/>
+        <source>IMPORT_MED_FIELDS</source>
+        <translation>Import MED fields</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="191"/>
-      <source>OPERATION_FAILED</source>
-      <translation>Operation failed</translation>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="191"/>
+        <source>OPERATION_FAILED</source>
+        <translation>Operation failed</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="192"/>
-      <source>CREATION_FAILED</source>
-      <translation>The creation of med data from the image file failed</translation>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="192"/>
+        <source>CREATION_FAILED</source>
+        <translation>The creation of med data from the image file failed</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="283"/>
-      <source>OPERATION_NOT_ALLOWED</source>
-      <translation>Operation not allowed</translation>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="283"/>
+        <source>OPERATION_NOT_ALLOWED</source>
+        <translation>Operation not allowed</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="284"/>
-      <source>FIELD_ALREADY_DEFINED</source>
-      <translation>This field is already defined in the workspace</translation>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="284"/>
+        <source>FIELD_ALREADY_DEFINED</source>
+        <translation>This field is already defined in the workspace</translation>
     </message>
-  </context>
-  <context>
+</context>
+<context>
     <name>WidgetPresentationParameters</name>
     <message>
-      <source>LAB_DEFAULT_DYN_TITLE</source>
-      <translation>Default parameters</translation>
-    </message>    
+        <source>LAB_DEFAULT_DYN_TITLE</source>
+        <translation>Default parameters</translation>
+    </message>
+    <message>
+        <source>LAB_DISP_COMP</source>
+        <translation>Displayed component:</translation>
+    </message>
+    <message>
+        <source>LAB_EUCLIDEAN_NORM</source>
+        <translation>Euclidean norm</translation>
+    </message>
+    <message>
+        <source>LAB_SCALARBAR</source>
+        <translation>Scalar bar:</translation>
+    </message>
     <message>
-      <source>LAB_DISP_COMP</source>
-      <translation>Displayed component:</translation>
+        <source>LAB_RANGE</source>
+        <translation>Range:</translation>
     </message>
     <message>
-      <source>LAB_EUCLIDEAN_NORM</source>
-      <translation>Euclidean norm</translation>
+        <source>LAB_ALL_TIMESTEPS</source>
+        <translation>All timesteps</translation>
     </message>
     <message>
-      <source>LAB_SCALARBAR</source>
-      <translation>Scalar bar:</translation>
+        <source>LAB_CURRENT_TIMESTEP</source>
+        <translation>Current timestep</translation>
     </message>
     <message>
-      <source>LAB_RANGE</source>
-      <translation>Range:</translation>
+        <source>LAB_USER_RANGE</source>
+        <translation>User-specified</translation>
     </message>
     <message>
-      <source>LAB_ALL_TIMESTEPS</source>
-      <translation>All timesteps</translation>
+        <source>LAB_TIMESTEP</source>
+        <translation>Timestep:</translation>
     </message>
     <message>
-      <source>LAB_CURRENT_TIMESTEP</source>
-      <translation>Current timestep</translation>
+        <source>LAB_MIN_VALUE</source>
+        <translation>Min value:</translation>
     </message>
     <message>
-      <source>LAB_USER_RANGE</source>
-      <translation>User-specified</translation>
+        <source>LAB_MAX_VALUE</source>
+        <translation>Max value:</translation>
     </message>
     <message>
-      <source>LAB_TIMESTEP</source>
-      <translation>Timestep:</translation>
+        <source>LAB_COLOR_MAP</source>
+        <translation>Color map:</translation>
     </message>
     <message>
-      <source>LAB_MIN_VALUE</source>
-      <translation>Min value:</translation>
+        <source>LAB_MESH_WIREFRAME</source>
+        <translation>Wireframe</translation>
     </message>
     <message>
-      <source>LAB_MAX_VALUE</source>
-      <translation>Max value:</translation>
+        <source>LAB_MESH_SURFACE</source>
+        <translation>Surface</translation>
     </message>
     <message>
-      <source>LAB_COLOR_MAP</source>
-      <translation>Color map:</translation>
+        <source>LAB_MESH_SURF_EDGES</source>
+        <translation>Surface With Edges</translation>
     </message>
-
     <message>
-      <source>LAB_MESH_WIREFRAME</source>
-      <translation>Wireframe</translation>
+        <source>LAB_DISP_MESH_MODE</source>
+        <translation>Mesh display:</translation>
     </message>
     <message>
-      <source>LAB_MESH_SURFACE</source>
-      <translation>Surface</translation>
+        <source>LAB_NB_CONTOURS</source>
+        <translation>Number of contours (max. %1):</translation>
     </message>
     <message>
-      <source>LAB_MESH_SURF_EDGES</source>
-      <translation>Surface With Edges</translation>
+        <source>LAB_NB_SLICES</source>
+        <translation>Number of slices (max. %1):</translation>
     </message>
     <message>
-      <source>LAB_DISP_MESH_MODE</source>
-      <translation>Mesh display:</translation>
+        <source>LAB_SPINBOX_TOOLTIP</source>
+        <translation>Hit &apos;Enter&apos; to apply</translation>
     </message>
     <message>
-      <source>LAB_NB_CONTOURS</source>
-      <translation>Number of contours:</translation>
+        <source>LAB_SLICE_ORIENT</source>
+        <translation>Slice orientation:</translation>
     </message>
     <message>
-      <source>LAB_NB_SLICES</source>
-      <translation>Number of slices:</translation>
+        <source>LAB_SLICE_NORMAL_TO_X</source>
+        <translation>Normal to X</translation>
     </message>
     <message>
-      <source>LAB_SLICE_ORIENT</source>
-      <translation>Slice orientation:</translation>
+        <source>LAB_SLICE_NORMAL_TO_Y</source>
+        <translation>Normal to Y</translation>
     </message>
-
     <message>
-      <source>LAB_SLICE_NORMAL_TO_X</source>
-      <translation>Normal to X</translation>
+        <source>LAB_SLICE_NORMAL_TO_Z</source>
+        <translation>Normal to Z</translation>
     </message>
     <message>
-      <source>LAB_SLICE_NORMAL_TO_Y</source>
-      <translation>Normal to Y</translation>
+        <source>LAB_SLICE_NORMAL_TO_XY</source>
+        <translation>Normal to XY</translation>
     </message>
     <message>
-      <source>LAB_SLICE_NORMAL_TO_Z</source>
-      <translation>Normal to Z</translation>
+        <source>LAB_SLICE_NORMAL_TO_XZ</source>
+        <translation>Normal to XZ</translation>
     </message>
     <message>
-      <source>LAB_SLICE_NORMAL_TO_XY</source>
-      <translation>Normal to XY</translation>
+        <source>LAB_SLICE_NORMAL_TO_YZ</source>
+        <translation>Normal to YZ</translation>
     </message>
     <message>
-      <source>LAB_SLICE_NORMAL_TO_XZ</source>
-      <translation>Normal to XZ</translation>
+        <source>LAB_SLICE_NORMAL_TO_XYZ</source>
+        <translation>Normal to XYZ</translation>
     </message>
     <message>
-      <source>LAB_SLICE_NORMAL_TO_YZ</source>
-      <translation>Normal to YZ</translation>
+        <source>LAB_BLUE_TO_RED</source>
+        <translation>Blue to red rainbow</translation>
     </message>
     <message>
-      <source>LAB_SLICE_NORMAL_TO_XYZ</source>
-      <translation>Normal to XYZ</translation>
+        <source>LAB_COOL_TO_WARM</source>
+        <translation>Cool to warm</translation>
     </message>
-    
-  </context>
-  <context>
+</context>
+<context>
     <name>DlgAlias</name>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgAlias.ui" line="14"/>
-      <source>SELECT_AN_ALIAS_FOR_THE_FIELD</source>
-      <translation>Select an alias for the field</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgAlias.ui" line="14"/>
+        <source>SELECT_AN_ALIAS_FOR_THE_FIELD</source>
+        <translation>Select an alias for the field</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgAlias.ui" line="401"/>
-      <source>DEFINE_AN_ALIAS</source>
-      <translation>You can define an alias to manipulate the field in console:</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgAlias.ui" line="401"/>
+        <source>DEFINE_AN_ALIAS</source>
+        <translation>You can define an alias to manipulate the field in console:</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgAlias.ui" line="419"/>
-      <source>ALIAS</source>
-      <translation>Alias</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgAlias.ui" line="419"/>
+        <source>ALIAS</source>
+        <translation>Alias</translation>
     </message>
     <message utf8="true">
-      <location filename="MEDCALC/gui/dialogs/DlgAlias.ui" line="436"/>
-      <source>MSG_OPERATION_DEFINES_VARIABLE</source>
-      <translation>(this operation defines a variable named &lt;alias&gt; in TUI console. Enter &quot;&lt;alias&gt;.help()&quot; to see available functions, or simply &quot;doc&quot;)</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgAlias.ui" line="436"/>
+        <source>MSG_OPERATION_DEFINES_VARIABLE</source>
+        <translation>(this operation defines a variable named &lt;alias&gt; in TUI console. Enter &quot;&lt;alias&gt;.help()&quot; to see available functions, or simply &quot;doc&quot;)</translation>
     </message>
-  </context>
-  <context>
+</context>
+<context>
     <name>DlgChangeUnderlyingMesh</name>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.ui" line="14"/>
-      <source>FORM</source>
-      <translation>Form</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.ui" line="14"/>
+        <source>FORM</source>
+        <translation>Form</translation>
     </message>
     <message utf8="true">
-      <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.ui" line="403"/>
-      <source>MESH_GT</source>
-      <translation>Mesh -&gt;</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.ui" line="403"/>
+        <source>MESH_GT</source>
+        <translation>Mesh -&gt;</translation>
     </message>
     <message utf8="true">
-      <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.ui" line="420"/>
-      <source>MSG_EXPLORER</source>
-      <translation>(Explorer provides a view on MED data sources (mesh and fields) referenced in data space)</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.ui" line="420"/>
+        <source>MSG_EXPLORER</source>
+        <translation>(Explorer provides a view on MED data sources (mesh and fields) referenced in data space)</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.cxx" line="35"/>
-      <source>DATA_VERIFICATION</source>
-      <translation>Data verification</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.cxx" line="35"/>
+        <source>DATA_VERIFICATION</source>
+        <translation>Data verification</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.cxx" line="36"/>
-      <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.ui" line="391"/>
-      <source>SELECT_MESH</source>
-      <translation>You must select a mesh in the explorer and clic the button Mesh</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.cxx" line="36"/>
+        <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.ui" line="391"/>
+        <source>SELECT_MESH</source>
+        <translation>You must select a mesh in the explorer and clic the button Mesh</translation>
     </message>
-  </context>
-  <context>
+</context>
+<context>
     <name>DlgInterpolateField</name>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="391"/>
-      <source>SELECT_MESH</source>
-      <translation>You must select a mesh in the explorer and clic the button Mesh</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="391"/>
+        <source>SELECT_MESH</source>
+        <translation>You must select a mesh in the explorer and clic the button Mesh</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="406"/>
-      <source>TARGET_MESH_GT</source>
-      <translation>Target mesh -&gt;</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="406"/>
+        <source>TARGET_MESH_GT</source>
+        <translation>Target mesh -&gt;</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="423"/>
-      <source>MSG_EXPLORER</source>
-      <translation>(Explorer provides a view on MED data sources (mesh and fields) referenced in data space)</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="423"/>
+        <source>MSG_EXPLORER</source>
+        <translation>(Explorer provides a view on MED data sources (mesh and fields) referenced in data space)</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="450"/>
-      <source>LABEL_PRECISION</source>
-      <translation>Interpolator precision</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="450"/>
+        <source>LABEL_PRECISION</source>
+        <translation>Interpolator precision</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="493"/>
-      <source>LABEL_INTERSECTION_TYPE</source>
-      <translation>Intersection type</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="493"/>
+        <source>LABEL_INTERSECTION_TYPE</source>
+        <translation>Intersection type</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="520"/>
-      <source>LABEL_METHOD</source>
-      <translation>Interpolation method</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="520"/>
+        <source>LABEL_METHOD</source>
+        <translation>Interpolation method</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="547"/>
-      <source>LABEL_DEFAULT_VALUE</source>
-      <translation>Default value of resulting field</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="547"/>
+        <source>LABEL_DEFAULT_VALUE</source>
+        <translation>Default value of resulting field</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="581"/>
-      <source>LABEL_REVERSE</source>
-      <translation>Reverse interpolation ?</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="581"/>
+        <source>LABEL_REVERSE</source>
+        <translation>Reverse interpolation ?</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="612"/>
-      <source>LABEL_NATURE</source>
-      <translation>Field nature</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="612"/>
+        <source>LABEL_NATURE</source>
+        <translation>Field nature</translation>
     </message>
-  </context>
-  <context>
+</context>
+<context>
     <name>DlgImageToMed</name>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgImageToMed.ui" line="14"/>
-      <source>FORM</source>
-      <translation>Form</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgImageToMed.ui" line="14"/>
+        <source>FORM</source>
+        <translation>Form</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgImageToMed.ui" line="28"/>
-      <source>IMAGE_FILE</source>
-      <translation>Image file:</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgImageToMed.ui" line="28"/>
+        <source>IMAGE_FILE</source>
+        <translation>Image file:</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgImageToMed.ui" line="35"/>
-      <source>MED_FILE</source>
-      <translation>MED file:</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgImageToMed.ui" line="35"/>
+        <source>MED_FILE</source>
+        <translation>MED file:</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="64"/>
-      <source>SELECT_IMAGE_FILE</source>
-      <translation>Select image file</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="64"/>
+        <source>SELECT_IMAGE_FILE</source>
+        <translation>Select image file</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="79"/>
-      <source>SPECIFY_MED_FILE</source>
-      <translation>Specify a MED file</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="79"/>
+        <source>SPECIFY_MED_FILE</source>
+        <translation>Specify a MED file</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgImageToMed.ui" line="82"/>
-      <source>LOAD_AUTOMATICALLY</source>
-      <translation>Load automatically</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgImageToMed.ui" line="82"/>
+        <source>LOAD_AUTOMATICALLY</source>
+        <translation>Load automatically</translation>
     </message>
-  </context>
-  <context>
+</context>
+<context>
     <name>DlgUseInWorkspace</name>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgUseInWorkspace.ui" line="13"/>
-      <source>FORM</source>
-      <translation>Form</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgUseInWorkspace.ui" line="13"/>
+        <source>FORM</source>
+        <translation>Form</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgUseInWorkspace.ui" line="49"/>
-      <source>PRESSURE</source>
-      <translation>Pressure:</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgUseInWorkspace.ui" line="49"/>
+        <source>PRESSURE</source>
+        <translation>Pressure:</translation>
     </message>
     <message utf8="true">
-      <location filename="MEDCALC/gui/dialogs/DlgUseInWorkspace.ui" line="56"/>
-      <source>TEMPERATURE</source>
-      <translation>Temperature:</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgUseInWorkspace.ui" line="56"/>
+        <source>TEMPERATURE</source>
+        <translation>Temperature:</translation>
     </message>
-  </context>
-  <context>
+</context>
+<context>
     <name>GenericDialog</name>
     <message>
-      <location filename="MEDCALC/gui/dialogs/GenericDialog.ui" line="13"/>
-      <source>DIALOG</source>
-      <translation>Dialog</translation>
+        <location filename="MEDCALC/gui/dialogs/GenericDialog.ui" line="13"/>
+        <source>DIALOG</source>
+        <translation>Dialog</translation>
     </message>
-  </context>
-  <context>
+</context>
+<context>
     <name>MEDModule</name>
     <message>
-      <location filename="MEDCALC/gui/MEDModule.cxx" line="68"/>
-      <location filename="MEDCALC/gui/MEDModule.cxx" line="157"/>
-      <source>IMPORT_FROM_FILE</source>
-      <translation>Import from File</translation>
+        <location filename="MEDCALC/gui/MEDModule.cxx" line="68"/>
+        <location filename="MEDCALC/gui/MEDModule.cxx" line="157"/>
+        <source>IMPORT_FROM_FILE</source>
+        <translation>Import from File</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/MEDModule.cxx" line="69"/>
-      <source>IMPORT_MED_FILE</source>
-      <translation>Import MED file</translation>
+        <location filename="MEDCALC/gui/MEDModule.cxx" line="69"/>
+        <source>IMPORT_MED_FILE</source>
+        <translation>Import MED file</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/MEDModule.cxx" line="72"/>
-      <source>MEN_FILE</source>
-      <translation>&amp;File</translation>
+        <location filename="MEDCALC/gui/MEDModule.cxx" line="72"/>
+        <source>MEN_FILE</source>
+        <translation>&amp;File</translation>
     </message>
     <message>
-      <source>PREF_TAB_GENERAL</source>
-      <translation>General</translation>
+        <source>PREF_TAB_GENERAL</source>
+        <translation>General</translation>
     </message>
     <message>
-      <source>PREF_THEME_GROUP</source>
-      <translation>Theme</translation>
+        <source>PREF_THEME_GROUP</source>
+        <translation>Theme</translation>
     </message>
     <message>
-      <source>PREF_ICONS</source>
-      <translation>Icons</translation>
+        <source>PREF_ICONS</source>
+        <translation>Icons</translation>
     </message>
     <message>
-      <source>PREF_ICON_THEME_MODERN</source>
-      <translation>Modern</translation>
+        <source>PREF_ICON_THEME_MODERN</source>
+        <translation>Modern</translation>
     </message>
     <message>
-      <source>PREF_ICON_THEME_CLASSIC</source>
-      <translation>Classic</translation>
+        <source>PREF_ICON_THEME_CLASSIC</source>
+        <translation>Classic</translation>
     </message>
-  </context>
-  <context>
+</context>
+<context>
     <name>WorkspaceController</name>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="66"/>
-      <source>VISUALIZE_SCALAR_MAP</source>
-      <translation>Visualize (scalar map)</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="66"/>
+        <source>VISUALIZE_SCALAR_MAP</source>
+        <translation>Visualize (scalar map)</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="67"/>
-      <source>USE_IN_CONSOLE</source>
-      <translation>Use (in console)</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="67"/>
+        <source>USE_IN_CONSOLE</source>
+        <translation>Use (in console)</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="68"/>
-      <source>EXPORT_TO_PARAVIS</source>
-      <translation>Export (to PARAVIS)</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="68"/>
+        <source>EXPORT_TO_PARAVIS</source>
+        <translation>Export (to PARAVIS)</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="69"/>
-      <source>SAVE_AS_MED</source>
-      <translation>Save (as MED file)</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="69"/>
+        <source>SAVE_AS_MED</source>
+        <translation>Save (as MED file)</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="70"/>
-      <source>REMOVE_FROM_WORKSPACE</source>
-      <translation>Remove (from workspace)</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="70"/>
+        <source>REMOVE_FROM_WORKSPACE</source>
+        <translation>Remove (from workspace)</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="91"/>
-      <source>LAB_SAVE_WORKSPACE</source>
-      <translation>Save workspace</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="91"/>
+        <source>LAB_SAVE_WORKSPACE</source>
+        <translation>Save workspace</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="92"/>
-      <source>TIP_SAVE_WORKSPACE</source>
-      <translation>Save the workspace (fields and meshes) in a MED file</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="92"/>
+        <source>TIP_SAVE_WORKSPACE</source>
+        <translation>Save the workspace (fields and meshes) in a MED file</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="97"/>
-      <source>LAB_CLEAN_WORKSPACE</source>
-      <translation>Clean workspace</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="97"/>
+        <source>LAB_CLEAN_WORKSPACE</source>
+        <translation>Clean workspace</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="98"/>
-      <source>TIP_CLEAN_WORKSPACE</source>
-      <translation>Clean all data in the workspace</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="98"/>
+        <source>TIP_CLEAN_WORKSPACE</source>
+        <translation>Clean all data in the workspace</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="271"/>
-      <source>SAVE_SELECTED_FIELDS</source>
-      <translation>Save selected fields</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="271"/>
+        <source>SAVE_SELECTED_FIELDS</source>
+        <translation>Save selected fields</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="425"/>
-      <source>SAVE_WORKSPACE_DATA</source>
-      <translation>Save workspace data</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="425"/>
+        <source>SAVE_WORKSPACE_DATA</source>
+        <translation>Save workspace data</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="439"/>
-      <source>NOT_IMPLEMENTED_YET</source>
-      <translation>Not implemented yet</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="439"/>
+        <source>NOT_IMPLEMENTED_YET</source>
+        <translation>Not implemented yet</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="440"/>
-      <source>FUNCTION_NOT_IMPLEMENTED</source>
-      <translation>This function is not implemented yet</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="440"/>
+        <source>FUNCTION_NOT_IMPLEMENTED</source>
+        <translation>This function is not implemented yet</translation>
     </message>
-  </context>
-  <context>
+</context>
+<context>
     <name>@default</name>
     <message>
-      <location filename="MEDCALC/gui/MEDModule.cxx" line="151"/>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="152"/>
-      <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="75"/>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="267"/>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="420"/>
-      <source>FILE_FILTER_MED</source>
-      <translation>MED files (*.med)</translation>
-    </message>
-    <message>
-      <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="57"/>
-      <source>FILE_FILTER_PNG</source>
-      <translation>PNG image (*.png)</translation>
-    </message>
-    <message>
-      <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="58"/>
-      <source>FILE_FILTER_JPG</source>
-      <translation>JPG image (*.jpg)</translation>
+        <location filename="MEDCALC/gui/MEDModule.cxx" line="151"/>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="152"/>
+        <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="75"/>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="267"/>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="420"/>
+        <source>FILE_FILTER_MED</source>
+        <translation>MED files (*.med)</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="59"/>
-      <source>FILE_FILTER_PGM</source>
-      <translation>PGM image (*.jpg)</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="57"/>
+        <source>FILE_FILTER_PNG</source>
+        <translation>PNG image (*.png)</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="60"/>
-      <source>FILE_FILTER_ALL</source>
-      <translation>All files (*.*)</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="58"/>
+        <source>FILE_FILTER_JPG</source>
+        <translation>JPG image (*.jpg)</translation>
     </message>
     <message>
-      <source>LAB_VIEW_MODE</source>
-      <translation>View mode:</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="59"/>
+        <source>FILE_FILTER_PGM</source>
+        <translation>PGM image (*.jpg)</translation>
     </message>
     <message>
-      <source>LAB_VIEW_MODE_REPLACE</source>
-      <translation>Replace</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="60"/>
+        <source>FILE_FILTER_ALL</source>
+        <translation>All files (*.*)</translation>
     </message>
     <message>
-      <source>LAB_VIEW_MODE_OVERLAP</source>
-      <translation>Overlap</translation>
+        <source>LAB_VIEW_MODE</source>
+        <translation>View mode:</translation>
     </message>
     <message>
-      <source>LAB_VIEW_MODE_NEW_LAYOUT</source>
-      <translation>New layout</translation>
+        <source>LAB_VIEW_MODE_REPLACE</source>
+        <translation>Replace</translation>
     </message>
     <message>
-      <source>LAB_VIEW_MODE_SPLIT_VIEW</source>
-      <translation>Split</translation>
+        <source>LAB_VIEW_MODE_OVERLAP</source>
+        <translation>Overlap</translation>
     </message>
     <message>
-      <source>LAB_BLUE_TO_RED</source>
-      <translation>Blue to red rainbow</translation>
+        <source>LAB_VIEW_MODE_NEW_LAYOUT</source>
+        <translation>New layout</translation>
     </message>
     <message>
-      <source>LAB_COOL_TO_WARM</source>
-      <translation>Cool to warm</translation>
+        <source>LAB_VIEW_MODE_SPLIT_VIEW</source>
+        <translation>Split</translation>
     </message>
-  </context>
+</context>
 </TS>
index be5cf5ba24fab3212d5df99fa3b558ccbea45202..8b92efa4b66d3098fddcbe744f2bab9c6bcfe6b3 100644 (file)
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
-<TS version="2.0">
-  <context>
+<TS version="2.0" language="fr">
+<context>
     <name>PresentationController</name>
     <message>
-      <source>TITLE_PRESENTATION_PARAMETERS</source>
-      <translation>Paramètres de presentation</translation>
+        <source>TITLE_PRESENTATION_PARAMETERS</source>
+        <translation>Paramètres de presentation</translation>
     </message>
     <message>
-      <source>LAB_PRESENTATION_SCALAR_MAP</source>
-      <translation>Carte scalaire</translation>
+        <source>LAB_PRESENTATION_MESH_VIEW</source>
+        <translation>Maillage</translation>
     </message>
     <message>
-      <source>TIP_PRESENTATION_SCALAR_MAP</source>
-      <translation>Carte scalaire</translation>
+        <source>TIP_PRESENTATION_MESH_VIEW</source>
+        <translation>Maillage</translation>
     </message>
     <message>
-      <source>LAB_PRESENTATION_CONTOUR</source>
-      <translation>Contour</translation>
+        <source>LAB_PRESENTATION_SCALAR_MAP</source>
+        <translation>Carte scalaire</translation>
     </message>
     <message>
-      <source>TIP_PRESENTATION_CONTOUR</source>
-      <translation>Contour</translation>
+        <source>TIP_PRESENTATION_SCALAR_MAP</source>
+        <translation>Carte scalaire</translation>
     </message>
     <message>
-      <source>LAB_PRESENTATION_VECTOR_FIELD</source>
-      <translation>Champ de vecteurs</translation>
+        <source>LAB_PRESENTATION_CONTOUR</source>
+        <translation>Contour</translation>
     </message>
     <message>
-      <source>TIP_PRESENTATION_VECTOR_FIELD</source>
-      <translation>Champ de vecteurs</translation>
+        <source>TIP_PRESENTATION_CONTOUR</source>
+        <translation>Contour</translation>
     </message>
     <message>
-      <source>LAB_PRESENTATION_SLICES</source>
-      <translation>Coupes</translation>
+        <source>LAB_PRESENTATION_VECTOR_FIELD</source>
+        <translation>Champ de vecteurs</translation>
     </message>
     <message>
-      <source>TIP_PRESENTATION_SLICES</source>
-      <translation>Coupes</translation>
+        <source>TIP_PRESENTATION_VECTOR_FIELD</source>
+        <translation>Champ de vecteurs</translation>
     </message>
     <message>
-      <source>LAB_PRESENTATION_DEFLECTION_SHAPE</source>
-      <translation>Déformée</translation>
+        <source>LAB_PRESENTATION_SLICES</source>
+        <translation>Coupes</translation>
     </message>
     <message>
-      <source>TIP_PRESENTATION_DEFLECTION_SHAPE</source>
-      <translation>Déformée</translation>
+        <source>TIP_PRESENTATION_SLICES</source>
+        <translation>Coupes</translation>
     </message>
     <message>
-      <source>LAB_PRESENTATION_POINT_SPRITE</source>
-      <translation>Point sprite</translation>
+        <source>LAB_PRESENTATION_DEFLECTION_SHAPE</source>
+        <translation>Déformée</translation>
     </message>
     <message>
-      <source>TIP_PRESENTATION_POINT_SPRITE</source>
-      <translation>Point sprite</translation>
+        <source>TIP_PRESENTATION_DEFLECTION_SHAPE</source>
+        <translation>Déformée</translation>
     </message>
     <message>
-      <source>MENU_PRESENTATIONS</source>
-      <translation>Présentations</translation>
+        <source>LAB_PRESENTATION_POINT_SPRITE</source>
+        <translation>Point sprite</translation>
     </message>
     <message>
-      <source>MEDPresentationScalarMap</source>
-      <translation>Carte scalaire</translation>
+        <source>TIP_PRESENTATION_POINT_SPRITE</source>
+        <translation>Point sprite</translation>
     </message>
     <message>
-      <source>MEDPresentationContour</source>
-      <translation>Contour</translation>
+        <source>LAB_DELETE_PRESENTATION</source>
+        <translation>Supprimer</translation>
     </message>
     <message>
-      <source>MEDPresentationVectorField</source>
-      <translation>Champ de vecteurs</translation>
+        <source>TIP_DELETE_PRESENTATION</source>
+        <translation>Supprime la présentation sélectionnée</translation>
     </message>
     <message>
-      <source>MEDPresentationSlices</source>
-      <translation>Coupes</translation>
+        <source>LAB_PARAVIS_DUMP</source>
+        <translation>Trace du pipeline</translation>
     </message>
     <message>
-      <source>MEDPresentationDeflectionShape</source>
-      <translation>Déformée</translation>
+        <source>TIP_PARAVIS_DUMP</source>
+        <translation>Affiche les commandes Python bas niveau de la présentation</translation>
     </message>
     <message>
-      <source>MEDPresentationPointSprite</source>
-      <translation>Point sprite</translation>
+        <source>MENU_PRESENTATIONS</source>
+        <translation>Présentations</translation>
     </message>
-  </context>
-  <context>
+    <message>
+        <source>MEDPresentationMeshView</source>
+        <translation>Maillage</translation>
+    </message>
+    <message>
+        <source>MEDPresentationScalarMap</source>
+        <translation>Carte scalaire</translation>
+    </message>
+    <message>
+        <source>MEDPresentationContour</source>
+        <translation>Contour</translation>
+    </message>
+    <message>
+        <source>MEDPresentationVectorField</source>
+        <translation>Champ de vecteurs</translation>
+    </message>
+    <message>
+        <source>MEDPresentationSlices</source>
+        <translation>Coupes</translation>
+    </message>
+    <message>
+        <source>MEDPresentationDeflectionShape</source>
+        <translation>Déformée</translation>
+    </message>
+    <message>
+        <source>MEDPresentationPointSprite</source>
+        <translation>Point sprite</translation>
+    </message>
+</context>
+<context>
     <name>ProcessingController</name>
     <message>
-      <source>MENU_PROCESSING</source>
-      <translation>Traitement</translation>
+        <source>MENU_PROCESSING</source>
+        <translation>Traitement</translation>
     </message>
     <message>
-      <source>LAB_PROCESSING_CHANGE_MESH</source>
-      <translation>Changer le maillage sous-jacent</translation>
+        <source>LAB_PROCESSING_CHANGE_MESH</source>
+        <translation>Changer le maillage sous-jacent</translation>
     </message>
     <message>
-      <source>LAB_PROCESSING_INTERPOLATE_FIELD</source>
-      <translation>Interpoler le champ</translation>
+        <source>LAB_PROCESSING_INTERPOLATE_FIELD</source>
+        <translation>Interpoler le champ</translation>
     </message>
-  </context>
-  <context>
+</context>
+<context>
     <name>DatasourceController</name>
     <message>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="45"/>
-      <source>LAB_ADD_DATA_SOURCE</source>
-      <translation>Importer des données MED</translation>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="45"/>
+        <source>LAB_ADD_DATA_SOURCE</source>
+        <translation>Importer des données MED</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="46"/>
-      <source>TIP_ADD_DATA_SOURCE</source>
-      <translation>Ajouter des données par import de fichiers MED</translation>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="46"/>
+        <source>TIP_ADD_DATA_SOURCE</source>
+        <translation>Ajouter des données par import de fichiers MED</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="52"/>
-      <source>LAB_ADD_IMAGE_SOURCE</source>
-      <translation>Ajouter une image</translation>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="52"/>
+        <source>LAB_ADD_IMAGE_SOURCE</source>
+        <translation>Ajouter une image</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="53"/>
-      <source>TIP_ADD_IMAGE_SOURCE</source>
-      <translation>Ajouter des données par import d'un fichier image</translation>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="53"/>
+        <source>TIP_ADD_IMAGE_SOURCE</source>
+        <translation>Ajouter des données par import d&apos;un fichier image</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="62"/>
-      <source>LAB_EXPAND_FIELD</source>
-      <translation>Étendre les series temporelles du champ</translation>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="62"/>
+        <source>LAB_EXPAND_FIELD</source>
+        <translation>Étendre les series temporelles du champ</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="75"/>
-      <source>LAB_USE_IN_WORKSPACE</source>
-      <translation>Utiliser dans l'espace de travail</translation>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="75"/>
+        <source>LAB_USE_IN_WORKSPACE</source>
+        <translation>Utiliser dans l&apos;espace de travail</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="157"/>
-      <source>IMPORT_MED_FIELDS</source>
-      <translation>Importer des champs (format MED)</translation>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="157"/>
+        <source>IMPORT_MED_FIELDS</source>
+        <translation>Importer des champs (format MED)</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="191"/>
-      <source>OPERATION_FAILED</source>
-      <translation>L'opération a échoué</translation>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="191"/>
+        <source>OPERATION_FAILED</source>
+        <translation>L&apos;opération a échoué</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="192"/>
-      <source>CREATION_FAILED</source>
-      <translation>La création des données MED à partir d'un fichier image a échoué</translation>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="192"/>
+        <source>CREATION_FAILED</source>
+        <translation>La création des données MED à partir d&apos;un fichier image a échoué</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="283"/>
-      <source>OPERATION_NOT_ALLOWED</source>
-      <translation>Opération non autorisée</translation>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="283"/>
+        <source>OPERATION_NOT_ALLOWED</source>
+        <translation>Opération non autorisée</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="284"/>
-      <source>FIELD_ALREADY_DEFINED</source>
-      <translation>Ce champ est déjà défini dans l'espace de travail</translation>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="284"/>
+        <source>FIELD_ALREADY_DEFINED</source>
+        <translation>Ce champ est déjà défini dans l&apos;espace de travail</translation>
     </message>
-  </context>
-  <context>
+</context>
+<context>
     <name>WidgetPresentationParameters</name>
     <message>
-      <source>LAB_DISP_COMP</source>
-      <translation>Composante affichée :</translation>
+        <source>LAB_DEFAULT_DYN_TITLE</source>
+        <translation>Paramètres par défaut</translation>
+    </message>    
+    <message>
+        <source>LAB_DISP_COMP</source>
+        <translation>Composante affichée :</translation>
+    </message>
+    <message>
+        <source>LAB_EUCLIDEAN_NORM</source>
+        <translation>Norme euclidienne</translation>
     </message>
     <message>
-      <source>LAB_EUCLIDEAN_NORM</source>
-      <translation>Norme euclidienne</translation>
+        <source>LAB_SCALARBAR</source>
+        <translation>Echelle de valeurs :</translation>
     </message>
     <message>
-      <source>LAB_SCALARBAR</source>
-      <translation>Echelle de valeurs :</translation>
+        <source>LAB_RANGE</source>
+        <translation>Intervalle :</translation>
     </message>
     <message>
-      <source>LAB_RANGE</source>
-      <translation>Intervalle :</translation>
+        <source>LAB_ALL_TIMESTEPS</source>
+        <translation>Tous les pas de temps</translation>
     </message>
     <message>
-      <source>LAB_ALL_TIMESTEPS</source>
-      <translation>Tous les pas de temps</translation>
+        <source>LAB_CURRENT_TIMESTEP</source>
+        <translation>Pas de temps courant</translation>
     </message>
     <message>
-      <source>LAB_CURRENT_TIMESTEP</source>
-      <translation>Pas de temps courant</translation>
+        <source>LAB_USER_RANGE</source>
+        <translation>Personnalisé :</translation>
     </message>
     <message>
-      <source>LAB_USER_RANGE</source>
-      <translation>Personnalisé :</translation>
+        <source>LAB_TIMESTEP</source>
+        <translation>Pas de temps :</translation>
     </message>
     <message>
-      <source>LAB_TIMESTEP</source>
-      <translation>Pas de temps :</translation>
+        <source>LAB_MIN_VALUE</source>
+        <translation>Valeur min :</translation>
     </message>
     <message>
-      <source>LAB_MIN_VALUE</source>
-      <translation>Valeur min :</translation>
+        <source>LAB_MAX_VALUE</source>
+        <translation>Valeur max :</translation>
     </message>
     <message>
-      <source>LAB_MAX_VALUE</source>
-      <translation>Valeur max :</translation>
+        <source>LAB_COLOR_MAP</source>
+        <translation>Table de couleurs :</translation>
     </message>
     <message>
-      <source>LAB_COLOR_MAP</source>
-      <translation>Table de couleurs :</translation>
+        <source>LAB_MESH_WIREFRAME</source>
+        <translation>Fil de fer</translation>
     </message>
     <message>
-      <source>LAB_BLUE_TO_RED</source>
-      <translation>Arc-en-ciel bleu vers rouge</translation>
+        <source>LAB_MESH_SURFACE</source>
+        <translation>Surface</translation>
+    </message>
+    <message>
+        <source>LAB_MESH_SURF_EDGES</source>
+        <translation>Surface Avec Arrêtes</translation>
+    </message>
+    <message>
+        <source>LAB_DISP_MESH_MODE</source>
+        <translation>Affichage du maillage:</translation>
+    </message>
+    <message>
+        <source>LAB_NB_CONTOURS</source>
+        <translation>Nombre de contours (max. %1) :</translation>
+    </message>
+    <message>
+        <source>LAB_NB_SLICES</source>
+        <translation>Nombres de coupes (max. %1) :</translation>
+    </message>
+    <message>
+        <source>LAB_SPINBOX_TOOLTIP</source>
+        <translation>Taper &apos;Entrée&apos; pour appliquer</translation>
+    </message>    
+    <message>
+        <source>LAB_SLICE_ORIENT</source>
+        <translation>Orientation des coupes:</translation>
+    </message>
+    <message>
+        <source>LAB_SLICE_NORMAL_TO_X</source>
+        <translation>Normale à X</translation>
+    </message>
+    <message>
+        <source>LAB_SLICE_NORMAL_TO_Y</source>
+        <translation>Normale à Y</translation>
+    </message>
+    <message>
+        <source>LAB_SLICE_NORMAL_TO_Z</source>
+        <translation>Normale à Z</translation>
+    </message>
+    <message>
+        <source>LAB_SLICE_NORMAL_TO_XY</source>
+        <translation>Normale à XY</translation>
+    </message>
+    <message>
+        <source>LAB_SLICE_NORMAL_TO_XZ</source>
+        <translation>Normale à XZ</translation>
+    </message>
+    <message>
+        <source>LAB_SLICE_NORMAL_TO_YZ</source>
+        <translation>Normale à YZ</translation>
+    </message>
+    <message>
+        <source>LAB_SLICE_NORMAL_TO_XYZ</source>
+        <translation>Normale à XYZ</translation>
+    </message>    
+    <message>
+        <source>LAB_BLUE_TO_RED</source>
+        <translation>Arc-en-ciel bleu vers rouge</translation>
     </message>
     <message>
-      <source>LAB_COOL_TO_WARM</source>
-      <translation>Froid vers chaud</translation>
+        <source>LAB_COOL_TO_WARM</source>
+        <translation>Froid vers chaud</translation>
     </message>
-  </context>
-  <context>
+</context>
+<context>
     <name>DlgAlias</name>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgAlias.ui" line="14"/>
-      <source>SELECT_AN_ALIAS_FOR_THE_FIELD</source>
-      <translation>Selectionner un alias pour ce champ</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgAlias.ui" line="14"/>
+        <source>SELECT_AN_ALIAS_FOR_THE_FIELD</source>
+        <translation>Selectionner un alias pour ce champ</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgAlias.ui" line="401"/>
-      <source>DEFINE_AN_ALIAS</source>
-      <translation>Vous pouvez définir un alias pour manipuler le champs dans la console:</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgAlias.ui" line="401"/>
+        <source>DEFINE_AN_ALIAS</source>
+        <translation>Vous pouvez définir un alias pour manipuler le champs dans la console:</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgAlias.ui" line="419"/>
-      <source>ALIAS</source>
-      <translation>Alias</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgAlias.ui" line="419"/>
+        <source>ALIAS</source>
+        <translation>Alias</translation>
     </message>
     <message utf8="true">
-      <location filename="MEDCALC/gui/dialogs/DlgAlias.ui" line="436"/>
-      <source>MSG_OPERATION_DEFINES_VARIABLE</source>
-      <translation>(cette opération définit une variable nommée &lt;alias&gt; dans la console texte. Tapez &quot;&lt;alias&gt;.help()&quot; pour voir les fonctions disponibles, ou simplement &quot;doc&quot;)</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgAlias.ui" line="436"/>
+        <source>MSG_OPERATION_DEFINES_VARIABLE</source>
+        <translation>(cette opération définit une variable nommée &lt;alias&gt; dans la console texte. Tapez &quot;&lt;alias&gt;.help()&quot; pour voir les fonctions disponibles, ou simplement &quot;doc&quot;)</translation>
     </message>
-  </context>
-  <context>
+</context>
+<context>
     <name>DlgChangeUnderlyingMesh</name>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.ui" line="14"/>
-      <source>FORM</source>
-      <translation>Formulaire</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.ui" line="14"/>
+        <source>FORM</source>
+        <translation>Formulaire</translation>
     </message>
     <message utf8="true">
-      <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.ui" line="403"/>
-      <source>MESH_GT</source>
-      <translation>Maillage -&gt;</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.ui" line="403"/>
+        <source>MESH_GT</source>
+        <translation>Maillage -&gt;</translation>
     </message>
     <message utf8="true">
-      <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.ui" line="420"/>
-      <source>MSG_EXPLORER</source>
-      <translation>(L'explorateur fournit une vue des données MED (maillage et champs) référencées dans l'espace des données)</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.ui" line="420"/>
+        <source>MSG_EXPLORER</source>
+        <translation>(L&apos;explorateur fournit une vue des données MED (maillage et champs) référencées dans l&apos;espace des données)</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.cxx" line="35"/>
-      <source>DATA_VERIFICATION</source>
-      <translation>Vérification des données</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.cxx" line="35"/>
+        <source>DATA_VERIFICATION</source>
+        <translation>Vérification des données</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.cxx" line="36"/>
-      <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.ui" line="391"/>
-      <source>SELECT_MESH</source>
-      <translation>Vous devez sélectionner un maillage dans l'explorateur et cliquer sur le bouton Maillage</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.cxx" line="36"/>
+        <location filename="MEDCALC/gui/dialogs/DlgChangeUnderlyingMesh.ui" line="391"/>
+        <source>SELECT_MESH</source>
+        <translation>Vous devez sélectionner un maillage dans l&apos;explorateur et cliquer sur le bouton Maillage</translation>
     </message>
-  </context>
-  <context>
+</context>
+<context>
     <name>DlgInterpolateField</name>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="391"/>
-      <source>SELECT_MESH</source>
-      <translation>Vous devez sélectionner un maillage dans l'explorateur et cliquer sur le bouton Maillage</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="391"/>
+        <source>SELECT_MESH</source>
+        <translation>Vous devez sélectionner un maillage dans l&apos;explorateur et cliquer sur le bouton Maillage</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="406"/>
-      <source>TARGET_MESH_GT</source>
-      <translation>Maillage cible -&gt;</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="406"/>
+        <source>TARGET_MESH_GT</source>
+        <translation>Maillage cible -&gt;</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="423"/>
-      <source>MSG_EXPLORER</source>
-      <translation>(L'explorateur fournit une vue des données MED (maillage et champs) référencées dans l'espace des données)</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="423"/>
+        <source>MSG_EXPLORER</source>
+        <translation>(L&apos;explorateur fournit une vue des données MED (maillage et champs) référencées dans l&apos;espace des données)</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="450"/>
-      <source>LABEL_PRECISION</source>
-      <translation>Précision de l'interpolateur</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="450"/>
+        <source>LABEL_PRECISION</source>
+        <translation>Précision de l&apos;interpolateur</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="493"/>
-      <source>LABEL_INTERSECTION_TYPE</source>
-      <translation>Type d'intersection</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="493"/>
+        <source>LABEL_INTERSECTION_TYPE</source>
+        <translation>Type d&apos;intersection</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="520"/>
-      <source>LABEL_METHOD</source>
-      <translation>Méthode d'interpolation</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="520"/>
+        <source>LABEL_METHOD</source>
+        <translation>Méthode d&apos;interpolation</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="547"/>
-      <source>LABEL_DEFAULT_VALUE</source>
-      <translation>Valeur par défaut du champ résultant</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="547"/>
+        <source>LABEL_DEFAULT_VALUE</source>
+        <translation>Valeur par défaut du champ résultant</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="581"/>
-      <source>LABEL_REVERSE</source>
-      <translation>Interpolation inverse ?</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="581"/>
+        <source>LABEL_REVERSE</source>
+        <translation>Interpolation inverse ?</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="612"/>
-      <source>LABEL_NATURE</source>
-      <translation>Nature du champ</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgInterpolateField.ui" line="612"/>
+        <source>LABEL_NATURE</source>
+        <translation>Nature du champ</translation>
     </message>
-  </context>
-  <context>
+</context>
+<context>
     <name>DlgImageToMed</name>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgImageToMed.ui" line="14"/>
-      <source>FORM</source>
-      <translation>Formulaire</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgImageToMed.ui" line="14"/>
+        <source>FORM</source>
+        <translation>Formulaire</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgImageToMed.ui" line="28"/>
-      <source>IMAGE_FILE</source>
-      <translation>Fichier image :</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgImageToMed.ui" line="28"/>
+        <source>IMAGE_FILE</source>
+        <translation>Fichier image :</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgImageToMed.ui" line="35"/>
-      <source>MED_FILE</source>
-      <translation>Fichier MED :</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgImageToMed.ui" line="35"/>
+        <source>MED_FILE</source>
+        <translation>Fichier MED :</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="64"/>
-      <source>SELECT_IMAGE_FILE</source>
-      <translation>Selectionner un fichier image</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="64"/>
+        <source>SELECT_IMAGE_FILE</source>
+        <translation>Selectionner un fichier image</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="79"/>
-      <source>SPECIFY_MED_FILE</source>
-      <translation>Spécifier un fichier MED</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="79"/>
+        <source>SPECIFY_MED_FILE</source>
+        <translation>Spécifier un fichier MED</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgImageToMed.ui" line="82"/>
-      <source>LOAD_AUTOMATICALLY</source>
-      <translation>Charger automatiquement</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgImageToMed.ui" line="82"/>
+        <source>LOAD_AUTOMATICALLY</source>
+        <translation>Charger automatiquement</translation>
     </message>
-  </context>
-  <context>
+</context>
+<context>
     <name>DlgUseInWorkspace</name>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgUseInWorkspace.ui" line="13"/>
-      <source>FORM</source>
-      <translation>Formulaire</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgUseInWorkspace.ui" line="13"/>
+        <source>FORM</source>
+        <translation>Formulaire</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgUseInWorkspace.ui" line="49"/>
-      <source>PRESSURE</source>
-      <translation>Pression :</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgUseInWorkspace.ui" line="49"/>
+        <source>PRESSURE</source>
+        <translation>Pression :</translation>
     </message>
     <message utf8="true">
-      <location filename="MEDCALC/gui/dialogs/DlgUseInWorkspace.ui" line="56"/>
-      <source>TEMPERATURE</source>
-      <translation>Température :</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgUseInWorkspace.ui" line="56"/>
+        <source>TEMPERATURE</source>
+        <translation>Température :</translation>
     </message>
-  </context>
-  <context>
+</context>
+<context>
     <name>GenericDialog</name>
     <message>
-      <location filename="MEDCALC/gui/dialogs/GenericDialog.ui" line="13"/>
-      <source>DIALOG</source>
-      <translation>Dialogue</translation>
+        <location filename="MEDCALC/gui/dialogs/GenericDialog.ui" line="13"/>
+        <source>DIALOG</source>
+        <translation>Dialogue</translation>
     </message>
-  </context>
-  <context>
+</context>
+<context>
     <name>MEDModule</name>
     <message>
-      <location filename="MEDCALC/gui/MEDModule.cxx" line="68"/>
-      <location filename="MEDCALC/gui/MEDModule.cxx" line="157"/>
-      <source>IMPORT_FROM_FILE</source>
-      <translation>Importer depuis un fichier</translation>
+        <location filename="MEDCALC/gui/MEDModule.cxx" line="68"/>
+        <location filename="MEDCALC/gui/MEDModule.cxx" line="157"/>
+        <source>IMPORT_FROM_FILE</source>
+        <translation>Importer depuis un fichier</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/MEDModule.cxx" line="69"/>
-      <source>IMPORT_MED_FILE</source>
-      <translation>Importer un fichier MED</translation>
+        <location filename="MEDCALC/gui/MEDModule.cxx" line="69"/>
+        <source>IMPORT_MED_FILE</source>
+        <translation>Importer un fichier MED</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/MEDModule.cxx" line="72"/>
-      <source>MEN_FILE</source>
-      <translation>&amp;Fichier</translation>
+        <location filename="MEDCALC/gui/MEDModule.cxx" line="72"/>
+        <source>MEN_FILE</source>
+        <translation>&amp;Fichier</translation>
     </message>
     <message>
-      <source>PREF_TAB_GENERAL</source>
-      <translation>Général</translation>
+        <source>PREF_TAB_GENERAL</source>
+        <translation>Général</translation>
     </message>
     <message>
-      <source>PREF_THEME_GROUP</source>
-      <translation>Thème</translation>
+        <source>PREF_THEME_GROUP</source>
+        <translation>Thème</translation>
     </message>
     <message>
-      <source>PREF_ICONS</source>
-      <translation>Icones</translation>
+        <source>PREF_ICONS</source>
+        <translation>Icones</translation>
     </message>
     <message>
-      <source>PREF_ICON_THEME_MODERN</source>
-      <translation>Moderne</translation>
+        <source>PREF_ICON_THEME_MODERN</source>
+        <translation>Moderne</translation>
     </message>
     <message>
-      <source>PREF_ICON_THEME_CLASSIC</source>
-      <translation>Classique</translation>
+        <source>PREF_ICON_THEME_CLASSIC</source>
+        <translation>Classique</translation>
     </message>
-  </context>
-  <context>
+</context>
+<context>
     <name>WorkspaceController</name>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="66"/>
-      <source>VISUALIZE_SCALAR_MAP</source>
-      <translation>Visualiser (carte scalaire)</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="66"/>
+        <source>VISUALIZE_SCALAR_MAP</source>
+        <translation>Visualiser (carte scalaire)</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="67"/>
-      <source>USE_IN_CONSOLE</source>
-      <translation>Utiliser (dans la console)</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="67"/>
+        <source>USE_IN_CONSOLE</source>
+        <translation>Utiliser (dans la console)</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="68"/>
-      <source>EXPORT_TO_PARAVIS</source>
-      <translation>Exporter (vers PARAVIS)</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="68"/>
+        <source>EXPORT_TO_PARAVIS</source>
+        <translation>Exporter (vers PARAVIS)</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="69"/>
-      <source>SAVE_AS_MED</source>
-      <translation>Sauvegarder (dans un fichier MED)</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="69"/>
+        <source>SAVE_AS_MED</source>
+        <translation>Sauvegarder (dans un fichier MED)</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="70"/>
-      <source>REMOVE_FROM_WORKSPACE</source>
-      <translation>Supprimer (de l'espace de travail)</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="70"/>
+        <source>REMOVE_FROM_WORKSPACE</source>
+        <translation>Supprimer (de l&apos;espace de travail)</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="91"/>
-      <source>LAB_SAVE_WORKSPACE</source>
-      <translation>Sauvegarder l'espace de travail</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="91"/>
+        <source>LAB_SAVE_WORKSPACE</source>
+        <translation>Sauvegarder l&apos;espace de travail</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="92"/>
-      <source>TIP_SAVE_WORKSPACE</source>
-      <translation>Sauvegarder l'espace de travail (champs et maillages) dans un fichier MED</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="92"/>
+        <source>TIP_SAVE_WORKSPACE</source>
+        <translation>Sauvegarder l&apos;espace de travail (champs et maillages) dans un fichier MED</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="97"/>
-      <source>LAB_CLEAN_WORKSPACE</source>
-      <translation>Nettoyer l'espace de travail</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="97"/>
+        <source>LAB_CLEAN_WORKSPACE</source>
+        <translation>Nettoyer l&apos;espace de travail</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="98"/>
-      <source>TIP_CLEAN_WORKSPACE</source>
-      <translation>Effacer toute les données de l'espace de travail</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="98"/>
+        <source>TIP_CLEAN_WORKSPACE</source>
+        <translation>Effacer toute les données de l&apos;espace de travail</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="271"/>
-      <source>SAVE_SELECTED_FIELDS</source>
-      <translation>Sauvegarder les champs sélectionnés</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="271"/>
+        <source>SAVE_SELECTED_FIELDS</source>
+        <translation>Sauvegarder les champs sélectionnés</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="425"/>
-      <source>SAVE_WORKSPACE_DATA</source>
-      <translation>Sauvegarder les données de l'espace de travail</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="425"/>
+        <source>SAVE_WORKSPACE_DATA</source>
+        <translation>Sauvegarder les données de l&apos;espace de travail</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="439"/>
-      <source>NOT_IMPLEMENTED_YET</source>
-      <translation>Non implémenté</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="439"/>
+        <source>NOT_IMPLEMENTED_YET</source>
+        <translation>Non implémenté</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="440"/>
-      <source>FUNCTION_NOT_IMPLEMENTED</source>
-      <translation>Cette function n'est pas encore implémentée</translation>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="440"/>
+        <source>FUNCTION_NOT_IMPLEMENTED</source>
+        <translation>Cette function n&apos;est pas encore implémentée</translation>
     </message>
-  </context>
-  <context>
+</context>
+<context>
     <name>@default</name>
     <message>
-      <location filename="MEDCALC/gui/MEDModule.cxx" line="151"/>
-      <location filename="MEDCALC/gui/DatasourceController.cxx" line="152"/>
-      <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="75"/>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="267"/>
-      <location filename="MEDCALC/gui/WorkspaceController.cxx" line="420"/>
-      <source>FILE_FILTER_MED</source>
-      <translation>Fichiers MED (*.med)</translation>
+        <location filename="MEDCALC/gui/MEDModule.cxx" line="151"/>
+        <location filename="MEDCALC/gui/DatasourceController.cxx" line="152"/>
+        <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="75"/>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="267"/>
+        <location filename="MEDCALC/gui/WorkspaceController.cxx" line="420"/>
+        <source>FILE_FILTER_MED</source>
+        <translation>Fichiers MED (*.med)</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="57"/>
-      <source>FILE_FILTER_PNG</source>
-      <translation>Image PNG (*.png)</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="57"/>
+        <source>FILE_FILTER_PNG</source>
+        <translation>Image PNG (*.png)</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="58"/>
-      <source>FILE_FILTER_JPG</source>
-      <translation>Image JPG (*.jpg)</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="58"/>
+        <source>FILE_FILTER_JPG</source>
+        <translation>Image JPG (*.jpg)</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="59"/>
-      <source>FILE_FILTER_PGM</source>
-      <translation>Image PGM (*.jpg)</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="59"/>
+        <source>FILE_FILTER_PGM</source>
+        <translation>Image PGM (*.jpg)</translation>
     </message>
     <message>
-      <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="60"/>
-      <source>FILE_FILTER_ALL</source>
-      <translation>Tous les fichiers (*.*)</translation>
+        <location filename="MEDCALC/gui/dialogs/DlgImageToMed.cxx" line="60"/>
+        <source>FILE_FILTER_ALL</source>
+        <translation>Tous les fichiers (*.*)</translation>
     </message>
     <message>
-      <source>LAB_VIEW_MODE</source>
-      <translation>Mode de rendu :</translation>
+        <source>LAB_VIEW_MODE</source>
+        <translation>Mode de rendu :</translation>
     </message>
     <message>
-      <source>LAB_VIEW_MODE_REPLACE</source>
-      <translation>Remplacer</translation>
+        <source>LAB_VIEW_MODE_REPLACE</source>
+        <translation>Remplacer</translation>
     </message>
     <message>
-      <source>LAB_VIEW_MODE_OVERLAP</source>
-      <translation>Superposer</translation>
+        <source>LAB_VIEW_MODE_OVERLAP</source>
+        <translation>Superposer</translation>
     </message>
     <message>
-      <source>LAB_VIEW_MODE_NEW_LAYOUT</source>
-      <translation>Nouvel onglet</translation>
+        <source>LAB_VIEW_MODE_NEW_LAYOUT</source>
+        <translation>Nouvel onglet</translation>
     </message>
     <message>
-      <source>LAB_VIEW_MODE_SPLIT_VIEW</source>
-      <translation>Scinder</translation>
+        <source>LAB_VIEW_MODE_SPLIT_VIEW</source>
+        <translation>Scinder</translation>
     </message>
-  </context>
+</context>
 </TS>
index 3b8e9e21948bf30037e5f25ae397e76f5138f393..c0fd9bce40d7b2b1c2100bdfe83255c2ab4647e2 100644 (file)
@@ -47,6 +47,9 @@
 #include <SalomeApp_Study.h>
 #include <SalomeApp_DataObject.h>
 
+#include <SALOME_ListIO.hxx>
+#include <LightApp_SelectionMgr.h>
+
 #include <SALOMEDS_SObject.hxx>
 #include <SALOMEDS_Study.hxx>
 
@@ -107,19 +110,20 @@ PresentationController::~PresentationController()
     delete((*it).second);
 }
 
-/**
- * [ABN] Created this probably because I don't know the right way to deal with non existent
- * attributes in an object from the study ...
- */
 int
 PresentationController::getIntParamFromStudyEditor(SALOMEDS::SObject_var obj, const char * name)
 {
-  int theInt = -1;
-  try {
-      theInt = _studyEditor->getParameterInt(obj,name);
+  if (obj->_is_nil())
+    return -1;
+
+  SALOMEDS::GenericAttribute_var anAttr;
+  SALOMEDS::AttributeParameter_var aParam;
+  if ( obj->FindAttribute(anAttr,"AttributeParameter") ) {
+    aParam = SALOMEDS::AttributeParameter::_narrow(anAttr);
+    if (aParam->IsSet(name, PT_INTEGER))
+      return aParam->GetInt(name);
   }
-  catch(...)  {  }
-  return theInt;
+  return -1;
 }
 
 std::string
@@ -178,7 +182,7 @@ PresentationController::createActions()
 
   // Presentations
   int presentationToolbarId = _salomeModule->createTool("Presentations", "PresentationToolbar");
-  int presentationMenuId = _salomeModule->createMenu(tr("MENU_PRESENTATIONS"), -1, 1);
+  int presentationMenuId = _salomeModule->createMenu(tr("MENU_PRESENTATIONS"), -1, -1, 10);
 
   label   = tr("LAB_PRESENTATION_MESH_VIEW");
   tooltip = tr("TIP_PRESENTATION_MESH_VIEW");
@@ -305,34 +309,54 @@ PresentationController::visualize(PresentationEvent::EventType eventType)
   // visualisation using the tui command (so that the user can see how
   // to make a view of an object from the tui console).
   for (int i=0; i<listOfSObject->size(); i++) {
-      SALOMEDS::SObject_var soField = listOfSObject->at(i);
-      int fieldId = getIntParamFromStudyEditor(soField, FIELD_ID);
-      if (fieldId < 0)  // is it a field serie ?
+      SALOMEDS::SObject_var soObj = listOfSObject->at(i);
+      std::string name(_studyEditor->getName(soObj));
+      if (soObj->_is_nil() || name == "MEDCalc")
+        return;
+
+      int fieldId = getIntParamFromStudyEditor(soObj, FIELD_ID);
+      int meshId = getIntParamFromStudyEditor(soObj, MESH_ID);
+      MEDCALC::FieldHandler* fieldHandler = 0;
+      MEDCALC::MeshHandler* meshHandler = 0;
+
+      // is it a mesh?
+      if (meshId >= 0)
         {
-          int fieldSeriesId = getIntParamFromStudyEditor(soField, FIELD_SERIES_ID);
-          // If fieldId and fieldSeriesId equals -1, then it means that it is not a field
-          // managed by the MED module, and we stop this function process.
-          if ( fieldSeriesId < 0)
+          if (eventType != PresentationEvent::EVENT_VIEW_OBJECT_MESH_VIEW)
             continue;
-          MEDCALC::FieldHandlerList* fieldHandlerList = MEDFactoryClient::getDataManager()->getFieldListInFieldseries(fieldSeriesId);
-          if (fieldHandlerList->length() < 0)
-            continue;
-          // For a field series, get the first real field entry:
-          MEDCALC::FieldHandler fieldHandler = (*fieldHandlerList)[0];
-          fieldId = fieldHandler.id;
+          meshHandler = MEDFactoryClient::getDataManager()->getMeshHandler(meshId);
+        }
+      else
+        {
+          if (fieldId < 0)  // is it a field serie ?
+            {
+              int fieldSeriesId = getIntParamFromStudyEditor(soObj, FIELD_SERIES_ID);
+              // If fieldId and fieldSeriesId equals -1, then it means that it is not a field
+              // managed by the MED module, and we stop this function process.
+              if ( fieldSeriesId < 0)
+                  continue;
+
+              MEDCALC::FieldHandlerList* fieldHandlerList = MEDFactoryClient::getDataManager()->getFieldListInFieldseries(fieldSeriesId);
+              if (fieldHandlerList->length() < 0)
+                continue;
+              // For a field series, get the first real field entry:
+              MEDCALC::FieldHandler fieldHandler = (*fieldHandlerList)[0];
+              fieldId = fieldHandler.id;
+            }
+          fieldHandler = MEDFactoryClient::getDataManager()->getFieldHandler(fieldId);
         }
 
-      MEDCALC::FieldHandler* fieldHandler = MEDFactoryClient::getDataManager()->getFieldHandler(fieldId);
-      if (! fieldHandler) {
+      if ((!fieldHandler) && (!meshHandler)) {
           QMessageBox::warning(_salomeModule->getApp()->desktop(),
                                tr("Operation not allowed"),
-                               tr("No field is defined"));
+                               tr("No field (or mesh) is defined"));
           return;
       }
 
       PresentationEvent* event = new PresentationEvent();
       event->eventtype = eventType;
       event->fieldHandler = fieldHandler;
+      event->meshHandler = meshHandler;
       emit presentationSignal(event); // --> processPresentationEvent()
   }
 }
@@ -391,6 +415,9 @@ PresentationController::onDeletePresentation()
   // For each object, emit a signal to the workspace to request pres deletion
   for (int i=0; i<listOfSObject->size(); i++) {
       SALOMEDS::SObject_var soPres = listOfSObject->at(i);
+      std::string name(_studyEditor->getName(soPres));
+      if (soPres->_is_nil() || name == "MEDCalc")
+        return;
       int presId = getIntParamFromStudyEditor(soPres,PRESENTATION_ID);
       // If fieldId equals -1, then it means that it is not a field
       // managed by the MED module, and we stop this function process.
@@ -489,8 +516,10 @@ PresentationController::processPresentationEvent(const PresentationEvent* event)
   // dedicated widget helper class?
 
   if ( event->eventtype == PresentationEvent::EVENT_VIEW_OBJECT_MESH_VIEW ) {
-        commands += QString("presentation_id = medcalc.MakeMeshView(accessField(%1), viewMode=%2)").arg(fieldHandler->id).arg(viewMode);
-        commands += QString("presentation_id");
+      // Do we request mesh view from a field or from a mesh only?
+      int meshId = event->meshHandler ? event->meshHandler->id : event->fieldHandler->meshid;
+      commands += QString("presentation_id = medcalc.MakeMeshView(%1, viewMode=%2)").arg(meshId).arg(viewMode);
+      commands += QString("presentation_id");
     }
   else if ( event->eventtype == PresentationEvent::EVENT_VIEW_OBJECT_SCALAR_MAP ) {
       commands += QString("presentation_id = medcalc.MakeScalarMap(accessField(%1), viewMode=%2, scalarBarRange=%3, colorMap=%4)")
@@ -602,6 +631,7 @@ PresentationController::findOrCreateWidgetHelper(MEDCALC::MEDPresentationManager
     {
       const char * msg ="findOrCreateWidgetHelper(): NOT IMPLEMENTED !!!";
       STDLOG(msg);
+      return wh;
     }
   _presHelperMap[presId] = wh;
   return wh;
@@ -621,6 +651,8 @@ PresentationController::onPresentationSelected(int presId, const QString& presTy
     }
   else
     {
+      if(_currentWidgetHelper)
+        _currentWidgetHelper->releaseWidget();
       // Activate corresponding ParaView render view
       _presManager->activateView(presId);
       // Update widgets parameters
@@ -641,6 +673,9 @@ PresentationController::onParavisDump()
   // For the first object only, request the dump
   for (int i=0; i<listOfSObject->size(); i++) {
       SALOMEDS::SObject_var soPres = listOfSObject->at(i);
+      std::string name(_studyEditor->getName(soPres));
+      if (soPres->_is_nil() || name == "MEDCalc")
+        return;
       int presId = getIntParamFromStudyEditor(soPres,PRESENTATION_ID);
       // If fieldId equals -1, then it means that it is not a field
       // managed by the MED module, and we stop this function process.
@@ -657,7 +692,7 @@ PresentationController::onParavisDump()
 }
 
 void
-PresentationController::updateTreeViewWithNewPresentation(long fieldId, long presentationId)
+PresentationController::updateTreeViewWithNewPresentation(long dataId, long presentationId)
 {
   if (presentationId < 0) {
       std::cerr << "Unknown presentation\n";
@@ -678,37 +713,36 @@ PresentationController::updateTreeViewWithNewPresentation(long fieldId, long pre
   SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>(_salomeModule->application()->activeStudy());
   _PTR(Study) studyDS = study->studyDS();
 
-  _salomeModule->engine()->registerPresentation(_CAST(Study, studyDS)->GetStudy(), fieldId,
-      oss.str().c_str(), type.c_str(),ico.c_str(), presentationId);
-
-
-  //  MEDCALC::ViewModeType viewMode = MEDFactoryClient::getPresentationManager()->getPresentationViewMode(presentationId);
-  //
-  //  // Remove sibling presentations if view mode is set to REPLACE
-  //  if (viewMode == MEDCALC::VIEW_MODE_REPLACE) {
-  //    MED_ORB::PresentationsList* presList = _salomeModule->engine()->getSiblingPresentations(_CAST(Study, studyDS)->GetStudy(), presentationId);
-  //    CORBA::ULong size = presList->length();
-  //
-  //    std::stringstream sstm;
-  //    sstm << "Removing sibling presentation(s): ";
-  //    for (int i = 0; i < size; ++i)
-  //      sstm << (*presList)[i] << "  ";
-  //    STDLOG(sstm.str());
-  //
-  //    for (int i = 0; i < size; ++i) {
-  //      PresentationEvent* event = new PresentationEvent();
-  //      event->eventtype = PresentationEvent::EVENT_DELETE_PRESENTATION;
-  //      XmedDataObject* dataObject = new XmedDataObject();
-  //      dataObject->setPresentationId((*presList)[i]);
-  //      event->objectdata = dataObject;
-  //      emit presentationSignal(event); // --> WorkspaceController::processPresentationEvent
-  //    }
-  //
-  //    delete presList;
-  //  }
+  // Mesh views are always registered at the mesh level:
+  if (type == MEDPresentationMeshView::TYPE_NAME)
+    {
+      _salomeModule->engine()->registerPresentationMesh(_CAST(Study, studyDS)->GetStudy(), dataId,
+          oss.str().c_str(), type.c_str(),ico.c_str(), presentationId);
+    }
+  else
+    _salomeModule->engine()->registerPresentationField(_CAST(Study, studyDS)->GetStudy(), dataId,
+            oss.str().c_str(), type.c_str(),ico.c_str(), presentationId);
 
   // update Object browser
   _salomeModule->getApp()->updateObjectBrowser(true);
+
+  // auto-select new presentation
+  std::string entry = _salomeModule->engine()->getStudyPresentationEntry(_CAST(Study, studyDS)->GetStudy(), presentationId);
+  SALOME_ListIO selectedObjects;
+  LightApp_Study* lightStudy = dynamic_cast<LightApp_Study*>( _salomeModule->application()->activeStudy() );
+  QString component = lightStudy->componentDataType( entry.c_str() );
+  selectedObjects.Append( new SALOME_InteractiveObject( (const char*)entry.c_str(),
+                                                        (const char*)component.toLatin1(),
+                                                        ""/*refobj->Name().c_str()*/ ) );
+  //QStringList selectedObjects;
+  //selectedObjects << QString(entry.c_str());
+  LightApp_SelectionMgr* aSelectionMgr = _salomeModule->getApp()->selectionMgr();
+  aSelectionMgr->setSelectedObjects(selectedObjects, false);
+
+  // emit onPresentationSelected
+  int presId = -1;
+  _salomeModule->itemClickGeneric(name, type, presId);
+  onPresentationSelected(presId, QString::fromStdString(type), QString::fromStdString(name));
 }
 
 void
@@ -728,30 +762,43 @@ PresentationController::updateTreeViewForPresentationRemoval(long presentationId
   _salomeModule->getApp()->updateObjectBrowser(true);
 }
 
+void
+PresentationController::_dealWithReplaceMode()
+{
+  // Deal with replace mode: presentations with invalid IDs have to be removed:
+  SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>(_salomeModule->application()->activeStudy());
+  _PTR(Study) studyDS = study->studyDS();
+
+  MEDCALC::PresentationsList * lstManager = _presManager->getAllPresentations();
+  MED_ORB::PresentationsList * lstModule = _salomeModule->engine()->getStudyPresentations(_CAST(Study, studyDS)->GetStudy());
+  // The IDs not in the intersection needs deletion:
+  CORBA::Long * last = lstManager->get_buffer() + lstManager->length();
+  for (unsigned i = 0; i < lstModule->length(); i++) {
+    CORBA::Long * ptr = std::find(lstManager->get_buffer(), last, (*lstModule)[i]);
+    if (ptr == last) {
+      STDLOG("Removing pres " << (*lstModule)[i] << " from OB.");
+      // Presentation in module but not in manager anymore: to be deleted from OB:
+      updateTreeViewForPresentationRemoval((*lstModule)[i]);
+    }
+  }
+}
+
 void
 PresentationController::processWorkspaceEvent(const MEDCALC::MedEvent* event)
 {
   if ( event->type == MEDCALC::EVENT_ADD_PRESENTATION ) {
-    updateTreeViewWithNewPresentation(event->dataId, event->presentationId);
-    // Deal with replace mode: presentations with invalid IDs have to be removed:
-    SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>(_salomeModule->application()->activeStudy());
-    _PTR(Study) studyDS = study->studyDS();
-
-    MEDCALC::PresentationsList * lstManager = _presManager->getAllPresentations();
-    MED_ORB::PresentationsList * lstModule = _salomeModule->engine()->getStudyPresentations(_CAST(Study, studyDS)->GetStudy());
-    // The IDs not in the intersection needs deletion:
-    CORBA::Long * last = lstManager->get_buffer() + lstManager->length();
-    for (unsigned i = 0; i < lstModule->length(); i++)
-      {
-        CORBA::Long * ptr = std::find(lstManager->get_buffer(), last, (*lstModule)[i]);
-        if (ptr == last)
-          {
-            STDLOG("Removing pres " << (*lstModule)[i] << " from OB.");
-          // Presentation in module but not in manager anymore: to be deleted from OB:
-          updateTreeViewForPresentationRemoval((*lstModule)[i]);
-          onPresentationSelected(-1, "", ""); // make sure param widget is hidden
-          }
-      }
+    if (event->dataId == -1) {
+      // A file has been loaded, and we want to create a default presentation (MeshView) for it
+      QString viewMode = getViewModePython();
+      QStringList commands;
+      commands += QString("presentation_id = medcalc.MakeMeshView(medcalc.GetFirstMeshFromDataSource(source_id), viewMode=%1)").arg(viewMode);
+      commands += QString("presentation_id");
+      _consoleDriver->exec(commands);
+    }
+    else {
+      updateTreeViewWithNewPresentation(event->dataId, event->presentationId);
+      _dealWithReplaceMode();
+    }
   }
   else if ( event->type == MEDCALC::EVENT_REMOVE_PRESENTATION ) {
       updateTreeViewForPresentationRemoval(event->presentationId);
@@ -770,4 +817,3 @@ PresentationController::showDockWidgets(bool isVisible)
 {
   _dockWidget->setVisible(isVisible);
 }
-
index 39d58a3e789088cfd6398459cd4098567e9bb6e1..0c187e5627fbd157771d9dbf35701a1e5e1f8435 100644 (file)
@@ -76,12 +76,12 @@ protected slots:
   void onPresentationSelected(int presId, const QString& presType, const QString& presName);
 
   void processWorkspaceEvent(const MEDCALC::MedEvent*);
-  void processPresentationEvent(const PresentationEvent* event);
+  void processPresentationEvent(const PresentationEvent*);
 
 private:
   void visualize(PresentationEvent::EventType);
-  void updateTreeViewWithNewPresentation(long, long);
-  void updateTreeViewForPresentationRemoval(long);
+  void updateTreeViewWithNewPresentation(long dataId, long presentationId);
+  void updateTreeViewForPresentationRemoval(long presId);
   std::string _getIconName(const std::string&);
   MEDWidgetHelper * findOrCreateWidgetHelper(MEDCALC::MEDPresentationManager_ptr presManager,
                                              int presId, const std::string& type, const std::string& name);
@@ -94,6 +94,8 @@ private:
   QString getMeshModePython(const int mode) const;
   QString getSliceOrientationPython(const int orient) const;
 
+  void _dealWithReplaceMode();
+
 private:
   MEDModule* _salomeModule;
   XmedConsoleDriver* _consoleDriver;   // the same as in WorkspaceController
index 92b8dc4f9691e997c7f985f9b8fb564cca4b9750..66868893e63b5f80085cdd221826df7b8dd4f05f 100644 (file)
@@ -29,6 +29,7 @@ typedef struct {
 
   EventType eventtype;
   MEDCALC::FieldHandler * fieldHandler;
+  MEDCALC::MeshHandler * meshHandler;
   int presentationId;
   int anInteger;                // multi-purpose variable
   //int anInteger2;             // multi-purpose variable
index a554668d76d6d2cd0029eb91ab49ef3028e228fa..d78eacd61f4fa7395470bfa3abff3ae4df7088bf 100644 (file)
 #include "ProcessingController.hxx"
 #include <MEDCalcConstants.hxx>
 
+#include <SALOMEDS_SObject.hxx>
+#include <SALOMEDS_Study.hxx>
+#include CORBA_CLIENT_HEADER(SALOMEDS)
+#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
+
 #include "MEDFactoryClient.hxx"
 #include "MEDModule.hxx"
 #include "Basics_Utils.hxx"
@@ -53,7 +58,7 @@ ProcessingController::createActions()
   STDLOG("Creating ProcessingController actions");
 
   int processingToolbarId = _salomeModule->createTool("Processing", "ProcessingToolbar");
-  int processingMenuId = _salomeModule->createMenu(tr("MENU_PROCESSING"), -1, 1);
+  int processingMenuId = _salomeModule->createMenu(tr("MENU_PROCESSING"), -1, -1, 12);
 
   // Change underlying mesh (note that this action creates a new field in
   // the workspace that corresponds to a copy of the selected field
@@ -86,8 +91,17 @@ ProcessingController::OnChangeUnderlyingMesh()
   SALOME_StudyEditor::SObjectList* listOfSObject = _studyEditor->getSelectedObjects();
   if ( listOfSObject->size() > 0 ) {
     SALOMEDS::SObject_var soField = listOfSObject->at(0);
-    //int fieldId = _studyEditor->getParameterInt(soField,FIELD_SERIES_ID);
-    int fieldId = _studyEditor->getParameterInt(soField,FIELD_ID);
+    std::string name(_studyEditor->getName(soField));
+    if (soField->_is_nil() || name == "MEDCalc")
+      return;
+    SALOMEDS::GenericAttribute_var anAttr;
+    SALOMEDS::AttributeParameter_var aParam;
+    if ( soField->FindAttribute(anAttr,"AttributeParameter") ) {
+      aParam = SALOMEDS::AttributeParameter::_narrow(anAttr);
+      if (! aParam->IsSet(FIELD_SERIES_ID, PT_INTEGER))
+        return;
+    }
+    int fieldId = aParam->GetInt(FIELD_SERIES_ID);
     // _GBO_ : the dialog should not be modal, so that we can choose a
     // mesh in the browser. Then we have to emit a signal from the
     // dialog.accept, connected to a slot of the DatasourceControler
@@ -142,7 +156,17 @@ ProcessingController::OnInterpolateField()
   SALOME_StudyEditor::SObjectList* listOfSObject = _studyEditor->getSelectedObjects();
   if ( listOfSObject->size() > 0 ) {
     SALOMEDS::SObject_var soField = listOfSObject->at(0);
-    int fieldId = _studyEditor->getParameterInt(soField,FIELD_ID);
+    std::string name(_studyEditor->getName(soField));
+    if (soField->_is_nil() || name == "MEDCalc")
+      return;
+    SALOMEDS::GenericAttribute_var anAttr;
+    SALOMEDS::AttributeParameter_var aParam;
+    if ( soField->FindAttribute(anAttr,"AttributeParameter") ) {
+      aParam = SALOMEDS::AttributeParameter::_narrow(anAttr);
+      if (! aParam->IsSet(FIELD_SERIES_ID, PT_INTEGER))
+        return;
+    }
+    int fieldId = aParam->GetInt(FIELD_SERIES_ID);
     // _GBO_ : the dialog should not be modal, so that we can choose a
     // mesh in the browser. Then we have to emit a signal from the
     // dialog.accept, connected to a slot of the DatasourceControler
index dd59a244776e709b9d1a9052e1951f3ac087960f..a2c442aa4b68e7a8644f7da7b01b325d252e8482 100644 (file)
@@ -527,6 +527,12 @@ void WorkspaceController::processDatasourceEvent(const DatasourceEvent* event) {
     commands += QString("source_id = medcalc.LoadDataSource('%1')").arg(event->objectalias);
     commands += QString("source_id");
     _consoleDriver->exec(commands);
+
+    // Create a default presentation when loading a file
+    MEDCALC::MedEvent* evt = new MEDCALC::MedEvent();
+    evt->type = MEDCALC::EVENT_ADD_PRESENTATION;
+    evt->dataId = -1;
+    emit workspaceSignal(evt); // forward to PresentationController
   }
   else if ( event->eventtype == DatasourceEvent::EVENT_ADD_IMAGE_AS_DATASOURCE ) {
     QStringList commands;
index 26defc750ed7fa9f7bf981ccb46c612075832988..90a7adf8d20e435dc1706b61d278cec3c2f3bc9c 100644 (file)
 #include "DlgChangeUnderlyingMesh.hxx"
 #include <MEDCalcConstants.hxx>
 
+#include <SALOMEDS_SObject.hxx>
+#include <SALOMEDS_Study.hxx>
+#include CORBA_CLIENT_HEADER(SALOMEDS)
+#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
+
 #include <QString>
 #include <QMessageBox>
 
@@ -64,9 +69,17 @@ void DlgChangeUnderlyingMesh::OnSelectMesh() {
   SALOME_StudyEditor::SObjectList * listOfSObject = _studyEditor->getSelectedObjects();
   if ( listOfSObject->size() > 0 ) {
     SALOMEDS::SObject_var soMesh = listOfSObject->at(0);
-    // _GBO_ TODO: we should test here if it is a mesh (attribute in
-    // the sobject)
-    _meshId = _studyEditor->getParameterInt(soMesh,MESH_ID);
+    std::string name(_studyEditor->getName(soMesh));
+    if (soMesh->_is_nil() || name == "MEDCalc")
+      return;
+    SALOMEDS::GenericAttribute_var anAttr;
+    SALOMEDS::AttributeParameter_var aParam;
+    if ( soMesh->FindAttribute(anAttr,"AttributeParameter") ) {
+      aParam = SALOMEDS::AttributeParameter::_narrow(anAttr);
+      if (! aParam->IsSet(MESH_ID, PT_INTEGER))
+        return;
+    }
+    _meshId = aParam->GetInt(MESH_ID);
     const char * meshname = _studyEditor->getName(soMesh);
     this->ui.txtMesh->setText(QString(meshname));
   }
index 4ef53c6f2ec3b36cfbb94bec799a0d93e348eaee..7c318ba2309b19bae6fb4dd3526c70900217e97b 100644 (file)
 #include "DlgInterpolateField.hxx"
 #include <MEDCalcConstants.hxx>
 
+#include <SALOMEDS_SObject.hxx>
+#include <SALOMEDS_Study.hxx>
+#include CORBA_CLIENT_HEADER(SALOMEDS)
+#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
+
 #include <QString>
 #include <QMessageBox>
 #include <QDoubleValidator>
@@ -113,9 +118,17 @@ void DlgInterpolateField::OnSelectMesh() {
   SALOME_StudyEditor::SObjectList * listOfSObject = _studyEditor->getSelectedObjects();
   if ( listOfSObject->size() > 0 ) {
     SALOMEDS::SObject_var soMesh = listOfSObject->at(0);
-    // _GBO_ TODO: we should test here if it is a mesh (attribute in
-    // the sobject)
-    _meshId = _studyEditor->getParameterInt(soMesh,MESH_ID);
+    std::string name(_studyEditor->getName(soMesh));
+    if (soMesh->_is_nil() || name == "MEDCalc")
+      return;
+    SALOMEDS::GenericAttribute_var anAttr;
+    SALOMEDS::AttributeParameter_var aParam;
+    if ( soMesh->FindAttribute(anAttr,"AttributeParameter") ) {
+      aParam = SALOMEDS::AttributeParameter::_narrow(anAttr);
+      if (! aParam->IsSet(MESH_ID, PT_INTEGER))
+        return;
+    }
+    _meshId = aParam->GetInt(MESH_ID);
     const char * meshname = _studyEditor->getName(soMesh);
     this->ui.txtMesh->setText(QString(meshname));
   }
index 3114be35edb16faa3d31144fd636863d37d37c68..8faec9df2a294ad7aff99abbac8bb6fa5d81f5d2 100644 (file)
@@ -38,8 +38,8 @@ WidgetPresentationParameters::WidgetPresentationParameters(QWidget* parent)
                    this,                       SLOT(onComboColorMapIndexChanged(int)) );
   QObject::connect(_ui.comboBoxSliceOrient,       SIGNAL(activated(int)),
                    this,                       SLOT(onComboOrientIndexChanged(int)) );
-  QObject::connect(_ui.spinBox,                SIGNAL(valueChanged(int)),
-                     this,                     SLOT(onSpinBoxValueChanged(int)) );
+  QObject::connect(_ui.spinBox,                SIGNAL(editingFinished()),
+                     this,                     SLOT(onSpinBoxEditingFinished()) );
 }
 
 void
@@ -74,9 +74,9 @@ WidgetPresentationParameters::onComboScalarBarRangeIndexChanged(int idx)
 }
 
 void
-WidgetPresentationParameters::onSpinBoxValueChanged(int val)
+WidgetPresentationParameters::onSpinBoxEditingFinished()
 {
-  if (!_blockSig) emit spinBoxValueChanged(val);
+  if (!_blockSig) emit spinBoxValueChanged(_ui.spinBox->value());
 }
 
 void
@@ -125,7 +125,8 @@ WidgetPresentationParameters::isShown() const
 string
 WidgetPresentationParameters::getComponent() const
 {
-  if (_ui.comboBoxCompo->currentIndex() == 0) // Euclidean norm
+  if (_ui.comboBoxCompo->count() > 1 && _ui.comboBoxCompo->count() <= 3)
+    if (_ui.comboBoxCompo->currentIndex() == 0) // Euclidean norm
       return "";
 
   return _ui.comboBoxCompo->currentText().toStdString();
@@ -141,10 +142,15 @@ WidgetPresentationParameters::setComponents(vector<string> compos, int selecInde
   _ui.comboBoxCompo->show();
 
   _ui.comboBoxCompo->clear();
-  _ui.comboBoxCompo->addItem(tr("LAB_EUCLIDEAN_NORM"));
+  bool vectorField = (compos.size() > 1 && compos.size() <= 3);
+  if (vectorField)
+    _ui.comboBoxCompo->addItem(tr("LAB_EUCLIDEAN_NORM"));
   for(vector<string>::const_iterator it = compos.begin(); it != compos.end(); ++it)
     _ui.comboBoxCompo->addItem(QString::fromStdString(*it));
-  _ui.comboBoxCompo->setCurrentIndex(selecIndex);
+  if (!vectorField)
+    _ui.comboBoxCompo->setCurrentIndex(std::max(0, selecIndex-1));
+  else
+    _ui.comboBoxCompo->setCurrentIndex(selecIndex);
 
   _blockSig = false;
 }
@@ -161,9 +167,11 @@ WidgetPresentationParameters::setNbContour(int nbContour)
     }
 
   // Show the widget:
-  _ui.labelSpinBox->setText(tr("LAB_NB_CONTOURS"));
+  _ui.labelSpinBox->setText(tr("LAB_NB_CONTOURS").arg(MEDCALC::NB_CONTOURS_MAX));
+
   _ui.labelSpinBox->show();
   _ui.spinBox->show();
+  _ui.spinBox->setRange(1, MEDCALC::NB_CONTOURS_MAX);
   _ui.spinBox->setValue(nbContour);
 
   _blockSig = false;
@@ -181,9 +189,10 @@ WidgetPresentationParameters::setNbSlices(int nbSlices)
     }
 
   // Show the widget:
-  _ui.labelSpinBox->setText(tr("LAB_NB_SLICES"));
+  _ui.labelSpinBox->setText(tr("LAB_NB_SLICES").arg(MEDCALC::NB_SLICES_MAX));
   _ui.labelSpinBox->show();
   _ui.spinBox->show();
+  _ui.spinBox->setRange(1, MEDCALC::NB_SLICES_MAX);
   _ui.spinBox->setValue(nbSlices);
 
   _blockSig = false;
index b518e5605d797efd7afe5e9e577d19c4bf663255..a9d0d5742ff97e0e8c334d71bb1a7d6d4ca71946 100644 (file)
@@ -84,7 +84,7 @@ private slots:
   void onComboCompoIndexChanged(int);
   void onComboOrientIndexChanged(int);
   void onComboMeshIndexChanged(int);
-  void onSpinBoxValueChanged(int);
+  void onSpinBoxEditingFinished();
 
 private:
   Ui_WidgetPresentationParameters _ui; // instance of the class defined in ui_WidgetPresentationParameters.h
index c5557a3da4d6f22b4be862c8954f0c1f1f22828b..d4500e896716b4ae4ca39bacfa4b707b263506d6 100644 (file)
       </item>
       <item row="2" column="1">
        <widget class="QSpinBox" name="spinBox">
+        <property name="toolTip">
+         <string>LAB_SPINBOX_TOOLTIP</string>
+        </property>
         <property name="minimum">
          <number>1</number>
         </property>
index 6f4f7f5f897e345c92a00d08a948e75357591e86..f7f5d91671e4085308934c21c1700a5985712820 100644 (file)
@@ -30,7 +30,7 @@ from medcalc_testutils import GetMEDFileDirTUI
 datafile = os.path.join(GetMEDFileDirTUI(), "smooth_surface_and_field.med")
 source_id = medcalc.LoadDataSource(datafile)
 
-presentation_id = medcalc.MakeMeshView(accessField(0), MEDCALC.VIEW_MODE_REPLACE)
+presentation_id = medcalc.MakeMeshView(0, MEDCALC.VIEW_MODE_REPLACE)  # here the ID of the mesh directly
 sleep(1)
 medcalc.RemovePresentation(presentation_id)
 sleep(1)
index 273b74a0cb534fe8a796b0ee2d5b95f802af5a8f..71845ab4650937515ec93c00018c9c2a4f8b90c0 100644 (file)
@@ -35,8 +35,7 @@ import medevents
 from fieldproxy import newFieldProxy, FieldProxy
 
 # Input/Output
-from medio import LoadDataSource
-from medio import LoadImageAsDataSource
+from medio import LoadDataSource, LoadImageAsDataSource, GetFirstMeshFromDataSource
 
 # Presentations
 from medpresentation import MakeMeshView
@@ -72,4 +71,3 @@ import medconsole
 # Playing test scenarii
 from medtest import PlayQtTestingScenario
 from medtest import RequestSALOMETermination
-
index afd74692e8d583b3c0009c09301cf9f5cb49fc45..9288d85be9f9442cc02f5e8ed88483b5759a67e6 100644 (file)
 #
 # containerType = Name of the container factory
 #
-componentName = "MEDFactory"
-corbaModule   = "MEDCALC"
+factoryComponentName = "MEDFactory"
+medComponentName = "MED"
+#corbaModule   = "MEDCALC"
 containerType = "FactoryServer"
 
 import salome
 if salome.lcc is None:
   salome.salome_init()
   pass
-__import__(corbaModule)
-factory = salome.lcc.FindOrLoadComponent(containerType,componentName)
+
+import MEDCALC   # corbaModule
+med_engine = salome.lcc.FindOrLoadComponent(containerType,medComponentName)
+factory = salome.lcc.FindOrLoadComponent(containerType,factoryComponentName)
 # The factory is not the main CORBA component of the SALOME module MED
 # (i.e. the engine associated to the active study), but the CORBA
 # entry point for MED fields operations (i.e. a CORBA component
index 364fbba3fa5fba607fa9692ba52c0cc8e18e3df3..013842d04e4d4824fef7b203021f6d8e68d2db29 100644 (file)
@@ -39,3 +39,10 @@ def LoadImageAsDataSource(filename):
   builder.image2med(filename, medfilename)
   return LoadDataSource(medfilename)
 #
+
+def GetFirstMeshFromDataSource(datasource_id):
+  dataManager = medcalc.medcorba.factory.getDataManager()
+  handlerLst = dataManager.getMeshHandlerList(datasource_id)
+  if not len(handlerLst):
+    return -1
+  return handlerLst[0].id
index faa1e0eb08618a1b1ca4fb9c1ab8c635f1d31159..3ef5c42a8afe9fe4b5e8fce30ca047ea21443459 100644 (file)
@@ -23,15 +23,15 @@ from medcalc.medevents import notifyGui_addPresentation, notifyGui_removePresent
 
 __manager = medcalc.medcorba.factory.getPresentationManager()
 
-def MakeMeshView(proxy,
+def MakeMeshView(meshID,
                  viewMode=MEDCALC.VIEW_MODE_DEFAULT,
                  meshMode=MEDCALC.MESH_MODE_DEFAULT):
   # Create the presentation instance in CORBA engine
   # The engine in turn creates the ParaView pipeline elements
-  params = MEDCALC.MeshViewParameters(proxy.id, meshMode)
+  params = MEDCALC.MeshViewParameters(meshID, meshMode)
   try:
     presentation_id = __manager.makeMeshView(params, viewMode)
-    notifyGui_addPresentation(proxy.id, presentation_id)
+    notifyGui_addPresentation(meshID, presentation_id)
     return presentation_id
   except SALOME.SALOME_Exception as e:
     notifyGui_error("An error occured while creating the mesh view:\n" + e.details.text)
@@ -180,8 +180,12 @@ def ComputeCellAverageSize(obj):
   bb, nCells = obj.GetDataInformation().GetBounds(), obj.GetDataInformation().GetNumberOfCells()
   bb = zip(bb[::2], bb[1::2])
   deltas = [x[1]-x[0] for x in bb]
+  ## Filter out null dimensions:
+  avgDelta = sum(deltas) / 3.0
+  deltas = [d for d in deltas if abs(d) > 1.0e-12*avgDelta]
+  ##
   vol = reduce(lambda x,y:x*y, deltas, 1.0) 
-  cellSize = (vol/nCells)**(1.0/3.0)  # necessarily 3D in ParaView
+  cellSize = (vol/nCells)**(1.0/float(len(deltas)))
   return cellSize
 
 def GetDomainCenter(obj):
@@ -219,7 +223,10 @@ def GetSliceOrigins(obj, nbSlices, normal):
 def SelectSourceField(obj, meshName, fieldName, discretisation):
   """
   Properly set the AllArrays property of a MEDReader source to point to the correct field.
+  Setting the fieldName to void string is allowed (meaning we work on the mesh only).
   """
+  if fieldName == "":
+    return
   tree = obj.GetProperty("FieldsTreeInfo")[::2]
   it = None
   for t in tree: