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