Salome HOME
Merge remote-tracking branch 'origin/agr/fix_tests'
authorabn <adrien.bruneton@cea.fr>
Wed, 27 Jul 2016 10:10:55 +0000 (12:10 +0200)
committerabn <adrien.bruneton@cea.fr>
Wed, 27 Jul 2016 10:10:55 +0000 (12:10 +0200)
Conflicts:
src/MEDCalc/gui/CMakeLists.txt
src/MEDCalc/gui/MEDModule.cxx
src/MEDCalc/gui/MEDModule.hxx

36 files changed:
CMakeLists.txt
idl/MEDPresentationManager.idl
idl/MED_Gen.idl
src/MEDCalc/MEDCalcConstants.hxx
src/MEDCalc/cmp/CMakeLists.txt
src/MEDCalc/cmp/MED.cxx
src/MEDCalc/cmp/MED.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/MEDPresentationPointSprite.cxx
src/MEDCalc/cmp/MEDPresentationPointSprite.hxx
src/MEDCalc/cmp/MEDPresentationScalarMap.cxx
src/MEDCalc/cmp/MEDPresentationScalarMap.hxx
src/MEDCalc/cmp/MEDPresentationSlices.cxx
src/MEDCalc/cmp/MEDPresentationSlices.hxx
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/MED_images.ts
src/MEDCalc/gui/MED_msg_en.ts
src/MEDCalc/gui/PresentationController.cxx
src/MEDCalc/gui/PresentationController.hxx
src/MEDCalc/gui/WorkspaceController.cxx
src/MEDCalc/gui/XmedDataModel.cxx
src/MEDCalc/gui/XmedDataModel.hxx
src/MEDCalc/gui/dialogs/WidgetPresentationParameters.hxx
src/MEDCalc/res/close.png [new file with mode: 0755]

index f612e41dccf9bc10722bcf02ff7237ee6018c50a..e9cda51078534062dbd073c93f6f9dd40fb4bdfd 100644 (file)
@@ -23,6 +23,9 @@ PROJECT(SalomeMED C CXX)
 
 # Ensure a proper linker behavior:
 CMAKE_POLICY(SET CMP0003 NEW)
+IF(WIN32)
+  CMAKE_POLICY(SET CMP0020 OLD) # disable automatic linking to qtmain.lib 
+ENDIF(WIN32)
 
 # Versioning
 # ===========
index c797e4036b2bfdf0c0fc27e824662328fc99f96f..c3e100225381634171c8dcb7ca63d8ba505220bf 100644 (file)
@@ -141,6 +141,10 @@ module MEDCALC
 
     boolean removePresentation(in long presId);
 
+    // Helper functions to keep GUI sync
+    boolean activateView(in long presentationId);
+
+    MEDPresentationViewMode getPresentationViewMode(in long presId);
   };
 
 };
index 6dbae1d6a39b6765a9f79057ca8650852c73313b..21df0b93374d867cc8eee8fd69501dd57e7aa0c0 100644 (file)
@@ -34,6 +34,8 @@ module MED_ORB
     OP_ERROR                 //!< ERROR: other problems
   };
 
+  typedef sequence<long> PresentationsList;
+
   interface
   MED_Gen : Engines::EngineComponent
   {
@@ -51,6 +53,11 @@ module MED_ORB
     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);
+
   };
 };
 
index e9c72abbf40df5967bb247996d38ff6a2450610c..2023db6d7986d89c7c3f48c0290308ba08ba6e37 100644 (file)
@@ -22,7 +22,7 @@
 #define IS_IN_WORKSPACE  "isInWorkspace"
 #define SOURCE_ID        "sourceId"
 #define MESH_ID          "meshId"
-//#define FIELD_SERIES_ID  "fieldSeriesId"
+#define FIELD_SERIES_ID  "fieldSeriesId"
 #define FIELD_ID         "fieldId"
 #define PRESENTATION_ID  "presentationId"
 #define IS_PRESENTATION  "isPresentation"
index 7ae135aa37296dbe2babf5e94eda61b5f26bf87b..63415add6e5c2ee18715fc1ca79656d4c6395f53 100644 (file)
@@ -29,6 +29,7 @@ INCLUDE_DIRECTORIES(
   ${CMAKE_CURRENT_BINARY_DIR}
   ${CMAKE_CURRENT_SOURCE_DIR}/..
   ${PROJECT_BINARY_DIR}/idl
+  ${GUI_INCLUDE_DIRS}  # For PyLockWrapper 
 )
 
 SET(COMMON_SOURCES
@@ -68,6 +69,7 @@ SET(COMMON_LIBS
   ${OMNIORB_LIBRARIES}
   ${PYTHON_LIBRARIES}
   ${MEDCoupling_medcoupling} ${MEDCoupling_medloader} ${MEDCoupling_medcouplingremapper}
+  ${GUI_PyInterp}
 )
 
 # This undefines the macros MIN and MAX which are specified in the windows headers
index a69140721ab571b18b315d08676c583f5848c91d..99b6976c6a07e0c4f55d4395e7af546b4494aef1 100644 (file)
@@ -67,9 +67,6 @@ MED::addDatasourceToStudy(SALOMEDS::Study_ptr study,
   // set exception handler to catch unexpected CORBA exceptions
   Unexpect aCatch(SALOME_SalomeException);
 
-  // set result status to error initially
-  MED_ORB::status result = MED_ORB::OP_ERROR;
-
   // check if reference to study is valid
   if (!CORBA::is_nil(study)) {
     // get full object path
@@ -139,8 +136,8 @@ MED::addDatasourceToStudy(SALOMEDS::Study_ptr study,
           soFieldseries->SetAttrString("AttributePixMap", "ICO_DATASOURCE_FIELD");
           anAttr = studyBuilder->FindOrCreateAttribute(soFieldseries, "AttributeParameter");
           aParam = SALOMEDS::AttributeParameter::_narrow(anAttr);
-          //aParam->SetInt(FIELD_SERIES_ID, fieldseriesHandler.id);
-          aParam->SetInt(FIELD_ID, fieldseriesHandler.id);
+          aParam->SetInt(FIELD_SERIES_ID, fieldseriesHandler.id);
+          //aParam->SetInt(FIELD_ID, fieldseriesHandler.id);
           aParam->SetBool(IS_IN_WORKSPACE, false);
 
           useCaseBuilder->AppendTo(soFieldseries->GetFather(), soFieldseries);
@@ -155,8 +152,7 @@ MED::addDatasourceToStudy(SALOMEDS::Study_ptr study,
     }
   }
 
-  result = MED_ORB::OP_OK;
-  return result;
+  return MED_ORB::OP_OK;
 }
 
 MED_ORB::status
@@ -169,9 +165,6 @@ MED::registerPresentation(SALOMEDS::Study_ptr study,
   // set exception handler to catch unexpected CORBA exceptions
   Unexpect aCatch(SALOME_SalomeException);
 
-  // set result status to error initially
-  MED_ORB::status result = MED_ORB::OP_ERROR;
-
   if (_fieldSeriesEntries.find(fieldId) == _fieldSeriesEntries.end()) {
     std::cerr << "Field not found\n";
     return MED_ORB::OP_ERROR ;
@@ -182,7 +175,7 @@ MED::registerPresentation(SALOMEDS::Study_ptr study,
 
   if (soFieldseries->IsNull()) {
     std::cerr << "Entry not found\n";
-    return  MED_ORB::OP_ERROR;
+    return MED_ORB::OP_ERROR;
   }
 
   SALOMEDS::StudyBuilder_var studyBuilder = study->NewBuilder();
@@ -201,8 +194,7 @@ MED::registerPresentation(SALOMEDS::Study_ptr study,
   aParam->SetBool(IS_PRESENTATION, true);
   aParam->SetInt(PRESENTATION_ID, presentationId);
 
-  result = MED_ORB::OP_OK;
-  return result;
+  return MED_ORB::OP_OK;
 }
 
 MED_ORB::status
@@ -212,9 +204,6 @@ MED::unregisterPresentation(SALOMEDS::Study_ptr study,
   // set exception handler to catch unexpected CORBA exceptions
   Unexpect aCatch(SALOME_SalomeException);
 
-  // set result status to error initially
-  MED_ORB::status result = MED_ORB::OP_ERROR;
-
   SALOMEDS::StudyBuilder_var studyBuilder = study->NewBuilder();
   SALOMEDS::UseCaseBuilder_var useCaseBuilder = study->GetUseCaseBuilder();
 
@@ -237,6 +226,56 @@ MED::unregisterPresentation(SALOMEDS::Study_ptr study,
       }
     }
   }
+
+  return MED_ORB::OP_OK;
+}
+
+MED_ORB::PresentationsList*
+MED::getSiblingPresentations(SALOMEDS::Study_ptr study, CORBA::Long presentationId)
+{
+  // set exception handler to catch unexpected CORBA exceptions
+  Unexpect aCatch(SALOME_SalomeException);
+
+  MED_ORB::PresentationsList* presList = new MED_ORB::PresentationsList;
+
+  SALOMEDS::StudyBuilder_var studyBuilder = study->NewBuilder();
+  SALOMEDS::UseCaseBuilder_var useCaseBuilder = study->GetUseCaseBuilder();
+
+  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;
+
+      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);
+            }
+          }
+        }
+        return presList;
+      }
+    }
+  }
+
+  return presList;
 }
 
 Engines::TMPFile*
