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 volume, either linear and quadratic (this is determed
148 * by number of given nodes).
149 * \param IdsOfNodes List of node IDs for creation of element.
150 * Needed order of nodes in this list corresponds to description
151 * of MED. This description is located by the following link:
152 * http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
154 long AddVolume(in long_array IDsOfNodes) raises (SALOME::SALOME_Exception);
157 * Create volume of many faces, giving nodes for each face.
158 * \param IdsOfNodes List of node IDs for volume creation face by face.
159 * \param Quantities List of integer values, Quantities[i]
160 * gives quantity of nodes in face number i.
162 long AddPolyhedralVolume (in long_array IdsOfNodes,
163 in long_array Quantities) raises (SALOME::SALOME_Exception);
165 * Create volume of many faces, giving IDs of existing faces.
166 * \param IdsOfFaces List of face IDs for volume creation.
167 * \note The created volume will refer only to nodes
168 * of the given faces, not to the faces itself.
170 long AddPolyhedralVolumeByFaces (in long_array IdsOfFaces) raises (SALOME::SALOME_Exception);
173 * Create 0D elements on all nodes of the given object except those
174 * nodes on which a 0D element already exists.
175 * \param theObject object on whose nodes 0D elements will be created.
176 * \param theGroupName optional name of a group to add 0D elements created
177 * and/or found on nodes of \a theObject.
178 * \return an object (a new group or a temporary SMESH_IDSource) holding
179 * ids of new and/or found 0D elements.
181 SMESH_IDSource Create0DElementsOnAllNodes(in SMESH_IDSource theObject,
182 in string theGroupName)
183 raises (SALOME::SALOME_Exception);
186 * \brief Bind a node to a vertex
187 * \param NodeID - node ID
188 * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
190 void SetNodeOnVertex(in long NodeID, in long VertexID)
191 raises (SALOME::SALOME_Exception);
193 * \brief Store node position on an edge
194 * \param NodeID - node ID
195 * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
196 * \param paramOnEdge - parameter on edge where the node is located
198 void SetNodeOnEdge(in long NodeID, in long EdgeID, in double paramOnEdge)
199 raises (SALOME::SALOME_Exception);
201 * \brief Store node position on a face
202 * \param NodeID - node ID
203 * \param FaceID - face ID available through GEOM_Object.GetSubShapeIndices()[0]
204 * \param u - U parameter on face where the node is located
205 * \param v - V parameter on face where the node is located
207 void SetNodeOnFace(in long NodeID, in long FaceID, in double u, in double v)
208 raises (SALOME::SALOME_Exception);
210 * \brief Bind a node to a solid
211 * \param NodeID - node ID
212 * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
214 void SetNodeInVolume(in long NodeID, in long SolidID)
215 raises (SALOME::SALOME_Exception);
217 * \brief Bind an element to a shape
218 * \param ElementID - element ID
219 * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0]
221 void SetMeshElementOnShape(in long ElementID, in long ShapeID)
222 raises (SALOME::SALOME_Exception);
225 boolean MoveNode(in long NodeID, in double x, in double y, in double z)
226 raises (SALOME::SALOME_Exception);
228 boolean InverseDiag(in long NodeID1, in long NodeID2)
229 raises (SALOME::SALOME_Exception);
231 boolean DeleteDiag(in long NodeID1, in long NodeID2)
232 raises (SALOME::SALOME_Exception);
234 boolean Reorient(in long_array IDsOfElements)
235 raises (SALOME::SALOME_Exception);
237 boolean ReorientObject(in SMESH_IDSource theObject)
238 raises (SALOME::SALOME_Exception);
240 * \brief Reorient faces contained in \a the2Dgroup.
241 * \param the2Dgroup - the mesh or its part to reorient
242 * \param theDirection - desired direction of normal of \a theFace
243 * \param theFace - ID of face whose orientation is checked.
244 * It can be < 1 then \a thePoint is used to find a face.
245 * \param thePoint - is used to find a face if \a theFace < 1.
246 * \return number of reoriented faces.
248 long Reorient2D(in SMESH_IDSource the2Dgroup,
249 in DirStruct theDirection,
251 in PointStruct thePoint) raises (SALOME::SALOME_Exception);
253 * \brief Reorient faces basing on orientation of adjacent volumes.
254 * \param faces - a list of objects containing face to reorient
255 * \param volumes - an object containing volumes.
256 * \param outsideNormal - to orient faces to have their normal
257 * pointing either \a outside or \a inside the adjacent volumes.
258 * \return number of reoriented faces.
260 long Reorient2DBy3D(in ListOfIDSources faces,
261 in SMESH_IDSource volumes,
262 in boolean outsideNormal) raises (SALOME::SALOME_Exception);
265 * \brief Fuse neighbour triangles into quadrangles.
266 * \param IDsOfElements Ids of triangles to be fused.
267 * \param theCriterion Is used to choose a neighbour to fuse with.
268 * \param theMaxAngle Is a max angle between element normals at which fusion
269 * is still performed; theMaxAngle is mesured in radians.
270 * \return \c true in case of success, FALSE otherwise.
272 boolean TriToQuad (in long_array IDsOfElements,
273 in NumericalFunctor Criterion,
274 in double MaxAngle) raises (SALOME::SALOME_Exception);
276 * \brief Fuse neighbour triangles into quadrangles.
278 * Behaves like the above method, taking a list of elements from \a theObject
280 boolean TriToQuadObject (in SMESH_IDSource theObject,
281 in NumericalFunctor Criterion,
282 in double MaxAngle) raises (SALOME::SALOME_Exception);
285 * \brief Split quadrangles into triangles.
286 * \param IDsOfElements Ids of quadrangles to split.
287 * \param theCriterion Is used to choose a diagonal for splitting.
288 * \return TRUE in case of success, FALSE otherwise.
290 boolean QuadToTri (in long_array IDsOfElements,
291 in NumericalFunctor Criterion) raises (SALOME::SALOME_Exception);
293 * \brief Split quadrangles into triangles.
295 * Behaves like the above method, taking a list of elements from \a theObject
297 boolean QuadToTriObject (in SMESH_IDSource theObject,
298 in NumericalFunctor Criterion) raises (SALOME::SALOME_Exception);
300 * \brief Split each of quadrangles into 4 triangles.
301 * \param theQuads Container of quadrangles to split.
303 void QuadTo4Tri (in SMESH_IDSource theQuads) raises (SALOME::SALOME_Exception);
306 * \brief Split quadrangles into triangles.
307 * \param theElems The faces to be splitted.
308 * \param the13Diag Is used to choose a diagonal for splitting.
309 * \return TRUE in case of success, FALSE otherwise.
311 boolean SplitQuad (in long_array IDsOfElements,
312 in boolean Diag13) raises (SALOME::SALOME_Exception);
314 * \brief Split quadrangles into triangles.
316 * Behaves like the above method, taking list of elements from \a theObject
318 boolean SplitQuadObject (in SMESH_IDSource theObject,
319 in boolean Diag13) raises (SALOME::SALOME_Exception);
322 * Find better splitting of the given quadrangle.
323 * \param IDOfQuad ID of the quadrangle to be splitted.
324 * \param Criterion A criterion to choose a diagonal for splitting.
325 * \return 1 if 1-3 diagonal is better, 2 if 2-4
326 * diagonal is better, 0 if error occurs.
328 long BestSplit (in long IDOfQuad,
329 in NumericalFunctor Criterion) raises (SALOME::SALOME_Exception);
332 * \brief Split volumic elements into tetrahedrons
333 * \param elems - elements to split
334 * \param methodFlags - flags passing splitting method:
335 * 1 - split the hexahedron into 5 tetrahedrons
336 * 2 - split the hexahedron into 6 tetrahedrons
337 * 3 - split the hexahedron into 24 tetrahedrons
339 void SplitVolumesIntoTetra(in SMESH_IDSource elems, in short methodFlags)
340 raises (SALOME::SALOME_Exception);
343 * \brief Split hexahedra into triangular prisms
344 * \param elems - elements to split
345 * \param startHexPoint - a point used to find a hexahedron for which \a facetToSplitNormal
346 * gives a normal vector defining facets to split into triangles.
347 * \param facetToSplitNormal - normal used to find a facet of hexahedron
348 * to split into triangles.
349 * \param methodFlags - flags passing splitting method:
350 * 1 - split the hexahedron into 2 prisms
351 * 2 - split the hexahedron into 4 prisms
352 * \param allDomains - if \c False, only hexahedra adjacent to one closest
353 * to \a facetToSplitNormal location are split, else \a facetToSplitNormal
354 * is used to find the facet to split in all domains present in \a elems.
356 void SplitHexahedraIntoPrisms(in SMESH_IDSource elems,
357 in SMESH::PointStruct startHexPoint,
358 in SMESH::DirStruct facetToSplitNormal,
359 in short methodFlags,
360 in boolean allDomains)
361 raises (SALOME::SALOME_Exception);
364 enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH };
366 boolean Smooth(in long_array IDsOfElements,
367 in long_array IDsOfFixedNodes,
368 in long MaxNbOfIterations,
369 in double MaxAspectRatio,
370 in Smooth_Method Method) raises (SALOME::SALOME_Exception);
372 boolean SmoothObject(in SMESH_IDSource theObject,
373 in long_array IDsOfFixedNodes,
374 in long MaxNbOfIterations,
375 in double MaxAspectRatio,
376 in Smooth_Method Method) raises (SALOME::SALOME_Exception);
378 boolean SmoothParametric(in long_array IDsOfElements,
379 in long_array IDsOfFixedNodes,
380 in long MaxNbOfIterations,
381 in double MaxAspectRatio,
382 in Smooth_Method Method) raises (SALOME::SALOME_Exception);
384 boolean SmoothParametricObject(in SMESH_IDSource theObject,
385 in long_array IDsOfFixedNodes,
386 in long MaxNbOfIterations,
387 in double MaxAspectRatio,
388 in Smooth_Method Method) raises (SALOME::SALOME_Exception);
390 void ConvertToQuadratic(in boolean theForce3d)
391 raises (SALOME::SALOME_Exception);
392 void ConvertToQuadraticObject(in boolean theForce3d,
393 in SMESH_IDSource theObject)
394 raises (SALOME::SALOME_Exception);
396 boolean ConvertFromQuadratic()
397 raises (SALOME::SALOME_Exception);
398 void ConvertFromQuadraticObject(in SMESH_IDSource theObject)
399 raises (SALOME::SALOME_Exception);
401 void ConvertToBiQuadratic(in boolean theForce3d,
402 in SMESH_IDSource theObject)
403 raises (SALOME::SALOME_Exception);
405 void RenumberNodes() raises (SALOME::SALOME_Exception);
407 void RenumberElements() raises (SALOME::SALOME_Exception);
410 * \brief Generate dim+1 elements by rotation of the object around axis
411 * \param Nodes - nodes to revolve: a list including groups, sub-meshes or a mesh
412 * \param Edges - edges to revolve: a list including groups, sub-meshes or a mesh
413 * \param Faces - faces to revolve: a list including groups, sub-meshes or a mesh
414 * \param Axis - rotation axis
415 * \param AngleInRadians - rotation angle
416 * \param NbOfSteps - number of elements to generate from one element
417 * \param ToMakeGroups - if true, new elements will be included into new groups
418 * corresponding to groups the input elements included in.
419 * \return ListOfGroups - new groups craeted if \a ToMakeGroups is true
421 ListOfGroups RotationSweepObjects(in ListOfIDSources Nodes,
422 in ListOfIDSources Edges,
423 in ListOfIDSources Faces,
425 in double AngleInRadians,
428 in boolean ToMakeGroups)
429 raises (SALOME::SALOME_Exception);
432 * \brief Generate dim+1 elements by extrusion of elements along vector
433 * \param nodes - nodes to extrude: a list including groups, sub-meshes or a mesh
434 * \param edges - edges to extrude: a list including groups, sub-meshes or a mesh
435 * \param faces - faces to extrude: a list including groups, sub-meshes or a mesh
436 * \param stepVector - vector giving direction and distance of an extrusion step
437 * \param nbOfSteps - number of elements to generate from one element
438 * \param toMakeGroups - if true, new elements will be included into new groups
439 * corresponding to groups the input elements included in.
440 * \return ListOfGroups - new groups craeted if \a toMakeGroups is true
442 ListOfGroups ExtrusionSweepObjects(in ListOfIDSources nodes,
443 in ListOfIDSources edges,
444 in ListOfIDSources faces,
445 in DirStruct stepVector,
447 in boolean toMakeGroups)
448 raises (SALOME::SALOME_Exception);
450 /*! Generates new elements by extrusion along the normal to a discretized surface or wire
452 ListOfGroups ExtrusionByNormal(in ListOfIDSources theObjects,
455 in boolean byAverageNormal,
456 in boolean useInputElemsOnly,
457 in boolean makeGroups,
459 raises (SALOME::SALOME_Exception);
462 * Generate new elements by extrusion of theElements
463 * by StepVector by NbOfSteps
464 * \param ExtrFlags set flags for performing extrusion
465 * \param SewTolerance - uses for comparing locations of nodes if flag
466 * EXTRUSION_FLAG_SEW is set
467 * \param ToMakeGroups - if true, new elements will be included into new groups
468 * corresponding to groups the input elements included in.
469 * \return ListOfGroups - new groups craeted if \a ToMakeGroups is true
471 ListOfGroups AdvancedExtrusion(in long_array IDsOfElements,
472 in DirStruct StepVector,
475 in double SewTolerance,
476 in boolean ToMakeGroups)
477 raises (SALOME::SALOME_Exception);
479 enum Extrusion_Error {
484 EXTR_BAD_STARTING_NODE,
485 EXTR_BAD_ANGLES_NUMBER,
486 EXTR_CANT_GET_TANGENT
489 ListOfGroups ExtrusionAlongPathObjects(in ListOfIDSources Nodes,
490 in ListOfIDSources Edges,
491 in ListOfIDSources Faces,
492 in SMESH_IDSource Path,
493 in GEOM::GEOM_Object PathShape,
495 in boolean HasAngles,
496 in double_array Angles,
497 in boolean LinearVariation,
498 in boolean HasRefPoint,
499 in PointStruct RefPoint,
500 in boolean MakeGroups,
501 out Extrusion_Error Error)
502 raises (SALOME::SALOME_Exception);
505 * Compute rotation angles for ExtrusionAlongPath as linear variation
506 * of given angles along path steps
507 * param PathMesh mesh containing a 1D sub-mesh on the edge, along
508 * which proceeds the extrusion
509 * param PathShape is shape(edge); as the mesh can be complex, the edge
510 * is used to define the sub-mesh for the path
512 double_array LinearAnglesVariation(in SMESH_Mesh PathMesh,
513 in GEOM::GEOM_Object PathShape,
514 in double_array Angles);
516 enum MirrorType { POINT, AXIS, PLANE };
518 void Mirror (in long_array IDsOfElements,
519 in AxisStruct Mirror,
522 raises (SALOME::SALOME_Exception);
523 ListOfGroups MirrorMakeGroups (in long_array IDsOfElements,
524 in AxisStruct Mirror,
526 raises (SALOME::SALOME_Exception);
527 SMESH_Mesh MirrorMakeMesh (in long_array IDsOfElements,
528 in AxisStruct Mirror,
530 in boolean CopyGroups,
532 raises (SALOME::SALOME_Exception);
534 void MirrorObject (in SMESH_IDSource theObject,
535 in AxisStruct Mirror,
538 raises (SALOME::SALOME_Exception);
539 ListOfGroups MirrorObjectMakeGroups (in SMESH_IDSource theObject,
540 in AxisStruct Mirror,
542 raises (SALOME::SALOME_Exception);
543 SMESH_Mesh MirrorObjectMakeMesh (in SMESH_IDSource theObject,
544 in AxisStruct Mirror,
546 in boolean CopyGroups,
548 raises (SALOME::SALOME_Exception);
550 void Translate (in long_array IDsOfElements,
553 raises (SALOME::SALOME_Exception);
554 ListOfGroups TranslateMakeGroups (in long_array IDsOfElements,
556 raises (SALOME::SALOME_Exception);
557 SMESH_Mesh TranslateMakeMesh (in long_array IDsOfElements,
559 in boolean CopyGroups,
561 raises (SALOME::SALOME_Exception);
563 void TranslateObject (in SMESH_IDSource theObject,
566 raises (SALOME::SALOME_Exception);
567 ListOfGroups TranslateObjectMakeGroups (in SMESH_IDSource theObject,
569 raises (SALOME::SALOME_Exception);
570 SMESH_Mesh TranslateObjectMakeMesh (in SMESH_IDSource theObject,
572 in boolean CopyGroups,
574 raises (SALOME::SALOME_Exception);
576 void Scale (in SMESH_IDSource theObject,
577 in PointStruct thePoint,
578 in double_array theScaleFact,
580 raises (SALOME::SALOME_Exception);
581 ListOfGroups ScaleMakeGroups (in SMESH_IDSource theObject,
582 in PointStruct thePoint,
583 in double_array theScaleFact)
584 raises (SALOME::SALOME_Exception);
585 SMESH_Mesh ScaleMakeMesh (in SMESH_IDSource theObject,
586 in PointStruct thePoint,
587 in double_array theScaleFact,
588 in boolean CopyGroups,
590 raises (SALOME::SALOME_Exception);
592 void Rotate (in long_array IDsOfElements,
594 in double AngleInRadians,
596 raises (SALOME::SALOME_Exception);
597 ListOfGroups RotateMakeGroups (in long_array IDsOfElements,
599 in double AngleInRadians)
600 raises (SALOME::SALOME_Exception);
601 SMESH_Mesh RotateMakeMesh (in long_array IDsOfElements,
603 in double AngleInRadians,
604 in boolean CopyGroups,
606 raises (SALOME::SALOME_Exception);
608 void RotateObject (in SMESH_IDSource theObject,
610 in double AngleInRadians,
612 raises (SALOME::SALOME_Exception);
613 ListOfGroups RotateObjectMakeGroups (in SMESH_IDSource theObject,
615 in double AngleInRadians)
616 raises (SALOME::SALOME_Exception);
617 SMESH_Mesh RotateObjectMakeMesh (in SMESH_IDSource theObject,
619 in double AngleInRadians,
620 in boolean CopyGroups,
622 raises (SALOME::SALOME_Exception);
624 void FindCoincidentNodes (in double Tolerance,
625 out array_of_long_array GroupsOfNodes)
626 raises (SALOME::SALOME_Exception);
628 void FindCoincidentNodesOnPart (in SMESH_IDSource SubMeshOrGroup,
630 out array_of_long_array GroupsOfNodes)
631 raises (SALOME::SALOME_Exception);
633 void FindCoincidentNodesOnPartBut (in SMESH_IDSource SubMeshOrGroup,
635 out array_of_long_array GroupsOfNodes,
636 in ListOfIDSources ExceptSubMeshOrGroups)
637 raises (SALOME::SALOME_Exception);
639 void MergeNodes (in array_of_long_array GroupsOfNodes)
640 raises (SALOME::SALOME_Exception);
643 * \brief Find elements built on the same nodes.
644 * \param MeshOrSubMeshOrGroup Mesh or SubMesh, or Group of elements for searching.
645 * \return List of groups of equal elements.
647 void FindEqualElements (in SMESH_IDSource MeshOrSubMeshOrGroup,
648 out array_of_long_array GroupsOfElementsID)
649 raises (SALOME::SALOME_Exception);
652 * \brief Merge elements in each given group.
653 * \param GroupsOfElementsID Groups of elements for merging.
655 void MergeElements(in array_of_long_array GroupsOfElementsID)
656 raises (SALOME::SALOME_Exception);
659 * \brief Merge equal elements in the whole mesh.
661 void MergeEqualElements()
662 raises (SALOME::SALOME_Exception);
665 * If the given ID is a valid node ID (nodeID > 0), just move this node, else
666 * move the node closest to the point to point's location and return ID of the node
668 long MoveClosestNodeToPoint(in double x, in double y, in double z, in long nodeID)
669 raises (SALOME::SALOME_Exception);
672 * Return ID of node closest to a given point
674 long FindNodeClosestTo(in double x, in double y, in double z)
675 raises (SALOME::SALOME_Exception);
678 * Return elements of given type where the given point is IN or ON.
680 * 'ALL' type means elements of any type excluding nodes and 0D elements
682 long_array FindElementsByPoint(in double x, in double y, in double z, in ElementType type)
683 raises (SALOME::SALOME_Exception);
686 * Searching among the given elements, return elements of given type
687 * where the given point is IN or ON.
689 * 'ALL' type means elements of any type excluding nodes and 0D elements
691 long_array FindAmongElementsByPoint(in SMESH_IDSource elements,
692 in double x, in double y, in double z,
694 raises (SALOME::SALOME_Exception);
697 * Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
698 * TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
700 short GetPointState(in double x, in double y, in double z)
701 raises (SALOME::SALOME_Exception);
705 SEW_BORDER1_NOT_FOUND,
706 SEW_BORDER2_NOT_FOUND,
707 SEW_BOTH_BORDERS_NOT_FOUND,
709 SEW_VOLUMES_TO_SPLIT,
710 // for SewSideElements() only:
711 SEW_DIFF_NB_OF_ELEMENTS,
712 SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
717 Sew_Error SewFreeBorders (in long FirstNodeID1,
718 in long SecondNodeID1,
720 in long FirstNodeID2,
721 in long SecondNodeID2,
723 in boolean CreatePolygons,
724 in boolean CreatePolyedrs)
725 raises (SALOME::SALOME_Exception);
727 Sew_Error SewConformFreeBorders (in long FirstNodeID1,
728 in long SecondNodeID1,
730 in long FirstNodeID2,
731 in long SecondNodeID2)
732 raises (SALOME::SALOME_Exception);
734 Sew_Error SewBorderToSide (in long FirstNodeIDOnFreeBorder,
735 in long SecondNodeIDOnFreeBorder,
736 in long LastNodeIDOnFreeBorder,
737 in long FirstNodeIDOnSide,
738 in long LastNodeIDOnSide,
739 in boolean CreatePolygons,
740 in boolean CreatePolyedrs)
741 raises (SALOME::SALOME_Exception);
743 Sew_Error SewSideElements (in long_array IDsOfSide1Elements,
744 in long_array IDsOfSide2Elements,
745 in long NodeID1OfSide1ToMerge,
746 in long NodeID1OfSide2ToMerge,
747 in long NodeID2OfSide1ToMerge,
748 in long NodeID2OfSide2ToMerge)
749 raises (SALOME::SALOME_Exception);
752 * Set new nodes for given element.
753 * If number of nodes is not corresponded to type of
754 * element - returns false
756 boolean ChangeElemNodes(in long ide, in long_array newIDs)
757 raises (SALOME::SALOME_Exception);
760 * \brief Duplicates given elements, i.e. creates new elements based on the
761 * same nodes as the given ones.
762 * \param theElements - container of elements to duplicate.
763 * \param theGroupName - a name of group to contain the generated elements.
764 * If a group with such a name already exists, the new elements
765 * are added to the existng group, else a new group is created.
766 * If \a theGroupName is empty, new elements are not added
768 * \return a group where the new elements are added. NULL if theGroupName == "".
771 SMESH_Group DoubleElements( in SMESH_IDSource theElements,
772 in string theGroupName )
773 raises (SALOME::SALOME_Exception);
776 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
777 * \param theNodes - identifiers of nodes to be doubled
778 * \param theModifiedElems - identifiers of elements to be updated by the new (doubled)
779 * nodes. If list of element identifiers is empty then nodes are doubled but
780 * they not assigned to elements
781 * \return TRUE if operation has been completed successfully, FALSE otherwise
782 * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodeGroups()
784 boolean DoubleNodes( in long_array theNodes, in long_array theModifiedElems )
785 raises (SALOME::SALOME_Exception);
788 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
789 * This method provided for convenience works as DoubleNodes() described above.
790 * \param theNodeId - identifier of node to be doubled.
791 * \param theModifiedElems - identifiers of elements to be updated.
792 * \return TRUE if operation has been completed successfully, FALSE otherwise
793 * \sa DoubleNodes(), DoubleNodeGroup(), DoubleNodeGroups()
795 boolean DoubleNode( in long theNodeId, in long_array theModifiedElems )
796 raises (SALOME::SALOME_Exception);
799 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
800 * This method provided for convenience works as DoubleNodes() described above.
801 * \param theNodes - group of nodes to be doubled.
802 * \param theModifiedElems - group of elements to be updated.
803 * \return TRUE if operation has been completed successfully, FALSE otherwise
804 * \sa DoubleNode(), DoubleNodes(), DoubleNodeGroups(), DoubleNodeGroupNew()
806 boolean DoubleNodeGroup( in SMESH_GroupBase theNodes,
807 in SMESH_GroupBase theModifiedElems )
808 raises (SALOME::SALOME_Exception);
810 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
811 * Works as DoubleNodeGroup() described above, but returns a new group with
812 * newly created nodes.
813 * \param theNodes - group of nodes to be doubled.
814 * \param theModifiedElems - group of elements to be updated.
815 * \return a new group with newly created nodes
816 * \sa DoubleNodeGroup()
818 SMESH_Group DoubleNodeGroupNew( in SMESH_GroupBase theNodes,
819 in SMESH_GroupBase theModifiedElems )
820 raises (SALOME::SALOME_Exception);
823 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
824 * This method provided for convenience works as DoubleNodes() described above.
825 * \param theNodes - list of groups of nodes to be doubled
826 * \param theModifiedElems - list of groups of elements to be updated.
827 * \return TRUE if operation has been completed successfully, FALSE otherwise
828 * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodes()
830 boolean DoubleNodeGroups( in ListOfGroups theNodes,
831 in ListOfGroups theModifiedElems )
832 raises (SALOME::SALOME_Exception);
834 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
835 * Works as DoubleNodeGroups() described above, but returns a new group with
836 * newly created nodes.
837 * \param theNodes - list of groups of nodes to be doubled
838 * \param theModifiedElems - list of groups of elements to be updated.
839 * \return a new group with newly created nodes
840 * \sa DoubleNodeGroups()
842 SMESH_Group DoubleNodeGroupsNew( in ListOfGroups theNodes,
843 in ListOfGroups theModifiedElems )
844 raises (SALOME::SALOME_Exception);
847 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
848 * \param theElems - the list of elements (edges or faces) to be replicated
849 * The nodes for duplication could be found from these elements
850 * \param theNodesNot - list of nodes to NOT replicate
851 * \param theAffectedElems - the list of elements (cells and edges) to which the
852 * replicated nodes should be associated to.
853 * \return TRUE if operation has been completed successfully, FALSE otherwise
854 * \sa DoubleNodeGroup(), DoubleNodeGroups()
856 boolean DoubleNodeElem( in long_array theElems,
857 in long_array theNodesNot,
858 in long_array theAffectedElems )
859 raises (SALOME::SALOME_Exception);
862 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
863 * \param theElems - the list of elements (edges or faces) to be replicated
864 * The nodes for duplication could be found from these elements
865 * \param theNodesNot - list of nodes to NOT replicate
866 * \param theShape - shape to detect affected elements (element which geometric center
867 * located on or inside shape).
868 * The replicated nodes should be associated to affected elements.
869 * \return TRUE if operation has been completed successfully, FALSE otherwise
870 * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
872 boolean DoubleNodeElemInRegion( in long_array theElems,
873 in long_array theNodesNot,
874 in GEOM::GEOM_Object theShape )
875 raises (SALOME::SALOME_Exception);
878 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
879 * This method provided for convenience works as DoubleNodes() described above.
880 * \param theElems - group of of elements (edges or faces) to be replicated
881 * \param theNodesNot - group of nodes not to replicated
882 * \param theAffectedElems - group of elements to which the replicated nodes
883 * should be associated to.
884 * \return TRUE if operation has been completed successfully, FALSE otherwise
885 * \sa DoubleNodes(), DoubleNodeGroups(), DoubleNodeElemGroupNew()
887 boolean DoubleNodeElemGroup( in SMESH_GroupBase theElems,
888 in SMESH_GroupBase theNodesNot,
889 in SMESH_GroupBase theAffectedElems )
890 raises (SALOME::SALOME_Exception);
892 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
893 * Works as DoubleNodeElemGroup() described above, but returns a new group with
894 * newly created elements.
895 * \param theElems - group of of elements (edges or faces) to be replicated
896 * \param theNodesNot - group of nodes not to replicated
897 * \param theAffectedElems - group of elements to which the replicated nodes
898 * should be associated to.
899 * \return a new group with newly created elements
900 * \sa DoubleNodeElemGroup()
902 SMESH_Group DoubleNodeElemGroupNew( in SMESH_GroupBase theElems,
903 in SMESH_GroupBase theNodesNot,
904 in SMESH_GroupBase theAffectedElems )
905 raises (SALOME::SALOME_Exception);
907 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
908 * Works as DoubleNodeElemGroup() described above, but returns two new groups:
909 * a group of newly created elements and a group of newly created nodes
910 * \param theElems - group of of elements (edges or faces) to be replicated
911 * \param theNodesNot - group of nodes not to replicated
912 * \param theAffectedElems - group of elements to which the replicated nodes
913 * should be associated to.
914 * \param theElemGroupNeeded - to create group of new elements or not
915 * \param theNodeGroupNeeded - to create group of new nodes or not
916 * \return two new groups of newly created elements (1st) and nodes (2nd)
917 * \sa DoubleNodeElemGroup()
919 ListOfGroups DoubleNodeElemGroup2New( in SMESH_GroupBase theElems,
920 in SMESH_GroupBase theNodesNot,
921 in SMESH_GroupBase theAffectedElems,
922 in boolean theElemGroupNeeded,
923 in boolean theNodeGroupNeeded)
924 raises (SALOME::SALOME_Exception);
927 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
928 * This method provided for convenience works as DoubleNodes() described above.
929 * \param theElems - group of elements (edges or faces) to be replicated
930 * \param theNodesNot - group of nodes not to replicated
931 * \param theShape - shape to detect affected elements (element which geometric center
932 * located on or inside shape).
933 * The replicated nodes should be associated to affected elements.
934 * \return TRUE if operation has been completed successfully, FALSE otherwise
935 * \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
937 boolean DoubleNodeElemGroupInRegion( in SMESH_GroupBase theElems,
938 in SMESH_GroupBase theNodesNot,
939 in GEOM::GEOM_Object theShape )
940 raises (SALOME::SALOME_Exception);
943 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
944 * This method provided for convenience works as DoubleNodes() described above.
945 * \param theElems - list of groups of elements (edges or faces) to be replicated
946 * \param theNodesNot - list of groups of nodes not to replicated
947 * \param theAffectedElems - group of elements to which the replicated nodes
948 * should be associated to.
949 * \return TRUE if operation has been completed successfully, FALSE otherwise
950 * \sa DoubleNodeGroup(), DoubleNodes(), DoubleNodeElemGroupsNew()
952 boolean DoubleNodeElemGroups( in ListOfGroups theElems,
953 in ListOfGroups theNodesNot,
954 in ListOfGroups theAffectedElems )
955 raises (SALOME::SALOME_Exception);
957 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
958 * Works as DoubleNodeElemGroups() described above, but returns a new group with
959 * newly created elements.
960 * \param theElems - list of groups of elements (edges or faces) to be replicated
961 * \param theNodesNot - list of groups of nodes not to replicated
962 * \param theAffectedElems - group of elements to which the replicated nodes
963 * should be associated to.
964 * \return a new group with newly created elements
965 * \sa DoubleNodeElemGroups()
967 SMESH_Group DoubleNodeElemGroupsNew( in ListOfGroups theElems,
968 in ListOfGroups theNodesNot,
969 in ListOfGroups theAffectedElems )
970 raises (SALOME::SALOME_Exception);
972 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
973 * Works as DoubleNodeElemGroups() described above, but returns two new groups:
974 * a group of newly created elements and a group of newly created nodes.
975 * \param theElems - list of groups of elements (edges or faces) to be replicated
976 * \param theNodesNot - list of groups of nodes not to replicated
977 * \param theAffectedElems - group of elements to which the replicated nodes
978 * should be associated to.
979 * \param theElemGroupNeeded - to create group of new elements or not
980 * \param theNodeGroupNeeded - to create group of new nodes or not
981 * \return two new groups of newly created elements (1st) and nodes (2nd)
982 * \sa DoubleNodeElemGroups()
984 ListOfGroups DoubleNodeElemGroups2New( in ListOfGroups theElems,
985 in ListOfGroups theNodesNot,
986 in ListOfGroups theAffectedElems,
987 in boolean theElemGroupNeeded,
988 in boolean theNodeGroupNeeded )
989 raises (SALOME::SALOME_Exception);
992 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
993 * This method provided for convenience works as DoubleNodes() described above.
994 * \param theElems - list of groups of elements (edges or faces) to be replicated
995 * \param theNodesNot - list of groups of nodes not to replicated
996 * \param theShape - shape to detect affected elements (element which geometric center
997 * located on or inside shape).
998 * The replicated nodes should be associated to affected elements.
999 * \return TRUE if operation has been completed successfully, FALSE otherwise
1000 * \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
1002 boolean DoubleNodeElemGroupsInRegion( in ListOfGroups theElems,
1003 in ListOfGroups theNodesNot,
1004 in GEOM::GEOM_Object theShape )
1005 raises (SALOME::SALOME_Exception);
1008 * \brief Identify the elements that will be affected by node duplication (actual duplication is not performed).
1009 * This method is the first step of DoubleNodeElemGroupsInRegion.
1010 * \param theElems - list of groups of elements (edges or faces) to be replicated
1011 * \param theNodesNot - list of groups of nodes not to replicated
1012 * \param theShape - shape to detect affected elements (element which geometric center
1013 * located on or inside shape).
1014 * The replicated nodes should be associated to affected elements.
1015 * \return groups of affected elements
1016 * \sa DoubleNodeElemGroupsInRegion()
1018 ListOfGroups AffectedElemGroupsInRegion( in ListOfGroups theElems,
1019 in ListOfGroups theNodesNot,
1020 in GEOM::GEOM_Object theShape )
1021 raises (SALOME::SALOME_Exception);
1024 * \brief Generates skin mesh (containing 2D cells) from 3D mesh
1025 * The created 2D mesh elements based on nodes of free faces of boundary volumes
1026 * \return TRUE if operation has been completed successfully, FALSE otherwise
1028 boolean Make2DMeshFrom3D() raises (SALOME::SALOME_Exception);
1031 * \brief Creates missing boundary elements
1032 * \param elements - elements whose boundary is to be checked
1033 * \param dimension - defines type of boundary elements to create
1034 * BND_1DFROM3D creates mesh edges on all borders of free facets of 3D elements.
1035 * \param groupName - a name of group to store created boundary elements in,
1036 * "" means not to create the group
1037 * \param meshName - a name of new mesh to store created boundary elements in,
1038 * "" means not to create the new mesh
1039 * \param toCopyElements - if true, the checked elements will be copied into the new mesh
1040 * else only boundary elements will be copied into the new mesh
1041 * \param toCopyExistingBondary - if true, not only new but also pre-existing
1042 * boundary elements will be copied into the new mesh
1043 * \param group - returns the create group, if any
1044 * \retval SMESH::SMESH_Mesh - the mesh where elements were added to
1046 SMESH_Mesh MakeBoundaryMesh(in SMESH_IDSource elements,
1047 in Bnd_Dimension dimension,
1048 in string groupName,
1050 in boolean toCopyElements,
1051 in boolean toCopyExistingBondary,
1052 out SMESH_Group group) raises (SALOME::SALOME_Exception);
1054 * \brief Creates missing boundary elements around either the whole mesh or
1055 * groups of 2D elements
1056 * \param dimension - defines type of boundary elements to create
1057 * \param groupName - a name of group to store all boundary elements in,
1058 * "" means not to create the group
1059 * \param meshName - a name of a new mesh, which is a copy of the initial
1060 * mesh + created boundary elements; "" means not to create the new mesh
1061 * \param toCopyAll - if true, the whole initial mesh will be copied into
1062 * the new mesh else only boundary elements will be copied into the new mesh
1063 * \param groups - optional groups of 2D elements to make boundary around
1064 * \param mesh - returns the mesh where elements were added to
1065 * \param group - returns the created group, if any
1066 * \retval long - number of added boundary elements
1068 long MakeBoundaryElements(in Bnd_Dimension dimension,
1069 in string groupName,
1071 in boolean toCopyAll,
1072 in ListOfIDSources groups,
1073 out SMESH_Mesh mesh,
1074 out SMESH_Group group) raises (SALOME::SALOME_Exception);
1077 * \brief Double nodes on shared faces between groups of volumes and create flat elements on demand.
1078 * Flat elements are mainly used by some types of mechanic calculations.
1080 * The list of groups must describe a partition of the mesh volumes.
1081 * The nodes of the internal faces at the boundaries of the groups are doubled.
1082 * In option, the internal faces are replaced by flat elements.
1083 * Triangles are transformed in prisms, and quadrangles in hexahedrons.
1084 * \param theDomains - list of groups of volumes
1085 * \param createJointElems - if TRUE, create the elements
1086 * \param onAllBoundaries - if TRUE, the nodes and elements are also created on
1087 * the boundary between \a theDomains and the rest mesh
1088 * \return TRUE if operation has been completed successfully, FALSE otherwise
1090 boolean DoubleNodesOnGroupBoundaries( in ListOfGroups theDomains,
1091 in boolean createJointElems,
1092 in boolean onAllBoundaries)
1093 raises (SALOME::SALOME_Exception);
1096 * \brief Double nodes on some external faces and create flat elements.
1097 * Flat elements are mainly used by some types of mechanic calculations.
1099 * Each group of the list must be constituted of faces.
1100 * Triangles are transformed in prisms, and quadrangles in hexahedrons.
1101 * \param theGroupsOfFaces - list of groups of faces
1102 * \return TRUE if operation has been completed successfully, FALSE otherwise
1104 boolean CreateFlatElementsOnFacesGroups( in ListOfGroups theGroupsOfFaces )
1105 raises (SALOME::SALOME_Exception);
1108 * \brief identify all the elements around a geom shape, get the faces delimiting the hole
1109 * Build groups of volume to remove, groups of faces to replace on the skin of the object,
1110 * groups of faces to remove insidethe object, (idem edges).
1111 * Build ordered list of nodes at the border of each group of faces to replace (to be used to build a geom subshape)
1113 void CreateHoleSkin(in double radius,
1114 in GEOM::GEOM_Object theShape,
1115 in string groupName,
1116 in double_array theNodesCoords,
1117 out array_of_long_array GroupsOfNodes)
1118 raises (SALOME::SALOME_Exception);