Salome HOME
Copyright update 2021
[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   };
46
47   enum MeshModeType {
48     MESH_MODE_WIREFRAME,
49     MESH_MODE_SURFACE_EDGES,
50     MESH_MODE_SURFACE
51   };
52   
53   
54
55 //  struct ScalarBarRange {
56 //    // (valMin,valMax) defines the scalar bar range from:
57 //    //      (-1,timestep): the field values at the chosen timestep
58 //    //      (-1,-1):      the field values across all timesteps
59 //    //      (-2,-2):      the field values at current timestep
60 //    //      (start,end):  a user-input range of values
61 //    long valMin;
62 //    long valMax;
63 //  };
64
65   const string DISPLAY_EUCLIDEAN_NORM = "";  // Void string to avoid clash with a real component name -- never used actually?
66
67   enum SliceOrientationType {
68     SLICE_NORMAL_TO_X,
69     SLICE_NORMAL_TO_Y,
70     SLICE_NORMAL_TO_Z,
71     SLICE_NORMAL_TO_XY,
72     SLICE_NORMAL_TO_XZ,
73     SLICE_NORMAL_TO_YZ,
74     SLICE_NORMAL_TO_XYZ
75   };
76
77   /* Default values */
78
79   const ViewModeType VIEW_MODE_DEFAULT = VIEW_MODE_REPLACE;
80   const ColorMapType COLOR_MAP_DEFAULT = COLOR_MAP_BLUE_TO_RED_RAINBOW;
81   const ScalarBarRangeType SCALAR_BAR_RANGE_DEFAULT = SCALAR_BAR_ALL_TIMESTEPS;
82   const MeshModeType MESH_MODE_DEFAULT = MESH_MODE_WIREFRAME;
83 //  const long SCALAR_BAR_RANGE_VAL_MIN_DEFAULT = -1;
84 //  const long SCALAR_BAR_RANGE_VAL_MAX_DEFAULT = -1;
85   const string DISPLAY_DEFAULT = DISPLAY_EUCLIDEAN_NORM;
86   const SliceOrientationType SLICE_ORIENTATION_DEFAULT = SLICE_NORMAL_TO_X;
87
88   const long NB_CONTOURS_DEFAULT = 10;
89   const long NB_SLICES_DEFAULT = 1;
90
91   const long NB_CONTOURS_MAX = 50;
92   const long NB_SLICES_MAX = 20;
93
94   /* Structs */
95
96   // Just showing the mesh 
97   struct MeshViewParameters {
98     long meshHandlerId;
99     MeshModeType mode;
100   };
101
102   // A simple scalar map
103   struct ScalarMapParameters {
104     long fieldHandlerId;
105     string displayedComponent; // DISPLAY_EUCLIDEAN_NORM or any component name
106     ScalarBarRangeType scalarBarRange;
107     ColorMapType colorMap;
108   };
109
110   // A contour is an isoline in 2D and an isosurface in 3D
111   struct ContourParameters {   // Contour are only for scalar fields
112     long fieldHandlerId;
113     ScalarBarRangeType scalarBarRange;
114     ColorMapType colorMap;
115     long nbContours;
116   };
117
118   struct VectorFieldParameters {
119     long fieldHandlerId;
120     ScalarBarRangeType scalarBarRange;
121     ColorMapType colorMap;
122   };
123
124   struct SlicesParameters {
125     long fieldHandlerId;
126     string displayedComponent; // DISPLAY_EUCLIDEAN_NORM or any component name
127     ScalarBarRangeType scalarBarRange;
128     ColorMapType colorMap;
129     SliceOrientationType orientation;
130     long nbSlices;
131   };
132
133   struct DeflectionShapeParameters {
134     long fieldHandlerId;
135     ScalarBarRangeType scalarBarRange;
136     ColorMapType colorMap;
137   };
138
139   struct PointSpriteParameters {
140     long fieldHandlerId;
141     string displayedComponent; // DISPLAY_EUCLIDEAN_NORM or any component name
142     ScalarBarRangeType scalarBarRange;
143     ColorMapType colorMap;
144   };
145
146   typedef sequence<long> PresentationsList;
147
148   /* Functions */
149
150   interface MEDPresentationManager : SALOME::GenericObj
151   {
152     long makeMeshView(in MeshViewParameters params, in ViewModeType viewMode)   raises (SALOME::SALOME_Exception);
153     long makeScalarMap(in ScalarMapParameters params, in ViewModeType viewMode) raises (SALOME::SALOME_Exception);
154     long makeContour(in ContourParameters params, in ViewModeType viewMode)     raises (SALOME::SALOME_Exception);
155     long makeVectorField(in VectorFieldParameters params, in ViewModeType viewMode)  raises (SALOME::SALOME_Exception);
156     long makeSlices(in SlicesParameters params, in ViewModeType viewMode)            raises (SALOME::SALOME_Exception);
157     long makeDeflectionShape(in DeflectionShapeParameters params, in ViewModeType viewMode) raises (SALOME::SALOME_Exception);
158     long makePointSprite(in PointSpriteParameters params, in ViewModeType viewMode)  raises (SALOME::SALOME_Exception);
159
160     void setPresentationStringProperty(in long presId, in string propName, in string propValue);
161     string getPresentationStringProperty(in long presId, in string propName);
162     void setPresentationIntProperty(in long presId, in string propName, in long propValue);
163     long getPresentationIntProperty(in long presId, in string propName);
164
165     MeshViewParameters  getMeshViewParameters(in long presId);
166     ScalarMapParameters getScalarMapParameters(in long presId);
167     ContourParameters   getContourParameters(in long presId);
168     SlicesParameters     getSlicesParameters(in long presId);
169     VectorFieldParameters     getVectorFieldParameters(in long presId);
170     PointSpriteParameters     getPointSpriteParameters(in long presId);
171     DeflectionShapeParameters     getDeflectionShapeParameters(in long presId);
172
173     void updateMeshView(in long presId, in MeshViewParameters params)   raises (SALOME::SALOME_Exception);
174     void updateScalarMap(in long presId, in ScalarMapParameters params) raises (SALOME::SALOME_Exception);
175     void updateContour(in long presId, in ContourParameters params)     raises (SALOME::SALOME_Exception);
176     void updateVectorField(in long presId, in VectorFieldParameters params) raises (SALOME::SALOME_Exception);
177     void updateSlices(in long presId, in SlicesParameters params)       raises (SALOME::SALOME_Exception);
178     void updateDeflectionShape(in long presId, in DeflectionShapeParameters params) raises (SALOME::SALOME_Exception);
179     void updatePointSprite(in long presId, in PointSpriteParameters params)         raises (SALOME::SALOME_Exception);
180
181     boolean removePresentation(in long presId)   raises (SALOME::SALOME_Exception);
182
183     // Helper function to keep GUI sync
184     boolean activateView(in long presentationId) raises (SALOME::SALOME_Exception);
185
186     // Low level ParaVis dump
187     string getParavisDump(in long presId) raises (SALOME::SALOME_Exception);
188
189 //    ViewModeType getPresentationViewMode(in long presId);
190     
191     PresentationsList getAllPresentations();
192
193     void cleanUp()   raises (SALOME::SALOME_Exception);
194   };
195 };
196
197 #endif