1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : SMESH_MeshEditor.idl
24 #ifndef _SMESH_MESHEDITOR_IDL_
25 #define _SMESH_MESHEDITOR_IDL_
27 #include "SMESH_Mesh.idl"
28 #include "SMESH_Gen.idl"
32 enum Bnd_Dimension { BND_2DFROM3D, BND_1DFROM3D, BND_1DFROM2D };
35 * This interface makes modifications on the Mesh - removing elements and nodes etc.
37 interface NumericalFunctor;
39 interface SMESH_MeshEditor
42 * Returns a mesh subject to edition
47 * Return data of mesh edition preview which is computed provided
48 * that the editor was obtained through SMESH_Mesh::GetMeshEditPreviewer()
50 MeshPreviewStruct GetPreviewData() raises (SALOME::SALOME_Exception);
53 * If during last operation of MeshEditor some nodes were
54 * created, this method returns list of their IDs, if new nodes
55 * not created - returns empty list
57 long_array GetLastCreatedNodes() raises (SALOME::SALOME_Exception);
60 * If during last operation of MeshEditor some elements were
61 * created, this method returns list of their IDs, if new elements
62 * not created - returns empty list
64 long_array GetLastCreatedElems() raises (SALOME::SALOME_Exception);
67 * \brief Clears sequences of last created elements and nodes
69 void ClearLastCreated() raises (SALOME::SALOME_Exception);
72 * \brief Returns description of an error/warning occured during the last operation
74 ComputeError GetLastError() raises (SALOME::SALOME_Exception);
77 * \brief Wrap a sequence of ids in a SMESH_IDSource
78 * \param IDsOfElements list of mesh elements identifiers
79 * \return new ID source object
81 SMESH_IDSource MakeIDSource(in long_array IDsOfElements, in ElementType type);
84 * \brief Remove mesh elements specified by their identifiers.
85 * \param IDsOfElements list of mesh elements identifiers
86 * \return \c true if elements are correctly removed or \c false otherwise
88 boolean RemoveElements(in long_array IDsOfElements) raises (SALOME::SALOME_Exception);
91 * \brief Remove mesh nodes specified by their identifiers.
92 * \param IDsOfNodes list of mesh nodes identifiers
93 * \return \c true if nodes are correctly removed or \c false otherwise
95 boolean RemoveNodes(in long_array IDsOfNodes) raises (SALOME::SALOME_Exception);
98 * \brief Remove all orphan nodes.
99 * \return number of removed nodes
101 long RemoveOrphanNodes() raises (SALOME::SALOME_Exception);
104 * \brief Add a new node.
105 * \param x X coordinate of new node
106 * \param y Y coordinate of new node
107 * \param z Z coordinate of new node
108 * \return integer identifier of new node
110 long AddNode(in double x, in double y, in double z) raises (SALOME::SALOME_Exception);
113 * Create a 0D element on the given node.
114 * \param IdOfNode Node IDs for creation of element.
116 long Add0DElement(in long IDOfNode) raises (SALOME::SALOME_Exception);
119 * Create a ball element on the given node.
120 * \param IdOfNode Node IDs for creation of element.
122 long AddBall(in long IDOfNode, in double diameter) raises (SALOME::SALOME_Exception);
125 * Create an edge, either linear and quadratic (this is determed
126 * by number of given nodes, two or three).
127 * \param IdsOfNodes List of node IDs for creation of element.
128 * Needed order of nodes in this list corresponds to description
129 * of MED. This description is located by the following link:
130 * http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
132 long AddEdge(in long_array IDsOfNodes) raises (SALOME::SALOME_Exception);
135 * Create face, either linear and quadratic (this is determed
136 * by number of given nodes).
137 * \param IdsOfNodes List of node IDs for creation of element.
138 * Needed order of nodes in this list corresponds to description
139 * of MED. This description is located by the following link:
140 * http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
142 long AddFace(in long_array IDsOfNodes) raises (SALOME::SALOME_Exception);
144 long AddPolygonalFace(in long_array IdsOfNodes) raises (SALOME::SALOME_Exception);
147 * Create a quadratic polygonal face
148 * \param IdsOfNodes - nodes of the polygon; corner nodes follow first
149 * \return long - ID of a new polygon
151 long AddQuadPolygonalFace(in long_array IdsOfNodes) raises (SALOME::SALOME_Exception);
154 * Create volume, either linear and quadratic (this is determed
155 * by number of given nodes).
156 * \param IdsOfNodes List of node IDs for creation of element.
157 * Needed order of nodes in this list corresponds to description
158 * of MED. This description is located by the following link:
159 * http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
161 long AddVolume(in long_array IDsOfNodes) raises (SALOME::SALOME_Exception);
164 * Create volume of many faces, giving nodes for each face.
165 * \param IdsOfNodes List of node IDs for volume creation face by face.
166 * \param Quantities List of integer values, Quantities[i]
167 * gives quantity of nodes in face number i.
169 long AddPolyhedralVolume (in long_array IdsOfNodes,
170 in long_array Quantities) raises (SALOME::SALOME_Exception);
172 * Create volume of many faces, giving IDs of existing faces.
173 * \param IdsOfFaces List of face IDs for volume creation.
174 * \note The created volume will refer only to nodes
175 * of the given faces, not to the faces itself.
177 long AddPolyhedralVolumeByFaces (in long_array IdsOfFaces) raises (SALOME::SALOME_Exception);
180 * Create 0D elements on all nodes of the given object except those
181 * nodes on which a 0D element already exists.
182 * \param theObject object on whose nodes 0D elements will be created.
183 * \param theGroupName optional name of a group to add 0D elements created
184 * and/or found on nodes of \a theObject.
185 * \return an object (a new group or a temporary SMESH_IDSource) holding
186 * ids of new and/or found 0D elements.
188 SMESH_IDSource Create0DElementsOnAllNodes(in SMESH_IDSource theObject,
189 in string theGroupName)
190 raises (SALOME::SALOME_Exception);
193 * \brief Bind a node to a vertex
194 * \param NodeID - node ID
195 * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
197 void SetNodeOnVertex(in long NodeID, in long VertexID)
198 raises (SALOME::SALOME_Exception);
200 * \brief Store node position on an edge
201 * \param NodeID - node ID
202 * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
203 * \param paramOnEdge - parameter on edge where the node is located
205 void SetNodeOnEdge(in long NodeID, in long EdgeID, in double paramOnEdge)
206 raises (SALOME::SALOME_Exception);
208 * \brief Store node position on a face
209 * \param NodeID - node ID
210 * \param FaceID - face ID available through GEOM_Object.GetSubShapeIndices()[0]
211 * \param u - U parameter on face where the node is located
212 * \param v - V parameter on face where the node is located
214 void SetNodeOnFace(in long NodeID, in long FaceID, in double u, in double v)
215 raises (SALOME::SALOME_Exception);
217 * \brief Bind a node to a solid
218 * \param NodeID - node ID
219 * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
221 void SetNodeInVolume(in long NodeID, in long SolidID)
222 raises (SALOME::SALOME_Exception);
224 * \brief Bind an element to a shape
225 * \param ElementID - element ID
226 * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0]
228 void SetMeshElementOnShape(in long ElementID, in long ShapeID)
229 raises (SALOME::SALOME_Exception);
232 boolean MoveNode(in long NodeID, in double x, in double y, in double z)
233 raises (SALOME::SALOME_Exception);
235 boolean InverseDiag(in long NodeID1, in long NodeID2)
236 raises (SALOME::SALOME_Exception);
238 boolean DeleteDiag(in long NodeID1, in long NodeID2)
239 raises (SALOME::SALOME_Exception);
241 boolean Reorient(in long_array IDsOfElements)
242 raises (SALOME::SALOME_Exception);
244 boolean ReorientObject(in SMESH_IDSource theObject)
245 raises (SALOME::SALOME_Exception);
247 * \brief Reorient faces contained in \a the2Dgroup.
248 * \param the2Dgroup - the mesh or its part to reorient
249 * \param theDirection - desired direction of normal of \a theFace
250 * \param theFace - ID of face whose orientation is checked.
251 * It can be < 1 then \a thePoint is used to find a face.
252 * \param thePoint - is used to find a face if \a theFace < 1.
253 * \return number of reoriented faces.
255 long Reorient2D(in SMESH_IDSource the2Dgroup,
256 in DirStruct theDirection,
258 in PointStruct thePoint) raises (SALOME::SALOME_Exception);
260 * \brief Reorient faces basing on orientation of adjacent volumes.
261 * \param faces - a list of objects containing face to reorient
262 * \param volumes - an object containing volumes.
263 * \param outsideNormal - to orient faces to have their normal
264 * pointing either \a outside or \a inside the adjacent volumes.
265 * \return number of reoriented faces.
267 long Reorient2DBy3D(in ListOfIDSources faces,
268 in SMESH_IDSource volumes,
269 in boolean outsideNormal) raises (SALOME::SALOME_Exception);
272 * \brief Fuse neighbour triangles into quadrangles.
273 * \param IDsOfElements Ids of triangles to be fused.
274 * \param theCriterion Is used to choose a neighbour to fuse with.
275 * \param theMaxAngle Is a max angle between element normals at which fusion
276 * is still performed; theMaxAngle is mesured in radians.
277 * \return \c true in case of success, FALSE otherwise.
279 boolean TriToQuad (in long_array IDsOfElements,
280 in NumericalFunctor Criterion,
281 in double MaxAngle) raises (SALOME::SALOME_Exception);
283 * \brief Fuse neighbour triangles into quadrangles.
285 * Behaves like the above method, taking a list of elements from \a theObject
287 boolean TriToQuadObject (in SMESH_IDSource theObject,
288 in NumericalFunctor Criterion,
289 in double MaxAngle) raises (SALOME::SALOME_Exception);
292 * \brief Split quadrangles into triangles.
293 * \param IDsOfElements Ids of quadrangles to split.
294 * \param theCriterion Is used to choose a diagonal for splitting.
295 * \return TRUE in case of success, FALSE otherwise.
297 boolean QuadToTri (in long_array IDsOfElements,
298 in NumericalFunctor Criterion) raises (SALOME::SALOME_Exception);
300 * \brief Split quadrangles into triangles.
302 * Behaves like the above method, taking a list of elements from \a theObject
304 boolean QuadToTriObject (in SMESH_IDSource theObject,
305 in NumericalFunctor Criterion) raises (SALOME::SALOME_Exception);
307 * \brief Split each of quadrangles into 4 triangles.
308 * \param theQuads Container of quadrangles to split.
310 void QuadTo4Tri (in SMESH_IDSource theQuads) raises (SALOME::SALOME_Exception);
313 * \brief Split quadrangles into triangles.
314 * \param theElems The faces to be splitted.
315 * \param the13Diag Is used to choose a diagonal for splitting.
316 * \return TRUE in case of success, FALSE otherwise.
318 boolean SplitQuad (in long_array IDsOfElements,
319 in boolean Diag13) raises (SALOME::SALOME_Exception);
321 * \brief Split quadrangles into triangles.
323 * Behaves like the above method, taking list of elements from \a theObject
325 boolean SplitQuadObject (in SMESH_IDSource theObject,
326 in boolean Diag13) raises (SALOME::SALOME_Exception);
329 * Find better splitting of the given quadrangle.
330 * \param IDOfQuad ID of the quadrangle to be splitted.
331 * \param Criterion A criterion to choose a diagonal for splitting.
332 * \return 1 if 1-3 diagonal is better, 2 if 2-4
333 * diagonal is better, 0 if error occurs.
335 long BestSplit (in long IDOfQuad,
336 in NumericalFunctor Criterion) raises (SALOME::SALOME_Exception);
339 * \brief Split volumic elements into tetrahedrons
340 * \param elems - elements to split
341 * \param methodFlags - flags passing splitting method:
342 * 1 - split the hexahedron into 5 tetrahedrons
343 * 2 - split the hexahedron into 6 tetrahedrons
344 * 3 - split the hexahedron into 24 tetrahedrons
346 void SplitVolumesIntoTetra(in SMESH_IDSource elems, in short methodFlags)
347 raises (SALOME::SALOME_Exception);
350 * \brief Split hexahedra into triangular prisms
351 * \param elems - elements to split
352 * \param startHexPoint - a point used to find a hexahedron for which \a facetToSplitNormal
353 * gives a normal vector defining facets to split into triangles.
354 * \param facetToSplitNormal - normal used to find a facet of hexahedron
355 * to split into triangles.
356 * \param methodFlags - flags passing splitting method:
357 * 1 - split the hexahedron into 2 prisms
358 * 2 - split the hexahedron into 4 prisms
359 * \param allDomains - if \c False, only hexahedra adjacent to one closest
360 * to \a facetToSplitNormal location are split, else \a facetToSplitNormal
361 * is used to find the facet to split in all domains present in \a elems.
363 void SplitHexahedraIntoPrisms(in SMESH_IDSource elems,
364 in SMESH::PointStruct startHexPoint,
365 in SMESH::DirStruct facetToSplitNormal,
366 in short methodFlags,
367 in boolean allDomains)
368 raises (SALOME::SALOME_Exception);
371 * \brief Split bi-quadratic elements into linear ones without creation of additional nodes.
372 * - bi-quadratic triangle will be split into 3 linear quadrangles;
373 * - bi-quadratic quadrangle will be split into 4 linear quadrangles;
374 * - tri-quadratic hexahedron will be split into 8 linear hexahedra;
375 * Quadratic elements of lower dimension adjacent to the split bi-quadratic element
376 * will be split in order to keep the mesh conformal.
377 * \param elems - elements to split
379 void SplitBiQuadraticIntoLinear(in ListOfIDSources elems)
380 raises (SALOME::SALOME_Exception);
383 enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH };
385 boolean Smooth(in long_array IDsOfElements,
386 in long_array IDsOfFixedNodes,
387 in long MaxNbOfIterations,
388 in double MaxAspectRatio,
389 in Smooth_Method Method) raises (SALOME::SALOME_Exception);
391 boolean SmoothObject(in SMESH_IDSource theObject,
392 in long_array IDsOfFixedNodes,
393 in long MaxNbOfIterations,
394 in double MaxAspectRatio,
395 in Smooth_Method Method) raises (SALOME::SALOME_Exception);
397 boolean SmoothParametric(in long_array IDsOfElements,
398 in long_array IDsOfFixedNodes,
399 in long MaxNbOfIterations,
400 in double MaxAspectRatio,
401 in Smooth_Method Method) raises (SALOME::SALOME_Exception);
403 boolean SmoothParametricObject(in SMESH_IDSource theObject,
404 in long_array IDsOfFixedNodes,
405 in long MaxNbOfIterations,
406 in double MaxAspectRatio,
407 in Smooth_Method Method) raises (SALOME::SALOME_Exception);
409 void ConvertToQuadratic(in boolean theForce3d)
410 raises (SALOME::SALOME_Exception);
411 void ConvertToQuadraticObject(in boolean theForce3d,
412 in SMESH_IDSource theObject)
413 raises (SALOME::SALOME_Exception);
415 boolean ConvertFromQuadratic()
416 raises (SALOME::SALOME_Exception);
417 void ConvertFromQuadraticObject(in SMESH_IDSource theObject)
418 raises (SALOME::SALOME_Exception);
420 void ConvertToBiQuadratic(in boolean theForce3d,
421 in SMESH_IDSource theObject)
422 raises (SALOME::SALOME_Exception);
424 void RenumberNodes() raises (SALOME::SALOME_Exception);
426 void RenumberElements() raises (SALOME::SALOME_Exception);
429 * \brief Generate dim+1 elements by rotation of the object around axis
430 * \param Nodes - nodes to revolve: a list including groups, sub-meshes or a mesh
431 * \param Edges - edges to revolve: a list including groups, sub-meshes or a mesh
432 * \param Faces - faces to revolve: a list including groups, sub-meshes or a mesh
433 * \param Axis - rotation axis
434 * \param AngleInRadians - rotation angle
435 * \param NbOfSteps - number of elements to generate from one element
436 * \param ToMakeGroups - if true, new elements will be included into new groups
437 * corresponding to groups the input elements included in.
438 * \return ListOfGroups - new groups craeted if \a ToMakeGroups is true
440 ListOfGroups RotationSweepObjects(in ListOfIDSources Nodes,
441 in ListOfIDSources Edges,
442 in ListOfIDSources Faces,
444 in double AngleInRadians,
447 in boolean ToMakeGroups)
448 raises (SALOME::SALOME_Exception);
451 * \brief Generate dim+1 elements by extrusion of elements along vector
452 * \param nodes - nodes to extrude: a list including groups, sub-meshes or a mesh
453 * \param edges - edges to extrude: a list including groups, sub-meshes or a mesh
454 * \param faces - faces to extrude: a list including groups, sub-meshes or a mesh
455 * \param stepVector - vector giving direction and distance of an extrusion step
456 * \param nbOfSteps - number of elements to generate from one element
457 * \param toMakeGroups - if true, new elements will be included into new groups
458 * corresponding to groups the input elements included in.
459 * \return ListOfGroups - new groups craeted if \a toMakeGroups is true
461 ListOfGroups ExtrusionSweepObjects(in ListOfIDSources nodes,
462 in ListOfIDSources edges,
463 in ListOfIDSources faces,
464 in DirStruct stepVector,
466 in boolean toMakeGroups)
467 raises (SALOME::SALOME_Exception);
469 /*! Generates new elements by extrusion along the normal to a discretized surface or wire
471 ListOfGroups ExtrusionByNormal(in ListOfIDSources theObjects,
474 in boolean byAverageNormal,
475 in boolean useInputElemsOnly,
476 in boolean makeGroups,
478 raises (SALOME::SALOME_Exception);
481 * Generate new elements by extrusion of theElements
482 * by StepVector by NbOfSteps
483 * \param ExtrFlags set flags for performing extrusion
484 * \param SewTolerance - uses for comparing locations of nodes if flag
485 * EXTRUSION_FLAG_SEW is set
486 * \param ToMakeGroups - if true, new elements will be included into new groups
487 * corresponding to groups the input elements included in.
488 * \return ListOfGroups - new groups craeted if \a ToMakeGroups is true
490 ListOfGroups AdvancedExtrusion(in long_array IDsOfElements,
491 in DirStruct StepVector,
494 in double SewTolerance,
495 in boolean ToMakeGroups)
496 raises (SALOME::SALOME_Exception);
498 enum Extrusion_Error {
503 EXTR_BAD_STARTING_NODE,
504 EXTR_BAD_ANGLES_NUMBER,
505 EXTR_CANT_GET_TANGENT
508 ListOfGroups ExtrusionAlongPathObjects(in ListOfIDSources Nodes,
509 in ListOfIDSources Edges,
510 in ListOfIDSources Faces,
511 in SMESH_IDSource Path,
512 in GEOM::GEOM_Object PathShape,
514 in boolean HasAngles,
515 in double_array Angles,
516 in boolean LinearVariation,
517 in boolean HasRefPoint,
518 in PointStruct RefPoint,
519 in boolean MakeGroups,
520 out Extrusion_Error Error)
521 raises (SALOME::SALOME_Exception);
524 * Compute rotation angles for ExtrusionAlongPath as linear variation
525 * of given angles along path steps
526 * param PathMesh mesh containing a 1D sub-mesh on the edge, along
527 * which proceeds the extrusion
528 * param PathShape is shape(edge); as the mesh can be complex, the edge
529 * is used to define the sub-mesh for the path
531 double_array LinearAnglesVariation(in SMESH_Mesh PathMesh,
532 in GEOM::GEOM_Object PathShape,
533 in double_array Angles);
535 enum MirrorType { POINT, AXIS, PLANE };
537 void Mirror (in long_array IDsOfElements,
538 in AxisStruct Mirror,
541 raises (SALOME::SALOME_Exception);
542 ListOfGroups MirrorMakeGroups (in long_array IDsOfElements,
543 in AxisStruct Mirror,
545 raises (SALOME::SALOME_Exception);
546 SMESH_Mesh MirrorMakeMesh (in long_array IDsOfElements,
547 in AxisStruct Mirror,
549 in boolean CopyGroups,
551 raises (SALOME::SALOME_Exception);
553 void MirrorObject (in SMESH_IDSource theObject,
554 in AxisStruct Mirror,
557 raises (SALOME::SALOME_Exception);
558 ListOfGroups MirrorObjectMakeGroups (in SMESH_IDSource theObject,
559 in AxisStruct Mirror,
561 raises (SALOME::SALOME_Exception);
562 SMESH_Mesh MirrorObjectMakeMesh (in SMESH_IDSource theObject,
563 in AxisStruct Mirror,
565 in boolean CopyGroups,
567 raises (SALOME::SALOME_Exception);
569 void Translate (in long_array IDsOfElements,
572 raises (SALOME::SALOME_Exception);
573 ListOfGroups TranslateMakeGroups (in long_array IDsOfElements,
575 raises (SALOME::SALOME_Exception);
576 SMESH_Mesh TranslateMakeMesh (in long_array IDsOfElements,
578 in boolean CopyGroups,
580 raises (SALOME::SALOME_Exception);
582 void TranslateObject (in SMESH_IDSource theObject,
585 raises (SALOME::SALOME_Exception);
586 ListOfGroups TranslateObjectMakeGroups (in SMESH_IDSource theObject,
588 raises (SALOME::SALOME_Exception);
589 SMESH_Mesh TranslateObjectMakeMesh (in SMESH_IDSource theObject,
591 in boolean CopyGroups,
593 raises (SALOME::SALOME_Exception);
595 void Scale (in SMESH_IDSource theObject,
596 in PointStruct thePoint,
597 in double_array theScaleFact,
599 raises (SALOME::SALOME_Exception);
600 ListOfGroups ScaleMakeGroups (in SMESH_IDSource theObject,
601 in PointStruct thePoint,
602 in double_array theScaleFact)
603 raises (SALOME::SALOME_Exception);
604 SMESH_Mesh ScaleMakeMesh (in SMESH_IDSource theObject,
605 in PointStruct thePoint,
606 in double_array theScaleFact,
607 in boolean CopyGroups,
609 raises (SALOME::SALOME_Exception);
611 void Rotate (in long_array IDsOfElements,
613 in double AngleInRadians,
615 raises (SALOME::SALOME_Exception);
616 ListOfGroups RotateMakeGroups (in long_array IDsOfElements,
618 in double AngleInRadians)
619 raises (SALOME::SALOME_Exception);
620 SMESH_Mesh RotateMakeMesh (in long_array IDsOfElements,
622 in double AngleInRadians,
623 in boolean CopyGroups,
625 raises (SALOME::SALOME_Exception);
627 void RotateObject (in SMESH_IDSource theObject,
629 in double AngleInRadians,
631 raises (SALOME::SALOME_Exception);
632 ListOfGroups RotateObjectMakeGroups (in SMESH_IDSource theObject,
634 in double AngleInRadians)
635 raises (SALOME::SALOME_Exception);
636 SMESH_Mesh RotateObjectMakeMesh (in SMESH_IDSource theObject,
638 in double AngleInRadians,
639 in boolean CopyGroups,
641 raises (SALOME::SALOME_Exception);
643 void FindCoincidentNodes (in double Tolerance,
644 out array_of_long_array GroupsOfNodes,
645 in boolean SeparateCornersAndMedium)
646 raises (SALOME::SALOME_Exception);
648 void FindCoincidentNodesOnPart (in SMESH_IDSource SubMeshOrGroup,
650 out array_of_long_array GroupsOfNodes,
651 in boolean SeparateCornersAndMedium)
652 raises (SALOME::SALOME_Exception);
654 void FindCoincidentNodesOnPartBut (in SMESH_IDSource SubMeshOrGroup,
656 out array_of_long_array GroupsOfNodes,
657 in ListOfIDSources ExceptSubMeshOrGroups,
658 in boolean SeparateCornersAndMedium)
659 raises (SALOME::SALOME_Exception);
661 void MergeNodes (in array_of_long_array GroupsOfNodes,
662 in SMESH::ListOfIDSources NodesToKeep)
663 raises (SALOME::SALOME_Exception);
666 * \brief Find elements built on the same nodes.
667 * \param MeshOrSubMeshOrGroup Mesh or SubMesh, or Group of elements for searching.
668 * \return List of groups of equal elements.
670 void FindEqualElements (in SMESH_IDSource MeshOrSubMeshOrGroup,
671 out array_of_long_array GroupsOfElementsID)
672 raises (SALOME::SALOME_Exception);
675 * \brief Merge elements in each given group.
676 * \param GroupsOfElementsID Groups of elements for merging.
678 void MergeElements(in array_of_long_array GroupsOfElementsID)
679 raises (SALOME::SALOME_Exception);
682 * \brief Merge equal elements in the whole mesh.
684 void MergeEqualElements()
685 raises (SALOME::SALOME_Exception);
688 * If the given ID is a valid node ID (nodeID > 0), just move this node, else
689 * move the node closest to the point to point's location and return ID of the node
691 long MoveClosestNodeToPoint(in double x, in double y, in double z, in long nodeID)
692 raises (SALOME::SALOME_Exception);
695 * Return ID of node closest to a given point
697 long FindNodeClosestTo(in double x, in double y, in double z)
698 raises (SALOME::SALOME_Exception);
701 * Return elements of given type where the given point is IN or ON.
703 * 'ALL' type means elements of any type excluding nodes and 0D elements
705 long_array FindElementsByPoint(in double x, in double y, in double z, in ElementType type)
706 raises (SALOME::SALOME_Exception);
709 * Searching among the given elements, return elements of given type
710 * where the given point is IN or ON.
712 * 'ALL' type means elements of any type excluding nodes and 0D elements
714 long_array FindAmongElementsByPoint(in SMESH_IDSource elements,
715 in double x, in double y, in double z,
717 raises (SALOME::SALOME_Exception);
720 * Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
721 * TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
723 short GetPointState(in double x, in double y, in double z)
724 raises (SALOME::SALOME_Exception);
728 SEW_BORDER1_NOT_FOUND,
729 SEW_BORDER2_NOT_FOUND,
730 SEW_BOTH_BORDERS_NOT_FOUND,
732 SEW_VOLUMES_TO_SPLIT,
733 // for SewSideElements() only:
734 SEW_DIFF_NB_OF_ELEMENTS,
735 SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
740 Sew_Error SewFreeBorders (in long FirstNodeID1,
741 in long SecondNodeID1,
743 in long FirstNodeID2,
744 in long SecondNodeID2,
746 in boolean CreatePolygons,
747 in boolean CreatePolyedrs)
748 raises (SALOME::SALOME_Exception);
750 Sew_Error SewConformFreeBorders (in long FirstNodeID1,
751 in long SecondNodeID1,
753 in long FirstNodeID2,
754 in long SecondNodeID2)
755 raises (SALOME::SALOME_Exception);
757 Sew_Error SewBorderToSide (in long FirstNodeIDOnFreeBorder,
758 in long SecondNodeIDOnFreeBorder,
759 in long LastNodeIDOnFreeBorder,
760 in long FirstNodeIDOnSide,
761 in long LastNodeIDOnSide,
762 in boolean CreatePolygons,
763 in boolean CreatePolyedrs)
764 raises (SALOME::SALOME_Exception);
766 Sew_Error SewSideElements (in long_array IDsOfSide1Elements,
767 in long_array IDsOfSide2Elements,
768 in long NodeID1OfSide1ToMerge,
769 in long NodeID1OfSide2ToMerge,
770 in long NodeID2OfSide1ToMerge,
771 in long NodeID2OfSide2ToMerge)
772 raises (SALOME::SALOME_Exception);
775 * Set new nodes for given element.
776 * If number of nodes is not corresponded to type of
777 * element - returns false
779 boolean ChangeElemNodes(in long ide, in long_array newIDs)
780 raises (SALOME::SALOME_Exception);
783 * \brief Duplicates given elements, i.e. creates new elements based on the
784 * same nodes as the given ones.
785 * \param theElements - container of elements to duplicate.
786 * \param theGroupName - a name of group to contain the generated elements.
787 * If a group with such a name already exists, the new elements
788 * are added to the existng group, else a new group is created.
789 * If \a theGroupName is empty, new elements are not added
791 * \return a group where the new elements are added. NULL if theGroupName == "".
794 SMESH_Group DoubleElements( in SMESH_IDSource theElements,
795 in string theGroupName )
796 raises (SALOME::SALOME_Exception);
799 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
800 * \param theNodes - identifiers of nodes to be doubled
801 * \param theModifiedElems - identifiers of elements to be updated by the new (doubled)
802 * nodes. If list of element identifiers is empty then nodes are doubled but
803 * they not assigned to elements
804 * \return TRUE if operation has been completed successfully, FALSE otherwise
805 * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodeGroups()
807 boolean DoubleNodes( in long_array theNodes, in long_array theModifiedElems )
808 raises (SALOME::SALOME_Exception);
811 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
812 * This method provided for convenience works as DoubleNodes() described above.
813 * \param theNodeId - identifier of node to be doubled.
814 * \param theModifiedElems - identifiers of elements to be updated.
815 * \return TRUE if operation has been completed successfully, FALSE otherwise
816 * \sa DoubleNodes(), DoubleNodeGroup(), DoubleNodeGroups()
818 boolean DoubleNode( in long theNodeId, in long_array theModifiedElems )
819 raises (SALOME::SALOME_Exception);
822 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
823 * This method provided for convenience works as DoubleNodes() described above.
824 * \param theNodes - group of nodes to be doubled.
825 * \param theModifiedElems - group of elements to be updated.
826 * \return TRUE if operation has been completed successfully, FALSE otherwise
827 * \sa DoubleNode(), DoubleNodes(), DoubleNodeGroups(), DoubleNodeGroupNew()
829 boolean DoubleNodeGroup( in SMESH_GroupBase theNodes,
830 in SMESH_GroupBase theModifiedElems )
831 raises (SALOME::SALOME_Exception);
833 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
834 * Works as DoubleNodeGroup() described above, but returns a new group with
835 * newly created nodes.
836 * \param theNodes - group of nodes to be doubled.
837 * \param theModifiedElems - group of elements to be updated.
838 * \return a new group with newly created nodes
839 * \sa DoubleNodeGroup()
841 SMESH_Group DoubleNodeGroupNew( in SMESH_GroupBase theNodes,
842 in SMESH_GroupBase theModifiedElems )
843 raises (SALOME::SALOME_Exception);
846 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
847 * This method provided for convenience works as DoubleNodes() described above.
848 * \param theNodes - list of groups of nodes to be doubled
849 * \param theModifiedElems - list of groups of elements to be updated.
850 * \return TRUE if operation has been completed successfully, FALSE otherwise
851 * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodes()
853 boolean DoubleNodeGroups( in ListOfGroups theNodes,
854 in ListOfGroups theModifiedElems )
855 raises (SALOME::SALOME_Exception);
857 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
858 * Works as DoubleNodeGroups() described above, but returns a new group with
859 * newly created nodes.
860 * \param theNodes - list of groups of nodes to be doubled
861 * \param theModifiedElems - list of groups of elements to be updated.
862 * \return a new group with newly created nodes
863 * \sa DoubleNodeGroups()
865 SMESH_Group DoubleNodeGroupsNew( in ListOfGroups theNodes,
866 in ListOfGroups theModifiedElems )
867 raises (SALOME::SALOME_Exception);
870 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
871 * \param theElems - the list of elements (edges or faces) to be replicated
872 * The nodes for duplication could be found from these elements
873 * \param theNodesNot - list of nodes to NOT replicate
874 * \param theAffectedElems - the list of elements (cells and edges) to which the
875 * replicated nodes should be associated to.
876 * \return TRUE if operation has been completed successfully, FALSE otherwise
877 * \sa DoubleNodeGroup(), DoubleNodeGroups()
879 boolean DoubleNodeElem( in long_array theElems,
880 in long_array theNodesNot,
881 in long_array theAffectedElems )
882 raises (SALOME::SALOME_Exception);
885 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
886 * \param theElems - the list of elements (edges or faces) to be replicated
887 * The nodes for duplication could be found from these elements
888 * \param theNodesNot - list of nodes to NOT replicate
889 * \param theShape - shape to detect affected elements (element which geometric center
890 * located on or inside shape).
891 * The replicated nodes should be associated to affected elements.
892 * \return TRUE if operation has been completed successfully, FALSE otherwise
893 * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
895 boolean DoubleNodeElemInRegion( in long_array theElems,
896 in long_array theNodesNot,
897 in GEOM::GEOM_Object theShape )
898 raises (SALOME::SALOME_Exception);
901 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
902 * This method provided for convenience works as DoubleNodes() described above.
903 * \param theElems - group of of elements (edges or faces) to be replicated
904 * \param theNodesNot - group of nodes not to replicated
905 * \param theAffectedElems - group of elements to which the replicated nodes
906 * should be associated to.
907 * \return TRUE if operation has been completed successfully, FALSE otherwise
908 * \sa DoubleNodes(), DoubleNodeGroups(), DoubleNodeElemGroupNew()
910 boolean DoubleNodeElemGroup( in SMESH_GroupBase theElems,
911 in SMESH_GroupBase theNodesNot,
912 in SMESH_GroupBase theAffectedElems )
913 raises (SALOME::SALOME_Exception);
915 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
916 * Works as DoubleNodeElemGroup() described above, but returns a new group with
917 * newly created elements.
918 * \param theElems - group of of elements (edges or faces) to be replicated
919 * \param theNodesNot - group of nodes not to replicated
920 * \param theAffectedElems - group of elements to which the replicated nodes
921 * should be associated to.
922 * \return a new group with newly created elements
923 * \sa DoubleNodeElemGroup()
925 SMESH_Group DoubleNodeElemGroupNew( in SMESH_GroupBase theElems,
926 in SMESH_GroupBase theNodesNot,
927 in SMESH_GroupBase theAffectedElems )
928 raises (SALOME::SALOME_Exception);
930 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
931 * Works as DoubleNodeElemGroup() described above, but returns two new groups:
932 * a group of newly created elements and a group of newly created nodes
933 * \param theElems - group of of elements (edges or faces) to be replicated
934 * \param theNodesNot - group of nodes not to replicated
935 * \param theAffectedElems - group of elements to which the replicated nodes
936 * should be associated to.
937 * \param theElemGroupNeeded - to create group of new elements or not
938 * \param theNodeGroupNeeded - to create group of new nodes or not
939 * \return two new groups of newly created elements (1st) and nodes (2nd)
940 * \sa DoubleNodeElemGroup()
942 ListOfGroups DoubleNodeElemGroup2New( in SMESH_GroupBase theElems,
943 in SMESH_GroupBase theNodesNot,
944 in SMESH_GroupBase theAffectedElems,
945 in boolean theElemGroupNeeded,
946 in boolean theNodeGroupNeeded)
947 raises (SALOME::SALOME_Exception);
950 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
951 * This method provided for convenience works as DoubleNodes() described above.
952 * \param theElems - group of elements (edges or faces) to be replicated
953 * \param theNodesNot - group of nodes not to replicated
954 * \param theShape - shape to detect affected elements (element which geometric center
955 * located on or inside shape).
956 * The replicated nodes should be associated to affected elements.
957 * \return TRUE if operation has been completed successfully, FALSE otherwise
958 * \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
960 boolean DoubleNodeElemGroupInRegion( in SMESH_GroupBase theElems,
961 in SMESH_GroupBase theNodesNot,
962 in GEOM::GEOM_Object theShape )
963 raises (SALOME::SALOME_Exception);
966 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
967 * This method provided for convenience works as DoubleNodes() described above.
968 * \param theElems - list of groups of elements (edges or faces) to be replicated
969 * \param theNodesNot - list of groups of nodes not to replicated
970 * \param theAffectedElems - group of elements to which the replicated nodes
971 * should be associated to.
972 * \return TRUE if operation has been completed successfully, FALSE otherwise
973 * \sa DoubleNodeGroup(), DoubleNodes(), DoubleNodeElemGroupsNew()
975 boolean DoubleNodeElemGroups( in ListOfGroups theElems,
976 in ListOfGroups theNodesNot,
977 in ListOfGroups theAffectedElems )
978 raises (SALOME::SALOME_Exception);
980 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
981 * Works as DoubleNodeElemGroups() described above, but returns a new group with
982 * newly created elements.
983 * \param theElems - list of groups of elements (edges or faces) to be replicated
984 * \param theNodesNot - list of groups of nodes not to replicated
985 * \param theAffectedElems - group of elements to which the replicated nodes
986 * should be associated to.
987 * \return a new group with newly created elements
988 * \sa DoubleNodeElemGroups()
990 SMESH_Group DoubleNodeElemGroupsNew( in ListOfGroups theElems,
991 in ListOfGroups theNodesNot,
992 in ListOfGroups theAffectedElems )
993 raises (SALOME::SALOME_Exception);
995 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
996 * Works as DoubleNodeElemGroups() described above, but returns two new groups:
997 * a group of newly created elements and a group of newly created nodes.
998 * \param theElems - list of groups of elements (edges or faces) to be replicated
999 * \param theNodesNot - list of groups of nodes not to replicated
1000 * \param theAffectedElems - group of elements to which the replicated nodes
1001 * should be associated to.
1002 * \param theElemGroupNeeded - to create group of new elements or not
1003 * \param theNodeGroupNeeded - to create group of new nodes or not
1004 * \return two new groups of newly created elements (1st) and nodes (2nd)
1005 * \sa DoubleNodeElemGroups()
1007 ListOfGroups DoubleNodeElemGroups2New( in ListOfGroups theElems,
1008 in ListOfGroups theNodesNot,
1009 in ListOfGroups theAffectedElems,
1010 in boolean theElemGroupNeeded,
1011 in boolean theNodeGroupNeeded )
1012 raises (SALOME::SALOME_Exception);
1015 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
1016 * This method provided for convenience works as DoubleNodes() described above.
1017 * \param theElems - list of groups of elements (edges or faces) to be replicated
1018 * \param theNodesNot - list of groups of nodes not to replicated
1019 * \param theShape - shape to detect affected elements (element which geometric center
1020 * located on or inside shape).
1021 * The replicated nodes should be associated to affected elements.
1022 * \return TRUE if operation has been completed successfully, FALSE otherwise
1023 * \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
1025 boolean DoubleNodeElemGroupsInRegion( in ListOfGroups theElems,
1026 in ListOfGroups theNodesNot,
1027 in GEOM::GEOM_Object theShape )
1028 raises (SALOME::SALOME_Exception);
1031 * \brief Identify the elements that will be affected by node duplication (actual duplication is not performed).
1032 * This method is the first step of DoubleNodeElemGroupsInRegion.
1033 * \param theElems - list of groups of elements (edges or faces) to be replicated
1034 * \param theNodesNot - list of groups of nodes not to replicated
1035 * \param theShape - shape to detect affected elements (element which geometric center
1036 * located on or inside shape).
1037 * The replicated nodes should be associated to affected elements.
1038 * \return groups of affected elements
1039 * \sa DoubleNodeElemGroupsInRegion()
1041 ListOfGroups AffectedElemGroupsInRegion( in ListOfGroups theElems,
1042 in ListOfGroups theNodesNot,
1043 in GEOM::GEOM_Object theShape )
1044 raises (SALOME::SALOME_Exception);
1047 * \brief Generates skin mesh (containing 2D cells) from 3D mesh
1048 * The created 2D mesh elements based on nodes of free faces of boundary volumes
1049 * \return TRUE if operation has been completed successfully, FALSE otherwise
1051 boolean Make2DMeshFrom3D() raises (SALOME::SALOME_Exception);
1054 * \brief Creates missing boundary elements
1055 * \param elements - elements whose boundary is to be checked
1056 * \param dimension - defines type of boundary elements to create
1057 * BND_1DFROM3D creates mesh edges on all borders of free facets of 3D elements.
1058 * \param groupName - a name of group to store created boundary elements in,
1059 * "" means not to create the group
1060 * \param meshName - a name of new mesh to store created boundary elements in,
1061 * "" means not to create the new mesh
1062 * \param toCopyElements - if true, the checked elements will be copied into the new mesh
1063 * else only boundary elements will be copied into the new mesh
1064 * \param toCopyExistingBondary - if true, not only new but also pre-existing
1065 * boundary elements will be copied into the new mesh
1066 * \param group - returns the create group, if any
1067 * \retval SMESH::SMESH_Mesh - the mesh where elements were added to
1069 SMESH_Mesh MakeBoundaryMesh(in SMESH_IDSource elements,
1070 in Bnd_Dimension dimension,
1071 in string groupName,
1073 in boolean toCopyElements,
1074 in boolean toCopyExistingBondary,
1075 out SMESH_Group group) raises (SALOME::SALOME_Exception);
1077 * \brief Creates missing boundary elements around either the whole mesh or
1078 * groups of 2D elements
1079 * \param dimension - defines type of boundary elements to create
1080 * \param groupName - a name of group to store all boundary elements in,
1081 * "" means not to create the group
1082 * \param meshName - a name of a new mesh, which is a copy of the initial
1083 * mesh + created boundary elements; "" means not to create the new mesh
1084 * \param toCopyAll - if true, the whole initial mesh will be copied into
1085 * the new mesh else only boundary elements will be copied into the new mesh
1086 * \param groups - optional groups of 2D elements to make boundary around
1087 * \param mesh - returns the mesh where elements were added to
1088 * \param group - returns the created group, if any
1089 * \retval long - number of added boundary elements
1091 long MakeBoundaryElements(in Bnd_Dimension dimension,
1092 in string groupName,
1094 in boolean toCopyAll,
1095 in ListOfIDSources groups,
1096 out SMESH_Mesh mesh,
1097 out SMESH_Group group) raises (SALOME::SALOME_Exception);
1100 * \brief Double nodes on shared faces between groups of volumes and create flat elements on demand.
1101 * Flat elements are mainly used by some types of mechanic calculations.
1103 * The list of groups must describe a partition of the mesh volumes.
1104 * The nodes of the internal faces at the boundaries of the groups are doubled.
1105 * In option, the internal faces are replaced by flat elements.
1106 * Triangles are transformed in prisms, and quadrangles in hexahedrons.
1107 * \param theDomains - list of groups of volumes
1108 * \param createJointElems - if TRUE, create the elements
1109 * \param onAllBoundaries - if TRUE, the nodes and elements are also created on
1110 * the boundary between \a theDomains and the rest mesh
1111 * \return TRUE if operation has been completed successfully, FALSE otherwise
1113 boolean DoubleNodesOnGroupBoundaries( in ListOfGroups theDomains,
1114 in boolean createJointElems,
1115 in boolean onAllBoundaries)
1116 raises (SALOME::SALOME_Exception);
1119 * \brief Double nodes on some external faces and create flat elements.
1120 * Flat elements are mainly used by some types of mechanic calculations.
1122 * Each group of the list must be constituted of faces.
1123 * Triangles are transformed in prisms, and quadrangles in hexahedrons.
1124 * \param theGroupsOfFaces - list of groups of faces
1125 * \return TRUE if operation has been completed successfully, FALSE otherwise
1127 boolean CreateFlatElementsOnFacesGroups( in ListOfGroups theGroupsOfFaces )
1128 raises (SALOME::SALOME_Exception);
1131 * \brief identify all the elements around a geom shape, get the faces delimiting the hole
1132 * Build groups of volume to remove, groups of faces to replace on the skin of the object,
1133 * groups of faces to remove insidethe object, (idem edges).
1134 * Build ordered list of nodes at the border of each group of faces to replace (to be used to build a geom subshape)
1136 void CreateHoleSkin(in double radius,
1137 in GEOM::GEOM_Object theShape,
1138 in string groupName,
1139 in double_array theNodesCoords,
1140 out array_of_long_array GroupsOfNodes)
1141 raises (SALOME::SALOME_Exception);