Salome HOME
Updated copyright comment
[modules/med.git] / idl / MEDPresentationManager.idl
index d95aca9bc028b471bc8b53ea1e1d3a9d50b7f84b..f9b79c72f0aba2eb6e202557543d2c3c14e21797 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2005-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2005-2024  CEA, EDF, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -27,23 +27,44 @@ module MEDCALC
 {
   /* Enumerations and constants */
 
-  enum MEDPresentationViewMode {
+  enum ViewModeType {
     VIEW_MODE_OVERLAP,
     VIEW_MODE_REPLACE,
     VIEW_MODE_NEW_LAYOUT,
     VIEW_MODE_SPLIT_VIEW
   };
 
-  enum MEDPresentationColorMap {
+  enum ColorMapType {
     COLOR_MAP_BLUE_TO_RED_RAINBOW,
     COLOR_MAP_COOL_TO_WARM
   };
 
-  enum MEDPresentationScalarBarRange {
+  enum ScalarBarRangeType {
     SCALAR_BAR_ALL_TIMESTEPS,
-    SCALAR_BAR_CURRENT_TIMESTEP
+    SCALAR_BAR_CURRENT_TIMESTEP,
+    SCALAR_BAR_CUSTOM_RANGE
   };
 
+  enum MeshModeType {
+    MESH_MODE_WIREFRAME,
+    MESH_MODE_SURFACE_EDGES,
+    MESH_MODE_SURFACE
+  };
+
+  enum PresentationVisibility {
+    PRESENTATION_INVISIBLE, 
+    PRESENTATION_VISIBLE,
+    PRESENTATION_NOT_IN_VIEW
+  };
+
+  enum IntegrationDirType {
+    INTEGRATION_DIR_BOTH,
+    INTEGRATION_DIR_FORWARD,
+    INTEGRATION_DIR_BACKWARD
+  };
+
+  typedef sequence<double> DoubleArray;
+  
 
 //  struct ScalarBarRange {
 //    // (valMin,valMax) defines the scalar bar range from:
@@ -57,7 +78,7 @@ module MEDCALC
 
   const string DISPLAY_EUCLIDEAN_NORM = "";  // Void string to avoid clash with a real component name -- never used actually?
 
-  enum SliceOrientation {
+  enum SliceOrientationType {
     SLICE_NORMAL_TO_X,
     SLICE_NORMAL_TO_Y,
     SLICE_NORMAL_TO_Z,
@@ -69,59 +90,139 @@ module MEDCALC
 
   /* Default values */
 
-  const MEDPresentationViewMode VIEW_MODE_DEFAULT = VIEW_MODE_REPLACE;
-  const MEDPresentationColorMap COLOR_MAP_DEFAULT = COLOR_MAP_BLUE_TO_RED_RAINBOW;
-  const MEDPresentationScalarBarRange SCALAR_BAR_RANGE_DEFAULT = SCALAR_BAR_ALL_TIMESTEPS;
-  const long SCALAR_BAR_RANGE_VAL_MIN_DEFAULT = -1;
-  const long SCALAR_BAR_RANGE_VAL_MAX_DEFAULT = -1;
+  const ViewModeType VIEW_MODE_DEFAULT = VIEW_MODE_REPLACE;
+  const ColorMapType COLOR_MAP_DEFAULT = COLOR_MAP_BLUE_TO_RED_RAINBOW;
+  const ScalarBarRangeType SCALAR_BAR_RANGE_DEFAULT = SCALAR_BAR_ALL_TIMESTEPS;
+  const MeshModeType MESH_MODE_DEFAULT = MESH_MODE_WIREFRAME;
+//  const long SCALAR_BAR_RANGE_VAL_MIN_DEFAULT = -1;
+//  const long SCALAR_BAR_RANGE_VAL_MAX_DEFAULT = -1;
   const string DISPLAY_DEFAULT = DISPLAY_EUCLIDEAN_NORM;
-  const SliceOrientation SLICE_ORIENTATION_DEFAULT = SLICE_NORMAL_TO_Z;
+  const SliceOrientationType SLICE_ORIENTATION_DEFAULT = SLICE_NORMAL_TO_X;
+  const IntegrationDirType INTEGRATION_DIR_DEFAULT = INTEGRATION_DIR_BOTH;
+
   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 meshHandlerId;
+    MeshModeType mode;
+    boolean visibility;
+  };
+
+  // A simple scalar map
   struct ScalarMapParameters {
     long fieldHandlerId;
     string displayedComponent; // DISPLAY_EUCLIDEAN_NORM or any component name
-    MEDPresentationScalarBarRange scalarBarRange;
-    MEDPresentationColorMap colorMap;
+    ScalarBarRangeType scalarBarRange;
+    ColorMapType colorMap;
+    boolean visibility;
+    boolean scalarBarVisibility;
+    DoubleArray scalarBarRangeArray;
+    boolean hideDataOutsideCustomRange;
   };
 
   // A contour is an isoline in 2D and an isosurface in 3D
   struct ContourParameters {   // Contour are only for scalar fields
     long fieldHandlerId;
-    MEDPresentationScalarBarRange scalarBarRange;
-    MEDPresentationColorMap colorMap;
+    ScalarBarRangeType scalarBarRange;
+    ColorMapType colorMap;
+    boolean visibility;
+    boolean scalarBarVisibility;
+    DoubleArray scalarBarRangeArray;
+    boolean hideDataOutsideCustomRange; 
     long nbContours;
+    string contourComponent;
   };
 
-//  struct VectorFieldParameters {
-//    long fieldHandlerId;
-//    string displayedComponent; // DISPLAY_EUCLIDEAN_NORM or any component name
-//    MEDPresentationScalarBarRange scalarBarRange;
-//    MEDPresentationColorMap colorMap;
-//  };
-//
-//  struct SlicesParameters {
-//    long fieldHandlerId;
-//    string displayedComponent; // DISPLAY_EUCLIDEAN_NORM or any component name
-//    MEDPresentationScalarBarRange scalarBarRange;
-//    MEDPresentationColorMap colorMap;
-//    SliceOrientation orientation;
-//    long nbSlices;
-//  };
-//
-//  struct DeflectionShapeParameters {
-//    long fieldHandlerId;
-//  };
-//
-//  struct PointSpriteParameters {
-//    long fieldHandlerId;
-//    string displayedComponent; // DISPLAY_EUCLIDEAN_NORM or any component name
-//    MEDPresentationScalarBarRange scalarBarRange;
-//    MEDPresentationColorMap colorMap;
-//  };
+  struct VectorFieldParameters {
+    long fieldHandlerId;
+    ScalarBarRangeType scalarBarRange;
+    ColorMapType colorMap;
+    boolean visibility;
+    boolean scalarBarVisibility;
+    DoubleArray scalarBarRangeArray;
+    boolean hideDataOutsideCustomRange;
+    double scaleFactor;
+    boolean customScaleFactor;
+  };
+
+  struct SlicesParameters {
+    long fieldHandlerId;
+    string displayedComponent; // DISPLAY_EUCLIDEAN_NORM or any component name
+    ScalarBarRangeType scalarBarRange;
+    ColorMapType colorMap;
+    boolean visibility;
+    boolean scalarBarVisibility;
+    DoubleArray scalarBarRangeArray;
+    boolean hideDataOutsideCustomRange;
+    SliceOrientationType orientation;
+    long nbSlices;
+  };
+
+
+  struct DeflectionShapeParameters {
+    long fieldHandlerId;
+    ScalarBarRangeType scalarBarRange;
+    ColorMapType colorMap;
+    boolean visibility;
+    boolean scalarBarVisibility;
+    DoubleArray scalarBarRangeArray;
+    boolean hideDataOutsideCustomRange;
+  };
+
+  struct PointSpriteParameters {
+    long fieldHandlerId;
+    string displayedComponent; // DISPLAY_EUCLIDEAN_NORM or any component name
+    ScalarBarRangeType scalarBarRange;
+    ColorMapType colorMap;
+    boolean visibility;
+    boolean scalarBarVisibility;
+    DoubleArray scalarBarRangeArray;
+    boolean hideDataOutsideCustomRange;
+  };
+
+  // sphinx doc: begin of plot3d params
+  struct Plot3DParameters {
+    long fieldHandlerId;
+    ScalarBarRangeType scalarBarRange;
+    ColorMapType colorMap;
+    boolean visibility;
+    boolean scalarBarVisibility;
+    DoubleArray scalarBarRangeArray;
+    boolean hideDataOutsideCustomRange; 
+    DoubleArray planeNormal;
+    double planePos;
+  };
+  // sphinx doc: end of plot3d params
+
+  struct StreamLinesParameters {
+    long fieldHandlerId;
+    ScalarBarRangeType scalarBarRange;
+    ColorMapType colorMap;
+    boolean visibility;
+    boolean scalarBarVisibility;
+    DoubleArray scalarBarRangeArray;
+    boolean hideDataOutsideCustomRange; 
+    IntegrationDirType integrDir;
+  };
+
+  struct CutSegmentParameters {
+    long fieldHandlerId;
+    ScalarBarRangeType scalarBarRange;
+    ColorMapType colorMap;
+    boolean visibility;
+    boolean scalarBarVisibility;
+    DoubleArray scalarBarRangeArray;
+    boolean hideDataOutsideCustomRange; 
+    DoubleArray point1;
+    DoubleArray point2;
+  };
 
   typedef sequence<long> PresentationsList;
 
@@ -129,40 +230,63 @@ module MEDCALC
 
   interface MEDPresentationManager : SALOME::GenericObj
   {
-    long makeScalarMap(in ScalarMapParameters params, in MEDPresentationViewMode viewMode);
-    long makeContour(in ContourParameters params, in MEDPresentationViewMode viewMode)
-      raises (SALOME::SALOME_Exception);
-//    long makeVectorField(in VectorFieldParameters params, in MEDPresentationViewMode viewMode);
-//    long makeSlices(in SlicesParameters params, in MEDPresentationViewMode viewMode);
-//    long makeDeflectionShape(in DeflectionShapeParameters params, in MEDPresentationViewMode viewMode);
-//    long makePointSprite(in PointSpriteParameters params, in MEDPresentationViewMode viewMode);
+    long makeMeshView(in MeshViewParameters params, in ViewModeType viewMode)   raises (SALOME::SALOME_Exception);
+    long makeScalarMap(in ScalarMapParameters params, in ViewModeType viewMode) raises (SALOME::SALOME_Exception);
+    long makeContour(in ContourParameters params, in ViewModeType viewMode)     raises (SALOME::SALOME_Exception);
+    long makeVectorField(in VectorFieldParameters params, in ViewModeType viewMode)  raises (SALOME::SALOME_Exception);
+    long makeSlices(in SlicesParameters params, in ViewModeType viewMode)            raises (SALOME::SALOME_Exception);
+    long makeDeflectionShape(in DeflectionShapeParameters params, in ViewModeType viewMode) raises (SALOME::SALOME_Exception);
+    long makePointSprite(in PointSpriteParameters params, in ViewModeType viewMode)  raises (SALOME::SALOME_Exception);
+    long makePlot3D(in Plot3DParameters params, in ViewModeType viewMode)       raises (SALOME::SALOME_Exception);
+    long makeStreamLines(in StreamLinesParameters params, in ViewModeType viewMode)       raises (SALOME::SALOME_Exception);
+    long makeCutSegment(in CutSegmentParameters params, in ViewModeType viewMode)       raises (SALOME::SALOME_Exception);
 
     void setPresentationStringProperty(in long presId, in string propName, in string propValue);
     string getPresentationStringProperty(in long presId, in string propName);
     void setPresentationIntProperty(in long presId, in string propName, in long propValue);
-    long getPresentationIntProperty(in long presId, in string propName);
+    long getPresentationIntProperty(in long presId, in string propName);  
+    void setPresentationDoubleProperty(in long presId, in string propName, in double propValue);
+    double getPresentationDoubleProperty(in long presId, in string propName);
+
 
+    MeshViewParameters  getMeshViewParameters(in long presId);
     ScalarMapParameters getScalarMapParameters(in long presId);
-    ContourParameters getContourParameters(in long presId);
+    ContourParameters   getContourParameters(in long presId);
+    SlicesParameters     getSlicesParameters(in long presId);
+    VectorFieldParameters     getVectorFieldParameters(in long presId);
+    PointSpriteParameters     getPointSpriteParameters(in long presId);
+    Plot3DParameters          getPlot3DParameters(in long presId);
+    DeflectionShapeParameters     getDeflectionShapeParameters(in long presId);
+    StreamLinesParameters     getStreamLinesParameters(in long presId);
+    CutSegmentParameters     getCutSegmentParameters(in long presId);
 
-    void updateScalarMap(in long presId, in ScalarMapParameters params);
-    void updateContour(in long presId, in ContourParameters params);
-//    void updateVectorField(in long presId, in VectorFieldParameters params);
-//    void updateSlices(in long presId, in SlicesParameters params);
-//    void updateDeflectionShape(in long presId, in DeflectionShapeParameters params);
-//    void updatePointSprite(in long presId, in PointSpriteParameters params);
+    void updateMeshView(in long presId, in MeshViewParameters params)   raises (SALOME::SALOME_Exception);
+    void updateScalarMap(in long presId, in ScalarMapParameters params) raises (SALOME::SALOME_Exception);
+    void updateContour(in long presId, in ContourParameters params)     raises (SALOME::SALOME_Exception);
+    void updateVectorField(in long presId, in VectorFieldParameters params) raises (SALOME::SALOME_Exception);
+    void updateSlices(in long presId, in SlicesParameters params)       raises (SALOME::SALOME_Exception);
+    void updateDeflectionShape(in long presId, in DeflectionShapeParameters params) raises (SALOME::SALOME_Exception);
+    void updatePointSprite(in long presId, in PointSpriteParameters params)         raises (SALOME::SALOME_Exception);
+    void updatePlot3D(in long presId, in Plot3DParameters params)         raises (SALOME::SALOME_Exception);
+    void updateStreamLines(in long presId, in StreamLinesParameters params)         raises (SALOME::SALOME_Exception);
+    void updateCutSegment(in long presId, in CutSegmentParameters params)         raises (SALOME::SALOME_Exception);
 
-    boolean removePresentation(in long presId);
+    boolean removePresentation(in long presId)   raises (SALOME::SALOME_Exception);
 
     // Helper function to keep GUI sync
-    boolean activateView(in long presentationId);
+    boolean activateView(in long presentationId) raises (SALOME::SALOME_Exception);
 
     // Low level ParaVis dump
-    string getParavisDump(in long presId);
+    string getParavisDump(in long presId) raises (SALOME::SALOME_Exception);
 
-//    MEDPresentationViewMode getPresentationViewMode(in long presId);
+//    ViewModeType getPresentationViewMode(in long presId);
     
     PresentationsList getAllPresentations();
+
+//  Visibility State in the active ParaView viewer
+    PresentationVisibility stateInActiveView(in long presId);
+
+    void cleanUp()   raises (SALOME::SALOME_Exception);
   };
 };