@@ -311,7 +350,7 @@ MED::getObjectInfo(CORBA::Long studyId, const char* entry)
   //bool isPresentation = false;
   int sourceId = -1;
   int meshId = -1;
-  //int fieldSeriesId = -1;
+  int fieldSeriesId = -1;
   int fieldId = -1;
   int presentationId = -1;
   if (aSObj->FindAttribute(anAttribute, "AttributeParameter")) {
@@ -324,8 +363,8 @@ MED::getObjectInfo(CORBA::Long studyId, const char* entry)
       sourceId = attrParam->GetInt(SOURCE_ID);
     if (attrParam->IsSet(MESH_ID, PT_INTEGER))
       meshId = attrParam->GetInt(MESH_ID);
-    //if (attrParam->IsSet(FIELD_SERIES_ID, PT_INTEGER))
-    //  fieldSeriesId = attrParam->GetInt(FIELD_SERIES_ID);
+    if (attrParam->IsSet(FIELD_SERIES_ID, PT_INTEGER))
+      fieldSeriesId = attrParam->GetInt(FIELD_SERIES_ID);
     if (attrParam->IsSet(FIELD_ID, PT_INTEGER))
       fieldId = attrParam->GetInt(FIELD_ID);
     if (attrParam->IsSet(PRESENTATION_ID, PT_INTEGER))
@@ -340,8 +379,8 @@ MED::getObjectInfo(CORBA::Long studyId, const char* entry)
     oss << "Source id: " << sourceId << std::endl;
   if (meshId > -1)
     oss << "Mesh id: " << meshId << std::endl;
-  //if (fieldSeriesId > -1)
-  //  oss << "Field series id: " << fieldSeriesId << std::endl;
+  if (fieldSeriesId > -1)
+    oss << "Field series id: " << fieldSeriesId << std::endl;
   if (fieldId > -1)
     oss << "Field id: " << fieldId << std::endl;
   //oss << "Is presentation: " << isPresentation << std::endl;
index 73270a20861650b1c7e7838dcefdb804a6298b8c..ddd373a7696924a51e0c47d5c525203f565d937c 100644 (file)
@@ -64,6 +64,10 @@ public:
   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);
+
   /*! Dump the study as a Python file */
   virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
                                        CORBA::Boolean isPublished,
index aa5075387ef6cbbe09c863b4e52aed794a9d44af..48305be826ccb315fcda4adcfdbef4c0c288bc16 100644 (file)
 #include "MEDPresentation.hxx"
 #include "MEDPresentationException.hxx"
 #include "MEDCouplingRefCountObject.hxx"
-#include <iostream>
+#include "Basics_Utils.hxx"
+#include "PyInterp_Utils.h"
+
+#include <sstream>
 
 MEDPresentation::MEDPresentation(MEDPresentation::TypeID fieldHandlerId, const std::string& name)
-    : _fieldHandlerId(fieldHandlerId), _pipeline(0), _display(0), _properties()
+    : _fieldHandlerId(fieldHandlerId), _pipeline(0), _display(0), _properties(),
+      _renderViewPyId(GeneratePythonId())
 {
   MEDCALC::MEDDataManager_ptr dataManager(MEDFactoryClient::getDataManager());
   MEDCALC::FieldHandler* fieldHandler = dataManager->getFieldHandler(fieldHandlerId);
@@ -47,8 +51,19 @@ MEDPresentation::MEDPresentation(MEDPresentation::TypeID fieldHandlerId, const s
 
 MEDPresentation::~MEDPresentation()
 {
-  std::cout << "###TODO#### ~MEDPresentation: clear pipeline\n";
-  std::cout << "###TODO#### ~MEDPresentation: clear display\n";
+  STDLOG("~MEDPresentation(): clear display");
+  {
+    PyLockWrapper lock;
+    std::ostringstream oss_o, oss_v, oss;
+    // Get top level object and display:
+    oss_o << "__obj" << _pipeline.front().first;
+    oss_v << "__view" << _renderViewPyId;
+    oss << "pvs.Hide(" << oss_o.str() <<  ", view=" << oss_v.str() << ");";
+    oss << "pvs.Render();";
+
+//    std::cerr << oss.str() << std::endl;
+    PyRun_SimpleString(oss.str().c_str());
+  }
 }
 
 void
@@ -60,12 +75,21 @@ MEDPresentation::generatePipeline()
 }
 
 void
-MEDPresentation::pushInternal(PyObject* obj, PyObject* disp)
+MEDPresentation::pushPyObjects(PyObjectId obj, PyObjectId disp)
 {
   _pipeline.push_back(obj);
   _display.push_back(disp);
 }
 
+void
+MEDPresentation::pushAndExecPyLine(const std::string & lin)
+{
+  // TODO: store internally for low level dump
+  PyLockWrapper lock;
+//  std::cerr << lin << std::endl;
+  PyRun_SimpleString(lin.c_str());
+}
+
 void
 MEDPresentation::setProperty(const std::string& propName, const std::string& propValue)
 {
@@ -86,7 +110,7 @@ MEDPresentation::getProperty(const std::string& propName) const
     return (*it).second;
   }
   else {
-    std::cerr << "getProperty(): no property named " << propName << std::endl;
+    STDLOG("MEDPresentation::getProperty(): no property named " + propName);
     return std::string();
   }
 }
@@ -112,7 +136,7 @@ MEDPresentation::getFieldTypeString(MEDCoupling::TypeOfField fieldType) const
     case MEDCoupling::ON_NODES:
       return "POINTS";
     default:
-      std::cerr << "MEDPresentation::getFieldTypeString() -- Not implemented ! Gauss points?";
+      STDLOG("MEDPresentation::getFieldTypeString() -- Not implemented ! Gauss points?");
       return "";
   }
 }
@@ -120,29 +144,33 @@ MEDPresentation::getFieldTypeString(MEDCoupling::TypeOfField fieldType) const
 std::string
 MEDPresentation::getRenderViewCommand(MEDCALC::MEDPresentationViewMode viewMode) const
 {
-  std::string cmd = std::string("pvs._DisableFirstRenderCameraReset();");
+  std::ostringstream oss, oss2;
+  oss << "__view" << _renderViewPyId;
+  std::string view(oss.str());
+  oss2 << "pvs._DisableFirstRenderCameraReset();";
   if (viewMode == MEDCALC::VIEW_MODE_OVERLAP) {
-    cmd += std::string("__view1 = pvs.GetActiveViewOrCreate('RenderView');");
+      oss2 << view << " = pvs.GetActiveViewOrCreate('RenderView');";
   } else if (viewMode == MEDCALC::VIEW_MODE_REPLACE) {
-    cmd += std::string("__view1 = pvs.GetActiveViewOrCreate('RenderView');");
-    cmd += std::string("pvs.active_objects.source and pvs.Hide(view=__view1);");
-    cmd += std::string("pvs.Render();");
+      oss2 << view << " = pvs.GetActiveViewOrCreate('RenderView');";
+      oss2 << "pvs.active_objects.source and pvs.Hide(view=" << view << ");";
+      oss2 << "pvs.Render();";
   } else if (viewMode == MEDCALC::VIEW_MODE_NEW_LAYOUT) {
-    cmd += std::string("__layout1 = pvs.servermanager.misc.ViewLayout(registrationGroup='layouts');");
-    cmd += std::string("__view1 = pvs.CreateView('RenderView');");
+      oss2 <<  "__layout1 = pvs.servermanager.misc.ViewLayout(registrationGroup='layouts');";
+      oss2 << view << " = pvs.CreateView('RenderView');";
   } else if (viewMode == MEDCALC::VIEW_MODE_SPLIT_VIEW) {
-    cmd += std::string("__view1 = pvs.CreateView('RenderView');");
+      oss2 << view << " = pvs.CreateView('RenderView');";
   }
-  return cmd;
+  return oss2.str();
 }
 
 std::string
 MEDPresentation::getResetCameraCommand() const
 {
-  return std::string("__view1.ResetCamera();");
+  std::ostringstream oss;
+  oss << "__view" << _renderViewPyId << ".ResetCamera();";
+  return oss.str();
 }
 
