1 // Copyright (C) 2007-2012 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.
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 * Return data of mesh edition preview which is computed provided
43 * that the editor was obtained trough SMESH_Mesh::GetMeshEditPreviewer()
45 MeshPreviewStruct GetPreviewData();
48 * If during last operation of MeshEditor some nodes were
49 * created this method returns list of their IDs, if new nodes
50 * not created - returns empty list
52 long_array GetLastCreatedNodes();
55 * If during last operation of MeshEditor some elements were
56 * created this method returns list of their IDs, if new elements
57 * not created - returns empty list
59 long_array GetLastCreatedElems();
62 * \brief Returns description of an error/warning occured during the last operation
64 ComputeError GetLastError();
67 * \brief Wrap a sequence of ids in a SMESH_IDSource
68 * \param IDsOfElements list of mesh elements identifiers
69 * \return new ID source object
71 SMESH_IDSource MakeIDSource(in long_array IDsOfElements, in ElementType type);
74 * \brief Remove mesh elements specified by their identifiers.
75 * \param IDsOfElements list of mesh elements identifiers
76 * \return \c true if elements are correctly removed or \c false otherwise
78 boolean RemoveElements(in long_array IDsOfElements);
81 * \brief Remove mesh nodes specified by their identifiers.
82 * \param IDsOfNodes list of mesh nodes identifiers
83 * \return \c true if nodes are correctly removed or \c false otherwise
85 boolean RemoveNodes(in long_array IDsOfNodes);
88 * \brief Remove all orphan nodes.
89 * \return number of removed nodes
91 long RemoveOrphanNodes();
94 * \brief Add a new node.
95 * \param x X coordinate of new node
96 * \param y Y coordinate of new node
97 * \param z Z coordinate of new node
98 * \return integer identifier of new node
100 long AddNode(in double x, in double y, in double z);
103 * Create a 0D element on the given node.
104 * \param IdOfNode Node IDs for creation of element.
106 long Add0DElement(in long IDOfNode);
109 * Create a ball element on the given node.
110 * \param IdOfNode Node IDs for creation of element.
112 long AddBall(in long IDOfNode, in double diameter);
115 * Create an edge, either linear and quadratic (this is determed
116 * by number of given nodes, two or three).
117 * \param IdsOfNodes List of node IDs for creation of element.
118 * Needed order of nodes in this list corresponds to description
119 * of MED. This description is located by the following link:
120 * http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
122 long AddEdge(in long_array IDsOfNodes);
125 * Create face, either linear and quadratic (this is determed
126 * by number of given nodes).
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 AddFace(in long_array IDsOfNodes);
134 long AddPolygonalFace(in long_array IdsOfNodes);
137 * Create volume, either linear and quadratic (this is determed
138 * by number of given nodes).
139 * \param IdsOfNodes List of node IDs for creation of element.
140 * Needed order of nodes in this list corresponds to description
141 * of MED. This description is located by the following link:
142 * http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
144 long AddVolume(in long_array IDsOfNodes);
147 * Create volume of many faces, giving nodes for each face.
148 * \param IdsOfNodes List of node IDs for volume creation face by face.
149 * \param Quantities List of integer values, Quantities[i]
150 * gives quantity of nodes in face number i.
152 long AddPolyhedralVolume (in long_array IdsOfNodes,
153 in long_array Quantities);
156 * Create volume of many faces, giving IDs of existing faces.
157 * \param IdsOfFaces List of face IDs for volume creation.
158 * \note The created volume will refer only to nodes
159 * of the given faces, not to the faces itself.
161 long AddPolyhedralVolumeByFaces (in long_array IdsOfFaces);
164 * \brief Bind a node to a vertex
165 * \param NodeID - node ID
166 * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
168 void SetNodeOnVertex(in long NodeID, in long VertexID)
169 raises (SALOME::SALOME_Exception);
171 * \brief Store node position on an edge
172 * \param NodeID - node ID
173 * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
174 * \param paramOnEdge - parameter on edge where the node is located
176 void SetNodeOnEdge(in long NodeID, in long EdgeID, in double paramOnEdge)
177 raises (SALOME::SALOME_Exception);
179 * \brief Store node position on a face
180 * \param NodeID - node ID
181 * \param FaceID - face ID available through GEOM_Object.GetSubShapeIndices()[0]
182 * \param u - U parameter on face where the node is located
183 * \param v - V parameter on face where the node is located
185 void SetNodeOnFace(in long NodeID, in long FaceID, in double u, in double v)
186 raises (SALOME::SALOME_Exception);
188 * \brief Bind a node to a solid
189 * \param NodeID - node ID
190 * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
192 void SetNodeInVolume(in long NodeID, in long SolidID)
193 raises (SALOME::SALOME_Exception);
195 * \brief Bind an element to a shape
196 * \param ElementID - element ID
197 * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0]
199 void SetMeshElementOnShape(in long ElementID, in long ShapeID)
200 raises (SALOME::SALOME_Exception);
203 boolean MoveNode(in long NodeID, in double x, in double y, in double z);
205 boolean InverseDiag(in long NodeID1, in long NodeID2);
207 boolean DeleteDiag(in long NodeID1, in long NodeID2);
209 boolean Reorient(in long_array IDsOfElements);
211 boolean ReorientObject(in SMESH_IDSource theObject);
213 * \brief Reorient faces contained in \a the2Dgroup.
214 * \param the2Dgroup - the mesh or its part to reorient
215 * \param theDirection - desired direction of normal of \a theFace
216 * \param theFace - ID of face whose orientation is checked.
217 * It can be < 1 then \a thePoint is used to find a face.
218 * \param thePoint - is used to find a face if \a theFace < 1.
219 * \return number of reoriented elements.
221 long Reorient2D(in SMESH_IDSource the2Dgroup,
222 in DirStruct theDirection,
224 in PointStruct thePoint) raises (SALOME::SALOME_Exception);
227 * \brief Fuse neighbour triangles into quadrangles.
228 * \param theElems The triangles to be fused.
229 * \param theCriterion Is used to choose a neighbour to fuse with.
230 * \param theMaxAngle Is a max angle between element normals at which fusion
231 * is still performed; theMaxAngle is mesured in radians.
232 * \return TRUE in case of success, FALSE otherwise.
234 boolean TriToQuad (in long_array IDsOfElements,
235 in NumericalFunctor Criterion,
239 * \brief Fuse neighbour triangles into quadrangles.
241 * Behaves like the above method, taking list of elements from \a theObject
243 boolean TriToQuadObject (in SMESH_IDSource theObject,
244 in NumericalFunctor Criterion,
248 * \brief Split quadrangles into triangles.
249 * \param theElems The faces to be splitted.
250 * \param theCriterion Is used to choose a diagonal for splitting.
251 * \return TRUE in case of success, FALSE otherwise.
253 boolean QuadToTri (in long_array IDsOfElements,
254 in NumericalFunctor Criterion);
257 * \brief Split quadrangles into triangles.
259 * Behaves like the above method, taking list of elements from \a theObject
261 boolean QuadToTriObject (in SMESH_IDSource theObject,
262 in NumericalFunctor Criterion);
265 * \brief Split quadrangles into triangles.
266 * \param theElems The faces to be splitted.
267 * \param the13Diag Is used to choose a diagonal for splitting.
268 * \return TRUE in case of success, FALSE otherwise.
270 boolean SplitQuad (in long_array IDsOfElements,
274 * \brief Split quadrangles into triangles.
276 * Behaves like the above method, taking list of elements from \a theObject
278 boolean SplitQuadObject (in SMESH_IDSource theObject,
282 * Find better splitting of the given quadrangle.
283 * \param IDOfQuad ID of the quadrangle to be splitted.
284 * \param Criterion A criterion to choose a diagonal for splitting.
285 * \return 1 if 1-3 diagonal is better, 2 if 2-4
286 * diagonal is better, 0 if error occurs.
288 long BestSplit (in long IDOfQuad,
289 in NumericalFunctor Criterion);
292 * \brief Split volumic elements into tetrahedrons
293 * \param elems - elements to split
294 * \param methodFlags - flags passing splitting method:
295 * 1 - split the hexahedron into 5 tetrahedrons
296 * 2 - split the hexahedron into 6 tetrahedrons
297 * 3 - split the hexahedron into 24 tetrahedrons
299 void SplitVolumesIntoTetra(in SMESH_IDSource elems, in short methodFlags)
300 raises (SALOME::SALOME_Exception);
303 enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH };
305 boolean Smooth(in long_array IDsOfElements,
306 in long_array IDsOfFixedNodes,
307 in long MaxNbOfIterations,
308 in double MaxAspectRatio,
309 in Smooth_Method Method);
311 boolean SmoothObject(in SMESH_IDSource theObject,
312 in long_array IDsOfFixedNodes,
313 in long MaxNbOfIterations,
314 in double MaxAspectRatio,
315 in Smooth_Method Method);
317 boolean SmoothParametric(in long_array IDsOfElements,
318 in long_array IDsOfFixedNodes,
319 in long MaxNbOfIterations,
320 in double MaxAspectRatio,
321 in Smooth_Method Method);
323 boolean SmoothParametricObject(in SMESH_IDSource theObject,
324 in long_array IDsOfFixedNodes,
325 in long MaxNbOfIterations,
326 in double MaxAspectRatio,
327 in Smooth_Method Method);
329 void ConvertToQuadratic(in boolean theForce3d);
331 boolean ConvertFromQuadratic();
333 void ConvertToQuadraticObject(in boolean theForce3d,
334 in SMESH_IDSource theObject)
335 raises (SALOME::SALOME_Exception);
337 void ConvertFromQuadraticObject(in SMESH_IDSource theObject)
338 raises (SALOME::SALOME_Exception);
340 void RenumberNodes();
342 void RenumberElements();
345 * \brief Genarate dim+1 elements by rotation of given elements around axis
346 * \param IDsOfElements - elements to ratate
347 * \param Axix - rotation axis
348 * \param AngleInRadians - rotation angle
349 * \param NbOfSteps - number of elements to generate from one element
351 void RotationSweep(in long_array IDsOfElements,
353 in double AngleInRadians,
355 in double Tolerance);
357 * \brief Same as previous but additionally create groups of elements
358 * generated from elements belonging to preexisting groups
360 ListOfGroups RotationSweepMakeGroups(in long_array IDsOfElements,
362 in double AngleInRadians,
364 in double Tolerance);
366 * \brief Genarate dim+1 elements by rotation of the object around axis
367 * \param theObject - object containing elements to ratate
368 * \param Axix - rotation axis
369 * \param AngleInRadians - rotation angle
370 * \param NbOfSteps - number of elements to generate from one element
372 void RotationSweepObject(in SMESH_IDSource theObject,
374 in double AngleInRadians,
376 in double Tolerance);
378 * \brief Same as previous but additionally create groups of elements
379 * generated from elements belonging to preexisting groups
381 ListOfGroups RotationSweepObjectMakeGroups(in SMESH_IDSource theObject,
383 in double AngleInRadians,
385 in double Tolerance);
387 * \brief Genarate dim+1 elements by rotation of the object around axis
388 * \param theObject - object containing elements to ratate
389 * \param Axix - rotation axis
390 * \param AngleInRadians - rotation angle
391 * \param NbOfSteps - number of elements to generate from one element
393 void RotationSweepObject1D(in SMESH_IDSource theObject,
395 in double AngleInRadians,
397 in double Tolerance);
399 * \brief Same as previous but additionally create groups of elements
400 * generated from elements belonging to preexisting groups
402 ListOfGroups RotationSweepObject1DMakeGroups(in SMESH_IDSource theObject,
404 in double AngleInRadians,
406 in double Tolerance);
408 * \brief Genarate dim+1 elements by rotation of the object around axis
409 * \param theObject - object containing elements to ratate
410 * \param Axix - rotation axis
411 * \param AngleInRadians - rotation angle
412 * \param NbOfSteps - number of elements to generate from one element
414 void RotationSweepObject2D(in SMESH_IDSource theObject,
416 in double AngleInRadians,
418 in double Tolerance);
420 * \brief Same as previous but additionally create groups of elements
421 * generated from elements belonging to preexisting groups
423 ListOfGroups RotationSweepObject2DMakeGroups(in SMESH_IDSource theObject,
425 in double AngleInRadians,
427 in double Tolerance);
429 * \brief Genarate dim+1 elements by extrusion of elements along vector
430 * \param IDsOfElements - elements to sweep
431 * \param StepVector - vector giving direction and distance of an extrusion step
432 * \param NbOfSteps - number of elements to generate from one element
434 void ExtrusionSweep(in long_array IDsOfElements,
435 in DirStruct StepVector,
438 * \brief Genarate dim+1 elements by extrusion of elements along vector
439 * \param IDsOfElements - elements to sweep
440 * \param StepVector - vector giving direction and distance of an extrusion step
441 * \param NbOfSteps - number of elements to generate from one element
443 void ExtrusionSweep0D(in long_array IDsOfElements,
444 in DirStruct StepVector,
447 * \brief Same as previous but additionally create groups of elements
448 * generated from elements belonging to preexisting groups
450 ListOfGroups ExtrusionSweepMakeGroups(in long_array IDsOfElements,
451 in DirStruct StepVector,
454 * \brief Same as previous but elements are nodes
456 ListOfGroups ExtrusionSweepMakeGroups0D(in long_array IDsOfElements,
457 in DirStruct StepVector,
460 * Generate new elements by extrusion of theElements
461 * by StepVector by NbOfSteps
462 * param ExtrFlags set flags for performing extrusion
463 * param SewTolerance - uses for comparing locations of nodes if flag
464 * EXTRUSION_FLAG_SEW is set
466 void AdvancedExtrusion(in long_array IDsOfElements,
467 in DirStruct StepVector,
470 in double SewTolerance);
472 * \brief Same as previous but additionally create groups of elements
473 * generated from elements belonging to preexisting groups
475 ListOfGroups AdvancedExtrusionMakeGroups(in long_array IDsOfElements,
476 in DirStruct StepVector,
479 in double SewTolerance);
481 void ExtrusionSweepObject(in SMESH_IDSource theObject,
482 in DirStruct StepVector,
484 ListOfGroups ExtrusionSweepObjectMakeGroups(in SMESH_IDSource theObject,
485 in DirStruct StepVector,
488 void ExtrusionSweepObject0D(in SMESH_IDSource theObject,
489 in DirStruct StepVector,
491 ListOfGroups ExtrusionSweepObject0DMakeGroups(in SMESH_IDSource theObject,
492 in DirStruct StepVector,
495 void ExtrusionSweepObject1D(in SMESH_IDSource theObject,
496 in DirStruct StepVector,
498 ListOfGroups ExtrusionSweepObject1DMakeGroups(in SMESH_IDSource theObject,
499 in DirStruct StepVector,
502 void ExtrusionSweepObject2D(in SMESH_IDSource theObject,
503 in DirStruct StepVector,
505 ListOfGroups ExtrusionSweepObject2DMakeGroups(in SMESH_IDSource theObject,
506 in DirStruct StepVector,
509 enum Extrusion_Error {
514 EXTR_BAD_STARTING_NODE,
515 EXTR_BAD_ANGLES_NUMBER,
516 EXTR_CANT_GET_TANGENT
519 ListOfGroups ExtrusionAlongPathX(in long_array IDsOfElements,
520 in SMESH_IDSource Path,
522 in boolean HasAngles,
523 in double_array Angles,
524 in boolean LinearVariation,
525 in boolean HasRefPoint,
526 in PointStruct RefPoint,
527 in boolean MakeGroups,
528 in ElementType ElemType,
529 out Extrusion_Error Error);
531 ListOfGroups ExtrusionAlongPathObjX(in SMESH_IDSource theObject,
532 in SMESH_IDSource Path,
534 in boolean HasAngles,
535 in double_array Angles,
536 in boolean LinearVariation,
537 in boolean HasRefPoint,
538 in PointStruct RefPoint,
539 in boolean MakeGroups,
540 in ElementType ElemType,
541 out Extrusion_Error Error);
543 Extrusion_Error ExtrusionAlongPath(in long_array IDsOfElements,
544 in SMESH_Mesh PathMesh,
545 in GEOM::GEOM_Object PathShape,
547 in boolean HasAngles,
548 in double_array Angles,
549 in boolean HasRefPoint,
550 in PointStruct RefPoint);
551 ListOfGroups ExtrusionAlongPathMakeGroups(in long_array IDsOfElements,
552 in SMESH_Mesh PathMesh,
553 in GEOM::GEOM_Object PathShape,
555 in boolean HasAngles,
556 in double_array Angles,
557 in boolean HasRefPoint,
558 in PointStruct RefPoint,
559 out Extrusion_Error Error);
561 Extrusion_Error ExtrusionAlongPathObject(in SMESH_IDSource theObject,
562 in SMESH_Mesh PathMesh,
563 in GEOM::GEOM_Object PathShape,
565 in boolean HasAngles,
566 in double_array Angles,
567 in boolean HasRefPoint,
568 in PointStruct RefPoint);
569 ListOfGroups ExtrusionAlongPathObjectMakeGroups(in SMESH_IDSource theObject,
570 in SMESH_Mesh PathMesh,
571 in GEOM::GEOM_Object PathShape,
573 in boolean HasAngles,
574 in double_array Angles,
575 in boolean HasRefPoint,
576 in PointStruct RefPoint,
577 out Extrusion_Error Error);
579 Extrusion_Error ExtrusionAlongPathObject1D(in SMESH_IDSource theObject,
580 in SMESH_Mesh PathMesh,
581 in GEOM::GEOM_Object PathShape,
583 in boolean HasAngles,
584 in double_array Angles,
585 in boolean HasRefPoint,
586 in PointStruct RefPoint);
587 ListOfGroups ExtrusionAlongPathObject1DMakeGroups(in SMESH_IDSource theObject,
588 in SMESH_Mesh PathMesh,
589 in GEOM::GEOM_Object PathShape,
591 in boolean HasAngles,
592 in double_array Angles,
593 in boolean HasRefPoint,
594 in PointStruct RefPoint,
595 out Extrusion_Error Error);
597 Extrusion_Error ExtrusionAlongPathObject2D(in SMESH_IDSource theObject,
598 in SMESH_Mesh PathMesh,
599 in GEOM::GEOM_Object PathShape,
601 in boolean HasAngles,
602 in double_array Angles,
603 in boolean HasRefPoint,
604 in PointStruct RefPoint);
605 ListOfGroups ExtrusionAlongPathObject2DMakeGroups(in SMESH_IDSource theObject,
606 in SMESH_Mesh PathMesh,
607 in GEOM::GEOM_Object PathShape,
609 in boolean HasAngles,
610 in double_array Angles,
611 in boolean HasRefPoint,
612 in PointStruct RefPoint,
613 out Extrusion_Error Error);
616 * Compute rotation angles for ExtrusionAlongPath as linear variation
617 * of given angles along path steps
618 * param PathMesh mesh containing a 1D sub-mesh on the edge, along
619 * which proceeds the extrusion
620 * param PathShape is shape(edge); as the mesh can be complex, the edge
621 * is used to define the sub-mesh for the path
623 double_array LinearAnglesVariation(in SMESH_Mesh PathMesh,
624 in GEOM::GEOM_Object PathShape,
625 in double_array Angles);
627 enum MirrorType { POINT, AXIS, PLANE };
629 void Mirror (in long_array IDsOfElements,
630 in AxisStruct Mirror,
633 ListOfGroups MirrorMakeGroups (in long_array IDsOfElements,
634 in AxisStruct Mirror,
636 SMESH_Mesh MirrorMakeMesh (in long_array IDsOfElements,
637 in AxisStruct Mirror,
639 in boolean CopyGroups,
642 void MirrorObject (in SMESH_IDSource theObject,
643 in AxisStruct Mirror,
646 ListOfGroups MirrorObjectMakeGroups (in SMESH_IDSource theObject,
647 in AxisStruct Mirror,
649 SMESH_Mesh MirrorObjectMakeMesh (in SMESH_IDSource theObject,
650 in AxisStruct Mirror,
652 in boolean CopyGroups,
655 void Translate (in long_array IDsOfElements,
658 ListOfGroups TranslateMakeGroups (in long_array IDsOfElements,
659 in DirStruct Vector);
660 SMESH_Mesh TranslateMakeMesh (in long_array IDsOfElements,
662 in boolean CopyGroups,
665 void TranslateObject (in SMESH_IDSource theObject,
668 ListOfGroups TranslateObjectMakeGroups (in SMESH_IDSource theObject,
669 in DirStruct Vector);
670 SMESH_Mesh TranslateObjectMakeMesh (in SMESH_IDSource theObject,
672 in boolean CopyGroups,
675 void Scale (in SMESH_IDSource theObject,
676 in PointStruct thePoint,
677 in double_array theScaleFact,
679 ListOfGroups ScaleMakeGroups (in SMESH_IDSource theObject,
680 in PointStruct thePoint,
681 in double_array theScaleFact);
682 SMESH_Mesh ScaleMakeMesh (in SMESH_IDSource theObject,
683 in PointStruct thePoint,
684 in double_array theScaleFact,
685 in boolean CopyGroups,
688 void Rotate (in long_array IDsOfElements,
690 in double AngleInRadians,
692 ListOfGroups RotateMakeGroups (in long_array IDsOfElements,
694 in double AngleInRadians);
695 SMESH_Mesh RotateMakeMesh (in long_array IDsOfElements,
697 in double AngleInRadians,
698 in boolean CopyGroups,
701 void RotateObject (in SMESH_IDSource theObject,
703 in double AngleInRadians,
705 ListOfGroups RotateObjectMakeGroups (in SMESH_IDSource theObject,
707 in double AngleInRadians);
708 SMESH_Mesh RotateObjectMakeMesh (in SMESH_IDSource theObject,
710 in double AngleInRadians,
711 in boolean CopyGroups,
714 void FindCoincidentNodes (in double Tolerance,
715 out array_of_long_array GroupsOfNodes);
717 void FindCoincidentNodesOnPart (in SMESH_IDSource SubMeshOrGroup,
719 out array_of_long_array GroupsOfNodes);
721 void FindCoincidentNodesOnPartBut (in SMESH_IDSource SubMeshOrGroup,
723 out array_of_long_array GroupsOfNodes,
724 in ListOfIDSources ExceptSubMeshOrGroups);
726 void MergeNodes (in array_of_long_array GroupsOfNodes);
729 * \brief Find elements built on the same nodes.
730 * \param MeshOrSubMeshOrGroup Mesh or SubMesh, or Group of elements for searching.
731 * \return List of groups of equal elements.
733 void FindEqualElements (in SMESH_IDSource MeshOrSubMeshOrGroup,
734 out array_of_long_array GroupsOfElementsID);
737 * \brief Merge elements in each given group.
738 * \param GroupsOfElementsID Groups of elements for merging.
740 void MergeElements(in array_of_long_array GroupsOfElementsID);
743 * \brief Merge equal elements in the whole mesh.
745 void MergeEqualElements();
748 * If the given ID is a valid node ID (nodeID > 0), just move this node, else
749 * move the node closest to the point to point's location and return ID of the node
751 long MoveClosestNodeToPoint(in double x, in double y, in double z, in long nodeID);
754 * Return ID of node closest to a given point
756 long FindNodeClosestTo(in double x, in double y, in double z);
759 * Return elements of given type where the given point is IN or ON.
761 * 'ALL' type means elements of any type excluding nodes and 0D elements
763 long_array FindElementsByPoint(in double x, in double y, in double z, in ElementType type);
766 * Searching among the given elements, return elements of given type
767 * where the given point is IN or ON.
769 * 'ALL' type means elements of any type excluding nodes and 0D elements
771 long_array FindAmongElementsByPoint(in SMESH_IDSource elements,
772 in double x, in double y, in double z,
773 in ElementType type);
776 * Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
777 * TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
779 short GetPointState(in double x, in double y, in double z);
783 SEW_BORDER1_NOT_FOUND,
784 SEW_BORDER2_NOT_FOUND,
785 SEW_BOTH_BORDERS_NOT_FOUND,
787 SEW_VOLUMES_TO_SPLIT,
788 // for SewSideElements() only:
789 SEW_DIFF_NB_OF_ELEMENTS,
790 SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
795 Sew_Error SewFreeBorders (in long FirstNodeID1,
796 in long SecondNodeID1,
798 in long FirstNodeID2,
799 in long SecondNodeID2,
801 in boolean CreatePolygons,
802 in boolean CreatePolyedrs);
804 Sew_Error SewConformFreeBorders (in long FirstNodeID1,
805 in long SecondNodeID1,
807 in long FirstNodeID2,
808 in long SecondNodeID2);
810 Sew_Error SewBorderToSide (in long FirstNodeIDOnFreeBorder,
811 in long SecondNodeIDOnFreeBorder,
812 in long LastNodeIDOnFreeBorder,
813 in long FirstNodeIDOnSide,
814 in long LastNodeIDOnSide,
815 in boolean CreatePolygons,
816 in boolean CreatePolyedrs);
818 Sew_Error SewSideElements (in long_array IDsOfSide1Elements,
819 in long_array IDsOfSide2Elements,
820 in long NodeID1OfSide1ToMerge,
821 in long NodeID1OfSide2ToMerge,
822 in long NodeID2OfSide1ToMerge,
823 in long NodeID2OfSide2ToMerge);
826 * Set new nodes for given element.
827 * If number of nodes is not corresponded to type of
828 * element - returns false
830 boolean ChangeElemNodes(in long ide, in long_array newIDs);
833 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
834 * \param theNodes - identifiers of nodes to be doubled
835 * \param theModifiedElems - identifiers of elements to be updated by the new (doubled)
836 * nodes. If list of element identifiers is empty then nodes are doubled but
837 * they not assigned to elements
838 * \return TRUE if operation has been completed successfully, FALSE otherwise
839 * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodeGroups()
841 boolean DoubleNodes( in long_array theNodes, in long_array theModifiedElems );
844 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
845 * This method provided for convenience works as DoubleNodes() described above.
846 * \param theNodeId - identifier of node to be doubled.
847 * \param theModifiedElems - identifiers of elements to be updated.
848 * \return TRUE if operation has been completed successfully, FALSE otherwise
849 * \sa DoubleNodes(), DoubleNodeGroup(), DoubleNodeGroups()
851 boolean DoubleNode( in long theNodeId, in long_array theModifiedElems );
854 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
855 * This method provided for convenience works as DoubleNodes() described above.
856 * \param theNodes - group of nodes to be doubled.
857 * \param theModifiedElems - group of elements to be updated.
858 * \return TRUE if operation has been completed successfully, FALSE otherwise
859 * \sa DoubleNode(), DoubleNodes(), DoubleNodeGroups(), DoubleNodeGroupNew()
861 boolean DoubleNodeGroup( in SMESH_GroupBase theNodes,
862 in SMESH_GroupBase theModifiedElems );
864 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
865 * Works as DoubleNodeGroup() described above, but returns a new group with
866 * newly created nodes.
867 * \param theNodes - group of nodes to be doubled.
868 * \param theModifiedElems - group of elements to be updated.
869 * \return a new group with newly created nodes
870 * \sa DoubleNodeGroup()
872 SMESH_Group DoubleNodeGroupNew( in SMESH_GroupBase theNodes,
873 in SMESH_GroupBase theModifiedElems );
876 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
877 * This method provided for convenience works as DoubleNodes() described above.
878 * \param theNodes - list of groups of nodes to be doubled
879 * \param theModifiedElems - list of groups of elements to be updated.
880 * \return TRUE if operation has been completed successfully, FALSE otherwise
881 * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodes()
883 boolean DoubleNodeGroups( in ListOfGroups theNodes,
884 in ListOfGroups theModifiedElems );
886 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
887 * Works as DoubleNodeGroups() described above, but returns a new group with
888 * newly created nodes.
889 * \param theNodes - list of groups of nodes to be doubled
890 * \param theModifiedElems - list of groups of elements to be updated.
891 * \return a new group with newly created nodes
892 * \sa DoubleNodeGroups()
894 SMESH_Group DoubleNodeGroupsNew( in ListOfGroups theNodes,
895 in ListOfGroups theModifiedElems );
898 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
899 * \param theElems - the list of elements (edges or faces) to be replicated
900 * The nodes for duplication could be found from these elements
901 * \param theNodesNot - list of nodes to NOT replicate
902 * \param theAffectedElems - the list of elements (cells and edges) to which the
903 * replicated nodes should be associated to.
904 * \return TRUE if operation has been completed successfully, FALSE otherwise
905 * \sa DoubleNodeGroup(), DoubleNodeGroups()
907 boolean DoubleNodeElem( in long_array theElems,
908 in long_array theNodesNot,
909 in long_array theAffectedElems );
912 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
913 * \param theElems - the list of elements (edges or faces) to be replicated
914 * The nodes for duplication could be found from these elements
915 * \param theNodesNot - list of nodes to NOT replicate
916 * \param theShape - shape to detect affected elements (element which geometric center
917 * located on or inside shape).
918 * The replicated nodes should be associated to affected elements.
919 * \return TRUE if operation has been completed successfully, FALSE otherwise
920 * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
922 boolean DoubleNodeElemInRegion( in long_array theElems,
923 in long_array theNodesNot,
924 in GEOM::GEOM_Object theShape );
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 of elements (edges or faces) to be replicated
930 * \param theNodesNot - group of nodes not to replicated
931 * \param theAffectedElems - group of elements to which the replicated nodes
932 * should be associated to.
933 * \return TRUE if operation has been completed successfully, FALSE otherwise
934 * \sa DoubleNodes(), DoubleNodeGroups(), DoubleNodeElemGroupNew()
936 boolean DoubleNodeElemGroup( in SMESH_GroupBase theElems,
937 in SMESH_GroupBase theNodesNot,
938 in SMESH_GroupBase theAffectedElems );
940 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
941 * Works as DoubleNodeElemGroup() described above, but returns a new group with
942 * newly created elements.
943 * \param theElems - group of of elements (edges or faces) to be replicated
944 * \param theNodesNot - group of nodes not to replicated
945 * \param theAffectedElems - group of elements to which the replicated nodes
946 * should be associated to.
947 * \return a new group with newly created elements
948 * \sa DoubleNodeElemGroup()
950 SMESH_Group DoubleNodeElemGroupNew( in SMESH_GroupBase theElems,
951 in SMESH_GroupBase theNodesNot,
952 in SMESH_GroupBase theAffectedElems );
954 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
955 * Works as DoubleNodeElemGroup() described above, but returns two new groups:
956 * a group of newly created elements and a group of newly created nodes
957 * \param theElems - group of of elements (edges or faces) to be replicated
958 * \param theNodesNot - group of nodes not to replicated
959 * \param theAffectedElems - group of elements to which the replicated nodes
960 * should be associated to.
961 * \param theElemGroupNeeded - to create group of new elements or not
962 * \param theNodeGroupNeeded - to create group of new nodes or not
963 * \return two new groups of newly created elements (1st) and nodes (2nd)
964 * \sa DoubleNodeElemGroup()
966 ListOfGroups DoubleNodeElemGroup2New( in SMESH_GroupBase theElems,
967 in SMESH_GroupBase theNodesNot,
968 in SMESH_GroupBase theAffectedElems,
969 in boolean theElemGroupNeeded,
970 in boolean theNodeGroupNeeded);
973 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
974 * This method provided for convenience works as DoubleNodes() described above.
975 * \param theElems - group of elements (edges or faces) to be replicated
976 * \param theNodesNot - group of nodes not to replicated
977 * \param theShape - shape to detect affected elements (element which geometric center
978 * located on or inside shape).
979 * The replicated nodes should be associated to affected elements.
980 * \return TRUE if operation has been completed successfully, FALSE otherwise
981 * \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
983 boolean DoubleNodeElemGroupInRegion( in SMESH_GroupBase theElems,
984 in SMESH_GroupBase theNodesNot,
985 in GEOM::GEOM_Object theShape );
988 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
989 * This method provided for convenience works as DoubleNodes() described above.
990 * \param theElems - list of groups of elements (edges or faces) to be replicated
991 * \param theNodesNot - list of groups of nodes not to replicated
992 * \param theAffectedElems - group of elements to which the replicated nodes
993 * should be associated to.
994 * \return TRUE if operation has been completed successfully, FALSE otherwise
995 * \sa DoubleNodeGroup(), DoubleNodes(), DoubleNodeElemGroupsNew()
997 boolean DoubleNodeElemGroups( in ListOfGroups theElems,
998 in ListOfGroups theNodesNot,
999 in ListOfGroups theAffectedElems );
1001 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
1002 * Works as DoubleNodeElemGroups() described above, but returns a new group with
1003 * newly created elements.
1004 * \param theElems - list of groups of elements (edges or faces) to be replicated
1005 * \param theNodesNot - list of groups of nodes not to replicated
1006 * \param theAffectedElems - group of elements to which the replicated nodes
1007 * should be associated to.
1008 * \return a new group with newly created elements
1009 * \sa DoubleNodeElemGroups()
1011 SMESH_Group DoubleNodeElemGroupsNew( in ListOfGroups theElems,
1012 in ListOfGroups theNodesNot,
1013 in ListOfGroups theAffectedElems );
1015 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
1016 * Works as DoubleNodeElemGroups() described above, but returns two new groups:
1017 * a group of newly created elements and a group of newly created nodes.
1018 * \param theElems - list of groups of elements (edges or faces) to be replicated
1019 * \param theNodesNot - list of groups of nodes not to replicated
1020 * \param theAffectedElems - group of elements to which the replicated nodes
1021 * should be associated to.
1022 * \param theElemGroupNeeded - to create group of new elements or not
1023 * \param theNodeGroupNeeded - to create group of new nodes or not
1024 * \return two new groups of newly created elements (1st) and nodes (2nd)
1025 * \sa DoubleNodeElemGroups()
1027 ListOfGroups DoubleNodeElemGroups2New( in ListOfGroups theElems,
1028 in ListOfGroups theNodesNot,
1029 in ListOfGroups theAffectedElems,
1030 in boolean theElemGroupNeeded,
1031 in boolean theNodeGroupNeeded );
1034 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
1035 * This method provided for convenience works as DoubleNodes() described above.
1036 * \param theElems - list of groups of elements (edges or faces) to be replicated
1037 * \param theNodesNot - list of groups of nodes not to replicated
1038 * \param theShape - shape to detect affected elements (element which geometric center
1039 * located on or inside shape).
1040 * The replicated nodes should be associated to affected elements.
1041 * \return TRUE if operation has been completed successfully, FALSE otherwise
1042 * \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
1044 boolean DoubleNodeElemGroupsInRegion( in ListOfGroups theElems,
1045 in ListOfGroups theNodesNot,
1046 in GEOM::GEOM_Object theShape );
1049 * \brief Identify the elements that will be affected by node duplication (actual duplication is not performed).
1050 * This method is the first step of DoubleNodeElemGroupsInRegion.
1051 * \param theElems - list of groups of elements (edges or faces) to be replicated
1052 * \param theNodesNot - list of groups of nodes not to replicated
1053 * \param theShape - shape to detect affected elements (element which geometric center
1054 * located on or inside shape).
1055 * The replicated nodes should be associated to affected elements.
1056 * \return groups of affected elements
1057 * \sa DoubleNodeElemGroupsInRegion()
1059 ListOfGroups AffectedElemGroupsInRegion( in ListOfGroups theElems,
1060 in ListOfGroups theNodesNot,
1061 in GEOM::GEOM_Object theShape );
1064 * \brief Generates skin mesh (containing 2D cells) from 3D mesh
1065 * The created 2D mesh elements based on nodes of free faces of boundary volumes
1066 * \return TRUE if operation has been completed successfully, FALSE otherwise
1068 boolean Make2DMeshFrom3D();
1071 * \brief Creates missing boundary elements
1072 * \param elements - elements whose boundary is to be checked
1073 * \param dimension - defines type of boundary elements to create
1074 * BND_1DFROM3D creates mesh edges on all borders of free facets of 3D elements.
1075 * \param groupName - a name of group to store created boundary elements in,
1076 * "" means not to create the group
1077 * \param meshName - a name of new mesh to store created boundary elements in,
1078 * "" means not to create the new mesh
1079 * \param toCopyElements - if true, the checked elements will be copied into the new mesh
1080 * else only boundary elements will be copied into the new mesh
1081 * \param toCopyExistingBondary - if true, not only new but also pre-existing
1082 * boundary elements will be copied into the new mesh
1083 * \param group - returns the create group, if any
1084 * \retval SMESH::SMESH_Mesh - the mesh where elements were added to
1086 SMESH_Mesh MakeBoundaryMesh(in SMESH_IDSource elements,
1087 in Bnd_Dimension dimension,
1088 in string groupName,
1090 in boolean toCopyElements,
1091 in boolean toCopyExistingBondary,
1092 out SMESH_Group group);
1094 * \brief Creates missing boundary elements around either the whole mesh or
1095 * groups of 2D elements
1096 * \param dimension - defines type of boundary elements to create
1097 * \param groupName - a name of group to store all boundary elements in,
1098 * "" means not to create the group
1099 * \param meshName - a name of a new mesh, which is a copy of the initial
1100 * mesh + created boundary elements; "" means not to create the new mesh
1101 * \param toCopyAll - if true, the whole initial mesh will be copied into
1102 * the new mesh else only boundary elements will be copied into the new mesh
1103 * \param groups - optional groups of 2D elements to make boundary around
1104 * \param mesh - returns the mesh where elements were added to
1105 * \param group - returns the created group, if any
1106 * \retval long - number of added boundary elements
1108 long MakeBoundaryElements(in Bnd_Dimension dimension,
1109 in string groupName,
1111 in boolean toCopyAll,
1112 in ListOfIDSources groups,
1113 out SMESH_Mesh mesh,
1114 out SMESH_Group group) raises (SALOME::SALOME_Exception);
1117 * \brief Double nodes on shared faces between groups of volumes and create flat elements on demand.
1118 * Flat elements are mainly used by some types of mechanic calculations.
1120 * The list of groups must describe a partition of the mesh volumes.
1121 * The nodes of the internal faces at the boundaries of the groups are doubled.
1122 * In option, the internal faces are replaced by flat elements.
1123 * Triangles are transformed in prisms, and quadrangles in hexahedrons.
1124 * \param theDomains - list of groups of volumes
1125 * \param createJointElems - if TRUE, create the elements
1126 * \return TRUE if operation has been completed successfully, FALSE otherwise
1128 boolean DoubleNodesOnGroupBoundaries( in ListOfGroups theDomains,
1129 in boolean createJointElems )
1130 raises (SALOME::SALOME_Exception);
1133 * \brief Double nodes on some external faces and create flat elements.
1134 * Flat elements are mainly used by some types of mechanic calculations.
1136 * Each group of the list must be constituted of faces.
1137 * Triangles are transformed in prisms, and quadrangles in hexahedrons.
1138 * \param theGroupsOfFaces - list of groups of faces
1139 * \return TRUE if operation has been completed successfully, FALSE otherwise
1141 boolean CreateFlatElementsOnFacesGroups( in ListOfGroups theGroupsOfFaces );
1144 * \brief identify all the elements around a geom shape, get the faces delimiting the hole
1145 * Build groups of volume to remove, groups of faces to replace on the skin of the object,
1146 * groups of faces to remove insidethe object, (idem edges).
1147 * Build ordered list of nodes at the border of each group of faces to replace (to be used to build a geom subshape)
1149 void CreateHoleSkin(in double radius,
1150 in GEOM::GEOM_Object theShape,
1151 in string groupName,
1152 in double_array theNodesCoords,
1153 out array_of_long_array GroupsOfNodes) raises (SALOME::SALOME_Exception);