1 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
18 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
22 // File : SMESH_Mesh.idl
23 // Author : Paul RASCLE, EDF
26 #ifndef _SMESH_MESH_IDL_
27 #define _SMESH_MESH_IDL_
29 #include "SALOME_Exception.idl"
30 //#include "SMESH_Hypothesis.idl"
32 #include "SALOME_GenericObj.idl"
33 //#include "GEOM_Shape.idl"
51 interface SMESH_Hypothesis;
52 typedef sequence<SMESH_Hypothesis> ListOfHypothesis;
54 typedef sequence<double> double_array ;
55 typedef sequence<long> long_array ;
56 typedef sequence<string> string_array ;
82 * Enumeration for element type, like in SMDS
94 * Enumeration for hypothesis status (used by AddHypothesis() and RemoveHypothesis() methods)
96 enum Hypothesis_Status // in the order of severity
99 HYP_MISSING, // algo misses a hypothesis
100 HYP_CONCURENT, // several applicable hypotheses
101 HYP_BAD_PARAMETER,// hypothesis has a bad parameter value
102 HYP_UNKNOWN_FATAL,// --- all statuses below should be considered as fatal
103 // for Add/RemoveHypothesis operations
104 HYP_INCOMPATIBLE, // hypothesis does not fit algo
105 HYP_NOTCONFORM, // not conform mesh is produced appling a hypothesis
106 HYP_ALREADY_EXIST,// such hypothesis already exist
107 HYP_BAD_DIM // bad dimension
111 * Enumeration for DriverMED read status (used by ImportMEDFile() method)
113 enum DriverMED_ReadStatus // in the order of severity
116 DRS_EMPTY, // a MED file contains no mesh with the given name
117 DRS_WARN_RENUMBER, // a MED file has overlapped ranges of element numbers,
118 // so the numbers from the file are ignored
119 DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
120 DRS_FAIL // general failure (exception etc.)
123 typedef sequence<log_block> log_array;
125 interface SMESH_Group;
126 interface SMESH_subMesh;
127 interface SMESH_MeshEditor;
128 interface SMESH_Mesh : SALOME::GenericObj
131 * Associate a Shape to a Mesh created with NewEmpty
134 // boolean SetMesh(in GEOM::GEOM_Shape aShape)
135 // raises (SALOME::SALOME_Exception);
138 * Get the subMesh object associated to a subShape. The subMesh object
139 * gives access to nodes and elements IDs.
140 * SubMesh will be used instead of SubShape in a next idl version to
141 * adress a specific subMesh...
143 SMESH_subMesh GetSubMesh(in GEOM::GEOM_Shape aSubShape, in string name)
144 raises (SALOME::SALOME_Exception);
147 * Create a subMesh without reference to a subShape
149 // SMESH_subMesh NewEmpty()
150 // raises (SALOME::SALOME_Exception);
155 void RemoveSubMesh(in SMESH_subMesh aSubMesh)
156 raises (SALOME::SALOME_Exception);
161 SMESH_Group CreateGroup( in ElementType elem_type,
163 raises (SALOME::SALOME_Exception);
168 void RemoveGroup(in SMESH_Group aGroup)
169 raises (SALOME::SALOME_Exception);
172 * Add hypothesis to the mesh, under a particular subShape
173 * (or the main shape itself)
174 * The Add method is only used to prepare the build of the mesh and store
175 * the algorithms and associated parameters.
176 * Actual job of mesh the shape is done by MESH_Gen.
178 * - aSubShape : subShape obtained by a shape explode in GEOM
180 * - anHyp : hypothesis object
182 * - OK if the hypothesis is compatible with the subShape
183 * (and all previous hypothesis on the subShape)
184 * - NOK if the hypothesis is not compatible with the subShape
185 * (or one previous hypothesis on the subShape)
186 * raises exception if hypothesis has not been created
188 Hypothesis_Status AddHypothesis(in GEOM::GEOM_Shape aSubShape,
189 in SMESH_Hypothesis anHyp)
190 raises (SALOME::SALOME_Exception);
191 // boolean AddHypothesis(in SMESH_subMesh aSubMesh, in SMESH_Hypothesis anHyp)
192 // raises (SALOME::SALOME_Exception);
196 * Remove an hypothesis previouly added with AddHypothesis.
198 Hypothesis_Status RemoveHypothesis(in GEOM::GEOM_Shape aSubShape,
199 in SMESH_Hypothesis anHyp)
200 raises (SALOME::SALOME_Exception);
201 // boolean RemoveHypothesis(in SMESH_subMesh aSubMesh,
202 // in SMESH_Hypothesis anHyp)
203 // raises (SALOME::SALOME_Exception);
206 * Get the list of hypothesis added on a subShape
208 ListOfHypothesis GetHypothesisList(in GEOM::GEOM_Shape aSubShape)
209 raises (SALOME::SALOME_Exception);
210 // ListOfHypothesis GetHypothesisList(in SMESH_subMesh aSubMesh)
211 // raises (SALOME::SALOME_Exception);
214 * Get the log of nodes and elements added or removed since previous
217 * - clearAfterGet : log is emptied after Get (safe if concurrents access)
219 // string_array GetLog(in boolean clearAfterGet)
220 // raises (SALOME::SALOME_Exception);
221 log_array GetLog(in boolean clearAfterGet)
222 raises (SALOME::SALOME_Exception);
225 * Clear the log of nodes and elements added or removed since previous
226 * clear. Must be used immediately after GetLog if clearAfterGet is false.
229 raises (SALOME::SALOME_Exception);
232 * Get the internal Id
241 SMESH_MeshEditor GetMeshEditor()
242 raises (SALOME::SALOME_Exception);
245 * Export Mesh with DAT and MED Formats
247 void ExportDAT( in string file )
248 raises (SALOME::SALOME_Exception);
249 void ExportMED( in string file, in boolean auto_groups )
250 raises (SALOME::SALOME_Exception);
251 void ExportUNV( in string file )
252 raises (SALOME::SALOME_Exception);
257 SALOME_MED::MESH GetMEDMesh()
258 raises (SALOME::SALOME_Exception);
261 raises (SALOME::SALOME_Exception);
264 raises (SALOME::SALOME_Exception);
267 raises (SALOME::SALOME_Exception);
270 raises (SALOME::SALOME_Exception);
273 raises (SALOME::SALOME_Exception);
276 raises (SALOME::SALOME_Exception);
279 raises (SALOME::SALOME_Exception);
282 raises (SALOME::SALOME_Exception);
285 raises (SALOME::SALOME_Exception);
288 raises (SALOME::SALOME_Exception);
291 raises (SALOME::SALOME_Exception);
296 interface SMESH_subMesh : SALOME::GenericObj
301 long GetNumberOfElements()
302 raises (SALOME::SALOME_Exception);
307 long GetNumberOfNodes()
308 raises (SALOME::SALOME_Exception);
313 long_array GetElementsId()
314 raises (SALOME::SALOME_Exception);
319 long_array GetElementsByType( in ElementType theType )
320 raises (SALOME::SALOME_Exception);
325 long_array GetNodesId()
326 raises (SALOME::SALOME_Exception);
329 * Get SMESH_Mesh which stores nodes coordinates & elements definition
331 SMESH_Mesh GetFather()
332 raises (SALOME::SALOME_Exception);
335 * Get the internal Id
342 SALOME_MED::FAMILY GetFamily()
343 raises (SALOME::SALOME_Exception);
347 * This interface makes modifications on the Mesh - removing elements and nodes
349 interface SMESH_MeshEditor {
352 boolean RemoveElements(in long_array IDsOfElements)
353 raises (SALOME::SALOME_Exception);
355 boolean RemoveNodes(in long_array IDsOfNodes)
356 raises (SALOME::SALOME_Exception);
358 boolean AddNode(in double x, in double y, in double z)
359 raises (SALOME::SALOME_Exception);
361 boolean AddEdge(in long_array IDsOfNodes)
362 raises (SALOME::SALOME_Exception);
364 boolean AddFace(in long_array IDsOfNodes)
365 raises (SALOME::SALOME_Exception);
367 boolean AddVolume(in long_array IDsOfNodes)
368 raises (SALOME::SALOME_Exception);