-
 std::string
 MEDPresentation::getColorMapCommand(MEDCALC::MEDPresentationColorMap colorMap) const
 {
@@ -151,3 +179,20 @@ MEDPresentation::getColorMapCommand(MEDCALC::MEDPresentationColorMap colorMap) c
   case MEDCALC::COLOR_MAP_COOL_TO_WARM: return "Cool to Warm";
   }
 }
+
+int
+MEDPresentation::GeneratePythonId()
+{
+  static int INIT_ID = 0;
+  return INIT_ID++;
+}
+
+void
+MEDPresentation::activateView() const
+{
+  PyLockWrapper lock;
+  std::ostringstream oss;
+  oss << "pvs.SetActiveView(__view" << _renderViewPyId << ");";
+  std::cerr << oss.str() << std::endl;
+  PyRun_SimpleString(oss.str().c_str());
+}
index 5be9e89cf373b96b3ddcabfa0f561dd54cb56bd8..d67971dbed4236e2d3c43efa12d569b161309871 100644 (file)
@@ -46,7 +46,10 @@ public:
   void setProperty(const std::string& propName, const std::string& propValue);
   const std::string getProperty(const std::string& propName) const;
 
+  void activateView() const;
+
 protected:
+  typedef std::pair<int, PyObject *> PyObjectId;
 
   MEDPresentation(MEDPresentation::TypeID fieldHandlerId, const std::string& name);
   std::string getRenderViewCommand(MEDCALC::MEDPresentationViewMode viewMode) const;
@@ -55,9 +58,15 @@ protected:
 
   virtual void internalGeneratePipeline() = 0;
   PyObject* getPythonObjectFromMain(const char* var) const;
-  void pushInternal(PyObject* obj, PyObject* disp = NULL);
+  void pushPyObjects(PyObjectId obj, PyObjectId disp);
+  void pushAndExecPyLine(const std::string & lin);
 
   MEDPresentation::TypeID getID() const { return _fieldHandlerId; }
+  long getPyViewID() const { return _renderViewPyId; }
+
+  static int GeneratePythonId();
+
+  virtual MEDCALC::MEDPresentationViewMode getViewMode() = 0;
 
 private:
 
@@ -70,20 +79,21 @@ private:
   void updatePipeline(PresentationParameters params);
 
 protected:
-
   std::string _fileName;
   std::string _fieldName;
   std::string _fieldType;
 
-private:
+  ///! Identifier (in the Python dump) of the render view
+  int _renderViewPyId;
 
+private:
   MEDPresentation::TypeID _fieldHandlerId;
 
   ///! Pipeline elements
-  std::vector<PyObject*> _pipeline;
+  std::vector<PyObjectId> _pipeline;
 
   ///! Corresponding display object, if any:
-  std::vector<PyObject*> _display;
+  std::vector<PyObjectId> _display;
 
   ///! Presentation properties <key,value>
   std::map<std::string, std::string> _properties;
index cdf86ed6715aa9be5921fc8734879ab80517aa09..87ce8e8c2818d17eb0e5d64abf814b2130d23bdf 100644 (file)
 void
 MEDPresentationContour::internalGeneratePipeline()
 {
-  PyGILState_STATE _gil_state = PyGILState_Ensure();
-
-  std::string cmd = std::string("import pvsimple as pvs;");
-  cmd += getRenderViewCommand(_params.viewMode); // define __view1
-
-  cmd += std::string("__obj1 = pvs.MEDReader(FileName='") + _fileName + std::string("');");
-  cmd += std::string("__isovolume1 = pvs.IsoVolume(Input=__obj1);");
-  cmd += std::string("__disp1 = pvs.Show(__isovolume1, __view1);");
-  cmd += std::string("pvs.ColorBy(__disp1, ('") + _fieldType + std::string("', '") + _fieldName + std::string("'));");
-  cmd += std::string("__disp1.SetScalarBarVisibility(__view1, True);");
-  cmd += std::string("__disp1.RescaleTransferFunctionToDataRangeOverTime();");
-  cmd += std::string("pvs.Render();");
-
-  cmd += getResetCameraCommand();
-
-  //std::cerr << "Python command:" << std::endl;
-  //std::cerr << cmd << std::endl;
-  PyRun_SimpleString(cmd.c_str());
-  // Retrieve Python object for internal storage:
-  PyObject* obj = getPythonObjectFromMain("__isovolume1");
-  PyObject* disp = getPythonObjectFromMain("__disp1");
-  pushInternal(obj, disp);
-
-  PyGILState_Release(_gil_state);
+//  PyGILState_STATE _gil_state = PyGILState_Ensure();
+//
+//  std::string cmd = std::string("import pvsimple as pvs;");
+//  cmd += getRenderViewCommand(_params.viewMode); // define __view1
+//
+//  cmd += std::string("__obj1 = pvs.MEDReader(FileName='") + _fileName + std::string("');");
+//  cmd += std::string("__isovolume1 = pvs.IsoVolume(Input=__obj1);");
+//  cmd += std::string("__disp1 = pvs.Show(__isovolume1, __view1);");
+//  cmd += std::string("pvs.ColorBy(__disp1, ('") + _fieldType + std::string("', '") + _fieldName + std::string("'));");
+//  cmd += std::string("__disp1.SetScalarBarVisibility(__view1, True);");
+//  cmd += std::string("__disp1.RescaleTransferFunctionToDataRangeOverTime();");
+//  cmd += std::string("pvs.Render();");
+//
+//  cmd += getResetCameraCommand();
+//
+//  //std::cerr << "Python command:" << std::endl;
+//  //std::cerr << cmd << std::endl;
+//  PyRun_SimpleString(cmd.c_str());
+//  // Retrieve Python object for internal storage:
+//  PyObject* obj = getPythonObjectFromMain("__isovolume1");
+//  PyObject* disp = getPythonObjectFromMain("__disp1");
+//  pushInternal(obj, disp);
+//
+//  PyGILState_Release(_gil_state);
 }
 
 void
index e03b76b58ba4b061b8892d5bc6a54047d989be41..364965cd6000563a9748ba0d5b0dc99fcfc0f7e5 100644 (file)
@@ -32,6 +32,7 @@ public:
   virtual ~MEDPresentationContour() {}
 
   void updatePipeline(const MEDCALC::ContourParameters& params);
+  MEDCALC::MEDPresentationViewMode getViewMode() { return _params.viewMode; }
 
 protected:
   virtual void internalGeneratePipeline();
index e56aa9f4bde1cd9a2c5cab70dc2b64e7839766bf..12a1d288a6ebcdf5f493583733e2622ca9eb33a0 100644 (file)
 void
 MEDPresentationDeflectionShape::internalGeneratePipeline()
 {
-  PyGILState_STATE _gil_state = PyGILState_Ensure();
-
-  std::string cmd = std::string("import pvsimple as pvs;");
-  cmd += getRenderViewCommand(_params.viewMode); // define __view1
-
-  cmd += std::string("__obj1 = pvs.MEDReader(FileName='") + _fileName + std::string("');");
-  cmd += std::string("__warpByVector1 = pvs.WarpByVector(Input=__obj1);");
-  cmd += std::string("__disp1 = pvs.Show(__warpByVector1, __view1);");
-  cmd += std::string("pvs.ColorBy(__disp1, ('") + _fieldType + std::string("', '") + _fieldName + std::string("'));");
-  cmd += std::string("__disp1.SetScalarBarVisibility(__view1, True);");
-  cmd += std::string("__disp1.RescaleTransferFunctionToDataRangeOverTime();");
-  cmd += std::string("pvs.Render();");
-
-  cmd += getResetCameraCommand();
-
-  //std::cerr << "Python command:" << std::endl;
-  //std::cerr << cmd << std::endl;
-  PyRun_SimpleString(cmd.c_str());
-  // Retrieve Python object for internal storage:
-  PyObject* obj = getPythonObjectFromMain("__warpByVector1");
-  PyObject* disp = getPythonObjectFromMain("__disp1");
-  pushInternal(obj, disp);
-
-  PyGILState_Release(_gil_state);
+//  PyGILState_STATE _gil_state = PyGILState_Ensure();
+//
+//  std::string cmd = std::string("import pvsimple as pvs;");
+//  cmd += getRenderViewCommand(_params.viewMode); // define __view1
+//
+//  cmd += std::string("__obj1 = pvs.MEDReader(FileName='") + _fileName + std::string("');");
+//  cmd += std::string("__warpByVector1 = pvs.WarpByVector(Input=__obj1);");
+//  cmd += std::string("__disp1 = pvs.Show(__warpByVector1, __view1);");
+//  cmd += std::string("pvs.ColorBy(__disp1, ('") + _fieldType + std::string("', '") + _fieldName + std::string("'));");
+//  cmd += std::string("__disp1.SetScalarBarVisibility(__view1, True);");
+//  cmd += std::string("__disp1.RescaleTransferFunctionToDataRangeOverTime();");
+//  cmd += std::string("pvs.Render();");
+//
+//  cmd += getResetCameraCommand();
+//
+//  //std::cerr << "Python command:" << std::endl;
+//  //std::cerr << cmd << std::endl;
+//  PyRun_SimpleString(cmd.c_str());
+//  // Retrieve Python object for internal storage:
+//  PyObject* obj = getPythonObjectFromMain("__warpByVector1");
+//  PyObject* disp = getPythonObjectFromMain("__disp1");
+//  pushInternal(obj, disp);
+//
+//  PyGILState_Release(_gil_state);
 }
 
 void
