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"
31 enum Bnd_Dimension { BND_2DFROM3D, BND_1DFROM3D, BND_1DFROM2D };
34 * This interface makes modifications on the Mesh - removing elements and nodes etc.
36 interface NumericalFunctor;
37 interface SMESH_MeshEditor
40 * \brief Wrap a sequence of ids in a SMESH_IDSource
41 * \param IDsOfElements list of mesh elements identifiers
42 * \return new ID source object
44 SMESH_IDSource MakeIDSource(in long_array IDsOfElements, in ElementType type);
47 * \brief Remove mesh elements specified by their identifiers.
48 * \param IDsOfElements list of mesh elements identifiers
49 * \return \c true if elements are correctly removed or \c false otherwise
51 boolean RemoveElements(in long_array IDsOfElements);
54 * \brief Remove mesh nodes specified by their identifiers.
55 * \param IDsOfNodes list of mesh nodes identifiers
56 * \return \c true if nodes are correctly removed or \c false otherwise
58 boolean RemoveNodes(in long_array IDsOfNodes);
61 * \brief Remove all orphan nodes.
62 * \return number of removed nodes
64 long RemoveOrphanNodes();
67 * \brief Add a new node.
68 * \param x X coordinate of new node
69 * \param y Y coordinate of new node
70 * \param z Z coordinate of new node
71 * \return integer identifier of new node
73 long AddNode(in double x, in double y, in double z);
76 * Create a 0D element on the given node.
77 * \param IdOfNode Node IDs for creation of element.
79 long Add0DElement(in long IDOfNode);
82 * Create a ball element on the given node.
83 * \param IdOfNode Node IDs for creation of element.
85 long AddBall(in long IDOfNode, in double diameter);
88 * Create an edge, either linear and quadratic (this is determed
89 * by number of given nodes, two or three).
90 * \param IdsOfNodes List of node IDs for creation of element.
91 * Needed order of nodes in this list corresponds to description
92 * of MED. This description is located by the following link:
93 * http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
95 long AddEdge(in long_array IDsOfNodes);
98 * Create face, either linear and quadratic (this is determed
99 * by number of given nodes).
100 * \param IdsOfNodes List of node IDs for creation of element.
101 * Needed order of nodes in this list corresponds to description
102 * of MED. This description is located by the following link:
103 * http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
105 long AddFace(in long_array IDsOfNodes);
107 long AddPolygonalFace(in long_array IdsOfNodes);
110 * Create volume, either linear and quadratic (this is determed
111 * by number of given nodes).
112 * \param IdsOfNodes List of node IDs for creation of element.
113 * Needed order of nodes in this list corresponds to description
114 * of MED. This description is located by the following link:
115 * http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
117 long AddVolume(in long_array IDsOfNodes);
120 * Create volume of many faces, giving nodes for each face.
121 * \param IdsOfNodes List of node IDs for volume creation face by face.
122 * \param Quantities List of integer values, Quantities[i]
123 * gives quantity of nodes in face number i.
125 long AddPolyhedralVolume (in long_array IdsOfNodes,
126 in long_array Quantities);
129 * Create volume of many faces, giving IDs of existing faces.
130 * \param IdsOfFaces List of face IDs for volume creation.
131 * \note The created volume will refer only to nodes
132 * of the given faces, not to the faces itself.
134 long AddPolyhedralVolumeByFaces (in long_array IdsOfFaces);
137 * \brief Bind a node to a vertex
138 * \param NodeID - node ID
139 * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
141 void SetNodeOnVertex(in long NodeID, in long VertexID)
142 raises (SALOME::SALOME_Exception);
144 * \brief Store node position on an edge
145 * \param NodeID - node ID
146 * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
147 * \param paramOnEdge - parameter on edge where the node is located
149 void SetNodeOnEdge(in long NodeID, in long EdgeID, in double paramOnEdge)
150 raises (SALOME::SALOME_Exception);
152 * \brief Store node position on a face
153 * \param NodeID - node ID
154 * \param FaceID - face ID available through GEOM_Object.GetSubShapeIndices()[0]
155 * \param u - U parameter on face where the node is located
156 * \param v - V parameter on face where the node is located
158 void SetNodeOnFace(in long NodeID, in long FaceID, in double u, in double v)
159 raises (SALOME::SALOME_Exception);
161 * \brief Bind a node to a solid
162 * \param NodeID - node ID
163 * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
165 void SetNodeInVolume(in long NodeID, in long SolidID)
166 raises (SALOME::SALOME_Exception);
168 * \brief Bind an element to a shape
169 * \param ElementID - element ID
170 * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0]
172 void SetMeshElementOnShape(in long ElementID, in long ShapeID)
173 raises (SALOME::SALOME_Exception);
176 boolean MoveNode(in long NodeID, in double x, in double y, in double z);
178 boolean InverseDiag(in long NodeID1, in long NodeID2);
180 boolean DeleteDiag(in long NodeID1, in long NodeID2);
182 boolean Reorient(in long_array IDsOfElements);
184 boolean ReorientObject(in SMESH_IDSource theObject);
186 * \brief Reorient faces contained in \a the2Dgroup.
187 * \param the2Dgroup - the mesh or its part to reorient
188 * \param theDirection - desired direction of normal of \a theFace
189 * \param theFace - ID of face whose orientation is checked.
190 * It can be < 1 then \a thePoint is used to find a face.
191 * \param thePoint - is used to find a face if \a theFace < 1.
192 * \return number of reoriented elements.
194 long Reorient2D(in SMESH_IDSource the2Dgroup,
195 in DirStruct theDirection,
197 in PointStruct thePoint) raises (SALOME::SALOME_Exception);
200 * \brief Fuse neighbour triangles into quadrangles.
201 * \param theElems The triangles to be fused.
202 * \param theCriterion Is used to choose a neighbour to fuse with.
203 * \param theMaxAngle Is a max angle between element normals at which fusion
204 * is still performed; theMaxAngle is mesured in radians.
205 * \return TRUE in case of success, FALSE otherwise.
207 boolean TriToQuad (in long_array IDsOfElements,
208 in NumericalFunctor Criterion,
212 * \brief Fuse neighbour triangles into quadrangles.
214 * Behaves like the above method, taking list of elements from \a theObject
216 boolean TriToQuadObject (in SMESH_IDSource theObject,
217 in NumericalFunctor Criterion,
221 * \brief Split quadrangles into triangles.
222 * \param theElems The faces to be splitted.
223 * \param theCriterion Is used to choose a diagonal for splitting.
224 * \return TRUE in case of success, FALSE otherwise.
226 boolean QuadToTri (in long_array IDsOfElements,
227 in NumericalFunctor Criterion);
230 * \brief Split quadrangles into triangles.
232 * Behaves like the above method, taking list of elements from \a theObject
234 boolean QuadToTriObject (in SMESH_IDSource theObject,
235 in NumericalFunctor Criterion);
238 * \brief Split quadrangles into triangles.
239 * \param theElems The faces to be splitted.
240 * \param the13Diag Is used to choose a diagonal for splitting.
241 * \return TRUE in case of success, FALSE otherwise.
243 boolean SplitQuad (in long_array IDsOfElements,
247 * \brief Split quadrangles into triangles.
249 * Behaves like the above method, taking list of elements from \a theObject
251 boolean SplitQuadObject (in SMESH_IDSource theObject,
255 * Find better splitting of the given quadrangle.
256 * \param IDOfQuad ID of the quadrangle to be splitted.
257 * \param Criterion A criterion to choose a diagonal for splitting.
258 * \return 1 if 1-3 diagonal is better, 2 if 2-4
259 * diagonal is better, 0 if error occurs.
261 long BestSplit (in long IDOfQuad,
262 in NumericalFunctor Criterion);
265 * \brief Split volumic elements into tetrahedrons
266 * \param elems - elements to split
267 * \param methodFlags - flags passing splitting method:
268 * 1 - split the hexahedron into 5 tetrahedrons
269 * 2 - split the hexahedron into 6 tetrahedrons
270 * 3 - split the hexahedron into 24 tetrahedrons
272 void SplitVolumesIntoTetra(in SMESH_IDSource elems, in short methodFlags)
273 raises (SALOME::SALOME_Exception);
276 enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH };
278 boolean Smooth(in long_array IDsOfElements,
279 in long_array IDsOfFixedNodes,
280 in long MaxNbOfIterations,
281 in double MaxAspectRatio,
282 in Smooth_Method Method);
284 boolean SmoothObject(in SMESH_IDSource theObject,
285 in long_array IDsOfFixedNodes,
286 in long MaxNbOfIterations,
287 in double MaxAspectRatio,
288 in Smooth_Method Method);
290 boolean SmoothParametric(in long_array IDsOfElements,
291 in long_array IDsOfFixedNodes,
292 in long MaxNbOfIterations,
293 in double MaxAspectRatio,
294 in Smooth_Method Method);
296 boolean SmoothParametricObject(in SMESH_IDSource theObject,
297 in long_array IDsOfFixedNodes,
298 in long MaxNbOfIterations,
299 in double MaxAspectRatio,
300 in Smooth_Method Method);
302 void ConvertToQuadratic(in boolean theForce3d);
304 boolean ConvertFromQuadratic();
306 void ConvertToQuadraticObject(in boolean theForce3d,
307 in SMESH_IDSource theObject)
308 raises (SALOME::SALOME_Exception);
310 void ConvertFromQuadraticObject(in SMESH_IDSource theObject)
311 raises (SALOME::SALOME_Exception);
313 void RenumberNodes();
315 void RenumberElements();
318 * \brief Genarate dim+1 elements by rotation of given elements around axis
319 * \param IDsOfElements - elements to ratate
320 * \param Axix - rotation axis
321 * \param AngleInRadians - rotation angle
322 * \param NbOfSteps - number of elements to generate from one element
324 void RotationSweep(in long_array IDsOfElements,
326 in double AngleInRadians,
328 in double Tolerance);
330 * \brief Same as previous but additionally create groups of elements
331 * generated from elements belonging to preexisting groups
333 ListOfGroups RotationSweepMakeGroups(in long_array IDsOfElements,
335 in double AngleInRadians,
337 in double Tolerance);
339 * \brief Genarate dim+1 elements by rotation of the object around axis
340 * \param theObject - object containing elements to ratate
341 * \param Axix - rotation axis
342 * \param AngleInRadians - rotation angle
343 * \param NbOfSteps - number of elements to generate from one element
345 void RotationSweepObject(in SMESH_IDSource theObject,
347 in double AngleInRadians,
349 in double Tolerance);
351 * \brief Same as previous but additionally create groups of elements
352 * generated from elements belonging to preexisting groups
354 ListOfGroups RotationSweepObjectMakeGroups(in SMESH_IDSource theObject,
356 in double AngleInRadians,
358 in double Tolerance);
360 * \brief Genarate dim+1 elements by rotation of the object around axis
361 * \param theObject - object containing elements to ratate
362 * \param Axix - rotation axis
363 * \param AngleInRadians - rotation angle
364 * \param NbOfSteps - number of elements to generate from one element
366 void RotationSweepObject1D(in SMESH_IDSource theObject,
368 in double AngleInRadians,
370 in double Tolerance);
372 * \brief Same as previous but additionally create groups of elements
373 * generated from elements belonging to preexisting groups
375 ListOfGroups RotationSweepObject1DMakeGroups(in SMESH_IDSource theObject,
377 in double AngleInRadians,
379 in double Tolerance);
381 * \brief Genarate dim+1 elements by rotation of the object around axis
382 * \param theObject - object containing elements to ratate
383 * \param Axix - rotation axis
384 * \param AngleInRadians - rotation angle
385 * \param NbOfSteps - number of elements to generate from one element
387 void RotationSweepObject2D(in SMESH_IDSource theObject,
389 in double AngleInRadians,
391 in double Tolerance);
393 * \brief Same as previous but additionally create groups of elements
394 * generated from elements belonging to preexisting groups
396 ListOfGroups RotationSweepObject2DMakeGroups(in SMESH_IDSource theObject,
398 in double AngleInRadians,
400 in double Tolerance);
402 * \brief Genarate dim+1 elements by extrusion of elements along vector
403 * \param IDsOfElements - elements to sweep
404 * \param StepVector - vector giving direction and distance of an extrusion step
405 * \param NbOfSteps - number of elements to generate from one element
407 void ExtrusionSweep(in long_array IDsOfElements,
408 in DirStruct StepVector,
411 * \brief Genarate dim+1 elements by extrusion of elements along vector
412 * \param IDsOfElements - elements to sweep
413 * \param StepVector - vector giving direction and distance of an extrusion step
414 * \param NbOfSteps - number of elements to generate from one element
416 void ExtrusionSweep0D(in long_array IDsOfElements,
417 in DirStruct StepVector,
420 * \brief Same as previous but additionally create groups of elements
421 * generated from elements belonging to preexisting groups
423 ListOfGroups ExtrusionSweepMakeGroups(in long_array IDsOfElements,
424 in DirStruct StepVector,
427 * \brief Same as previous but elements are nodes
429 ListOfGroups ExtrusionSweepMakeGroups0D(in long_array IDsOfElements,
430 in DirStruct StepVector,
433 * Generate new elements by extrusion of theElements
434 * by StepVector by NbOfSteps
435 * param ExtrFlags set flags for performing extrusion
436 * param SewTolerance - uses for comparing locations of nodes if flag
437 * EXTRUSION_FLAG_SEW is set
439 void AdvancedExtrusion(in long_array IDsOfElements,
440 in DirStruct StepVector,
443 in double SewTolerance);
445 * \brief Same as previous but additionally create groups of elements
446 * generated from elements belonging to preexisting groups
448 ListOfGroups AdvancedExtrusionMakeGroups(in long_array IDsOfElements,
449 in DirStruct StepVector,
452 in double SewTolerance);
454 void ExtrusionSweepObject(in SMESH_IDSource theObject,
455 in DirStruct StepVector,
457 ListOfGroups ExtrusionSweepObjectMakeGroups(in SMESH_IDSource theObject,
458 in DirStruct StepVector,
461 void ExtrusionSweepObject0D(in SMESH_IDSource theObject,
462 in DirStruct StepVector,
464 ListOfGroups ExtrusionSweepObject0DMakeGroups(in SMESH_IDSource theObject,
465 in DirStruct StepVector,
468 void ExtrusionSweepObject1D(in SMESH_IDSource theObject,
469 in DirStruct StepVector,
471 ListOfGroups ExtrusionSweepObject1DMakeGroups(in SMESH_IDSource theObject,
472 in DirStruct StepVector,
475 void ExtrusionSweepObject2D(in SMESH_IDSource theObject,
476 in DirStruct StepVector,
478 ListOfGroups ExtrusionSweepObject2DMakeGroups(in SMESH_IDSource theObject,
479 in DirStruct StepVector,
482 enum Extrusion_Error {
487 EXTR_BAD_STARTING_NODE,
488 EXTR_BAD_ANGLES_NUMBER,
489 EXTR_CANT_GET_TANGENT
492 ListOfGroups ExtrusionAlongPathX(in long_array IDsOfElements,
493 in SMESH_IDSource Path,
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 in ElementType ElemType,
502 out Extrusion_Error Error);
504 ListOfGroups ExtrusionAlongPathObjX(in SMESH_IDSource theObject,
505 in SMESH_IDSource Path,
507 in boolean HasAngles,
508 in double_array Angles,
509 in boolean LinearVariation,
510 in boolean HasRefPoint,
511 in PointStruct RefPoint,
512 in boolean MakeGroups,
513 in ElementType ElemType,
514 out Extrusion_Error Error);
516 Extrusion_Error ExtrusionAlongPath(in long_array IDsOfElements,
517 in SMESH_Mesh PathMesh,
518 in GEOM::GEOM_Object PathShape,
520 in boolean HasAngles,
521 in double_array Angles,
522 in boolean HasRefPoint,
523 in PointStruct RefPoint);
524 ListOfGroups ExtrusionAlongPathMakeGroups(in long_array IDsOfElements,
525 in SMESH_Mesh PathMesh,
526 in GEOM::GEOM_Object PathShape,
528 in boolean HasAngles,
529 in double_array Angles,
530 in boolean HasRefPoint,
531 in PointStruct RefPoint,
532 out Extrusion_Error Error);
534 Extrusion_Error ExtrusionAlongPathObject(in SMESH_IDSource theObject,
535 in SMESH_Mesh PathMesh,
536 in GEOM::GEOM_Object PathShape,
538 in boolean HasAngles,
539 in double_array Angles,
540 in boolean HasRefPoint,
541 in PointStruct RefPoint);
542 ListOfGroups ExtrusionAlongPathObjectMakeGroups(in SMESH_IDSource theObject,
543 in SMESH_Mesh PathMesh,
544 in GEOM::GEOM_Object PathShape,
546 in boolean HasAngles,
547 in double_array Angles,
548 in boolean HasRefPoint,
549 in PointStruct RefPoint,
550 out Extrusion_Error Error);
552 Extrusion_Error ExtrusionAlongPathObject1D(in SMESH_IDSource theObject,
553 in SMESH_Mesh PathMesh,
554 in GEOM::GEOM_Object PathShape,
556 in boolean HasAngles,
557 in double_array Angles,
558 in boolean HasRefPoint,
559 in PointStruct RefPoint);
560 ListOfGroups ExtrusionAlongPathObject1DMakeGroups(in SMESH_IDSource theObject,
561 in SMESH_Mesh PathMesh,
562 in GEOM::GEOM_Object PathShape,
564 in boolean HasAngles,
565 in double_array Angles,
566 in boolean HasRefPoint,
567 in PointStruct RefPoint,
568 out Extrusion_Error Error);
570 Extrusion_Error ExtrusionAlongPathObject2D(in SMESH_IDSource theObject,
571 in SMESH_Mesh PathMesh,
572 in GEOM::GEOM_Object PathShape,
574 in boolean HasAngles,
575 in double_array Angles,
576 in boolean HasRefPoint,
577 in PointStruct RefPoint);
578 ListOfGroups ExtrusionAlongPathObject2DMakeGroups(in SMESH_IDSource theObject,
579 in SMESH_Mesh PathMesh,
580 in GEOM::GEOM_Object PathShape,
582 in boolean HasAngles,
583 in double_array Angles,
584 in boolean HasRefPoint,
585 in PointStruct RefPoint,
586 out Extrusion_Error Error);
589 * Compute rotation angles for ExtrusionAlongPath as linear variation
590 * of given angles along path steps
591 * param PathMesh mesh containing a 1D sub-mesh on the edge, along
592 * which proceeds the extrusion
593 * param PathShape is shape(edge); as the mesh can be complex, the edge
594 * is used to define the sub-mesh for the path
596 double_array LinearAnglesVariation(in SMESH_Mesh PathMesh,
597 in GEOM::GEOM_Object PathShape,
598 in double_array Angles);
600 enum MirrorType { POINT, AXIS, PLANE };
602 void Mirror (in long_array IDsOfElements,
603 in AxisStruct Mirror,
606 ListOfGroups MirrorMakeGroups (in long_array IDsOfElements,
607 in AxisStruct Mirror,
609 SMESH_Mesh MirrorMakeMesh (in long_array IDsOfElements,
610 in AxisStruct Mirror,
612 in boolean CopyGroups,
615 void MirrorObject (in SMESH_IDSource theObject,
616 in AxisStruct Mirror,
619 ListOfGroups MirrorObjectMakeGroups (in SMESH_IDSource theObject,
620 in AxisStruct Mirror,
622 SMESH_Mesh MirrorObjectMakeMesh (in SMESH_IDSource theObject,
623 in AxisStruct Mirror,
625 in boolean CopyGroups,
628 void Translate (in long_array IDsOfElements,
631 ListOfGroups TranslateMakeGroups (in long_array IDsOfElements,
632 in DirStruct Vector);
633 SMESH_Mesh TranslateMakeMesh (in long_array IDsOfElements,
635 in boolean CopyGroups,
638 void TranslateObject (in SMESH_IDSource theObject,
641 ListOfGroups TranslateObjectMakeGroups (in SMESH_IDSource theObject,
642 in DirStruct Vector);
643 SMESH_Mesh TranslateObjectMakeMesh (in SMESH_IDSource theObject,
645 in boolean CopyGroups,
648 void Scale (in SMESH_IDSource theObject,
649 in PointStruct thePoint,
650 in double_array theScaleFact,
652 ListOfGroups ScaleMakeGroups (in SMESH_IDSource theObject,
653 in PointStruct thePoint,
654 in double_array theScaleFact);
655 SMESH_Mesh ScaleMakeMesh (in SMESH_IDSource theObject,
656 in PointStruct thePoint,
657 in double_array theScaleFact,
658 in boolean CopyGroups,
661 void Rotate (in long_array IDsOfElements,
663 in double AngleInRadians,
665 ListOfGroups RotateMakeGroups (in long_array IDsOfElements,
667 in double AngleInRadians);
668 SMESH_Mesh RotateMakeMesh (in long_array IDsOfElements,
670 in double AngleInRadians,
671 in boolean CopyGroups,
674 void RotateObject (in SMESH_IDSource theObject,
676 in double AngleInRadians,
678 ListOfGroups RotateObjectMakeGroups (in SMESH_IDSource theObject,
680 in double AngleInRadians);
681 SMESH_Mesh RotateObjectMakeMesh (in SMESH_IDSource theObject,
683 in double AngleInRadians,
684 in boolean CopyGroups,
687 void FindCoincidentNodes (in double Tolerance,
688 out array_of_long_array GroupsOfNodes);
690 void FindCoincidentNodesOnPart (in SMESH_IDSource SubMeshOrGroup,
692 out array_of_long_array GroupsOfNodes);
694 void FindCoincidentNodesOnPartBut (in SMESH_IDSource SubMeshOrGroup,
696 out array_of_long_array GroupsOfNodes,
697 in ListOfIDSources ExceptSubMeshOrGroups);
699 void MergeNodes (in array_of_long_array GroupsOfNodes);
702 * \brief Find elements built on the same nodes.
703 * \param MeshOrSubMeshOrGroup Mesh or SubMesh, or Group of elements for searching.
704 * \return List of groups of equal elements.
706 void FindEqualElements (in SMESH_IDSource MeshOrSubMeshOrGroup,
707 out array_of_long_array GroupsOfElementsID);
710 * \brief Merge elements in each given group.
711 * \param GroupsOfElementsID Groups of elements for merging.
713 void MergeElements(in array_of_long_array GroupsOfElementsID);
716 * \brief Merge equal elements in the whole mesh.
718 void MergeEqualElements();
721 * If the given ID is a valid node ID (nodeID > 0), just move this node, else
722 * move the node closest to the point to point's location and return ID of the node
724 long MoveClosestNodeToPoint(in double x, in double y, in double z, in long nodeID);
727 * Return ID of node closest to a given point
729 long FindNodeClosestTo(in double x, in double y, in double z);
732 * Return elements of given type where the given point is IN or ON.
734 * 'ALL' type means elements of any type excluding nodes and 0D elements
736 long_array FindElementsByPoint(in double x, in double y, in double z, in ElementType type);
739 * Searching among the given elements, return elements of given type
740 * where the given point is IN or ON.
742 * 'ALL' type means elements of any type excluding nodes and 0D elements
744 long_array FindAmongElementsByPoint(in SMESH_IDSource elements,
745 in double x, in double y, in double z,
746 in ElementType type);
749 * Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
750 * TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
752 short GetPointState(in double x, in double y, in double z);
756 SEW_BORDER1_NOT_FOUND,
757 SEW_BORDER2_NOT_FOUND,
758 SEW_BOTH_BORDERS_NOT_FOUND,
760 SEW_VOLUMES_TO_SPLIT,
761 // for SewSideElements() only:
762 SEW_DIFF_NB_OF_ELEMENTS,
763 SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
768 Sew_Error SewFreeBorders (in long FirstNodeID1,
769 in long SecondNodeID1,
771 in long FirstNodeID2,
772 in long SecondNodeID2,
774 in boolean CreatePolygons,
775 in boolean CreatePolyedrs);
777 Sew_Error SewConformFreeBorders (in long FirstNodeID1,
778 in long SecondNodeID1,
780 in long FirstNodeID2,
781 in long SecondNodeID2);
783 Sew_Error SewBorderToSide (in long FirstNodeIDOnFreeBorder,
784 in long SecondNodeIDOnFreeBorder,
785 in long LastNodeIDOnFreeBorder,
786 in long FirstNodeIDOnSide,
787 in long LastNodeIDOnSide,
788 in boolean CreatePolygons,
789 in boolean CreatePolyedrs);
791 Sew_Error SewSideElements (in long_array IDsOfSide1Elements,
792 in long_array IDsOfSide2Elements,
793 in long NodeID1OfSide1ToMerge,
794 in long NodeID1OfSide2ToMerge,
795 in long NodeID2OfSide1ToMerge,
796 in long NodeID2OfSide2ToMerge);
799 * Set new nodes for given element.
800 * If number of nodes is not corresponded to type of
801 * element - returns false
803 boolean ChangeElemNodes(in long ide, in long_array newIDs);
806 * Return data of mesh edition preview which is computed provided
807 * that the editor was obtained trough SMESH_Mesh::GetMeshEditPreviewer()
809 MeshPreviewStruct GetPreviewData();
812 * If during last operation of MeshEditor some nodes were
813 * created this method returns list of it's IDs, if new nodes
814 * not creared - returns empty list
816 long_array GetLastCreatedNodes();
819 * If during last operation of MeshEditor some elements were
820 * created this method returns list of it's IDs, if new elements
821 * not creared - returns empty list
823 long_array GetLastCreatedElems();
826 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
827 * \param theNodes - identifiers of nodes to be doubled
828 * \param theModifiedElems - identifiers of elements to be updated by the new (doubled)
829 * nodes. If list of element identifiers is empty then nodes are doubled but
830 * they not assigned to elements
831 * \return TRUE if operation has been completed successfully, FALSE otherwise
832 * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodeGroups()
834 boolean DoubleNodes( in long_array theNodes, in long_array theModifiedElems );
837 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
838 * This method provided for convenience works as DoubleNodes() described above.
839 * \param theNodeId - identifier of node to be doubled.
840 * \param theModifiedElems - identifiers of elements to be updated.
841 * \return TRUE if operation has been completed successfully, FALSE otherwise
842 * \sa DoubleNodes(), DoubleNodeGroup(), DoubleNodeGroups()
844 boolean DoubleNode( in long theNodeId, in long_array theModifiedElems );
847 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
848 * This method provided for convenience works as DoubleNodes() described above.
849 * \param theNodes - group of nodes to be doubled.
850 * \param theModifiedElems - group of elements to be updated.
851 * \return TRUE if operation has been completed successfully, FALSE otherwise
852 * \sa DoubleNode(), DoubleNodes(), DoubleNodeGroups(), DoubleNodeGroupNew()
854 boolean DoubleNodeGroup( in SMESH_GroupBase theNodes,
855 in SMESH_GroupBase theModifiedElems );
857 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
858 * Works as DoubleNodeGroup() described above, but returns a new group with
859 * newly created nodes.
860 * \param theNodes - group of nodes to be doubled.
861 * \param theModifiedElems - group of elements to be updated.
862 * \return a new group with newly created nodes
863 * \sa DoubleNodeGroup()
865 SMESH_Group DoubleNodeGroupNew( in SMESH_GroupBase theNodes,
866 in SMESH_GroupBase theModifiedElems );
869 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
870 * This method provided for convenience works as DoubleNodes() described above.
871 * \param theNodes - list of groups of nodes to be doubled
872 * \param theModifiedElems - list of groups of elements to be updated.
873 * \return TRUE if operation has been completed successfully, FALSE otherwise
874 * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodes()
876 boolean DoubleNodeGroups( in ListOfGroups theNodes,
877 in ListOfGroups theModifiedElems );
879 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
880 * Works as DoubleNodeGroups() described above, but returns a new group with
881 * newly created nodes.
882 * \param theNodes - list of groups of nodes to be doubled
883 * \param theModifiedElems - list of groups of elements to be updated.
884 * \return a new group with newly created nodes
885 * \sa DoubleNodeGroups()
887 SMESH_Group DoubleNodeGroupsNew( in ListOfGroups theNodes,
888 in ListOfGroups theModifiedElems );
891 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
892 * \param theElems - the list of elements (edges or faces) to be replicated
893 * The nodes for duplication could be found from these elements
894 * \param theNodesNot - list of nodes to NOT replicate
895 * \param theAffectedElems - the list of elements (cells and edges) to which the
896 * replicated nodes should be associated to.
897 * \return TRUE if operation has been completed successfully, FALSE otherwise
898 * \sa DoubleNodeGroup(), DoubleNodeGroups()
900 boolean DoubleNodeElem( in long_array theElems,
901 in long_array theNodesNot,
902 in long_array theAffectedElems );
905 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
906 * \param theElems - the list of elements (edges or faces) to be replicated
907 * The nodes for duplication could be found from these elements
908 * \param theNodesNot - list of nodes to NOT replicate
909 * \param theShape - shape to detect affected elements (element which geometric center
910 * located on or inside shape).
911 * The replicated nodes should be associated to affected elements.
912 * \return TRUE if operation has been completed successfully, FALSE otherwise
913 * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
915 boolean DoubleNodeElemInRegion( in long_array theElems,
916 in long_array theNodesNot,
917 in GEOM::GEOM_Object theShape );
920 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
921 * This method provided for convenience works as DoubleNodes() described above.
922 * \param theElems - group of of elements (edges or faces) to be replicated
923 * \param theNodesNot - group of nodes not to replicated
924 * \param theAffectedElems - group of elements to which the replicated nodes
925 * should be associated to.
926 * \return TRUE if operation has been completed successfully, FALSE otherwise
927 * \sa DoubleNodes(), DoubleNodeGroups(), DoubleNodeElemGroupNew()
929 boolean DoubleNodeElemGroup( in SMESH_GroupBase theElems,
930 in SMESH_GroupBase theNodesNot,
931 in SMESH_GroupBase theAffectedElems );
933 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
934 * Works as DoubleNodeElemGroup() described above, but returns a new group with
935 * newly created elements.
936 * \param theElems - group of of elements (edges or faces) to be replicated
937 * \param theNodesNot - group of nodes not to replicated
938 * \param theAffectedElems - group of elements to which the replicated nodes
939 * should be associated to.
940 * \return a new group with newly created elements
941 * \sa DoubleNodeElemGroup()
943 SMESH_Group DoubleNodeElemGroupNew( in SMESH_GroupBase theElems,
944 in SMESH_GroupBase theNodesNot,
945 in SMESH_GroupBase theAffectedElems );
947 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
948 * Works as DoubleNodeElemGroup() described above, but returns two new groups:
949 * a group of newly created elements and a group of newly created nodes
950 * \param theElems - group of of elements (edges or faces) to be replicated
951 * \param theNodesNot - group of nodes not to replicated
952 * \param theAffectedElems - group of elements to which the replicated nodes
953 * should be associated to.
954 * \param theElemGroupNeeded - to create group of new elements or not
955 * \param theNodeGroupNeeded - to create group of new nodes or not
956 * \return two new groups of newly created elements (1st) and nodes (2nd)
957 * \sa DoubleNodeElemGroup()
959 ListOfGroups DoubleNodeElemGroup2New( in SMESH_GroupBase theElems,
960 in SMESH_GroupBase theNodesNot,
961 in SMESH_GroupBase theAffectedElems,
962 in boolean theElemGroupNeeded,
963 in boolean theNodeGroupNeeded);
966 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
967 * This method provided for convenience works as DoubleNodes() described above.
968 * \param theElems - group of elements (edges or faces) to be replicated
969 * \param theNodesNot - group of nodes not to replicated
970 * \param theShape - shape to detect affected elements (element which geometric center
971 * located on or inside shape).
972 * The replicated nodes should be associated to affected elements.
973 * \return TRUE if operation has been completed successfully, FALSE otherwise
974 * \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
976 boolean DoubleNodeElemGroupInRegion( in SMESH_GroupBase theElems,
977 in SMESH_GroupBase theNodesNot,
978 in GEOM::GEOM_Object theShape );
981 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
982 * This method provided for convenience works as DoubleNodes() described above.
983 * \param theElems - list of groups of elements (edges or faces) to be replicated
984 * \param theNodesNot - list of groups of nodes not to replicated
985 * \param theAffectedElems - group of elements to which the replicated nodes
986 * should be associated to.
987 * \return TRUE if operation has been completed successfully, FALSE otherwise
988 * \sa DoubleNodeGroup(), DoubleNodes(), DoubleNodeElemGroupsNew()
990 boolean DoubleNodeElemGroups( in ListOfGroups theElems,
991 in ListOfGroups theNodesNot,
992 in ListOfGroups theAffectedElems );
994 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
995 * Works as DoubleNodeElemGroups() described above, but returns a new group with
996 * newly created elements.
997 * \param theElems - list of groups of elements (edges or faces) to be replicated
998 * \param theNodesNot - list of groups of nodes not to replicated
999 * \param theAffectedElems - group of elements to which the replicated nodes
1000 * should be associated to.
1001 * \return a new group with newly created elements
1002 * \sa DoubleNodeElemGroups()
1004 SMESH_Group DoubleNodeElemGroupsNew( in ListOfGroups theElems,
1005 in ListOfGroups theNodesNot,
1006 in ListOfGroups theAffectedElems );
1008 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
1009 * Works as DoubleNodeElemGroups() described above, but returns two new groups:
1010 * a group of newly created elements and a group of newly created nodes.
1011 * \param theElems - list of groups of elements (edges or faces) to be replicated
1012 * \param theNodesNot - list of groups of nodes not to replicated
1013 * \param theAffectedElems - group of elements to which the replicated nodes
1014 * should be associated to.
1015 * \param theElemGroupNeeded - to create group of new elements or not
1016 * \param theNodeGroupNeeded - to create group of new nodes or not
1017 * \return two new groups of newly created elements (1st) and nodes (2nd)
1018 * \sa DoubleNodeElemGroups()
1020 ListOfGroups DoubleNodeElemGroups2New( in ListOfGroups theElems,
1021 in ListOfGroups theNodesNot,
1022 in ListOfGroups theAffectedElems,
1023 in boolean theElemGroupNeeded,
1024 in boolean theNodeGroupNeeded );
1027 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
1028 * This method provided for convenience works as DoubleNodes() described above.
1029 * \param theElems - list of groups of elements (edges or faces) to be replicated
1030 * \param theNodesNot - list of groups of nodes not to replicated
1031 * \param theShape - shape to detect affected elements (element which geometric center
1032 * located on or inside shape).
1033 * The replicated nodes should be associated to affected elements.
1034 * \return TRUE if operation has been completed successfully, FALSE otherwise
1035 * \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
1037 boolean DoubleNodeElemGroupsInRegion( in ListOfGroups theElems,
1038 in ListOfGroups theNodesNot,
1039 in GEOM::GEOM_Object theShape );
1042 * \brief Identify the elements that will be affected by node duplication (actual duplication is not performed).
1043 * This method is the first step of DoubleNodeElemGroupsInRegion.
1044 * \param theElems - list of groups of elements (edges or faces) to be replicated
1045 * \param theNodesNot - list of groups of nodes not to replicated
1046 * \param theShape - shape to detect affected elements (element which geometric center
1047 * located on or inside shape).
1048 * The replicated nodes should be associated to affected elements.
1049 * \return groups of affected elements
1050 * \sa DoubleNodeElemGroupsInRegion()
1052 ListOfGroups AffectedElemGroupsInRegion( in ListOfGroups theElems,
1053 in ListOfGroups theNodesNot,
1054 in GEOM::GEOM_Object theShape );
1057 * \brief Generates skin mesh (containing 2D cells) from 3D mesh
1058 * The created 2D mesh elements based on nodes of free faces of boundary volumes
1059 * \return TRUE if operation has been completed successfully, FALSE otherwise
1061 boolean Make2DMeshFrom3D();
1064 * \brief Creates missing boundary elements
1065 * \param elements - elements whose boundary is to be checked
1066 * \param dimension - defines type of boundary elements to create
1067 * BND_1DFROM3D creates mesh edges on all borders of free facets of 3D elements.
1068 * \param groupName - a name of group to store created boundary elements in,
1069 * "" means not to create the group
1070 * \param meshName - a name of new mesh to store created boundary elements in,
1071 * "" means not to create the new mesh
1072 * \param toCopyElements - if true, the checked elements will be copied into the new mesh
1073 * else only boundary elements will be copied into the new mesh
1074 * \param toCopyExistingBondary - if true, not only new but also pre-existing
1075 * boundary elements will be copied into the new mesh
1076 * \param group - returns the create group, if any
1077 * \retval SMESH::SMESH_Mesh - the mesh where elements were added to
1079 SMESH_Mesh MakeBoundaryMesh(in SMESH_IDSource elements,
1080 in Bnd_Dimension dimension,
1081 in string groupName,
1083 in boolean toCopyElements,
1084 in boolean toCopyExistingBondary,
1085 out SMESH_Group group);
1087 * \brief Creates missing boundary elements around either the whole mesh or
1088 * groups of 2D elements
1089 * \param dimension - defines type of boundary elements to create
1090 * \param groupName - a name of group to store all boundary elements in,
1091 * "" means not to create the group
1092 * \param meshName - a name of a new mesh, which is a copy of the initial
1093 * mesh + created boundary elements; "" means not to create the new mesh
1094 * \param toCopyAll - if true, the whole initial mesh will be copied into
1095 * the new mesh else only boundary elements will be copied into the new mesh
1096 * \param groups - optional groups of 2D elements to make boundary around
1097 * \param mesh - returns the mesh where elements were added to
1098 * \param group - returns the created group, if any
1099 * \retval long - number of added boundary elements
1101 long MakeBoundaryElements(in Bnd_Dimension dimension,
1102 in string groupName,
1104 in boolean toCopyAll,
1105 in ListOfIDSources groups,
1106 out SMESH_Mesh mesh,
1107 out SMESH_Group group) raises (SALOME::SALOME_Exception);
1110 * \brief Double nodes on shared faces between groups of volumes and create flat elements on demand.
1111 * Flat elements are mainly used by some types of mechanic calculations.
1113 * The list of groups must describe a partition of the mesh volumes.
1114 * The nodes of the internal faces at the boundaries of the groups are doubled.
1115 * In option, the internal faces are replaced by flat elements.
1116 * Triangles are transformed in prisms, and quadrangles in hexahedrons.
1117 * \param theDomains - list of groups of volumes
1118 * \param createJointElems - if TRUE, create the elements
1119 * \return TRUE if operation has been completed successfully, FALSE otherwise
1121 boolean DoubleNodesOnGroupBoundaries( in ListOfGroups theDomains,
1122 in boolean createJointElems )
1123 raises (SALOME::SALOME_Exception);
1126 * \brief Double nodes on some external faces and create flat elements.
1127 * Flat elements are mainly used by some types of mechanic calculations.
1129 * Each group of the list must be constituted of faces.
1130 * Triangles are transformed in prisms, and quadrangles in hexahedrons.
1131 * \param theGroupsOfFaces - list of groups of faces
1132 * \return TRUE if operation has been completed successfully, FALSE otherwise
1134 boolean CreateFlatElementsOnFacesGroups( in ListOfGroups theGroupsOfFaces );
1137 * \brief identify all the elements around a geom shape, get the faces delimiting the hole
1138 * Build groups of volume to remove, groups of faces to replace on the skin of the object,
1139 * groups of faces to remove insidethe object, (idem edges).
1140 * Build ordered list of nodes at the border of each group of faces to replace (to be used to build a geom subshape)
1142 void CreateHoleSkin(in double radius,
1143 in GEOM::GEOM_Object theShape,
1144 in string groupName,
1145 in double_array theNodesCoords,
1146 out array_of_long_array GroupsOfNodes) raises (SALOME::SALOME_Exception);