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 "SALOME_GenericObj.idl"
34 interface GEOM_Object;
47 interface SMESH_Hypothesis;
48 typedef sequence<SMESH_Hypothesis> ListOfHypothesis;
50 typedef sequence<double> double_array ;
51 typedef sequence<long> long_array ;
52 typedef sequence<string> string_array ;
53 typedef sequence<long_array> array_of_long_array ;
80 struct PointStruct { double x;
83 struct DirStruct { PointStruct PS ; } ; // analog to Occ Direction
85 struct AxisStruct { double x;
94 * Enumeration for element type, like in SMDS
106 * Enumeration for hypothesis status (used by AddHypothesis() and RemoveHypothesis() methods)
108 enum Hypothesis_Status // in the order of severity
111 HYP_MISSING, // algo misses a hypothesis
112 HYP_CONCURENT, // several applicable hypotheses
113 HYP_BAD_PARAMETER,// hypothesis has a bad parameter value
114 HYP_UNKNOWN_FATAL,// --- all statuses below should be considered as fatal
115 // for Add/RemoveHypothesis operations
116 HYP_INCOMPATIBLE, // hypothesis does not fit algo
117 HYP_NOTCONFORM, // not conform mesh is produced appling a hypothesis
118 HYP_ALREADY_EXIST,// such hypothesis already exist
119 HYP_BAD_DIM // bad dimension
123 * Enumeration for DriverMED read status (used by ImportMEDFile() method)
125 enum DriverMED_ReadStatus // in the order of severity
128 DRS_EMPTY, // a MED file contains no mesh with the given name
129 DRS_WARN_RENUMBER, // a MED file has overlapped ranges of element numbers,
130 // so the numbers from the file are ignored
131 DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
132 DRS_FAIL // general failure (exception etc.)
135 typedef sequence<log_block> log_array;
137 interface SMESH_Group;
138 interface SMESH_subMesh;
139 interface SMESH_MeshEditor;
140 interface SMESH_Mesh : SALOME::GenericObj
143 * Associate a Shape to a Mesh created with NewEmpty
146 // boolean SetMesh(in GEOM::GEOM_Object anObject)
147 // raises (SALOME::SALOME_Exception);
150 * Get the subMesh object associated to a subShape. The subMesh object
151 * gives access to nodes and elements IDs.
152 * SubMesh will be used instead of SubShape in a next idl version to
153 * adress a specific subMesh...
155 SMESH_subMesh GetSubMesh(in GEOM::GEOM_Object aSubObject, in string name)
156 raises (SALOME::SALOME_Exception);
159 * Create a subMesh without reference to a subShape
161 // SMESH_subMesh NewEmpty()
162 // raises (SALOME::SALOME_Exception);
167 void RemoveSubMesh(in SMESH_subMesh aSubMesh)
168 raises (SALOME::SALOME_Exception);
173 SMESH_Group CreateGroup( in ElementType elem_type,
175 raises (SALOME::SALOME_Exception);
178 * Create a group from geometry group
180 SMESH_Group CreateGroupFromGEOM( in ElementType elem_type,
182 in GEOM::GEOM_Object theGEOMGroup )
183 raises (SALOME::SALOME_Exception);
188 void RemoveGroup(in SMESH_Group aGroup)
189 raises (SALOME::SALOME_Exception);
192 * Remove group with its contents
194 void RemoveGroupWithContents( in SMESH_Group aGroup )
195 raises (SALOME::SALOME_Exception);
198 * Union of two groups
199 * New group is created. All mesh elements that are
200 * present in initial groups are added to the new one
202 SMESH_Group UnionGroups( in SMESH_Group aGroup1, in SMESH_Group aGroup2, in string name )
203 raises (SALOME::SALOME_Exception);
206 * Intersection of two groups
207 * New group is created. All mesh elements that are
208 * present in both initial groups are added to the new one.
210 SMESH_Group IntersectGroups( in SMESH_Group aGroup1, in SMESH_Group aGroup2, in string name )
211 raises (SALOME::SALOME_Exception);
215 * New group is created. All mesh elements that are present in
216 * main group but do not present in tool group are added to the new one
218 SMESH_Group CutGroups( in SMESH_Group aMainGroup, in SMESH_Group aToolGroup, in string name )
219 raises (SALOME::SALOME_Exception);
222 * Add hypothesis to the mesh, under a particular subShape
223 * (or the main shape itself)
224 * The Add method is only used to prepare the build of the mesh and store
225 * the algorithms and associated parameters.
226 * Actual job of mesh the shape is done by MESH_Gen.
228 * - aSubShape : subShape obtained by a shape explode in GEOM
230 * - anHyp : hypothesis object
232 * - OK if the hypothesis is compatible with the subShape
233 * (and all previous hypothesis on the subShape)
234 * - NOK if the hypothesis is not compatible with the subShape
235 * (or one previous hypothesis on the subShape)
236 * raises exception if hypothesis has not been created
238 Hypothesis_Status AddHypothesis(in GEOM::GEOM_Object aSubObject,
239 in SMESH_Hypothesis anHyp)
240 raises (SALOME::SALOME_Exception);
241 // boolean AddHypothesis(in SMESH_subMesh aSubMesh, in SMESH_Hypothesis anHyp)
242 // raises (SALOME::SALOME_Exception);
246 * Remove an hypothesis previouly added with AddHypothesis.
248 Hypothesis_Status RemoveHypothesis(in GEOM::GEOM_Object aSubObject,
249 in SMESH_Hypothesis anHyp)
250 raises (SALOME::SALOME_Exception);
251 // boolean RemoveHypothesis(in SMESH_subMesh aSubMesh,
252 // in SMESH_Hypothesis anHyp)
253 // raises (SALOME::SALOME_Exception);
256 * Get the list of hypothesis added on a subShape
258 ListOfHypothesis GetHypothesisList(in GEOM::GEOM_Object aSubObject)
259 raises (SALOME::SALOME_Exception);
260 // ListOfHypothesis GetHypothesisList(in SMESH_subMesh aSubMesh)
261 // raises (SALOME::SALOME_Exception);
264 * Get the log of nodes and elements added or removed since previous
267 * - clearAfterGet : log is emptied after Get (safe if concurrents access)
269 // string_array GetLog(in boolean clearAfterGet)
270 // raises (SALOME::SALOME_Exception);
271 log_array GetLog(in boolean clearAfterGet)
272 raises (SALOME::SALOME_Exception);
275 * Clear the log of nodes and elements added or removed since previous
276 * clear. Must be used immediately after GetLog if clearAfterGet is false.
279 raises (SALOME::SALOME_Exception);
282 * Get the internal Id
291 SMESH_MeshEditor GetMeshEditor()
292 raises (SALOME::SALOME_Exception);
295 * Export Mesh with DAT and MED Formats
297 void ExportDAT( in string file )
298 raises (SALOME::SALOME_Exception);
299 void ExportMED( in string file, in boolean auto_groups )
300 raises (SALOME::SALOME_Exception);
301 void ExportUNV( in string file )
302 raises (SALOME::SALOME_Exception);
303 void ExportSTL( in string file, in boolean isascii )
304 raises (SALOME::SALOME_Exception);
309 SALOME_MED::MESH GetMEDMesh()
310 raises (SALOME::SALOME_Exception);
313 raises (SALOME::SALOME_Exception);
316 raises (SALOME::SALOME_Exception);
319 raises (SALOME::SALOME_Exception);
322 raises (SALOME::SALOME_Exception);
325 raises (SALOME::SALOME_Exception);
328 raises (SALOME::SALOME_Exception);
331 raises (SALOME::SALOME_Exception);
334 raises (SALOME::SALOME_Exception);
337 raises (SALOME::SALOME_Exception);
340 raises (SALOME::SALOME_Exception);
343 raises (SALOME::SALOME_Exception);
348 interface SMESH_subMesh : SALOME::GenericObj
353 long GetNumberOfElements()
354 raises (SALOME::SALOME_Exception);
359 long GetNumberOfNodes( in boolean all )
360 raises (SALOME::SALOME_Exception);
365 long_array GetElementsId()
366 raises (SALOME::SALOME_Exception);
371 long_array GetElementsByType( in ElementType theType )
372 raises (SALOME::SALOME_Exception);
377 long_array GetNodesId()
378 raises (SALOME::SALOME_Exception);
381 * Get SMESH_Mesh which stores nodes coordinates & elements definition
383 SMESH_Mesh GetFather()
384 raises (SALOME::SALOME_Exception);
387 * Get the internal Id
394 SALOME_MED::FAMILY GetFamily()
395 raises (SALOME::SALOME_Exception);
399 * This interface makes modifications on the Mesh - removing elements and nodes etc.
401 interface NumericalFunctor;
402 interface SMESH_MeshEditor {
405 boolean RemoveElements(in long_array IDsOfElements);
407 boolean RemoveNodes(in long_array IDsOfNodes);
409 boolean AddNode(in double x, in double y, in double z);
411 boolean AddEdge(in long_array IDsOfNodes);
413 boolean AddFace(in long_array IDsOfNodes);
415 boolean AddVolume(in long_array IDsOfNodes);
417 boolean MoveNode(in long NodeID, in double x, in double y, in double z);
419 boolean InverseDiag(in long NodeID1, in long NodeID2);
421 boolean DeleteDiag(in long NodeID1, in long NodeID2);
423 boolean Reorient(in long_array IDsOfElements);
425 boolean TriToQuad(in long_array IDsOfElements,
426 in NumericalFunctor Criterion,
429 boolean QuadToTri(in long_array IDsOfElements,
430 in NumericalFunctor Criterion);
432 boolean SplitQuad(in long_array IDsOfElements,
435 enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH };
437 boolean Smooth(in long_array IDsOfElements,
438 in long_array IDsOfFixedNodes,
439 in long MaxNbOfIterations,
440 in double MaxAspectRatio,
441 in Smooth_Method Method);
443 void RenumberNodes();
445 void RenumberElements();
447 void RotationSweep(in long_array IDsOfElements,
449 in double AngleInRadians,
451 in double Tolerance);
453 void ExtrusionSweep(in long_array IDsOfElements,
454 in DirStruct StepVector,
457 enum MirrorType { POINT, AXIS, PLANE };
459 void Mirror (in long_array IDsOfElements,
460 in AxisStruct Mirror,
461 in MirrorType theMirrorType,
464 void Translate (in long_array IDsOfElements,
468 void Rotate (in long_array IDsOfElements,
470 in double AngleInRadians,
473 void FindCoincidentNodes (in double Tolerance,
474 out array_of_long_array GroupsOfNodes);
476 void MergeNodes (in array_of_long_array GroupsOfNodes);
478 void MergeEqualElements();
480 boolean SewFreeBorders (in long FirstNodeID1,
481 in long SecondNodeID1,
483 in long FirstNodeID2,
484 in long SecondNodeID2,
485 in long LastNodeID2);
487 boolean SewConformFreeBorders (in long FirstNodeID1,
488 in long SecondNodeID1,
490 in long FirstNodeID2,
491 in long SecondNodeID2);
493 boolean SewBorderToSide (in long FirstNodeIDOnFreeBorder,
494 in long SecondNodeIDOnFreeBorder,
495 in long LastNodeIDOnFreeBorder,
496 in long FirstNodeIDOnSide,
497 in long LastNodeIDOnSide);
499 boolean SewSideElements (in long_array IDsOfSide1Elements,
500 in long_array IDsOfSide2Elements,
501 in long NodeID1OfSide1ToMerge,
502 in long NodeID1OfSide2ToMerge,
503 in long NodeID2OfSide1ToMerge,
504 in long NodeID2OfSide2ToMerge);