Salome HOME
#28928 [CEA] FIELDS : developer documentation for the simplified visualisation
[modules/med.git] / idl / MEDPresentationManager.idl
1 // Copyright (C) 2005-2021  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 ViewModeType {
31     VIEW_MODE_OVERLAP,
32     VIEW_MODE_REPLACE,
33     VIEW_MODE_NEW_LAYOUT,
34     VIEW_MODE_SPLIT_VIEW
35   };
36
37   enum ColorMapType {
38     COLOR_MAP_BLUE_TO_RED_RAINBOW,
39     COLOR_MAP_COOL_TO_WARM
40   };
41
42   enum ScalarBarRangeType {
43     SCALAR_BAR_ALL_TIMESTEPS,
44     SCALAR_BAR_CURRENT_TIMESTEP,
45     SCALAR_BAR_CUSTOM_RANGE
46   };
47
48   enum MeshModeType {
49     MESH_MODE_WIREFRAME,
50     MESH_MODE_SURFACE_EDGES,
51     MESH_MODE_SURFACE
52   };
53
54   enum PresentationVisibility {
55     PRESENTATION_INVISIBLE, 
56     PRESENTATION_VISIBLE,
57     PRESENTATION_NOT_IN_VIEW
58   };
59
60   enum IntegrationDirType {
61     INTEGRATION_DIR_BOTH,
62     INTEGRATION_DIR_FORWARD,
63     INTEGRATION_DIR_BACKWARD
64   };
65
66   typedef sequence<double> DoubleArray;
67   
68
69 //  struct ScalarBarRange {
70 //    // (valMin,valMax) defines the scalar bar range from:
71 //    //      (-1,timestep): the field values at the chosen timestep
72 //    //      (-1,-1):      the field values across all timesteps
73 //    //      (-2,-2):      the field values at current timestep
74 //    //      (start,end):  a user-input range of values
75 //    long valMin;
76 //    long valMax;
77 //  };
78
79   const string DISPLAY_EUCLIDEAN_NORM = "";  // Void string to avoid clash with a real component name -- never used actually?
80
81   enum SliceOrientationType {
82     SLICE_NORMAL_TO_X,
83     SLICE_NORMAL_TO_Y,
84     SLICE_NORMAL_TO_Z,
85     SLICE_NORMAL_TO_XY,
86     SLICE_NORMAL_TO_XZ,
87     SLICE_NORMAL_TO_YZ,
88     SLICE_NORMAL_TO_XYZ
89   };
90
91   /* Default values */
92
93   const ViewModeType VIEW_MODE_DEFAULT = VIEW_MODE_REPLACE;
94   const ColorMapType COLOR_MAP_DEFAULT = COLOR_MAP_BLUE_TO_RED_RAINBOW;
95   const ScalarBarRangeType SCALAR_BAR_RANGE_DEFAULT = SCALAR_BAR_ALL_TIMESTEPS;
96   const MeshModeType MESH_MODE_DEFAULT = MESH_MODE_WIREFRAME;
97 //  const long SCALAR_BAR_RANGE_VAL_MIN_DEFAULT = -1;
98 //  const long SCALAR_BAR_RANGE_VAL_MAX_DEFAULT = -1;
99   const string DISPLAY_DEFAULT = DISPLAY_EUCLIDEAN_NORM;
100   const SliceOrientationType SLICE_ORIENTATION_DEFAULT = SLICE_NORMAL_TO_X;
101   const IntegrationDirType INTEGRATION_DIR_DEFAULT = INTEGRATION_DIR_BOTH;
102
103   const long NB_CONTOURS_DEFAULT = 10;
104   const long NB_SLICES_DEFAULT = 1;
105
106   const long NB_CONTOURS_MAX = 50;
107   const long NB_SLICES_MAX = 20;
108
109   /* Structs */
110
111   // Just showing the mesh 
112   struct MeshViewParameters {
113     long meshHandlerId;
114     MeshModeType mode;
115     boolean visibility;
116   };
117
118   // A simple scalar map
119   struct ScalarMapParameters {
120     long fieldHandlerId;
121     string displayedComponent; // DISPLAY_EUCLIDEAN_NORM or any component name
122     ScalarBarRangeType scalarBarRange;
123     ColorMapType colorMap;
124     boolean visibility;
125     boolean scalarBarVisibility;
126     DoubleArray scalarBarRangeArray;
127     boolean hideDataOutsideCustomRange;
128   };
129
130   // A contour is an isoline in 2D and an isosurface in 3D
131   struct ContourParameters {   // Contour are only for scalar fields
132     long fieldHandlerId;
133     ScalarBarRangeType scalarBarRange;
134     ColorMapType colorMap;
135     boolean visibility;
136     boolean scalarBarVisibility;
137     DoubleArray scalarBarRangeArray;
138     boolean hideDataOutsideCustomRange; 
139     long nbContours;
140     string contourComponent;
141   };
142
143   struct VectorFieldParameters {
144     long fieldHandlerId;
145     ScalarBarRangeType scalarBarRange;
146     ColorMapType colorMap;
147     boolean visibility;
148     boolean scalarBarVisibility;
149     DoubleArray scalarBarRangeArray;
150     boolean hideDataOutsideCustomRange;
151     double scaleFactor;
152     boolean customScaleFactor;
153   };
154
155   struct SlicesParameters {
156     long fieldHandlerId;
157     string displayedComponent; // DISPLAY_EUCLIDEAN_NORM or any component name
158     ScalarBarRangeType scalarBarRange;
159     ColorMapType colorMap;
160     boolean visibility;
161     boolean scalarBarVisibility;
162     DoubleArray scalarBarRangeArray;
163     boolean hideDataOutsideCustomRange;
164     SliceOrientationType orientation;
165     long nbSlices;
166   };
167
168
169   struct DeflectionShapeParameters {
170     long fieldHandlerId;
171     ScalarBarRangeType scalarBarRange;
172     ColorMapType colorMap;
173     boolean visibility;
174     boolean scalarBarVisibility;
175     DoubleArray scalarBarRangeArray;
176     boolean hideDataOutsideCustomRange;
177   };
178
179   struct PointSpriteParameters {
180     long fieldHandlerId;
181     string displayedComponent; // DISPLAY_EUCLIDEAN_NORM or any component name
182     ScalarBarRangeType scalarBarRange;
183     ColorMapType colorMap;
184     boolean visibility;
185     boolean scalarBarVisibility;
186     DoubleArray scalarBarRangeArray;
187     boolean hideDataOutsideCustomRange;
188   };
189
190   // sphinx doc: begin of plot3d params
191   struct Plot3DParameters {
192     long fieldHandlerId;
193     ScalarBarRangeType scalarBarRange;
194     ColorMapType colorMap;
195     boolean visibility;
196     boolean scalarBarVisibility;
197     DoubleArray scalarBarRangeArray;
198     boolean hideDataOutsideCustomRange; 
199     DoubleArray planeNormal;
200     double planePos;
201   };
202   // sphinx doc: end of plot3d params
203
204   struct StreamLinesParameters {
205     long fieldHandlerId;
206     ScalarBarRangeType scalarBarRange;
207     ColorMapType colorMap;
208     boolean visibility;
209     boolean scalarBarVisibility;
210     DoubleArray scalarBarRangeArray;
211     boolean hideDataOutsideCustomRange; 
212     IntegrationDirType integrDir;
213   };
214
215   struct CutSegmentParameters {
216     long fieldHandlerId;
217     ScalarBarRangeType scalarBarRange;
218     ColorMapType colorMap;
219     boolean visibility;
220     boolean scalarBarVisibility;
221     DoubleArray scalarBarRangeArray;
222     boolean hideDataOutsideCustomRange; 
223     DoubleArray point1;
224     DoubleArray point2;
225   };
226
227   typedef sequence<long> PresentationsList;
228
229   /* Functions */
230
231   interface MEDPresentationManager : SALOME::GenericObj
232   {
233     long makeMeshView(in MeshViewParameters params, in ViewModeType viewMode)   raises (SALOME::SALOME_Exception);
234     long makeScalarMap(in ScalarMapParameters params, in ViewModeType viewMode) raises (SALOME::SALOME_Exception);
235     long makeContour(in ContourParameters params, in ViewModeType viewMode)     raises (SALOME::SALOME_Exception);
236     long makeVectorField(in VectorFieldParameters params, in ViewModeType viewMode)  raises (SALOME::SALOME_Exception);
237     long makeSlices(in SlicesParameters params, in ViewModeType viewMode)            raises (SALOME::SALOME_Exception);
238     long makeDeflectionShape(in DeflectionShapeParameters params, in ViewModeType viewMode) raises (SALOME::SALOME_Exception);
239     long makePointSprite(in PointSpriteParameters params, in ViewModeType viewMode)  raises (SALOME::SALOME_Exception);
240     long makePlot3D(in Plot3DParameters params, in ViewModeType viewMode)       raises (SALOME::SALOME_Exception);
241     long makeStreamLines(in StreamLinesParameters params, in ViewModeType viewMode)       raises (SALOME::SALOME_Exception);
242     long makeCutSegment(in CutSegmentParameters params, in ViewModeType viewMode)       raises (SALOME::SALOME_Exception);
243
244     void setPresentationStringProperty(in long presId, in string propName, in string propValue);
245     string getPresentationStringProperty(in long presId, in string propName);
246     void setPresentationIntProperty(in long presId, in string propName, in long propValue);
247     long getPresentationIntProperty(in long presId, in string propName);  
248     void setPresentationDoubleProperty(in long presId, in string propName, in double propValue);
249     double getPresentationDoubleProperty(in long presId, in string propName);
250
251
252     MeshViewParameters  getMeshViewParameters(in long presId);
253     ScalarMapParameters getScalarMapParameters(in long presId);
254     ContourParameters   getContourParameters(in long presId);
255     SlicesParameters     getSlicesParameters(in long presId);
256     VectorFieldParameters     getVectorFieldParameters(in long presId);
257     PointSpriteParameters     getPointSpriteParameters(in long presId);
258     Plot3DParameters          getPlot3DParameters(in long presId);
259     DeflectionShapeParameters     getDeflectionShapeParameters(in long presId);
260     StreamLinesParameters     getStreamLinesParameters(in long presId);
261     CutSegmentParameters     getCutSegmentParameters(in long presId);
262
263     void updateMeshView(in long presId, in MeshViewParameters params)   raises (SALOME::SALOME_Exception);
264     void updateScalarMap(in long presId, in ScalarMapParameters params) raises (SALOME::SALOME_Exception);
265     void updateContour(in long presId, in ContourParameters params)     raises (SALOME::SALOME_Exception);
266     void updateVectorField(in long presId, in VectorFieldParameters params) raises (SALOME::SALOME_Exception);
267     void updateSlices(in long presId, in SlicesParameters params)       raises (SALOME::SALOME_Exception);
268     void updateDeflectionShape(in long presId, in DeflectionShapeParameters params) raises (SALOME::SALOME_Exception);
269     void updatePointSprite(in long presId, in PointSpriteParameters params)         raises (SALOME::SALOME_Exception);
270     void updatePlot3D(in long presId, in Plot3DParameters params)         raises (SALOME::SALOME_Exception);
271     void updateStreamLines(in long presId, in StreamLinesParameters params)         raises (SALOME::SALOME_Exception);
272     void updateCutSegment(in long presId, in CutSegmentParameters params)         raises (SALOME::SALOME_Exception);
273
274     boolean removePresentation(in long presId)   raises (SALOME::SALOME_Exception);
275
276     // Helper function to keep GUI sync
277     boolean activateView(in long presentationId) raises (SALOME::SALOME_Exception);
278
279     // Low level ParaVis dump
280     string getParavisDump(in long presId) raises (SALOME::SALOME_Exception);
281
282 //    ViewModeType getPresentationViewMode(in long presId);
283     
284     PresentationsList getAllPresentations();
285
286 //  Visibility State in the active ParaView viewer
287     PresentationVisibility stateInActiveView(in long presId);
288
289     void cleanUp()   raises (SALOME::SALOME_Exception);
290   };
291 };
292
293 #endif