index f9bbbb2f24f7e7a9e255ff2fde8577ade249589d..f03240e087ff2cab0c09d56e7b70bb3fcf6b9e84 100644 (file)
@@ -32,6 +32,7 @@ public:
   virtual ~MEDPresentationDeflectionShape() {}
 
   void updatePipeline(const MEDCALC::DeflectionShapeParameters& params);
+  MEDCALC::MEDPresentationViewMode getViewMode() { return _params.viewMode; }
 
 protected:
   virtual void internalGeneratePipeline();
index a2e3cfb0925649157def5f5f9dc42e781cf19f27..920d0e060e2d92ddadbd893dafb224e0bd38eee9 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "MEDPresentationManager_i.hxx"
 #include "MEDFactoryClient.hxx"
+#include "Basics_Utils.hxx"
 
 // presentations
 #include "MEDPresentationScalarMap.hxx"
@@ -29,6 +30,7 @@
 #include "MEDPresentationPointSprite.hxx"
 
 #include <iostream>
+#include <sstream>
 
 MEDPresentationManager_i* MEDPresentationManager_i::_instance = NULL;
 
@@ -179,13 +181,36 @@ MEDPresentationManager_i::removePresentation(MEDPresentation::TypeID presentatio
   if (presentation)
     delete presentation;
   _presentations.erase(presentationID);
+
+  std::stringstream sstm;
+  sstm << "Presentation " << presentationID << " has been removed.\n";
+  STDLOG(sstm.str());
+
   return true;
 }
 
-MEDPresentation::TypeID
-MEDPresentationManager_i::_getActivePresentationId() const
+CORBA::Boolean
+MEDPresentationManager_i::activateView(MEDPresentation::TypeID presentationID)
 {
-  // :TODO:
+  std::map<MEDPresentation::TypeID, MEDPresentation*>::const_iterator citr = _presentations.find(presentationID);
+  if (citr == _presentations.end()) {
+    std::cerr << "getPresentationPyViewId(): presentation not found!!" << std::endl;
+    return false;
+  }
+  MEDPresentation* presentation = (*citr).second;
 
-  return -1;
+  presentation->activateView();
+  return true;
+}
+
+MEDCALC::MEDPresentationViewMode
+MEDPresentationManager_i::getPresentationViewMode(MEDPresentation::TypeID presentationID)
+{
+  MEDPresentation* pres = _getPresentation(presentationID);
+  if (pres) {
+    return pres->getViewMode();
+  } else {
+    std::cerr << "setPresentationProperty(): presentation not found!!" << std::endl;
+    return MEDCALC::VIEW_MODE_DEFAULT;
+  }
 }
index e7ec9677cf22ed0ca7dec49f018e5c4b684d2d7c..4d455d20de4ac817d2b90d4b202b5886d37c67af 100644 (file)
@@ -46,17 +46,21 @@ class MEDPresentationManager_i: public POA_MEDCALC::MEDPresentationManager,
   MEDCALC_EXPORT MEDPresentation::TypeID makeDeflectionShape(const MEDCALC::DeflectionShapeParameters&);
   MEDCALC_EXPORT MEDPresentation::TypeID makePointSprite(const MEDCALC::PointSpriteParameters&);
 
-  MEDCALC_EXPORT void setPresentationProperty(MEDPresentation::TypeID presentationID, const char* propName, const char* propValue);
-  MEDCALC_EXPORT char* getPresentationProperty(MEDPresentation::TypeID presentationID, const char* propName);
+  MEDCALC_EXPORT void setPresentationProperty(MEDPresentation::TypeID, const char* propName, const char* propValue);
+  MEDCALC_EXPORT char* getPresentationProperty(MEDPresentation::TypeID, const char* propName);
 
-  MEDCALC_EXPORT void updateScalarMap(MEDPresentation::TypeID presentationID, const MEDCALC::ScalarMapParameters&);
-  MEDCALC_EXPORT void updateContour(MEDPresentation::TypeID presentationID, const MEDCALC::ContourParameters&);
-  MEDCALC_EXPORT void updateVectorField(MEDPresentation::TypeID presentationID, const MEDCALC::VectorFieldParameters&);
-  MEDCALC_EXPORT void updateSlices(MEDPresentation::TypeID presentationID, const MEDCALC::SlicesParameters&);
-  MEDCALC_EXPORT void updateDeflectionShape(MEDPresentation::TypeID presentationID, const MEDCALC::DeflectionShapeParameters&);
-  MEDCALC_EXPORT void updatePointSprite(MEDPresentation::TypeID presentationID, const MEDCALC::PointSpriteParameters&);
+  MEDCALC_EXPORT void updateScalarMap(MEDPresentation::TypeID, const MEDCALC::ScalarMapParameters&);
+  MEDCALC_EXPORT void updateContour(MEDPresentation::TypeID, const MEDCALC::ContourParameters&);
+  MEDCALC_EXPORT void updateVectorField(MEDPresentation::TypeID, const MEDCALC::VectorFieldParameters&);
+  MEDCALC_EXPORT void updateSlices(MEDPresentation::TypeID, const MEDCALC::SlicesParameters&);
+  MEDCALC_EXPORT void updateDeflectionShape(MEDPresentation::TypeID, const MEDCALC::DeflectionShapeParameters&);
+  MEDCALC_EXPORT void updatePointSprite(MEDPresentation::TypeID, const MEDCALC::PointSpriteParameters&);
 
-  MEDCALC_EXPORT CORBA::Boolean removePresentation(MEDPresentation::TypeID presentationID);
+  MEDCALC_EXPORT CORBA::Boolean removePresentation(MEDPresentation::TypeID);
+
+  MEDCALC_EXPORT CORBA::Boolean activateView(MEDPresentation::TypeID);
+
+  MEDCALC_EXPORT MEDCALC::MEDPresentationViewMode getPresentationViewMode(MEDPresentation::TypeID);
 
  private:
   MEDPresentationManager_i();
@@ -73,7 +77,6 @@ class MEDPresentationManager_i: public POA_MEDCALC::MEDPresentationManager,
   void _updatePresentation(MEDPresentation::TypeID presentationID, PresentationParameters params);
 
   MEDPresentation* _getPresentation(MEDPresentation::TypeID) const;
-  MEDPresentation::TypeID _getActivePresentationId() const;
 
  private :
 
