Salome HOME
[MEDCalc] Contour presentation
[modules/med.git] / idl / MEDPresentationManager.idl
1 // Copyright (C) 2005-2016  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef __MED_PRESENTATION_MANAGER_IDL_
21 #define __MED_PRESENTATION_MANAGER_IDL_
22
23 #include "SALOME_GenericObj.idl"
24 #include "MEDDataManager.idl"
25
26 module MEDCALC
27 {
28   /* Enumerations and constants */
29
30   enum MEDPresentationViewMode {
31     VIEW_MODE_OVERLAP,
32     VIEW_MODE_REPLACE,
33     VIEW_MODE_NEW_LAYOUT,
34     VIEW_MODE_SPLIT_VIEW
35   };
36
37   enum MEDPresentationColorMap {
38     COLOR_MAP_BLUE_TO_RED_RAINBOW,
39     COLOR_MAP_COOL_TO_WARM
40   };
41
42   enum MEDPresentationScalarBarRange {
43     SCALAR_BAR_ALL_TIMESTEPS,
44     SCALAR_BAR_CURRENT_TIMESTEP
45   };
46
47
48 //  struct ScalarBarRange {
49 //    // (valMin,valMax) defines the scalar bar range from:
50 //    //      (-1,timestep): the field values at the chosen timestep
51 //    //      (-1,-1):      the field values across all timesteps
52 //    //      (-2,-2):      the field values at current timestep
53 //    //      (start,end):  a user-input range of values
54 //    long valMin;
55 //    long valMax;
56 //  };
57
58   const string DISPLAY_EUCLIDEAN_NORM = "";  // Void string to avoid clash with a real component name -- never used actually?
59
60   enum SliceOrientation {
61     SLICE_NORMAL_TO_X,
62     SLICE_NORMAL_TO_Y,
63     SLICE_NORMAL_TO_Z,
64     SLICE_NORMAL_TO_XY,
65     SLICE_NORMAL_TO_XZ,
66     SLICE_NORMAL_TO_YZ,
67     SLICE_NORMAL_TO_XYZ
68   };
69
70   /* Default values */
71
72   const MEDPresentationViewMode VIEW_MODE_DEFAULT = VIEW_MODE_REPLACE;
73   const MEDPresentationColorMap COLOR_MAP_DEFAULT = COLOR_MAP_BLUE_TO_RED_RAINBOW;
74   const MEDPresentationScalarBarRange SCALAR_BAR_RANGE_DEFAULT = SCALAR_BAR_ALL_TIMESTEPS;
75   const long SCALAR_BAR_RANGE_VAL_MIN_DEFAULT = -1;
76   const long SCALAR_BAR_RANGE_VAL_MAX_DEFAULT = -1;
77   const string DISPLAY_DEFAULT = DISPLAY_EUCLIDEAN_NORM;
78   const SliceOrientation SLICE_ORIENTATION_DEFAULT = SLICE_NORMAL_TO_Z;
79   const long NB_CONTOURS_DEFAULT = 10;
80   const long NB_SLICES_DEFAULT = 1;
81
82   /* Structs */
83
84   struct ScalarMapParameters {
85     long fieldHandlerId;
86     string displayedComponent; // DISPLAY_EUCLIDEAN_NORM or any component name
87     MEDPresentationScalarBarRange scalarBarRange;
88     MEDPresentationColorMap colorMap;
89   };
90
91   // A contour is an isoline in 2D and an isosurface in 3D
92   struct ContourParameters {   // Contour are only for scalar fields
93     long fieldHandlerId;
94     MEDPresentationScalarBarRange scalarBarRange;
95     MEDPresentationColorMap colorMap;
96     long nbContours;
97   };
98
99 //  struct VectorFieldParameters {
100 //    long fieldHandlerId;
101 //    string displayedComponent; // DISPLAY_EUCLIDEAN_NORM or any component name
102 //    MEDPresentationScalarBarRange scalarBarRange;
103 //    MEDPresentationColorMap colorMap;
104 //  };
105 //
106 //  struct SlicesParameters {
107 //    long fieldHandlerId;
108 //    string displayedComponent; // DISPLAY_EUCLIDEAN_NORM or any component name
109 //    MEDPresentationScalarBarRange scalarBarRange;
110 //    MEDPresentationColorMap colorMap;
111 //    SliceOrientation orientation;
112 //    long nbSlices;
113 //  };
114 //
115 //  struct DeflectionShapeParameters {
116 //    long fieldHandlerId;
117 //  };
118 //
119 //  struct PointSpriteParameters {
120 //    long fieldHandlerId;
121 //    string displayedComponent; // DISPLAY_EUCLIDEAN_NORM or any component name
122 //    MEDPresentationScalarBarRange scalarBarRange;
123 //    MEDPresentationColorMap colorMap;
124 //  };
125
126   typedef sequence<long> PresentationsList;
127
128   /* Functions */
129
130   interface MEDPresentationManager : SALOME::GenericObj
131   {
132     long makeScalarMap(in ScalarMapParameters params, in MEDPresentationViewMode viewMode);
133     long makeContour(in ContourParameters params, in MEDPresentationViewMode viewMode)
134       raises (SALOME::SALOME_Exception);
135 //    long makeVectorField(in VectorFieldParameters params, in MEDPresentationViewMode viewMode);
136 //    long makeSlices(in SlicesParameters params, in MEDPresentationViewMode viewMode);
137 //    long makeDeflectionShape(in DeflectionShapeParameters params, in MEDPresentationViewMode viewMode);
138 //    long makePointSprite(in PointSpriteParameters params, in MEDPresentationViewMode viewMode);
139
140     void setPresentationStringProperty(in long presId, in string propName, in string propValue);
141     string getPresentationStringProperty(in long presId, in string propName);
142     void setPresentationIntProperty(in long presId, in string propName, in long propValue);
143     long getPresentationIntProperty(in long presId, in string propName);
144
145     ScalarMapParameters getScalarMapParameters(in long presId);
146     ContourParameters getContourParameters(in long presId);
147
148     void updateScalarMap(in long presId, in ScalarMapParameters params);
149     void updateContour(in long presId, in ContourParameters params);
150 //    void updateVectorField(in long presId, in VectorFieldParameters params);
151 //    void updateSlices(in long presId, in SlicesParameters params);
152 //    void updateDeflectionShape(in long presId, in DeflectionShapeParameters params);
153 //    void updatePointSprite(in long presId, in PointSpriteParameters params);
154
155     boolean removePresentation(in long presId);
156
157     // Helper function to keep GUI sync
158     boolean activateView(in long presentationId);
159
160     // Low level ParaVis dump
161     string getParavisDump(in long presId);
162
163 //    MEDPresentationViewMode getPresentationViewMode(in long presId);
164     
165     PresentationsList getAllPresentations();
166   };
167 };
168
169 #endif