Salome HOME
NRI : Update IDL Dependancies.
[modules/smesh.git] / idl / SMESH_Mesh.idl
1 //=============================================================================
2 // File      : SMESH_Mesh.idl
3 // Created   : jeu avr 11 15:31:39 CEST 2002
4 // Author    : Paul RASCLE, EDF
5 // Project   : SALOME
6 // Copyright : EDF 2002
7 // $Header$
8 //=============================================================================
9
10
11 #ifndef _SMESH_MESH_IDL_
12 #define _SMESH_MESH_IDL_
13
14 #include "SALOME_Exception.idl"
15 #include "SMESH_Hypothesis.idl"
16
17 #include "GEOM_Shape.idl"
18 #include "MED.idl"
19
20 module SMESH
21 {
22   typedef sequence<double> double_array ;
23   typedef sequence<long> long_array ;
24   typedef sequence<string> string_array ;
25
26   enum log_command
27     {
28       ADD_NODE,
29       ADD_EDGE,
30       ADD_TRIANGLE,
31       ADD_QUADRANGLE,
32       ADD_TETRAHEDRON,
33       ADD_PYRAMID,
34       ADD_PRISM,
35       ADD_HEXAHEDRON,
36       REMOVE_NODE,
37       REMOVE_ELEMENT
38     };
39
40   struct log_block
41   {
42     long commandType;
43     long number;
44     double_array coords;
45     long_array indexes;
46   };
47   
48   typedef sequence<log_block> log_array;
49
50   interface SMESH_subMesh;
51   interface SMESH_MeshEditor;
52   interface SMESH_Mesh
53   {
54     /*!
55      * Associate a Shape to a Mesh created with NewEmpty
56      */
57
58 //     boolean SetMesh(in GEOM::GEOM_Shape aShape)
59 //        raises (SALOME::SALOME_Exception);
60
61     /*!
62      * Get the subMesh object associated to a subShape. The subMesh object
63      * gives access to nodes and elements IDs.
64      * SubMesh will be used instead of SubShape in a next idl version to 
65      * adress a specific subMesh...
66      */
67     SMESH_subMesh GetElementsOnShape(in GEOM::GEOM_Shape aSubShape)
68       raises (SALOME::SALOME_Exception);
69
70     /*!
71      * Create a subMesh without reference to a subShape
72      */
73 //     SMESH_subMesh NewEmpty()
74 //       raises (SALOME::SALOME_Exception);
75
76     /*!
77      * Add hypothesis to the mesh, under a particular subShape
78      * (or the main shape itself)
79      * The Add method is only used to prepare the build of the mesh and store
80      * the algorithms and associated parameters.
81      * Actual job of mesh the shape is done by MESH_Gen.
82      * @params
83      * - aSubShape : subShape obtained by a shape explode in GEOM
84      *   (or main shape)
85      * - anHyp : hypothesis object 
86      * @return
87      * - OK if the hypothesis is compatible with the subShape 
88      *   (and all previous hypothesis on the subShape)
89      * - NOK if the hypothesis is not compatible with the subShape
90      *   (or one previous hypothesis on the subShape)
91      * raises exception if hypothesis has not been created
92      */
93     boolean AddHypothesis(in GEOM::GEOM_Shape aSubShape, in SMESH_Hypothesis anHyp)
94       raises (SALOME::SALOME_Exception);
95 //     boolean AddHypothesis(in SMESH_subMesh aSubMesh, in SMESH_Hypothesis anHyp)
96 //       raises (SALOME::SALOME_Exception);
97
98
99     /*!
100      * Remove an hypothesis previouly added with AddHypothesis.
101      */
102     boolean RemoveHypothesis(in GEOM::GEOM_Shape aSubShape,
103                              in SMESH_Hypothesis anHyp)
104       raises (SALOME::SALOME_Exception);
105 //     boolean RemoveHypothesis(in SMESH_subMesh aSubMesh,
106 //                           in SMESH_Hypothesis anHyp)
107 //       raises (SALOME::SALOME_Exception);
108
109     /*!
110      * Get the list of hypothesis added on a subShape
111      */
112     ListOfHypothesis GetHypothesisList(in GEOM::GEOM_Shape aSubShape)
113       raises (SALOME::SALOME_Exception);
114 //     ListOfHypothesis GetHypothesisList(in SMESH_subMesh aSubMesh)
115 //       raises (SALOME::SALOME_Exception);
116
117     /*!
118      * Get the log of nodes and elements added or removed since previous
119      * clear of the log.
120      * @params
121      * - clearAfterGet : log is emptied after Get (safe if concurrents access)
122      */
123     //    string_array GetLog(in boolean clearAfterGet)
124     //      raises (SALOME::SALOME_Exception);
125     log_array GetLog(in boolean clearAfterGet)
126       raises (SALOME::SALOME_Exception);
127
128     /*!
129      * Clear the log of nodes and elements added or removed since previous
130      * clear. Must be used immediately after GetLog if clearAfterGet is false.
131      */
132     void ClearLog()
133       raises (SALOME::SALOME_Exception);
134
135     /*!
136      * Get the internal Id 
137      */
138     long GetId();     
139
140     /*!
141      * Get the study Id 
142      */
143     long GetStudyId();    
144     
145     SMESH_MeshEditor GetMeshEditor() 
146        raises (SALOME::SALOME_Exception);
147
148     /*!
149      * Export Mesh with DAT and MED Formats
150      */
151     void ExportDAT( in string file )
152       raises (SALOME::SALOME_Exception);
153     void ExportMED( in string file )
154       raises (SALOME::SALOME_Exception);
155     void ExportUNV( in string file )
156       raises (SALOME::SALOME_Exception);
157
158     /*!
159      * Get MED Mesh
160      */
161     SALOME_MED::MESH GetMEDMesh()
162       raises (SALOME::SALOME_Exception);
163
164     long NbNodes()
165       raises (SALOME::SALOME_Exception);
166
167     long NbEdges()
168       raises (SALOME::SALOME_Exception);
169
170     long NbFaces()
171       raises (SALOME::SALOME_Exception);
172
173     long NbTriangles()
174       raises (SALOME::SALOME_Exception);
175
176     long NbQuadrangles()
177       raises (SALOME::SALOME_Exception);
178
179     long NbVolumes()
180       raises (SALOME::SALOME_Exception);
181
182     long NbTetras()
183       raises (SALOME::SALOME_Exception);
184
185     long NbHexas()
186       raises (SALOME::SALOME_Exception);
187
188     long NbSubMesh()
189       raises (SALOME::SALOME_Exception);
190   };
191
192   interface SMESH_subMesh
193   {
194     /*!
195      * 
196      */
197     long GetNumberOfElements()
198       raises (SALOME::SALOME_Exception);
199
200     /*!
201      * 
202      */
203     long GetNumberOfNodes()
204       raises (SALOME::SALOME_Exception);
205
206     /*!
207      * 
208      */
209     long_array GetElementsId()
210       raises (SALOME::SALOME_Exception);
211
212     /*!
213      * 
214      */
215     long_array GetNodesId()
216       raises (SALOME::SALOME_Exception);
217
218     /*!
219      * Get SMESH_Mesh which stores nodes coordinates & elements definition
220      */
221     SMESH_Mesh GetFather()
222       raises (SALOME::SALOME_Exception);
223
224     /*!
225      * Get the internal Id 
226      */
227     long GetId();    
228
229     /*!
230      * Get MED subMesh
231      */
232     SALOME_MED::FAMILY GetFamily()
233       raises (SALOME::SALOME_Exception);
234   };
235   
236   /* 
237    * This interface makes modifications on the Mesh - removing elements and nodes
238    */     
239   interface SMESH_MeshEditor {
240
241
242     boolean RemoveElements(in long_array IDsOfElements)
243        raises (SALOME::SALOME_Exception);
244
245     boolean RemoveNodes(in long_array IDsOfNodes)
246       raises (SALOME::SALOME_Exception);
247
248     boolean AddNode(in double x, in double y, in double z)
249       raises (SALOME::SALOME_Exception);
250
251     boolean AddEdge(in long_array IDsOfNodes)
252       raises (SALOME::SALOME_Exception);
253
254     boolean AddFace(in long_array IDsOfNodes)
255       raises (SALOME::SALOME_Exception);
256
257     boolean AddVolume(in long_array IDsOfNodes)
258       raises (SALOME::SALOME_Exception);
259   };
260 };
261
262 #endif