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);
155 * Create volume of many faces, giving IDs of existing faces.
156 * \param IdsOfFaces List of face IDs for volume creation.
157 * \note The created volume will refer only to nodes
158 * of the given faces, not to the faces itself.
160 long AddPolyhedralVolumeByFaces (in long_array IdsOfFaces);
163 * Create 0D elements on all nodes of the given object except those
164 * nodes on which a 0D element already exists.
165 * \param theObject object on whose nodes 0D elements will be created.
166 * \param theGroupName optional name of a group to add 0D elements created
167 * and/or found on nodes of \a theObject.
168 * \return an object (a new group or a temporary SMESH_IDSource) holding
169 * ids of new and/or found 0D elements.
171 SMESH_IDSource Create0DElementsOnAllNodes(in SMESH_IDSource theObject,
172 in string theGroupName)
173 raises (SALOME::SALOME_Exception);
176 * \brief Bind a node to a vertex
177 * \param NodeID - node ID
178 * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
180 void SetNodeOnVertex(in long NodeID, in long VertexID)
181 raises (SALOME::SALOME_Exception);
183 * \brief Store node position on an edge
184 * \param NodeID - node ID
185 * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
186 * \param paramOnEdge - parameter on edge where the node is located
188 void SetNodeOnEdge(in long NodeID, in long EdgeID, in double paramOnEdge)
189 raises (SALOME::SALOME_Exception);
191 * \brief Store node position on a face
192 * \param NodeID - node ID
193 * \param FaceID - face ID available through GEOM_Object.GetSubShapeIndices()[0]
194 * \param u - U parameter on face where the node is located
195 * \param v - V parameter on face where the node is located
197 void SetNodeOnFace(in long NodeID, in long FaceID, in double u, in double v)
198 raises (SALOME::SALOME_Exception);
200 * \brief Bind a node to a solid
201 * \param NodeID - node ID
202 * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
204 void SetNodeInVolume(in long NodeID, in long SolidID)
205 raises (SALOME::SALOME_Exception);
207 * \brief Bind an element to a shape
208 * \param ElementID - element ID
209 * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0]
211 void SetMeshElementOnShape(in long ElementID, in long ShapeID)
212 raises (SALOME::SALOME_Exception);
215 boolean MoveNode(in long NodeID, in double x, in double y, in double z);
217 boolean InverseDiag(in long NodeID1, in long NodeID2);
219 boolean DeleteDiag(in long NodeID1, in long NodeID2);
221 boolean Reorient(in long_array IDsOfElements);
223 boolean ReorientObject(in SMESH_IDSource theObject);
225 * \brief Reorient faces contained in \a the2Dgroup.
226 * \param the2Dgroup - the mesh or its part to reorient
227 * \param theDirection - desired direction of normal of \a theFace
228 * \param theFace - ID of face whose orientation is checked.
229 * It can be < 1 then \a thePoint is used to find a face.
230 * \param thePoint - is used to find a face if \a theFace < 1.
231 * \return number of reoriented elements.
233 long Reorient2D(in SMESH_IDSource the2Dgroup,
234 in DirStruct theDirection,
236 in PointStruct thePoint) raises (SALOME::SALOME_Exception);
239 * \brief Fuse neighbour triangles into quadrangles.
240 * \param theElems The triangles to be fused.
241 * \param theCriterion Is used to choose a neighbour to fuse with.
242 * \param theMaxAngle Is a max angle between element normals at which fusion
243 * is still performed; theMaxAngle is mesured in radians.
244 * \return TRUE in case of success, FALSE otherwise.
246 boolean TriToQuad (in long_array IDsOfElements,
247 in NumericalFunctor Criterion,
251 * \brief Fuse neighbour triangles into quadrangles.
253 * Behaves like the above method, taking list of elements from \a theObject
255 boolean TriToQuadObject (in SMESH_IDSource theObject,
256 in NumericalFunctor Criterion,
260 * \brief Split quadrangles into triangles.
261 * \param theElems The faces to be splitted.
262 * \param theCriterion Is used to choose a diagonal for splitting.
263 * \return TRUE in case of success, FALSE otherwise.
265 boolean QuadToTri (in long_array IDsOfElements,
266 in NumericalFunctor Criterion);
269 * \brief Split quadrangles into triangles.
271 * Behaves like the above method, taking list of elements from \a theObject
273 boolean QuadToTriObject (in SMESH_IDSource theObject,
274 in NumericalFunctor Criterion);
277 * \brief Split quadrangles into triangles.
278 * \param theElems The faces to be splitted.
279 * \param the13Diag Is used to choose a diagonal for splitting.
280 * \return TRUE in case of success, FALSE otherwise.
282 boolean SplitQuad (in long_array IDsOfElements,
286 * \brief Split quadrangles into triangles.
288 * Behaves like the above method, taking list of elements from \a theObject
290 boolean SplitQuadObject (in SMESH_IDSource theObject,
294 * Find better splitting of the given quadrangle.
295 * \param IDOfQuad ID of the quadrangle to be splitted.
296 * \param Criterion A criterion to choose a diagonal for splitting.
297 * \return 1 if 1-3 diagonal is better, 2 if 2-4
298 * diagonal is better, 0 if error occurs.
300 long BestSplit (in long IDOfQuad,
301 in NumericalFunctor Criterion);
304 * \brief Split volumic elements into tetrahedrons
305 * \param elems - elements to split
306 * \param methodFlags - flags passing splitting method:
307 * 1 - split the hexahedron into 5 tetrahedrons
308 * 2 - split the hexahedron into 6 tetrahedrons
309 * 3 - split the hexahedron into 24 tetrahedrons
311 void SplitVolumesIntoTetra(in SMESH_IDSource elems, in short methodFlags)
312 raises (SALOME::SALOME_Exception);
315 enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH };
317 boolean Smooth(in long_array IDsOfElements,
318 in long_array IDsOfFixedNodes,
319 in long MaxNbOfIterations,
320 in double MaxAspectRatio,
321 in Smooth_Method Method);
323 boolean SmoothObject(in SMESH_IDSource theObject,
324 in long_array IDsOfFixedNodes,
325 in long MaxNbOfIterations,
326 in double MaxAspectRatio,
327 in Smooth_Method Method);
329 boolean SmoothParametric(in long_array IDsOfElements,
330 in long_array IDsOfFixedNodes,
331 in long MaxNbOfIterations,
332 in double MaxAspectRatio,
333 in Smooth_Method Method);
335 boolean SmoothParametricObject(in SMESH_IDSource theObject,
336 in long_array IDsOfFixedNodes,
337 in long MaxNbOfIterations,
338 in double MaxAspectRatio,
339 in Smooth_Method Method);
341 void ConvertToQuadratic(in boolean theForce3d);
343 boolean ConvertFromQuadratic();
345 void ConvertToQuadraticObject(in boolean theForce3d,
346 in SMESH_IDSource theObject)
347 raises (SALOME::SALOME_Exception);
349 void ConvertFromQuadraticObject(in SMESH_IDSource theObject)
350 raises (SALOME::SALOME_Exception);
352 void RenumberNodes();
354 void RenumberElements();
357 * \brief Genarate dim+1 elements by rotation of given elements around axis
358 * \param IDsOfElements - elements to ratate
359 * \param Axix - rotation axis
360 * \param AngleInRadians - rotation angle
361 * \param NbOfSteps - number of elements to generate from one element
363 void RotationSweep(in long_array IDsOfElements,
365 in double AngleInRadians,
367 in double Tolerance);
369 * \brief Same as previous but additionally create groups of elements
370 * generated from elements belonging to preexisting groups
372 ListOfGroups RotationSweepMakeGroups(in long_array IDsOfElements,
374 in double AngleInRadians,
376 in double Tolerance);
378 * \brief Genarate dim+1 elements by rotation of the object around axis
379 * \param theObject - object containing elements to ratate
380 * \param Axix - rotation axis
381 * \param AngleInRadians - rotation angle
382 * \param NbOfSteps - number of elements to generate from one element
384 void RotationSweepObject(in SMESH_IDSource theObject,
386 in double AngleInRadians,
388 in double Tolerance);
390 * \brief Same as previous but additionally create groups of elements
391 * generated from elements belonging to preexisting groups
393 ListOfGroups RotationSweepObjectMakeGroups(in SMESH_IDSource theObject,
395 in double AngleInRadians,
397 in double Tolerance);
399 * \brief Genarate dim+1 elements by rotation of the object around axis
400 * \param theObject - object containing elements to ratate
401 * \param Axix - rotation axis
402 * \param AngleInRadians - rotation angle
403 * \param NbOfSteps - number of elements to generate from one element
405 void RotationSweepObject1D(in SMESH_IDSource theObject,
407 in double AngleInRadians,
409 in double Tolerance);
411 * \brief Same as previous but additionally create groups of elements
412 * generated from elements belonging to preexisting groups
414 ListOfGroups RotationSweepObject1DMakeGroups(in SMESH_IDSource theObject,
416 in double AngleInRadians,
418 in double Tolerance);
420 * \brief Genarate dim+1 elements by rotation of the object around axis
421 * \param theObject - object containing elements to ratate
422 * \param Axix - rotation axis
423 * \param AngleInRadians - rotation angle
424 * \param NbOfSteps - number of elements to generate from one element
426 void RotationSweepObject2D(in SMESH_IDSource theObject,
428 in double AngleInRadians,
430 in double Tolerance);
432 * \brief Same as previous but additionally create groups of elements
433 * generated from elements belonging to preexisting groups
435 ListOfGroups RotationSweepObject2DMakeGroups(in SMESH_IDSource theObject,
437 in double AngleInRadians,
439 in double Tolerance);
441 * \brief Genarate dim+1 elements by extrusion of elements along vector
442 * \param IDsOfElements - elements to sweep
443 * \param StepVector - vector giving direction and distance of an extrusion step
444 * \param NbOfSteps - number of elements to generate from one element
446 void ExtrusionSweep(in long_array IDsOfElements,
447 in DirStruct StepVector,
450 * \brief Genarate dim+1 elements by extrusion of elements along vector
451 * \param IDsOfElements - elements to sweep
452 * \param StepVector - vector giving direction and distance of an extrusion step
453 * \param NbOfSteps - number of elements to generate from one element
455 void ExtrusionSweep0D(in long_array IDsOfElements,
456 in DirStruct StepVector,
459 * \brief Same as previous but additionally create groups of elements
460 * generated from elements belonging to preexisting groups
462 ListOfGroups ExtrusionSweepMakeGroups(in long_array IDsOfElements,
463 in DirStruct StepVector,
466 * \brief Same as previous but elements are nodes
468 ListOfGroups ExtrusionSweepMakeGroups0D(in long_array IDsOfElements,
469 in DirStruct StepVector,
472 * Generate new elements by extrusion of theElements
473 * by StepVector by NbOfSteps
474 * param ExtrFlags set flags for performing extrusion
475 * param SewTolerance - uses for comparing locations of nodes if flag
476 * EXTRUSION_FLAG_SEW is set
478 void AdvancedExtrusion(in long_array IDsOfElements,
479 in DirStruct StepVector,
482 in double SewTolerance);
484 * \brief Same as previous but additionally create groups of elements
485 * generated from elements belonging to preexisting groups
487 ListOfGroups AdvancedExtrusionMakeGroups(in long_array IDsOfElements,
488 in DirStruct StepVector,
491 in double SewTolerance);
493 void ExtrusionSweepObject(in SMESH_IDSource theObject,
494 in DirStruct StepVector,
496 ListOfGroups ExtrusionSweepObjectMakeGroups(in SMESH_IDSource theObject,
497 in DirStruct StepVector,
500 void ExtrusionSweepObject0D(in SMESH_IDSource theObject,
501 in DirStruct StepVector,
503 ListOfGroups ExtrusionSweepObject0DMakeGroups(in SMESH_IDSource theObject,
504 in DirStruct StepVector,
507 void ExtrusionSweepObject1D(in SMESH_IDSource theObject,
508 in DirStruct StepVector,
510 ListOfGroups ExtrusionSweepObject1DMakeGroups(in SMESH_IDSource theObject,
511 in DirStruct StepVector,
514 void ExtrusionSweepObject2D(in SMESH_IDSource theObject,
515 in DirStruct StepVector,
517 ListOfGroups ExtrusionSweepObject2DMakeGroups(in SMESH_IDSource theObject,
518 in DirStruct StepVector,
521 enum Extrusion_Error {
526 EXTR_BAD_STARTING_NODE,
527 EXTR_BAD_ANGLES_NUMBER,
528 EXTR_CANT_GET_TANGENT
531 ListOfGroups ExtrusionAlongPathX(in long_array IDsOfElements,
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 ListOfGroups ExtrusionAlongPathObjX(in SMESH_IDSource theObject,
544 in SMESH_IDSource Path,
546 in boolean HasAngles,
547 in double_array Angles,
548 in boolean LinearVariation,
549 in boolean HasRefPoint,
550 in PointStruct RefPoint,
551 in boolean MakeGroups,
552 in ElementType ElemType,
553 out Extrusion_Error Error);
555 Extrusion_Error ExtrusionAlongPath(in long_array IDsOfElements,
556 in SMESH_Mesh PathMesh,
557 in GEOM::GEOM_Object PathShape,
559 in boolean HasAngles,
560 in double_array Angles,
561 in boolean HasRefPoint,
562 in PointStruct RefPoint);
563 ListOfGroups ExtrusionAlongPathMakeGroups(in long_array IDsOfElements,
564 in SMESH_Mesh PathMesh,
565 in GEOM::GEOM_Object PathShape,
567 in boolean HasAngles,
568 in double_array Angles,
569 in boolean HasRefPoint,
570 in PointStruct RefPoint,
571 out Extrusion_Error Error);
573 Extrusion_Error ExtrusionAlongPathObject(in SMESH_IDSource theObject,
574 in SMESH_Mesh PathMesh,
575 in GEOM::GEOM_Object PathShape,
577 in boolean HasAngles,
578 in double_array Angles,
579 in boolean HasRefPoint,
580 in PointStruct RefPoint);
581 ListOfGroups ExtrusionAlongPathObjectMakeGroups(in SMESH_IDSource theObject,
582 in SMESH_Mesh PathMesh,
583 in GEOM::GEOM_Object PathShape,
585 in boolean HasAngles,
586 in double_array Angles,
587 in boolean HasRefPoint,
588 in PointStruct RefPoint,
589 out Extrusion_Error Error);
591 Extrusion_Error ExtrusionAlongPathObject1D(in SMESH_IDSource theObject,
592 in SMESH_Mesh PathMesh,
593 in GEOM::GEOM_Object PathShape,
595 in boolean HasAngles,
596 in double_array Angles,
597 in boolean HasRefPoint,
598 in PointStruct RefPoint);
599 ListOfGroups ExtrusionAlongPathObject1DMakeGroups(in SMESH_IDSource theObject,
600 in SMESH_Mesh PathMesh,
601 in GEOM::GEOM_Object PathShape,
603 in boolean HasAngles,
604 in double_array Angles,
605 in boolean HasRefPoint,
606 in PointStruct RefPoint,
607 out Extrusion_Error Error);
609 Extrusion_Error ExtrusionAlongPathObject2D(in SMESH_IDSource theObject,
610 in SMESH_Mesh PathMesh,
611 in GEOM::GEOM_Object PathShape,
613 in boolean HasAngles,
614 in double_array Angles,
615 in boolean HasRefPoint,
616 in PointStruct RefPoint);
617 ListOfGroups ExtrusionAlongPathObject2DMakeGroups(in SMESH_IDSource theObject,
618 in SMESH_Mesh PathMesh,
619 in GEOM::GEOM_Object PathShape,
621 in boolean HasAngles,
622 in double_array Angles,
623 in boolean HasRefPoint,
624 in PointStruct RefPoint,
625 out Extrusion_Error Error);
628 * Compute rotation angles for ExtrusionAlongPath as linear variation
629 * of given angles along path steps
630 * param PathMesh mesh containing a 1D sub-mesh on the edge, along
631 * which proceeds the extrusion
632 * param PathShape is shape(edge); as the mesh can be complex, the edge
633 * is used to define the sub-mesh for the path
635 double_array LinearAnglesVariation(in SMESH_Mesh PathMesh,
636 in GEOM::GEOM_Object PathShape,
637 in double_array Angles);
639 enum MirrorType { POINT, AXIS, PLANE };
641 void Mirror (in long_array IDsOfElements,
642 in AxisStruct Mirror,
645 ListOfGroups MirrorMakeGroups (in long_array IDsOfElements,
646 in AxisStruct Mirror,
648 SMESH_Mesh MirrorMakeMesh (in long_array IDsOfElements,
649 in AxisStruct Mirror,
651 in boolean CopyGroups,
654 void MirrorObject (in SMESH_IDSource theObject,
655 in AxisStruct Mirror,
658 ListOfGroups MirrorObjectMakeGroups (in SMESH_IDSource theObject,
659 in AxisStruct Mirror,
661 SMESH_Mesh MirrorObjectMakeMesh (in SMESH_IDSource theObject,
662 in AxisStruct Mirror,
664 in boolean CopyGroups,
667 void Translate (in long_array IDsOfElements,
670 ListOfGroups TranslateMakeGroups (in long_array IDsOfElements,
671 in DirStruct Vector);
672 SMESH_Mesh TranslateMakeMesh (in long_array IDsOfElements,
674 in boolean CopyGroups,
677 void TranslateObject (in SMESH_IDSource theObject,
680 ListOfGroups TranslateObjectMakeGroups (in SMESH_IDSource theObject,
681 in DirStruct Vector);
682 SMESH_Mesh TranslateObjectMakeMesh (in SMESH_IDSource theObject,
684 in boolean CopyGroups,
687 void Scale (in SMESH_IDSource theObject,
688 in PointStruct thePoint,
689 in double_array theScaleFact,
691 ListOfGroups ScaleMakeGroups (in SMESH_IDSource theObject,
692 in PointStruct thePoint,
693 in double_array theScaleFact);
694 SMESH_Mesh ScaleMakeMesh (in SMESH_IDSource theObject,
695 in PointStruct thePoint,
696 in double_array theScaleFact,
697 in boolean CopyGroups,
700 void Rotate (in long_array IDsOfElements,
702 in double AngleInRadians,
704 ListOfGroups RotateMakeGroups (in long_array IDsOfElements,
706 in double AngleInRadians);
707 SMESH_Mesh RotateMakeMesh (in long_array IDsOfElements,
709 in double AngleInRadians,
710 in boolean CopyGroups,
713 void RotateObject (in SMESH_IDSource theObject,
715 in double AngleInRadians,
717 ListOfGroups RotateObjectMakeGroups (in SMESH_IDSource theObject,
719 in double AngleInRadians);
720 SMESH_Mesh RotateObjectMakeMesh (in SMESH_IDSource theObject,
722 in double AngleInRadians,
723 in boolean CopyGroups,
726 void FindCoincidentNodes (in double Tolerance,
727 out array_of_long_array GroupsOfNodes);
729 void FindCoincidentNodesOnPart (in SMESH_IDSource SubMeshOrGroup,
731 out array_of_long_array GroupsOfNodes);
733 void FindCoincidentNodesOnPartBut (in SMESH_IDSource SubMeshOrGroup,
735 out array_of_long_array GroupsOfNodes,
736 in ListOfIDSources ExceptSubMeshOrGroups);
738 void MergeNodes (in array_of_long_array GroupsOfNodes);
741 * \brief Find elements built on the same nodes.
742 * \param MeshOrSubMeshOrGroup Mesh or SubMesh, or Group of elements for searching.
743 * \return List of groups of equal elements.
745 void FindEqualElements (in SMESH_IDSource MeshOrSubMeshOrGroup,
746 out array_of_long_array GroupsOfElementsID);
749 * \brief Merge elements in each given group.
750 * \param GroupsOfElementsID Groups of elements for merging.
752 void MergeElements(in array_of_long_array GroupsOfElementsID);
755 * \brief Merge equal elements in the whole mesh.
757 void MergeEqualElements();
760 * If the given ID is a valid node ID (nodeID > 0), just move this node, else
761 * move the node closest to the point to point's location and return ID of the node
763 long MoveClosestNodeToPoint(in double x, in double y, in double z, in long nodeID);
766 * Return ID of node closest to a given point
768 long FindNodeClosestTo(in double x, in double y, in double z);
771 * Return elements of given type where the given point is IN or ON.
773 * 'ALL' type means elements of any type excluding nodes and 0D elements
775 long_array FindElementsByPoint(in double x, in double y, in double z, in ElementType type);
778 * Searching among the given elements, return elements of given type
779 * where the given point is IN or ON.
781 * 'ALL' type means elements of any type excluding nodes and 0D elements
783 long_array FindAmongElementsByPoint(in SMESH_IDSource elements,
784 in double x, in double y, in double z,
785 in ElementType type);
788 * Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
789 * TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
791 short GetPointState(in double x, in double y, in double z);
795 SEW_BORDER1_NOT_FOUND,
796 SEW_BORDER2_NOT_FOUND,
797 SEW_BOTH_BORDERS_NOT_FOUND,
799 SEW_VOLUMES_TO_SPLIT,
800 // for SewSideElements() only:
801 SEW_DIFF_NB_OF_ELEMENTS,
802 SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
807 Sew_Error SewFreeBorders (in long FirstNodeID1,
808 in long SecondNodeID1,
810 in long FirstNodeID2,
811 in long SecondNodeID2,
813 in boolean CreatePolygons,
814 in boolean CreatePolyedrs);
816 Sew_Error SewConformFreeBorders (in long FirstNodeID1,
817 in long SecondNodeID1,
819 in long FirstNodeID2,
820 in long SecondNodeID2);
822 Sew_Error SewBorderToSide (in long FirstNodeIDOnFreeBorder,
823 in long SecondNodeIDOnFreeBorder,
824 in long LastNodeIDOnFreeBorder,
825 in long FirstNodeIDOnSide,
826 in long LastNodeIDOnSide,
827 in boolean CreatePolygons,
828 in boolean CreatePolyedrs);
830 Sew_Error SewSideElements (in long_array IDsOfSide1Elements,
831 in long_array IDsOfSide2Elements,
832 in long NodeID1OfSide1ToMerge,
833 in long NodeID1OfSide2ToMerge,
834 in long NodeID2OfSide1ToMerge,
835 in long NodeID2OfSide2ToMerge);
838 * Set new nodes for given element.
839 * If number of nodes is not corresponded to type of
840 * element - returns false
842 boolean ChangeElemNodes(in long ide, in long_array newIDs);
845 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
846 * \param theNodes - identifiers of nodes to be doubled
847 * \param theModifiedElems - identifiers of elements to be updated by the new (doubled)
848 * nodes. If list of element identifiers is empty then nodes are doubled but
849 * they not assigned to elements
850 * \return TRUE if operation has been completed successfully, FALSE otherwise
851 * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodeGroups()
853 boolean DoubleNodes( in long_array theNodes, in long_array theModifiedElems );
856 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
857 * This method provided for convenience works as DoubleNodes() described above.
858 * \param theNodeId - identifier of node to be doubled.
859 * \param theModifiedElems - identifiers of elements to be updated.
860 * \return TRUE if operation has been completed successfully, FALSE otherwise
861 * \sa DoubleNodes(), DoubleNodeGroup(), DoubleNodeGroups()
863 boolean DoubleNode( in long theNodeId, in long_array theModifiedElems );
866 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
867 * This method provided for convenience works as DoubleNodes() described above.
868 * \param theNodes - group of nodes to be doubled.
869 * \param theModifiedElems - group of elements to be updated.
870 * \return TRUE if operation has been completed successfully, FALSE otherwise
871 * \sa DoubleNode(), DoubleNodes(), DoubleNodeGroups(), DoubleNodeGroupNew()
873 boolean DoubleNodeGroup( in SMESH_GroupBase theNodes,
874 in SMESH_GroupBase theModifiedElems );
876 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
877 * Works as DoubleNodeGroup() described above, but returns a new group with
878 * newly created nodes.
879 * \param theNodes - group of nodes to be doubled.
880 * \param theModifiedElems - group of elements to be updated.
881 * \return a new group with newly created nodes
882 * \sa DoubleNodeGroup()
884 SMESH_Group DoubleNodeGroupNew( in SMESH_GroupBase theNodes,
885 in SMESH_GroupBase theModifiedElems );
888 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
889 * This method provided for convenience works as DoubleNodes() described above.
890 * \param theNodes - list of groups of nodes to be doubled
891 * \param theModifiedElems - list of groups of elements to be updated.
892 * \return TRUE if operation has been completed successfully, FALSE otherwise
893 * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodes()
895 boolean DoubleNodeGroups( in ListOfGroups theNodes,
896 in ListOfGroups theModifiedElems );
898 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
899 * Works as DoubleNodeGroups() described above, but returns a new group with
900 * newly created nodes.
901 * \param theNodes - list of groups of nodes to be doubled
902 * \param theModifiedElems - list of groups of elements to be updated.
903 * \return a new group with newly created nodes
904 * \sa DoubleNodeGroups()
906 SMESH_Group DoubleNodeGroupsNew( in ListOfGroups theNodes,
907 in ListOfGroups theModifiedElems );
910 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
911 * \param theElems - the list of elements (edges or faces) to be replicated
912 * The nodes for duplication could be found from these elements
913 * \param theNodesNot - list of nodes to NOT replicate
914 * \param theAffectedElems - the list of elements (cells and edges) to which the
915 * replicated nodes should be associated to.
916 * \return TRUE if operation has been completed successfully, FALSE otherwise
917 * \sa DoubleNodeGroup(), DoubleNodeGroups()
919 boolean DoubleNodeElem( in long_array theElems,
920 in long_array theNodesNot,
921 in long_array theAffectedElems );
924 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
925 * \param theElems - the list of elements (edges or faces) to be replicated
926 * The nodes for duplication could be found from these elements
927 * \param theNodesNot - list of nodes to NOT replicate
928 * \param theShape - shape to detect affected elements (element which geometric center
929 * located on or inside shape).
930 * The replicated nodes should be associated to affected elements.
931 * \return TRUE if operation has been completed successfully, FALSE otherwise
932 * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
934 boolean DoubleNodeElemInRegion( in long_array theElems,
935 in long_array theNodesNot,
936 in GEOM::GEOM_Object theShape );
939 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
940 * This method provided for convenience works as DoubleNodes() described above.
941 * \param theElems - group of of elements (edges or faces) to be replicated
942 * \param theNodesNot - group of nodes not to replicated
943 * \param theAffectedElems - group of elements to which the replicated nodes
944 * should be associated to.
945 * \return TRUE if operation has been completed successfully, FALSE otherwise
946 * \sa DoubleNodes(), DoubleNodeGroups(), DoubleNodeElemGroupNew()
948 boolean DoubleNodeElemGroup( in SMESH_GroupBase theElems,
949 in SMESH_GroupBase theNodesNot,
950 in SMESH_GroupBase theAffectedElems );
952 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
953 * Works as DoubleNodeElemGroup() described above, but returns a new group with
954 * newly created elements.
955 * \param theElems - group of of elements (edges or faces) to be replicated
956 * \param theNodesNot - group of nodes not to replicated
957 * \param theAffectedElems - group of elements to which the replicated nodes
958 * should be associated to.
959 * \return a new group with newly created elements
960 * \sa DoubleNodeElemGroup()
962 SMESH_Group DoubleNodeElemGroupNew( in SMESH_GroupBase theElems,
963 in SMESH_GroupBase theNodesNot,
964 in SMESH_GroupBase theAffectedElems );
966 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
967 * Works as DoubleNodeElemGroup() described above, but returns two new groups:
968 * a group of newly created elements and a group of newly created nodes
969 * \param theElems - group of of elements (edges or faces) to be replicated
970 * \param theNodesNot - group of nodes not to replicated
971 * \param theAffectedElems - group of elements to which the replicated nodes
972 * should be associated to.
973 * \param theElemGroupNeeded - to create group of new elements or not
974 * \param theNodeGroupNeeded - to create group of new nodes or not
975 * \return two new groups of newly created elements (1st) and nodes (2nd)
976 * \sa DoubleNodeElemGroup()
978 ListOfGroups DoubleNodeElemGroup2New( in SMESH_GroupBase theElems,
979 in SMESH_GroupBase theNodesNot,
980 in SMESH_GroupBase theAffectedElems,
981 in boolean theElemGroupNeeded,
982 in boolean theNodeGroupNeeded);
985 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
986 * This method provided for convenience works as DoubleNodes() described above.
987 * \param theElems - group of elements (edges or faces) to be replicated
988 * \param theNodesNot - group of nodes not to replicated
989 * \param theShape - shape to detect affected elements (element which geometric center
990 * located on or inside shape).
991 * The replicated nodes should be associated to affected elements.
992 * \return TRUE if operation has been completed successfully, FALSE otherwise
993 * \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
995 boolean DoubleNodeElemGroupInRegion( in SMESH_GroupBase theElems,
996 in SMESH_GroupBase theNodesNot,
997 in GEOM::GEOM_Object theShape );
1000 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
1001 * This method provided for convenience works as DoubleNodes() described above.
1002 * \param theElems - list of groups of elements (edges or faces) to be replicated
1003 * \param theNodesNot - list of groups of nodes not to replicated
1004 * \param theAffectedElems - group of elements to which the replicated nodes
1005 * should be associated to.
1006 * \return TRUE if operation has been completed successfully, FALSE otherwise
1007 * \sa DoubleNodeGroup(), DoubleNodes(), DoubleNodeElemGroupsNew()
1009 boolean DoubleNodeElemGroups( in ListOfGroups theElems,
1010 in ListOfGroups theNodesNot,
1011 in ListOfGroups theAffectedElems );
1013 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
1014 * Works as DoubleNodeElemGroups() described above, but returns a new group with
1015 * newly created elements.
1016 * \param theElems - list of groups of elements (edges or faces) to be replicated
1017 * \param theNodesNot - list of groups of nodes not to replicated
1018 * \param theAffectedElems - group of elements to which the replicated nodes
1019 * should be associated to.
1020 * \return a new group with newly created elements
1021 * \sa DoubleNodeElemGroups()
1023 SMESH_Group DoubleNodeElemGroupsNew( in ListOfGroups theElems,
1024 in ListOfGroups theNodesNot,
1025 in ListOfGroups theAffectedElems );
1027 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
1028 * Works as DoubleNodeElemGroups() described above, but returns two new groups:
1029 * a group of newly created elements and a group of newly created nodes.
1030 * \param theElems - list of groups of elements (edges or faces) to be replicated
1031 * \param theNodesNot - list of groups of nodes not to replicated
1032 * \param theAffectedElems - group of elements to which the replicated nodes
1033 * should be associated to.
1034 * \param theElemGroupNeeded - to create group of new elements or not
1035 * \param theNodeGroupNeeded - to create group of new nodes or not
1036 * \return two new groups of newly created elements (1st) and nodes (2nd)
1037 * \sa DoubleNodeElemGroups()
1039 ListOfGroups DoubleNodeElemGroups2New( in ListOfGroups theElems,
1040 in ListOfGroups theNodesNot,
1041 in ListOfGroups theAffectedElems,
1042 in boolean theElemGroupNeeded,
1043 in boolean theNodeGroupNeeded );
1046 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
1047 * This method provided for convenience works as DoubleNodes() described above.
1048 * \param theElems - list of groups of elements (edges or faces) to be replicated
1049 * \param theNodesNot - list of groups of nodes not to replicated
1050 * \param theShape - shape to detect affected elements (element which geometric center
1051 * located on or inside shape).
1052 * The replicated nodes should be associated to affected elements.
1053 * \return TRUE if operation has been completed successfully, FALSE otherwise
1054 * \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
1056 boolean DoubleNodeElemGroupsInRegion( in ListOfGroups theElems,
1057 in ListOfGroups theNodesNot,
1058 in GEOM::GEOM_Object theShape );
1061 * \brief Identify the elements that will be affected by node duplication (actual duplication is not performed).
1062 * This method is the first step of DoubleNodeElemGroupsInRegion.
1063 * \param theElems - list of groups of elements (edges or faces) to be replicated
1064 * \param theNodesNot - list of groups of nodes not to replicated
1065 * \param theShape - shape to detect affected elements (element which geometric center
1066 * located on or inside shape).
1067 * The replicated nodes should be associated to affected elements.
1068 * \return groups of affected elements
1069 * \sa DoubleNodeElemGroupsInRegion()
1071 ListOfGroups AffectedElemGroupsInRegion( in ListOfGroups theElems,
1072 in ListOfGroups theNodesNot,
1073 in GEOM::GEOM_Object theShape );
1076 * \brief Generates skin mesh (containing 2D cells) from 3D mesh
1077 * The created 2D mesh elements based on nodes of free faces of boundary volumes
1078 * \return TRUE if operation has been completed successfully, FALSE otherwise
1080 boolean Make2DMeshFrom3D();
1083 * \brief Creates missing boundary elements
1084 * \param elements - elements whose boundary is to be checked
1085 * \param dimension - defines type of boundary elements to create
1086 * BND_1DFROM3D creates mesh edges on all borders of free facets of 3D elements.
1087 * \param groupName - a name of group to store created boundary elements in,
1088 * "" means not to create the group
1089 * \param meshName - a name of new mesh to store created boundary elements in,
1090 * "" means not to create the new mesh
1091 * \param toCopyElements - if true, the checked elements will be copied into the new mesh
1092 * else only boundary elements will be copied into the new mesh
1093 * \param toCopyExistingBondary - if true, not only new but also pre-existing
1094 * boundary elements will be copied into the new mesh
1095 * \param group - returns the create group, if any
1096 * \retval SMESH::SMESH_Mesh - the mesh where elements were added to
1098 SMESH_Mesh MakeBoundaryMesh(in SMESH_IDSource elements,
1099 in Bnd_Dimension dimension,
1100 in string groupName,
1102 in boolean toCopyElements,
1103 in boolean toCopyExistingBondary,
1104 out SMESH_Group group);
1106 * \brief Creates missing boundary elements around either the whole mesh or
1107 * groups of 2D elements
1108 * \param dimension - defines type of boundary elements to create
1109 * \param groupName - a name of group to store all boundary elements in,
1110 * "" means not to create the group
1111 * \param meshName - a name of a new mesh, which is a copy of the initial
1112 * mesh + created boundary elements; "" means not to create the new mesh
1113 * \param toCopyAll - if true, the whole initial mesh will be copied into
1114 * the new mesh else only boundary elements will be copied into the new mesh
1115 * \param groups - optional groups of 2D elements to make boundary around
1116 * \param mesh - returns the mesh where elements were added to
1117 * \param group - returns the created group, if any
1118 * \retval long - number of added boundary elements
1120 long MakeBoundaryElements(in Bnd_Dimension dimension,
1121 in string groupName,
1123 in boolean toCopyAll,
1124 in ListOfIDSources groups,
1125 out SMESH_Mesh mesh,
1126 out SMESH_Group group) raises (SALOME::SALOME_Exception);
1129 * \brief Double nodes on shared faces between groups of volumes and create flat elements on demand.
1130 * Flat elements are mainly used by some types of mechanic calculations.
1132 * The list of groups must describe a partition of the mesh volumes.
1133 * The nodes of the internal faces at the boundaries of the groups are doubled.
1134 * In option, the internal faces are replaced by flat elements.
1135 * Triangles are transformed in prisms, and quadrangles in hexahedrons.
1136 * \param theDomains - list of groups of volumes
1137 * \param createJointElems - if TRUE, create the elements
1138 * \return TRUE if operation has been completed successfully, FALSE otherwise
1140 boolean DoubleNodesOnGroupBoundaries( in ListOfGroups theDomains,
1141 in boolean createJointElems )
1142 raises (SALOME::SALOME_Exception);
1145 * \brief Double nodes on some external faces and create flat elements.
1146 * Flat elements are mainly used by some types of mechanic calculations.
1148 * Each group of the list must be constituted of faces.
1149 * Triangles are transformed in prisms, and quadrangles in hexahedrons.
1150 * \param theGroupsOfFaces - list of groups of faces
1151 * \return TRUE if operation has been completed successfully, FALSE otherwise
1153 boolean CreateFlatElementsOnFacesGroups( in ListOfGroups theGroupsOfFaces );
1156 * \brief identify all the elements around a geom shape, get the faces delimiting the hole
1157 * Build groups of volume to remove, groups of faces to replace on the skin of the object,
1158 * groups of faces to remove insidethe object, (idem edges).
1159 * Build ordered list of nodes at the border of each group of faces to replace (to be used to build a geom subshape)
1161 void CreateHoleSkin(in double radius,
1162 in GEOM::GEOM_Object theShape,
1163 in string groupName,
1164 in double_array theNodesCoords,
1165 out array_of_long_array GroupsOfNodes) raises (SALOME::SALOME_Exception);