index 4c66cfc719180ee00e429e0cb41b9bb7d9403de7..eb283bf152986e6e60abcb850c3e4dd16c52e227 100644 (file)
@@ -24,13 +24,6 @@ template<typename PresentationType, typename PresentationParameters>
 MEDPresentation::TypeID
 MEDPresentationManager_i::_makePresentation(PresentationParameters params)
 {
-  // Replace = Remove then add
-  if (params.viewMode == MEDCALC::VIEW_MODE_REPLACE) {
-    MEDPresentation::TypeID currentPresentationId = _getActivePresentationId();
-    if (currentPresentationId > -1)
-      removePresentation(currentPresentationId);
-  }
-
   // Create a new presentation instance
   PresentationType* presentation = NULL;
   try {
index f3688036998db07a42db527676c0bccfcec6d8f4..18fdff4d37e6f17f3cbcb5c434a839904a2f88bc 100644 (file)
 void
 MEDPresentationPointSprite::internalGeneratePipeline()
 {
-  PyGILState_STATE _gil_state = PyGILState_Ensure();
-
-  std::string cmd = std::string("import pvsimple as pvs;");
-  cmd += getRenderViewCommand(_params.viewMode); // define __view1
-
-  cmd += std::string("__obj1 = pvs.MEDReader(FileName='") + _fileName + std::string("');");
-  cmd += std::string("__disp1 = pvs.Show(__obj1, __view1);");
-  cmd += std::string("pvs.ColorBy(__disp1, ('") + _fieldType + std::string("', '") + _fieldName + std::string("'));");
-  cmd += std::string("__disp1.SetScalarBarVisibility(__view1, True);");
-  cmd += std::string("__disp1.RescaleTransferFunctionToDataRangeOverTime();");
-  cmd += std::string("__disp1.SetRepresentationType('Point Sprite');");
-  cmd += std::string("pvs.Render();");
-
-  cmd += getResetCameraCommand();
-
-  //std::cerr << "Python command:" << std::endl;
-  //std::cerr << cmd << std::endl;
-  PyRun_SimpleString(cmd.c_str());
-  // Retrieve Python object for internal storage:
-  PyObject* obj = getPythonObjectFromMain("__obj1");
-  PyObject* disp = getPythonObjectFromMain("__disp1");
-  pushInternal(obj, disp);
-
-  PyGILState_Release(_gil_state);
+//  PyGILState_STATE _gil_state = PyGILState_Ensure();
+//
+//  std::string cmd = std::string("import pvsimple as pvs;");
+//  cmd += getRenderViewCommand(_params.viewMode); // define __view1
+//
+//  cmd += std::string("__obj1 = pvs.MEDReader(FileName='") + _fileName + std::string("');");
+//  cmd += std::string("__disp1 = pvs.Show(__obj1, __view1);");
+//  cmd += std::string("pvs.ColorBy(__disp1, ('") + _fieldType + std::string("', '") + _fieldName + std::string("'));");
+//  cmd += std::string("__disp1.SetScalarBarVisibility(__view1, True);");
+//  cmd += std::string("__disp1.RescaleTransferFunctionToDataRangeOverTime();");
+//  cmd += std::string("__disp1.SetRepresentationType('Point Sprite');");
+//  cmd += std::string("pvs.Render();");
+//
+//  cmd += getResetCameraCommand();
+//
+//  //std::cerr << "Python command:" << std::endl;
+//  //std::cerr << cmd << std::endl;
+//  PyRun_SimpleString(cmd.c_str());
+//  // Retrieve Python object for internal storage:
+//  PyObject* obj = getPythonObjectFromMain("__obj1");
+//  PyObject* disp = getPythonObjectFromMain("__disp1");
+//  pushInternal(obj, disp);
+//
+//  PyGILState_Release(_gil_state);
 }
 
 void
index 27530af82a8ddd35cb084735de45f91b855584dc..49b200b125a1d7c71c2436784f485f6b94f11738 100644 (file)
@@ -32,6 +32,7 @@ public:
   virtual ~MEDPresentationPointSprite() {}
 
   void updatePipeline(const MEDCALC::PointSpriteParameters& params);
+  MEDCALC::MEDPresentationViewMode getViewMode() { return _params.viewMode; }
 
 protected:
   virtual void internalGeneratePipeline();
index 6042bf8f3446640bcb3c231ab81f3ec17418373c..6af5375bd2729fc3fe637f8a4f6778a9839dcc7c 100644 (file)
 //
 
 #include "MEDPresentationScalarMap.hxx"
+#include "PyInterp_Utils.h"
+
+#include <sstream>
 
 void
 MEDPresentationScalarMap::internalGeneratePipeline()
 {
-  PyGILState_STATE _gil_state = PyGILState_Ensure();
+  PyLockWrapper lock;
 
-  std::string cmd = std::string("import pvsimple as pvs;");
-  cmd += getRenderViewCommand(_params.viewMode); // define __view1
+  int disp_id(GeneratePythonId());
+  int obj_id(disp_id);
+  std::ostringstream oss_o, oss_d, oss, oss_v;
+  oss_o << "__obj" << obj_id;      std::string obj(oss_o.str());
+  oss_d << "__disp" << disp_id;    std::string disp(oss_d.str());
 
-  cmd += std::string("__obj1 = pvs.MEDReader(FileName='") + _fileName + std::string("');");
-  cmd += std::string("__disp1 = pvs.Show(__obj1, __view1);");
-  cmd += std::string("pvs.ColorBy(__disp1, ('") + _fieldType + std::string("', '") + _fieldName + std::string("'));");
-  cmd += std::string("__disp1.SetScalarBarVisibility(__view1, True);");
-  cmd += std::string("__disp1.RescaleTransferFunctionToDataRangeOverTime();");
-  cmd += std::string("__lut = pvs.GetColorTransferFunction('")+_fieldName+std::string("');");
-  cmd += std::string("__lut.ApplyPreset('")+getColorMapCommand(_params.colorMap)+std::string("',True);");
-  cmd += std::string("pvs.Render();");
+  pushAndExecPyLine( "import pvsimple as pvs;");
+  pushAndExecPyLine( getRenderViewCommand(_params.viewMode) ); // define __viewXXX
 
-  cmd += getResetCameraCommand();
+  oss_v << "__view" << _renderViewPyId;    std::string view(oss_v.str());
 
-  //std::cerr << "Python command:" << std::endl;
-  //std::cerr << cmd << std::endl;
-  PyRun_SimpleString(cmd.c_str());
-  // Retrieve Python object for internal storage:
-  PyObject* obj = getPythonObjectFromMain("__obj1");
-  PyObject* disp = getPythonObjectFromMain("__disp1");
-  pushInternal(obj, disp);
+  oss << obj << " = pvs.MEDReader(FileName='" << _fileName << "');";
+  pushAndExecPyLine(oss.str()); oss.str("");
+  oss << disp << " = pvs.Show(" << obj << ", " << view << ");";
+  pushAndExecPyLine(oss.str()); oss.str("");
+  oss << "pvs.ColorBy(" << disp << ", ('" << _fieldType << "', '" << _fieldName << "'));";
+  pushAndExecPyLine(oss.str()); oss.str("");
+  oss << disp <<  ".SetScalarBarVisibility(" << view << ", True);";
+  pushAndExecPyLine(oss.str()); oss.str("");
+  oss << disp <<  ".RescaleTransferFunctionToDataRangeOverTime();";
+  pushAndExecPyLine(oss.str()); oss.str("");
+  oss << "__lut = pvs.GetColorTransferFunction('" << _fieldName << "');";
+  pushAndExecPyLine(oss.str()); oss.str("");
+  oss << "__lut.ApplyPreset('" << getColorMapCommand(_params.colorMap) << "',True);";
+  pushAndExecPyLine(oss.str()); oss.str("");
+  pushAndExecPyLine(getResetCameraCommand());
+  pushAndExecPyLine("pvs.Render();");
 
-  PyGILState_Release(_gil_state);
+  // Retrieve Python object for internal storage:
+  PyObject* p_obj = getPythonObjectFromMain(obj.c_str());
+  PyObject* p_disp = getPythonObjectFromMain(disp.c_str());
+  pushPyObjects(std::make_pair(obj_id, p_obj), std::make_pair(disp_id, p_disp));
 }
 
 void
index d3d1ae1cf5e3a566d92d884042bb954fd4c4e4da..2b35a3482b76b79c36441525f1e0d93cd7167641 100644 (file)
@@ -32,6 +32,7 @@ public:
   virtual ~MEDPresentationScalarMap() {}
 
   void updatePipeline(const MEDCALC::ScalarMapParameters& params);
+  MEDCALC::MEDPresentationViewMode getViewMode() { return _params.viewMode; }
 
 protected:
   virtual void internalGeneratePipeline();
index 9b5d97c3c67c7a95049359e8021a06355dc22144..243468f0b36ea97498df4564480426d07f588d1c 100644 (file)
 void
 MEDPresentationSlices::internalGeneratePipeline()
 {
-  PyGILState_STATE _gil_state = PyGILState_Ensure();
-
-  std::string cmd = std::string("import pvsimple as pvs;");
-  cmd += getRenderViewCommand(_params.viewMode); // define __view1
-
-  cmd += std::string("__obj1 = pvs.MEDReader(FileName='") + _fileName + std::string("');");
-  cmd += std::string("__slice1 = pvs.Slice(Input=__obj1);");
-  cmd += std::string("__disp1 = pvs.Show(__slice1, __view1);");
-  cmd += std::string("pvs.ColorBy(__disp1, ('") + _fieldType + std::string("', '") + _fieldName + std::string("'));");
-  cmd += std::string("__disp1.SetScalarBarVisibility(__view1, True);");
-  cmd += std::string("__disp1.RescaleTransferFunctionToDataRangeOverTime();");
-  cmd += std::string("pvs.Render();");
-
-  cmd += getResetCameraCommand();
-
-  //std::cerr << "Python command:" << std::endl;
-  //std::cerr << cmd << std::endl;
-  PyRun_SimpleString(cmd.c_str());
-  // Retrieve Python object for internal storage:
-  PyObject* obj = getPythonObjectFromMain("__slice1");
-  PyObject* disp = getPythonObjectFromMain("__disp1");
-  pushInternal(obj, disp);
-
-  PyGILState_Release(_gil_state);
+//  PyGILState_STATE _gil_state = PyGILState_Ensure();
+//
+//  std::string cmd = std::string("import pvsimple as pvs;");
+//  cmd += getRenderViewCommand(_params.viewMode); // define __view1
+//
+//  cmd += std::string("__obj1 = pvs.MEDReader(FileName='") + _fileName + std::string("');");
+//  cmd += std::string("__slice1 = pvs.Slice(Input=__obj1);");
+//  cmd += std::string("__disp1 = pvs.Show(__slice1, __view1);");
+//  cmd += std::string("pvs.ColorBy(__disp1, ('") + _fieldType + std::string("', '") + _fieldName + std::string("'));");
+//  cmd += std::string("__disp1.SetScalarBarVisibility(__view1, True);");
+//  cmd += std::string("__disp1.RescaleTransferFunctionToDataRangeOverTime();");
+//  cmd += std::string("pvs.Render();");
+//
+//  cmd += getResetCameraCommand();
+//
+//  //std::cerr << "Python command:" << std::endl;
+//  //std::cerr << cmd << std::endl;
+//  PyRun_SimpleString(cmd.c_str());
+//  // Retrieve Python object for internal storage:
+//  PyObject* obj = getPythonObjectFromMain("__slice1");
+//  PyObject* disp = getPythonObjectFromMain("__disp1");
+//  pushInternal(obj, disp);
+//
+//  PyGILState_Release(_gil_state);
 }
 
 void
index b7ee4184e66f989f61d4e6240cbf97f3bf2018b4..7166a92bdb5baafe88e6bbba1727257ce74ad308 100644 (file)
@@ -32,6 +32,7 @@ public:
   virtual ~MEDPresentationSlices() {}
 
   void updatePipeline(const MEDCALC::SlicesParameters& params);
+  MEDCALC::MEDPresentationViewMode getViewMode() { return _params.viewMode; }
 
 protected:
   virtual void internalGeneratePipeline();
index c5a1b3e345aa6a741545d2ec36ce79027f788dfb..979f8ed8cfa258e55a11271c642c5495c135d032 100644 (file)
 void
 MEDPresentationVectorField::internalGeneratePipeline()
 {
-  PyGILState_STATE _gil_state = PyGILState_Ensure();
-
-  std::string cmd = std::string("import pvsimple as pvs;");
-  cmd += getRenderViewCommand(_params.viewMode); // define __view1
-
-  cmd += std::string("__obj1 = pvs.MEDReader(FileName='") + _fileName + std::string("');");
-  cmd += std::string("__disp1 = pvs.Show(__obj1, __view1);");
-  cmd += std::string("pvs.ColorBy(__disp1, ('") + _fieldType + std::string("', '") + _fieldName + std::string("'));");
-  cmd += std::string("__disp1.SetScalarBarVisibility(__view1, True);");
-  cmd += std::string("__disp1.RescaleTransferFunctionToDataRangeOverTime();");
-  cmd += std::string("__disp1.SetRepresentationType('3D Glyphs');");
-  cmd += std::string("pvs.Render();");
-
-  cmd += getResetCameraCommand();
-
-  //std::cerr << "Python command:" << std::endl;
-  //std::cerr << cmd << std::endl;
-  PyRun_SimpleString(cmd.c_str());
-  // Retrieve Python object for internal storage:
-  PyObject* obj = getPythonObjectFromMain("__obj1");
-  PyObject* disp = getPythonObjectFromMain("__disp1");
-  pushInternal(obj, disp);
-
-  PyGILState_Release(_gil_state);
+//  PyGILState_STATE _gil_state = PyGILState_Ensure();
+//
+//  std::string cmd = std::string("import pvsimple as pvs;");
+//  cmd += getRenderViewCommand(_params.viewMode); // define __view1
+//
+//  cmd += std::string("__obj1 = pvs.MEDReader(FileName='") + _fileName + std::string("');");
+//  cmd += std::string("__disp1 = pvs.Show(__obj1, __view1);");
+//  cmd += std::string("pvs.ColorBy(__disp1, ('") + _fieldType + std::string("', '") + _fieldName + std::string("'));");
+//  cmd += std::string("__disp1.SetScalarBarVisibility(__view1, True);");
+//  cmd += std::string("__disp1.RescaleTransferFunctionToDataRangeOverTime();");
+//  cmd += std::string("__disp1.SetRepresentationType('3D Glyphs');");
+//  cmd += std::string("pvs.Render();");
+//
+//  cmd += getResetCameraCommand();
+//
+//  //std::cerr << "Python command:" << std::endl;
+//  //std::cerr << cmd << std::endl;
+//  PyRun_SimpleString(cmd.c_str());
+//  // Retrieve Python object for internal storage:
+//  PyObject* obj = getPythonObjectFromMain("__obj1");
+//  PyObject* disp = getPythonObjectFromMain("__disp1");
+//  pushInternal(obj, disp);
+//
+//  PyGILState_Release(_gil_state);
 }
 
 void
index 7981f4264247690ca11f656c82ee3c7ee0e5f2b2..3da7403113c2ab6e15240c44b7b04a803acfa9c9 100644 (file)
@@ -32,6 +32,7 @@ public:
   virtual ~MEDPresentationVectorField() {}
 
   void updatePipeline(const MEDCALC::VectorFieldParameters& params);
+  MEDCALC::MEDPresentationViewMode getViewMode() { return _params.viewMode; }
 
 protected:
   virtual void internalGeneratePipeline();
index 36b014ce02d3a0876ad0157949620a45ecb667d8..8fa43b3f67fe603f1527ebd5330456da9fda6f5f 100644 (file)
@@ -230,8 +230,8 @@ void DatasourceController::OnExpandField()
     SALOMEDS::SObject_var soFieldseries = listOfSObject->at(i);
 
     // 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);
+    long fieldseriesId = _studyEditor->getParameterInt(soFieldseries,FIELD_SERIES_ID);
+    //long fieldseriesId = _studyEditor->getParameterInt(soFieldseries,FIELD_ID);
     STDLOG("Expand the field timeseries "<<fieldseriesId);
 
     // If fieldseriesId equals -1, then it means that it is not a
index cb0c4703e4e218374b03a02a1ccca5feb4aef7eb..1501c32b102dd4fc0e387875955f985435bbc9d5 100644 (file)
 
 #ifndef DISABLE_PVVIEWER
 #include "PVViewer_ViewModel.h"
+#include "PVViewer_GUIElements.h"
 #endif
 
+
+#include "MEDFactoryClient.hxx"
+#include "MEDPresentationManager_i.hxx"
 #include <QTimer>
 
 #include <sstream>
 
+#include <pqAnimationManager.h>
+#include <pqPVApplicationCore.h>
+
+
 //! The only instance of the reference to engine
-MED_ORB::MED_Gen_var MEDModule::myEngine;
+MED_ORB::MED_Gen_var MEDModule::_MED_engine;
+//! The only instance of the MEDPresentationManager
+MEDCALC::MEDPresentationManager_ptr MEDModule::_presManager;
 
 MEDModule::MEDModule() :
-  SalomeApp_Module("MED"), _studyEditor(0), _datasourceController(0), _workspaceController(0),
-  _presentationController(0), _processingController(0)
+  SalomeApp_Module("MED"), _studyEditor(0),
+  _datasourceController(0), _workspaceController(0), _presentationController(0),
+  _processingController(0), _pvGuiElements(0)
 {
   // Note also that we can't use the getApp() function here because
   // the initialize(...) function has not been called yet.
@@ -79,18 +90,23 @@ MED_ORB::MED_Gen_var
 MEDModule::engine()
 {
   init(); // initialize engine, if necessary
-  return myEngine;
+  return _MED_engine;
 }
 
 void
 MEDModule::init()
 {
   // initialize MED module engine (load, if necessary)
-  if ( CORBA::is_nil( myEngine ) ) {
+  if ( CORBA::is_nil( _MED_engine ) ) {
     Engines::EngineComponent_var comp =
       SalomeApp_Application::lcc()->FindOrLoad_Component( "FactoryServer", "MED" );
-    myEngine = MED_ORB::MED_Gen::_narrow( comp );
+    _MED_engine = MED_ORB::MED_Gen::_narrow( comp );
   }
+
+  // Retrieve MEDFactory to get MEDPresentationManager (sometimes
+  if ( ! _presManager ) {
+      _presManager = MEDFactoryClient::getFactory()->getPresentationManager();
+    }
 }
 
 //void MEDModule::onEventLoopStarted()
@@ -108,9 +124,13 @@ MEDModule::initialize( CAM_Application* app )
   // call the parent implementation
   SalomeApp_Module::initialize( app );
 
+  getApp()->objectBrowser()->setAutoOpenLevel(5);
+
   if (app && app->desktop()) {
     connect((QObject*) (getApp()->objectBrowser()->treeView()), SIGNAL(doubleClicked(const QModelIndex&)),
             this, SLOT(onDblClick(const QModelIndex&)));
+    connect((QObject*) (getApp()->objectBrowser()->treeView()), SIGNAL(clicked(const QModelIndex&)),
+                this, SLOT(onClick(const QModelIndex&)));
   }
 
   // The following initializes the GUI widget and associated actions
@@ -122,7 +142,7 @@ QString
 MEDModule::engineIOR() const
 {
   init(); // initialize engine, if necessary
-  CORBA::String_var anIOR = getApp()->orb()->object_to_string( myEngine.in() );
+  CORBA::String_var anIOR = getApp()->orb()->object_to_string( _MED_engine.in() );
   return QString( anIOR.in() );
 }
 
@@ -174,7 +194,7 @@ MEDModule::createPreferences()
 bool
 MEDModule::activateModule( SUIT_Study* theStudy )
 {
-  if ( CORBA::is_nil( myEngine ) )
+  if ( CORBA::is_nil( _MED_engine ) )
     return false;
 
   // call parent implementation
@@ -257,6 +277,28 @@ 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
+MEDModule::initToolbars()
+{
+  // VCR and Time toolbars:
+  SUIT_Desktop* dsk = getApp()->desktop();
+  _pvGuiElements = PVViewer_GUIElements::GetInstance(dsk);
+
+  _pvGuiElements->getVCRToolbar();  // make sure VCR toolbar is built
+  _pvGuiElements->setToolBarVisible(false);
+  _pvGuiElements->setVCRTimeToolBarVisible(true);
+
+  // Emit signal in order to make sure that animation scene is set - same trick as in PARAVIS module activation
+  QMetaObject::invokeMethod( pqPVApplicationCore::instance()->animationManager(),
+                             "activeSceneChanged",
+                             Q_ARG( pqAnimationScene*, pqPVApplicationCore::instance()->animationManager()->getActiveScene() ) );
+
 #ifdef MED_HAS_QTTESTING
   connect(_workspaceController, SIGNAL(workspaceSignal(const MEDCALC::MedEvent*)),
     _testController, SLOT(processWorkspaceEvent(const MEDCALC::MedEvent*)));
@@ -313,7 +355,7 @@ void
 MEDModule::addActionInPopupMenu(int actionId,const QString& menus,const QString& rule)
 {
   // _GBO_ for a fine customization of the rule (for example with a
-  // test on the type of the selected object), see the LIGTH module:
+  // test on the type of the selected object), see the LIGHT module:
   // implement "LightApp_Selection*    createSelection() const;"
   int parentId = -1;
   QtxPopupMgr* mgr = this->popupMgr();
@@ -337,45 +379,75 @@ MEDModule::getSelectedColorMap()
   return _presentationController->getSelectedColorMap();
 }
 
-void
-MEDModule::onDblClick(const QModelIndex& index)
+bool
+MEDModule::itemClickGeneric(const QModelIndex & index, std::string & name, int & fieldId, int & presId) const
 {
   DataObjectList dol = getApp()->objectBrowser()->getSelected();
   if (dol.isEmpty())
-    return;
+    return false;
   SalomeApp_DataObject* item = dynamic_cast<SalomeApp_DataObject*>(dol[0]);
   if (!item)
-    return;
+    return false;
   SalomeApp_DataModel *model = dynamic_cast<SalomeApp_DataModel*>(dataModel());
   if (!model)
-    return;
+    return false;
 
   if (item->componentDataType().toStdString() != "MED")
-    return;
+    return false;
   _PTR(SObject) obj = item->object();
   _PTR(GenericAttribute) anAttribute;
 
   if (! obj->FindAttribute(anAttribute, "AttributeName"))
-    return;
+    return false;
   _PTR(AttributeName) attrName(anAttribute);
-  std::string name = attrName->Value();
+  name = attrName->Value();
 
   if (! obj->FindAttribute(anAttribute, "AttributeParameter"))
-    return;
+    return false;
   _PTR(AttributeParameter) attrParam(anAttribute);
   if (! attrParam->IsSet(IS_PRESENTATION, PT_BOOLEAN)
       || ! attrParam->GetBool(IS_PRESENTATION)) { // Not a presentation
-    return;
+      return false;
   }
   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);
+  return true;
+}
+
+void
+MEDModule::onClick(const QModelIndex & index)
+{
+  int fieldId, presId;
+  std::string name;
+  if (!itemClickGeneric(index, name, fieldId, presId))
+    return;
+
+  STDLOG("Presentation selection (activate view)");
+  std::ostringstream oss;
+  oss << fieldId << " / " << presId;
+  STDLOG("    - Field id / pres id:   " + oss.str());
+  STDLOG("    - Presentation name: " + name);
+
+  _presManager->activateView(presId);
+}
+
+void
+MEDModule::onDblClick(const QModelIndex& index)
+{
+  int fieldId, presId;
+  std::string name;
+  if (!itemClickGeneric(index, name, fieldId, presId))
     return;
-  int fieldId = attrParam->GetInt(FIELD_ID);
 
   STDLOG("Presentation edition: NOT IMPLEMENTED YET");
   STDLOG("  Presention infos:");
-  STDLOG("    - Component:         " + item->componentDataType().toStdString());
-  STDLOG("    - Item entry:        " + item->entry().toStdString());
-  STDLOG("    - Item name:         " + item->name().toStdString());
+//  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());
index 4a2e01851234a9dd92d1565f4ce48ca4198e905a..7541e3f919534227299daf9d2a097c0430144fd1 100644 (file)
@@ -41,6 +41,8 @@
 #include <QModelIndex>
 
 class SalomeApp_Application;
+class PVViewer_GUIElements;
+class MEDPresentationManager_i;
 
 /*!
  * This class defines the gui of the MED module.
@@ -91,10 +93,15 @@ public slots:
   virtual bool activateModule(SUIT_Study* theStudy);
   virtual bool deactivateModule(SUIT_Study* theStudy);
   virtual void onDblClick(const QModelIndex& index);
+  virtual void onClick(const QModelIndex& index);
+
+
 
 private:
   void createModuleWidgets();
   void createModuleActions();
+  void initToolbars();
+  bool itemClickGeneric(const QModelIndex & index, std::string & name, int & fieldId, int & presId) const;
 
   static void init();
 
@@ -105,10 +112,17 @@ private:
   XmedDataModel* _xmedDataModel;
   PresentationController* _presentationController;
   ProcessingController* _processingController;
+
+  PVViewer_GUIElements*   _pvGuiElements;
+
+  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
-  static MED_ORB::MED_Gen_var myEngine;
 };
 
 #endif
index 7484fc4c111b09db7227ddef25907df34442fbca..cd650e7434ab4ed11459443b89a688eb0954d370 100644 (file)
       <source>ICO_MEDPresentationPointSprite_CLASSIC</source>
       <translation>visu_points16.png</translation>
     </message>
+    <message>
+      <source>ICO_DELETE_PRESENTATION</source>
+      <translation>close.png</translation>
+    </message>
   </context>
 </TS>
index 3812907928fd450a5c92f54e4caf40525c9e8f69..8841a7d85311851e091b114119a001c61a799214 100644 (file)
       <source>TIP_PRESENTATION_POINT_SPRITE</source>
       <translation>Point sprite</translation>
     </message>
+    <message>
+      <source>LAB_DELETE_PRESENTATION</source>
+      <translation>Delete presentation</translation>
+    </message>
+    <message>
+      <source>TIP_DELETE_PRESENTATION</source>
+      <translation>Delete selected presentation</translation>
+    </message> 
     <message>
       <source>MENU_PRESENTATIONS</source>
       <translation>Presentations</translation>
index 4356a10745f5d548f60f4c916b58719d918d2d42..1785436a6c16c255701b6e79554e1f1686373d9c 100644 (file)
@@ -24,6 +24,7 @@
 #include "QtxActionGroup.h"
 #include "QtxActionToolMgr.h"
 #include "MEDFactoryClient.hxx"
+#include "MEDPresentationManager_i.hxx"
 
 #include <SalomeApp_Application.h>
 #include <SalomeApp_Study.h>
@@ -36,6 +37,7 @@
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
 #include <QMessageBox>
+#include <sstream>
 
 static const int OPTIONS_VIEW_MODE_ID = 943;
 static const int OPTIONS_VIEW_MODE_REPLACE_ID = 944;
@@ -43,11 +45,11 @@ static const int OPTIONS_VIEW_MODE_OVERLAP_ID = 945;
 static const int OPTIONS_VIEW_MODE_NEW_LAYOUT_ID = 946;
 static const int OPTIONS_VIEW_MODE_SPLIT_VIEW_ID = 947;
 
-PresentationController::PresentationController(MEDModule* salomeModule)
+PresentationController::PresentationController(MEDModule* salomeModule) :
+    _salomeModule(salomeModule),
+    _studyEditor(salomeModule->getStudyEditor())
 {
   STDLOG("Creating a PresentationController");
-  _salomeModule = salomeModule;
-  _studyEditor = _salomeModule->getStudyEditor();
 
   _widgetPresentationParameters = new WidgetPresentationParameters();
 
@@ -174,6 +176,15 @@ PresentationController::createActions()
   _salomeModule->createTool(actionId, presentationToolbarId);
   _salomeModule->action(actionId)->setIconVisibleInMenu(true);
   _salomeModule->createMenu(actionId, presentationMenuId);
+
+  label   = tr("LAB_DELETE_PRESENTATION");
+  tooltip = tr("TIP_DELETE_PRESENTATION");
+  icon    = tr(_getIconName("ICO_DELETE_PRESENTATION").c_str());
+  actionId = _salomeModule->createStandardAction(label,this, SLOT(OnDeletePresentation()),icon,tooltip);
+//  _salomeModule->createTool(actionId, presentationToolbarId);
+//  _salomeModule->action(actionId)->setIconVisibleInMenu(true);
+  _salomeModule->createMenu(actionId, presentationMenuId);
+
 }
 
 MEDCALC::MEDPresentationViewMode
@@ -216,11 +227,27 @@ PresentationController::visualize(PresentationEvent::EventType eventType)
   // 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 = _studyEditor->getParameterInt(soField,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.
-    if ( fieldId < 0 )
-      continue;
+    int fieldId = -1;
+    try {
+        fieldId = _studyEditor->getParameterInt(soField,FIELD_ID);    }
+    catch(...)    { }
+    if (fieldId < 0)  // is it a field serie ?
+      {
+        int fieldSeriesId = -1;
+        try {
+            fieldSeriesId = _studyEditor->getParameterInt(soField,FIELD_SERIES_ID);      }
+        catch(...)  { }
+        // 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;
+      }
 
     MEDCALC::FieldHandler* fieldHandler = MEDFactoryClient::getDataManager()->getFieldHandler(fieldId);
     if (! fieldHandler) {
@@ -275,6 +302,38 @@ PresentationController::OnVisualizePointSprite()
   this->visualize(PresentationEvent::EVENT_VIEW_OBJECT_POINT_SPRITE);
 }
 
+void
+PresentationController::OnDeletePresentation()
+{
+  // We need a _studyEditor updated on the active study
+  _studyEditor->updateActiveStudy();
+
+  // Get the selected objects in the study (SObject)
+  SALOME_StudyEditor::SObjectList* listOfSObject = _studyEditor->getSelectedObjects();
+
+  // 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);
+    int presId = _studyEditor->getParameterInt(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.
+    if ( presId < 0 )
+      continue;
+
+    STDLOG("Requesting deletion of presentation: ")
+    std::ostringstream oss;
+    oss << presId;
+    STDLOG("    - Pres id:          " + oss.str());
+
+    PresentationEvent* event = new PresentationEvent();
+    event->eventtype = PresentationEvent::EVENT_DELETE_PRESENTATION;
+    XmedDataObject* dataObject = new XmedDataObject();
+    dataObject->setPresentationId(presId);
+    event->objectdata = dataObject;
+    emit presentationSignal(event); // --> WorkspaceController::processPresentationEvent
+  }
+}
+
 void
 PresentationController::updateTreeViewWithNewPresentation(long fieldId, long presentationId)
 {
@@ -294,6 +353,32 @@ PresentationController::updateTreeViewWithNewPresentation(long fieldId, long pre
 
   _salomeModule->engine()->registerPresentation(_CAST(Study, studyDS)->GetStudy(), fieldId, name.c_str(), label.c_str(), presentationId);
 
+
+  MEDCALC::MEDPresentationViewMode 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;
+  }
+
   // update Object browser
   _salomeModule->getApp()->updateObjectBrowser(true);
 }
index 78d7ca36b9ba71b85653037da8b553605f82e92c..d2d9fc4617f699895b3f84421bed7d272c71d103 100644 (file)
@@ -39,7 +39,8 @@ typedef struct {
     EVENT_VIEW_OBJECT_POINT_SPRITE,
     EVENT_VIEW_OBJECT_SCALAR_MAP,
     EVENT_VIEW_OBJECT_SLICES,
-    EVENT_VIEW_OBJECT_VECTOR_FIELD
+    EVENT_VIEW_OBJECT_VECTOR_FIELD,
+    EVENT_DELETE_PRESENTATION
   };
   int eventtype;
   XmedDataObject* objectdata;
@@ -72,6 +73,9 @@ protected slots:
   void OnVisualizeSlices();
   void OnVisualizeDeflectionShape();
   void OnVisualizePointSprite();
+
+  void OnDeletePresentation();
+
   void processWorkspaceEvent(const MEDCALC::MedEvent*);
 
 private:
@@ -83,6 +87,7 @@ private:
 private:
   MEDModule* _salomeModule;
   SALOME_AppStudyEditor* _studyEditor; // borrowed to MEDModule
+
   QDockWidget *_dockWidget;
   WidgetPresentationParameters* _widgetPresentationParameters;
 };
index b5c3d008d5ba8cf95ce2da43e0b2c83983791886..8a2231969f58aaa2312c0988c4220679b0247fb8 100644 (file)
@@ -626,6 +626,11 @@ void WorkspaceController::processPresentationEvent(const PresentationEvent* even
     commands += QString("presentation_id");
     _consoleDriver->exec(commands);
   }
+  else if ( event->eventtype == PresentationEvent::EVENT_DELETE_PRESENTATION ) {
+      QStringList commands;
+      commands += QString("medcalc.RemovePresentation(%1)").arg(dataObject->getPresentationId());
+      _consoleDriver->exec(commands);
+  }
   else {
     STDLOG("The event "<<event->eventtype<<" is not implemented yet");
   }
index 62e37a660edd109d0957dec7bd04671ed52d4057..cb4b6fc15beb59807742727b8a656d04051e0fac 100644 (file)
@@ -27,7 +27,7 @@
 // =================================================================
 //
 
-XmedDataObject::XmedDataObject() : DataObject() {
+XmedDataObject::XmedDataObject() : DataObject(), _presId(-1) {
 }
 
 /*! This function specified the localization of the object in the
@@ -48,6 +48,13 @@ MEDCALC::FieldHandler * XmedDataObject::getFieldHandler() {
   return &_fieldHandler;
 }
 
+void XmedDataObject::setPresentationId(int presId) {
+  _presId = presId;
+}
+
+int XmedDataObject::getPresentationId() const { return _presId; }
+
+
 /*!
  * This function implements the convention for displaying a fieldname
  * characterized by its spatial discretisation type.
index 4027ccf6bc1683953f31775885ede3e100ac32ad..43f2252909e22267ce8ced04c23f73f3761a3212 100644 (file)
@@ -40,8 +40,12 @@ public:
   void setFieldHandler(MEDCALC::FieldHandler fieldHandler);
   MEDCALC::FieldHandler * getFieldHandler();
 
+  void setPresentationId(int presId);
+  int getPresentationId() const;
+
 private:
   MEDCALC::FieldHandler _fieldHandler;
+  int _presId;
   string _getTypedFieldLabel();
 };
 
index 72be05804ac17160954a5377fc30d6c6f98c7798..8e1905a8c9258fa7a9e81e88f30453836d2d7a94 100644 (file)
@@ -29,7 +29,7 @@
 
 #include <QObject>
 
-class WidgetPresentationParameters : public QWidget
+class MEDCALCGUI_DIALOGS_EXPORT WidgetPresentationParameters : public QWidget
 {
   Q_OBJECT
 
diff --git a/src/MEDCalc/res/close.png b/src/MEDCalc/res/close.png
new file mode 100755 (executable)
index 0000000..4364ce7
Binary files /dev/null and b/src/MEDCalc/res/close.png differ