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 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 0D element on the given node.
77 * \param IdOfNode Node IDs for creation of element.
79 long Add0DElement(in long IDOfNode);
82 * Create edge, either linear and quadratic (this is determed
83 * by number of given nodes).
84 * \param IdsOfNodes List of node IDs for creation of element.
85 * Needed order of nodes in this list corresponds to description
86 * of MED. This description is located by the following link:
87 * http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
89 long AddEdge(in long_array IDsOfNodes);
92 * Create face, either linear and quadratic (this is determed
93 * by number of given nodes).
94 * \param IdsOfNodes List of node IDs for creation of element.
95 * Needed order of nodes in this list corresponds to description
96 * of MED. This description is located by the following link:
97 * http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
99 long AddFace(in long_array IDsOfNodes);
101 long AddPolygonalFace(in long_array IdsOfNodes);
104 * Create volume, either linear and quadratic (this is determed
105 * by number of given nodes).
106 * \param IdsOfNodes List of node IDs for creation of element.
107 * Needed order of nodes in this list corresponds to description
108 * of MED. This description is located by the following link:
109 * http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
111 long AddVolume(in long_array IDsOfNodes);
114 * Create volume of many faces, giving nodes for each face.
115 * \param IdsOfNodes List of node IDs for volume creation face by face.
116 * \param Quantities List of integer values, Quantities[i]
117 * gives quantity of nodes in face number i.
119 long AddPolyhedralVolume (in long_array IdsOfNodes,
120 in long_array Quantities);
123 * Create volume of many faces, giving IDs of existing faces.
124 * \param IdsOfFaces List of face IDs for volume creation.
125 * \note The created volume will refer only to nodes
126 * of the given faces, not to the faces itself.
128 long AddPolyhedralVolumeByFaces (in long_array IdsOfFaces);
131 * \brief Bind a node to a vertex
132 * \param NodeID - node ID
133 * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
135 void SetNodeOnVertex(in long NodeID, in long VertexID)
136 raises (SALOME::SALOME_Exception);
138 * \brief Store node position on an edge
139 * \param NodeID - node ID
140 * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
141 * \param paramOnEdge - parameter on edge where the node is located
143 void SetNodeOnEdge(in long NodeID, in long EdgeID, in double paramOnEdge)
144 raises (SALOME::SALOME_Exception);
146 * \brief Store node position on a face
147 * \param NodeID - node ID
148 * \param FaceID - face ID available through GEOM_Object.GetSubShapeIndices()[0]
149 * \param u - U parameter on face where the node is located
150 * \param v - V parameter on face where the node is located
152 void SetNodeOnFace(in long NodeID, in long FaceID, in double u, in double v)
153 raises (SALOME::SALOME_Exception);
155 * \brief Bind a node to a solid
156 * \param NodeID - node ID
157 * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
159 void SetNodeInVolume(in long NodeID, in long SolidID)
160 raises (SALOME::SALOME_Exception);
162 * \brief Bind an element to a shape
163 * \param ElementID - element ID
164 * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0]
166 void SetMeshElementOnShape(in long ElementID, in long ShapeID)
167 raises (SALOME::SALOME_Exception);
170 boolean MoveNode(in long NodeID, in double x, in double y, in double z);
172 boolean InverseDiag(in long NodeID1, in long NodeID2);
174 boolean DeleteDiag(in long NodeID1, in long NodeID2);
176 boolean Reorient(in long_array IDsOfElements);
178 boolean ReorientObject(in SMESH_IDSource theObject);
180 * \brief Reorient faces contained in \a the2Dgroup.
181 * \param the2Dgroup - the mesh or its part to reorient
182 * \param theDirection - desired direction of normal of \a theFace
183 * \param theFace - ID of face whose orientation is checked.
184 * It can be < 1 then \a thePoint is used to find a face.
185 * \param thePoint - is used to find a face if \a theFace < 1.
186 * \return number of reoriented elements.
188 long Reorient2D(in SMESH_IDSource the2Dgroup,
189 in DirStruct theDirection,
191 in PointStruct thePoint) raises (SALOME::SALOME_Exception);
194 * \brief Fuse neighbour triangles into quadrangles.
195 * \param theElems The triangles to be fused.
196 * \param theCriterion Is used to choose a neighbour to fuse with.
197 * \param theMaxAngle Is a max angle between element normals at which fusion
198 * is still performed; theMaxAngle is mesured in radians.
199 * \return TRUE in case of success, FALSE otherwise.
201 boolean TriToQuad (in long_array IDsOfElements,
202 in NumericalFunctor Criterion,
206 * \brief Fuse neighbour triangles into quadrangles.
208 * Behaves like the above method, taking list of elements from \a theObject
210 boolean TriToQuadObject (in SMESH_IDSource theObject,
211 in NumericalFunctor Criterion,
215 * \brief Split quadrangles into triangles.
216 * \param theElems The faces to be splitted.
217 * \param theCriterion Is used to choose a diagonal for splitting.
218 * \return TRUE in case of success, FALSE otherwise.
220 boolean QuadToTri (in long_array IDsOfElements,
221 in NumericalFunctor Criterion);
224 * \brief Split quadrangles into triangles.
226 * Behaves like the above method, taking list of elements from \a theObject
228 boolean QuadToTriObject (in SMESH_IDSource theObject,
229 in NumericalFunctor Criterion);
232 * \brief Split quadrangles into triangles.
233 * \param theElems The faces to be splitted.
234 * \param the13Diag Is used to choose a diagonal for splitting.
235 * \return TRUE in case of success, FALSE otherwise.
237 boolean SplitQuad (in long_array IDsOfElements,
241 * \brief Split quadrangles into triangles.
243 * Behaves like the above method, taking list of elements from \a theObject
245 boolean SplitQuadObject (in SMESH_IDSource theObject,
249 * Find better splitting of the given quadrangle.
250 * \param IDOfQuad ID of the quadrangle to be splitted.
251 * \param Criterion A criterion to choose a diagonal for splitting.
252 * \return 1 if 1-3 diagonal is better, 2 if 2-4
253 * diagonal is better, 0 if error occurs.
255 long BestSplit (in long IDOfQuad,
256 in NumericalFunctor Criterion);
259 * \brief Split volumic elements into tetrahedrons
260 * \param elems - elements to split
261 * \param methodFlags - flags passing splitting method:
262 * 1 - split the hexahedron into 5 tetrahedrons
263 * 2 - split the hexahedron into 6 tetrahedrons
264 * 3 - split the hexahedron into 24 tetrahedrons
266 void SplitVolumesIntoTetra(in SMESH_IDSource elems, in short methodFlags)
267 raises (SALOME::SALOME_Exception);
270 enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH };
272 boolean Smooth(in long_array IDsOfElements,
273 in long_array IDsOfFixedNodes,
274 in long MaxNbOfIterations,
275 in double MaxAspectRatio,
276 in Smooth_Method Method);
278 boolean SmoothObject(in SMESH_IDSource theObject,
279 in long_array IDsOfFixedNodes,
280 in long MaxNbOfIterations,
281 in double MaxAspectRatio,
282 in Smooth_Method Method);
284 boolean SmoothParametric(in long_array IDsOfElements,
285 in long_array IDsOfFixedNodes,
286 in long MaxNbOfIterations,
287 in double MaxAspectRatio,
288 in Smooth_Method Method);
290 boolean SmoothParametricObject(in SMESH_IDSource theObject,
291 in long_array IDsOfFixedNodes,
292 in long MaxNbOfIterations,
293 in double MaxAspectRatio,
294 in Smooth_Method Method);
296 void ConvertToQuadratic(in boolean theForce3d);
298 boolean ConvertFromQuadratic();
300 void ConvertToQuadraticObject(in boolean theForce3d,
301 in SMESH_IDSource theObject)
302 raises (SALOME::SALOME_Exception);
304 void ConvertFromQuadraticObject(in SMESH_IDSource theObject)
305 raises (SALOME::SALOME_Exception);
307 void RenumberNodes();
309 void RenumberElements();
312 * \brief Genarate dim+1 elements by rotation of given elements around axis
313 * \param IDsOfElements - elements to ratate
314 * \param Axix - rotation axis
315 * \param AngleInRadians - rotation angle
316 * \param NbOfSteps - number of elements to generate from one element
318 void RotationSweep(in long_array IDsOfElements,
320 in double AngleInRadians,
322 in double Tolerance);
324 * \brief Same as previous but additionally create groups of elements
325 * generated from elements belonging to preexisting groups
327 ListOfGroups RotationSweepMakeGroups(in long_array IDsOfElements,
329 in double AngleInRadians,
331 in double Tolerance);
333 * \brief Genarate dim+1 elements by rotation of the object around axis
334 * \param theObject - object containing elements to ratate
335 * \param Axix - rotation axis
336 * \param AngleInRadians - rotation angle
337 * \param NbOfSteps - number of elements to generate from one element
339 void RotationSweepObject(in SMESH_IDSource theObject,
341 in double AngleInRadians,
343 in double Tolerance);
345 * \brief Same as previous but additionally create groups of elements
346 * generated from elements belonging to preexisting groups
348 ListOfGroups RotationSweepObjectMakeGroups(in SMESH_IDSource theObject,
350 in double AngleInRadians,
352 in double Tolerance);
354 * \brief Genarate dim+1 elements by rotation of the object around axis
355 * \param theObject - object containing elements to ratate
356 * \param Axix - rotation axis
357 * \param AngleInRadians - rotation angle
358 * \param NbOfSteps - number of elements to generate from one element
360 void RotationSweepObject1D(in SMESH_IDSource theObject,
362 in double AngleInRadians,
364 in double Tolerance);
366 * \brief Same as previous but additionally create groups of elements
367 * generated from elements belonging to preexisting groups
369 ListOfGroups RotationSweepObject1DMakeGroups(in SMESH_IDSource theObject,
371 in double AngleInRadians,
373 in double Tolerance);
375 * \brief Genarate dim+1 elements by rotation of the object around axis
376 * \param theObject - object containing elements to ratate
377 * \param Axix - rotation axis
378 * \param AngleInRadians - rotation angle
379 * \param NbOfSteps - number of elements to generate from one element
381 void RotationSweepObject2D(in SMESH_IDSource theObject,
383 in double AngleInRadians,
385 in double Tolerance);
387 * \brief Same as previous but additionally create groups of elements
388 * generated from elements belonging to preexisting groups
390 ListOfGroups RotationSweepObject2DMakeGroups(in SMESH_IDSource theObject,
392 in double AngleInRadians,
394 in double Tolerance);
396 * \brief Genarate dim+1 elements by extrusion of elements along vector
397 * \param IDsOfElements - elements to sweep
398 * \param StepVector - vector giving direction and distance of an extrusion step
399 * \param NbOfSteps - number of elements to generate from one element
401 void ExtrusionSweep(in long_array IDsOfElements,
402 in DirStruct StepVector,
405 * \brief Genarate dim+1 elements by extrusion of elements along vector
406 * \param IDsOfElements - elements to sweep
407 * \param StepVector - vector giving direction and distance of an extrusion step
408 * \param NbOfSteps - number of elements to generate from one element
410 void ExtrusionSweep0D(in long_array IDsOfElements,
411 in DirStruct StepVector,
414 * \brief Same as previous but additionally create groups of elements
415 * generated from elements belonging to preexisting groups
417 ListOfGroups ExtrusionSweepMakeGroups(in long_array IDsOfElements,
418 in DirStruct StepVector,
421 * \brief Same as previous but elements are nodes
423 ListOfGroups ExtrusionSweepMakeGroups0D(in long_array IDsOfElements,
424 in DirStruct StepVector,
427 * Generate new elements by extrusion of theElements
428 * by StepVector by NbOfSteps
429 * param ExtrFlags set flags for performing extrusion
430 * param SewTolerance - uses for comparing locations of nodes if flag
431 * EXTRUSION_FLAG_SEW is set
433 void AdvancedExtrusion(in long_array IDsOfElements,
434 in DirStruct StepVector,
437 in double SewTolerance);
439 * \brief Same as previous but additionally create groups of elements
440 * generated from elements belonging to preexisting groups
442 ListOfGroups AdvancedExtrusionMakeGroups(in long_array IDsOfElements,
443 in DirStruct StepVector,
446 in double SewTolerance);
448 void ExtrusionSweepObject(in SMESH_IDSource theObject,
449 in DirStruct StepVector,
451 ListOfGroups ExtrusionSweepObjectMakeGroups(in SMESH_IDSource theObject,
452 in DirStruct StepVector,
455 void ExtrusionSweepObject0D(in SMESH_IDSource theObject,
456 in DirStruct StepVector,
458 ListOfGroups ExtrusionSweepObject0DMakeGroups(in SMESH_IDSource theObject,
459 in DirStruct StepVector,
462 void ExtrusionSweepObject1D(in SMESH_IDSource theObject,
463 in DirStruct StepVector,
465 ListOfGroups ExtrusionSweepObject1DMakeGroups(in SMESH_IDSource theObject,
466 in DirStruct StepVector,
469 void ExtrusionSweepObject2D(in SMESH_IDSource theObject,
470 in DirStruct StepVector,
472 ListOfGroups ExtrusionSweepObject2DMakeGroups(in SMESH_IDSource theObject,
473 in DirStruct StepVector,
476 enum Extrusion_Error {
481 EXTR_BAD_STARTING_NODE,
482 EXTR_BAD_ANGLES_NUMBER,
483 EXTR_CANT_GET_TANGENT
486 ListOfGroups ExtrusionAlongPathX(in long_array IDsOfElements,
487 in SMESH_IDSource Path,
489 in boolean HasAngles,
490 in double_array Angles,
491 in boolean LinearVariation,
492 in boolean HasRefPoint,
493 in PointStruct RefPoint,
494 in boolean MakeGroups,
495 in ElementType ElemType,
496 out Extrusion_Error Error);
498 ListOfGroups ExtrusionAlongPathObjX(in SMESH_IDSource theObject,
499 in SMESH_IDSource Path,
501 in boolean HasAngles,
502 in double_array Angles,
503 in boolean LinearVariation,
504 in boolean HasRefPoint,
505 in PointStruct RefPoint,
506 in boolean MakeGroups,
507 in ElementType ElemType,
508 out Extrusion_Error Error);
510 Extrusion_Error ExtrusionAlongPath(in long_array IDsOfElements,
511 in SMESH_Mesh PathMesh,
512 in GEOM::GEOM_Object PathShape,
514 in boolean HasAngles,
515 in double_array Angles,
516 in boolean HasRefPoint,
517 in PointStruct RefPoint);
518 ListOfGroups ExtrusionAlongPathMakeGroups(in long_array IDsOfElements,
519 in SMESH_Mesh PathMesh,
520 in GEOM::GEOM_Object PathShape,
522 in boolean HasAngles,
523 in double_array Angles,
524 in boolean HasRefPoint,
525 in PointStruct RefPoint,
526 out Extrusion_Error Error);
528 Extrusion_Error ExtrusionAlongPathObject(in SMESH_IDSource theObject,
529 in SMESH_Mesh PathMesh,
530 in GEOM::GEOM_Object PathShape,
532 in boolean HasAngles,
533 in double_array Angles,
534 in boolean HasRefPoint,
535 in PointStruct RefPoint);
536 ListOfGroups ExtrusionAlongPathObjectMakeGroups(in SMESH_IDSource theObject,
537 in SMESH_Mesh PathMesh,
538 in GEOM::GEOM_Object PathShape,
540 in boolean HasAngles,
541 in double_array Angles,
542 in boolean HasRefPoint,
543 in PointStruct RefPoint,
544 out Extrusion_Error Error);
546 Extrusion_Error ExtrusionAlongPathObject1D(in SMESH_IDSource theObject,
547 in SMESH_Mesh PathMesh,
548 in GEOM::GEOM_Object PathShape,
550 in boolean HasAngles,
551 in double_array Angles,
552 in boolean HasRefPoint,
553 in PointStruct RefPoint);
554 ListOfGroups ExtrusionAlongPathObject1DMakeGroups(in SMESH_IDSource theObject,
555 in SMESH_Mesh PathMesh,
556 in GEOM::GEOM_Object PathShape,
558 in boolean HasAngles,
559 in double_array Angles,
560 in boolean HasRefPoint,
561 in PointStruct RefPoint,
562 out Extrusion_Error Error);
564 Extrusion_Error ExtrusionAlongPathObject2D(in SMESH_IDSource theObject,
565 in SMESH_Mesh PathMesh,
566 in GEOM::GEOM_Object PathShape,
568 in boolean HasAngles,
569 in double_array Angles,
570 in boolean HasRefPoint,
571 in PointStruct RefPoint);
572 ListOfGroups ExtrusionAlongPathObject2DMakeGroups(in SMESH_IDSource theObject,
573 in SMESH_Mesh PathMesh,
574 in GEOM::GEOM_Object PathShape,
576 in boolean HasAngles,
577 in double_array Angles,
578 in boolean HasRefPoint,
579 in PointStruct RefPoint,
580 out Extrusion_Error Error);
583 * Compute rotation angles for ExtrusionAlongPath as linear variation
584 * of given angles along path steps
585 * param PathMesh mesh containing a 1D sub-mesh on the edge, along
586 * which proceeds the extrusion
587 * param PathShape is shape(edge); as the mesh can be complex, the edge
588 * is used to define the sub-mesh for the path
590 double_array LinearAnglesVariation(in SMESH_Mesh PathMesh,
591 in GEOM::GEOM_Object PathShape,
592 in double_array Angles);
594 enum MirrorType { POINT, AXIS, PLANE };
596 void Mirror (in long_array IDsOfElements,
597 in AxisStruct Mirror,
600 ListOfGroups MirrorMakeGroups (in long_array IDsOfElements,
601 in AxisStruct Mirror,
603 SMESH_Mesh MirrorMakeMesh (in long_array IDsOfElements,
604 in AxisStruct Mirror,
606 in boolean CopyGroups,
609 void MirrorObject (in SMESH_IDSource theObject,
610 in AxisStruct Mirror,
613 ListOfGroups MirrorObjectMakeGroups (in SMESH_IDSource theObject,
614 in AxisStruct Mirror,
616 SMESH_Mesh MirrorObjectMakeMesh (in SMESH_IDSource theObject,
617 in AxisStruct Mirror,
619 in boolean CopyGroups,
622 void Translate (in long_array IDsOfElements,
625 ListOfGroups TranslateMakeGroups (in long_array IDsOfElements,
626 in DirStruct Vector);
627 SMESH_Mesh TranslateMakeMesh (in long_array IDsOfElements,
629 in boolean CopyGroups,
632 void TranslateObject (in SMESH_IDSource theObject,
635 ListOfGroups TranslateObjectMakeGroups (in SMESH_IDSource theObject,
636 in DirStruct Vector);
637 SMESH_Mesh TranslateObjectMakeMesh (in SMESH_IDSource theObject,
639 in boolean CopyGroups,
642 void Scale (in SMESH_IDSource theObject,
643 in PointStruct thePoint,
644 in double_array theScaleFact,
646 ListOfGroups ScaleMakeGroups (in SMESH_IDSource theObject,
647 in PointStruct thePoint,
648 in double_array theScaleFact);
649 SMESH_Mesh ScaleMakeMesh (in SMESH_IDSource theObject,
650 in PointStruct thePoint,
651 in double_array theScaleFact,
652 in boolean CopyGroups,
655 void Rotate (in long_array IDsOfElements,
657 in double AngleInRadians,
659 ListOfGroups RotateMakeGroups (in long_array IDsOfElements,
661 in double AngleInRadians);
662 SMESH_Mesh RotateMakeMesh (in long_array IDsOfElements,
664 in double AngleInRadians,
665 in boolean CopyGroups,
668 void RotateObject (in SMESH_IDSource theObject,
670 in double AngleInRadians,
672 ListOfGroups RotateObjectMakeGroups (in SMESH_IDSource theObject,
674 in double AngleInRadians);
675 SMESH_Mesh RotateObjectMakeMesh (in SMESH_IDSource theObject,
677 in double AngleInRadians,
678 in boolean CopyGroups,
681 void FindCoincidentNodes (in double Tolerance,
682 out array_of_long_array GroupsOfNodes);
684 void FindCoincidentNodesOnPart (in SMESH_IDSource SubMeshOrGroup,
686 out array_of_long_array GroupsOfNodes);
688 void FindCoincidentNodesOnPartBut (in SMESH_IDSource SubMeshOrGroup,
690 out array_of_long_array GroupsOfNodes,
691 in ListOfIDSources ExceptSubMeshOrGroups);
693 void MergeNodes (in array_of_long_array GroupsOfNodes);
696 * \brief Find elements built on the same nodes.
697 * \param MeshOrSubMeshOrGroup Mesh or SubMesh, or Group of elements for searching.
698 * \return List of groups of equal elements.
700 void FindEqualElements (in SMESH_IDSource MeshOrSubMeshOrGroup,
701 out array_of_long_array GroupsOfElementsID);
704 * \brief Merge elements in each given group.
705 * \param GroupsOfElementsID Groups of elements for merging.
707 void MergeElements(in array_of_long_array GroupsOfElementsID);
710 * \brief Merge equal elements in the whole mesh.
712 void MergeEqualElements();
715 * If the given ID is a valid node ID (nodeID > 0), just move this node, else
716 * move the node closest to the point to point's location and return ID of the node
718 long MoveClosestNodeToPoint(in double x, in double y, in double z, in long nodeID);
721 * Return ID of node closest to a given point
723 long FindNodeClosestTo(in double x, in double y, in double z);
726 * Return elements of given type where the given point is IN or ON.
728 * 'ALL' type means elements of any type excluding nodes and 0D elements
730 long_array FindElementsByPoint(in double x, in double y, in double z, in ElementType type);
733 * Searching among the given elements, return elements of given type
734 * where the given point is IN or ON.
736 * 'ALL' type means elements of any type excluding nodes and 0D elements
738 long_array FindAmongElementsByPoint(in SMESH_IDSource elements,
739 in double x, in double y, in double z,
740 in ElementType type);
743 * Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
744 * TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
746 short GetPointState(in double x, in double y, in double z);
750 SEW_BORDER1_NOT_FOUND,
751 SEW_BORDER2_NOT_FOUND,
752 SEW_BOTH_BORDERS_NOT_FOUND,
754 SEW_VOLUMES_TO_SPLIT,
755 // for SewSideElements() only:
756 SEW_DIFF_NB_OF_ELEMENTS,
757 SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
762 Sew_Error SewFreeBorders (in long FirstNodeID1,
763 in long SecondNodeID1,
765 in long FirstNodeID2,
766 in long SecondNodeID2,
768 in boolean CreatePolygons,
769 in boolean CreatePolyedrs);
771 Sew_Error SewConformFreeBorders (in long FirstNodeID1,
772 in long SecondNodeID1,
774 in long FirstNodeID2,
775 in long SecondNodeID2);
777 Sew_Error SewBorderToSide (in long FirstNodeIDOnFreeBorder,
778 in long SecondNodeIDOnFreeBorder,
779 in long LastNodeIDOnFreeBorder,
780 in long FirstNodeIDOnSide,
781 in long LastNodeIDOnSide,
782 in boolean CreatePolygons,
783 in boolean CreatePolyedrs);
785 Sew_Error SewSideElements (in long_array IDsOfSide1Elements,
786 in long_array IDsOfSide2Elements,
787 in long NodeID1OfSide1ToMerge,
788 in long NodeID1OfSide2ToMerge,
789 in long NodeID2OfSide1ToMerge,
790 in long NodeID2OfSide2ToMerge);
793 * Set new nodes for given element.
794 * If number of nodes is not corresponded to type of
795 * element - returns false
797 boolean ChangeElemNodes(in long ide, in long_array newIDs);
800 * Return data of mesh edition preview which is computed provided
801 * that the editor was obtained trough SMESH_Mesh::GetMeshEditPreviewer()
803 MeshPreviewStruct GetPreviewData();
806 * If during last operation of MeshEditor some nodes were
807 * created this method returns list of it's IDs, if new nodes
808 * not creared - returns empty list
810 long_array GetLastCreatedNodes();
813 * If during last operation of MeshEditor some elements were
814 * created this method returns list of it's IDs, if new elements
815 * not creared - returns empty list
817 long_array GetLastCreatedElems();
820 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
821 * \param theNodes - identifiers of nodes to be doubled
822 * \param theModifiedElems - identifiers of elements to be updated by the new (doubled)
823 * nodes. If list of element identifiers is empty then nodes are doubled but
824 * they not assigned to elements
825 * \return TRUE if operation has been completed successfully, FALSE otherwise
826 * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodeGroups()
828 boolean DoubleNodes( in long_array theNodes, in long_array theModifiedElems );
831 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
832 * This method provided for convenience works as DoubleNodes() described above.
833 * \param theNodeId - identifier of node to be doubled.
834 * \param theModifiedElems - identifiers of elements to be updated.
835 * \return TRUE if operation has been completed successfully, FALSE otherwise
836 * \sa DoubleNodes(), DoubleNodeGroup(), DoubleNodeGroups()
838 boolean DoubleNode( in long theNodeId, in long_array theModifiedElems );
841 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
842 * This method provided for convenience works as DoubleNodes() described above.
843 * \param theNodes - group of nodes to be doubled.
844 * \param theModifiedElems - group of elements to be updated.
845 * \return TRUE if operation has been completed successfully, FALSE otherwise
846 * \sa DoubleNode(), DoubleNodes(), DoubleNodeGroups(), DoubleNodeGroupNew()
848 boolean DoubleNodeGroup( in SMESH_GroupBase theNodes,
849 in SMESH_GroupBase theModifiedElems );
851 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
852 * Works as DoubleNodeGroup() described above, but returns a new group with
853 * newly created nodes.
854 * \param theNodes - group of nodes to be doubled.
855 * \param theModifiedElems - group of elements to be updated.
856 * \return a new group with newly created nodes
857 * \sa DoubleNodeGroup()
859 SMESH_Group DoubleNodeGroupNew( in SMESH_GroupBase theNodes,
860 in SMESH_GroupBase theModifiedElems );
863 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
864 * This method provided for convenience works as DoubleNodes() described above.
865 * \param theNodes - list of groups of nodes to be doubled
866 * \param theModifiedElems - list of groups of elements to be updated.
867 * \return TRUE if operation has been completed successfully, FALSE otherwise
868 * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodes()
870 boolean DoubleNodeGroups( in ListOfGroups theNodes,
871 in ListOfGroups theModifiedElems );
873 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
874 * Works as DoubleNodeGroups() described above, but returns a new group with
875 * newly created nodes.
876 * \param theNodes - list of groups of nodes to be doubled
877 * \param theModifiedElems - list of groups of elements to be updated.
878 * \return a new group with newly created nodes
879 * \sa DoubleNodeGroups()
881 SMESH_Group DoubleNodeGroupsNew( in ListOfGroups theNodes,
882 in ListOfGroups theModifiedElems );
885 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
886 * \param theElems - the list of elements (edges or faces) to be replicated
887 * The nodes for duplication could be found from these elements
888 * \param theNodesNot - list of nodes to NOT replicate
889 * \param theAffectedElems - the list of elements (cells and edges) to which the
890 * replicated nodes should be associated to.
891 * \return TRUE if operation has been completed successfully, FALSE otherwise
892 * \sa DoubleNodeGroup(), DoubleNodeGroups()
894 boolean DoubleNodeElem( in long_array theElems,
895 in long_array theNodesNot,
896 in long_array theAffectedElems );
899 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
900 * \param theElems - the list of elements (edges or faces) to be replicated
901 * The nodes for duplication could be found from these elements
902 * \param theNodesNot - list of nodes to NOT replicate
903 * \param theShape - shape to detect affected elements (element which geometric center
904 * located on or inside shape).
905 * The replicated nodes should be associated to affected elements.
906 * \return TRUE if operation has been completed successfully, FALSE otherwise
907 * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
909 boolean DoubleNodeElemInRegion( in long_array theElems,
910 in long_array theNodesNot,
911 in GEOM::GEOM_Object theShape );
914 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
915 * This method provided for convenience works as DoubleNodes() described above.
916 * \param theElems - group of of elements (edges or faces) to be replicated
917 * \param theNodesNot - group of nodes not to replicated
918 * \param theAffectedElems - group of elements to which the replicated nodes
919 * should be associated to.
920 * \return TRUE if operation has been completed successfully, FALSE otherwise
921 * \sa DoubleNodes(), DoubleNodeGroups(), DoubleNodeElemGroupNew()
923 boolean DoubleNodeElemGroup( in SMESH_GroupBase theElems,
924 in SMESH_GroupBase theNodesNot,
925 in SMESH_GroupBase theAffectedElems );
927 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
928 * Works as DoubleNodeElemGroup() described above, but returns a new group with
929 * newly created elements.
930 * \param theElems - group of of elements (edges or faces) to be replicated
931 * \param theNodesNot - group of nodes not to replicated
932 * \param theAffectedElems - group of elements to which the replicated nodes
933 * should be associated to.
934 * \return a new group with newly created elements
935 * \sa DoubleNodeElemGroup()
937 SMESH_Group DoubleNodeElemGroupNew( in SMESH_GroupBase theElems,
938 in SMESH_GroupBase theNodesNot,
939 in SMESH_GroupBase theAffectedElems );
941 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
942 * Works as DoubleNodeElemGroup() described above, but returns two new groups:
943 * a group of newly created elements and a group of newly created nodes
944 * \param theElems - group of of elements (edges or faces) to be replicated
945 * \param theNodesNot - group of nodes not to replicated
946 * \param theAffectedElems - group of elements to which the replicated nodes
947 * should be associated to.
948 * \param theElemGroupNeeded - to create group of new elements or not
949 * \param theNodeGroupNeeded - to create group of new nodes or not
950 * \return two new groups of newly created elements (1st) and nodes (2nd)
951 * \sa DoubleNodeElemGroup()
953 ListOfGroups DoubleNodeElemGroup2New( in SMESH_GroupBase theElems,
954 in SMESH_GroupBase theNodesNot,
955 in SMESH_GroupBase theAffectedElems,
956 in boolean theElemGroupNeeded,
957 in boolean theNodeGroupNeeded);
960 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
961 * This method provided for convenience works as DoubleNodes() described above.
962 * \param theElems - group of elements (edges or faces) to be replicated
963 * \param theNodesNot - group of nodes not to replicated
964 * \param theShape - shape to detect affected elements (element which geometric center
965 * located on or inside shape).
966 * The replicated nodes should be associated to affected elements.
967 * \return TRUE if operation has been completed successfully, FALSE otherwise
968 * \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
970 boolean DoubleNodeElemGroupInRegion( in SMESH_GroupBase theElems,
971 in SMESH_GroupBase theNodesNot,
972 in GEOM::GEOM_Object theShape );
975 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
976 * This method provided for convenience works as DoubleNodes() described above.
977 * \param theElems - list of groups of elements (edges or faces) to be replicated
978 * \param theNodesNot - list of groups of nodes not to replicated
979 * \param theAffectedElems - group of elements to which the replicated nodes
980 * should be associated to.
981 * \return TRUE if operation has been completed successfully, FALSE otherwise
982 * \sa DoubleNodeGroup(), DoubleNodes(), DoubleNodeElemGroupsNew()
984 boolean DoubleNodeElemGroups( in ListOfGroups theElems,
985 in ListOfGroups theNodesNot,
986 in ListOfGroups theAffectedElems );
988 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
989 * Works as DoubleNodeElemGroups() described above, but returns a new group with
990 * newly created elements.
991 * \param theElems - list of groups of elements (edges or faces) to be replicated
992 * \param theNodesNot - list of groups of nodes not to replicated
993 * \param theAffectedElems - group of elements to which the replicated nodes
994 * should be associated to.
995 * \return a new group with newly created elements
996 * \sa DoubleNodeElemGroups()
998 SMESH_Group DoubleNodeElemGroupsNew( in ListOfGroups theElems,
999 in ListOfGroups theNodesNot,
1000 in ListOfGroups theAffectedElems );
1002 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
1003 * Works as DoubleNodeElemGroups() described above, but returns two new groups:
1004 * a group of newly created elements and a group of newly created nodes.
1005 * \param theElems - list of groups of elements (edges or faces) to be replicated
1006 * \param theNodesNot - list of groups of nodes not to replicated
1007 * \param theAffectedElems - group of elements to which the replicated nodes
1008 * should be associated to.
1009 * \param theElemGroupNeeded - to create group of new elements or not
1010 * \param theNodeGroupNeeded - to create group of new nodes or not
1011 * \return two new groups of newly created elements (1st) and nodes (2nd)
1012 * \sa DoubleNodeElemGroups()
1014 ListOfGroups DoubleNodeElemGroups2New( in ListOfGroups theElems,
1015 in ListOfGroups theNodesNot,
1016 in ListOfGroups theAffectedElems,
1017 in boolean theElemGroupNeeded,
1018 in boolean theNodeGroupNeeded );
1021 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
1022 * This method provided for convenience works as DoubleNodes() described above.
1023 * \param theElems - list of groups of elements (edges or faces) to be replicated
1024 * \param theNodesNot - list of groups of nodes not to replicated
1025 * \param theShape - shape to detect affected elements (element which geometric center
1026 * located on or inside shape).
1027 * The replicated nodes should be associated to affected elements.
1028 * \return TRUE if operation has been completed successfully, FALSE otherwise
1029 * \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
1031 boolean DoubleNodeElemGroupsInRegion( in ListOfGroups theElems,
1032 in ListOfGroups theNodesNot,
1033 in GEOM::GEOM_Object theShape );
1036 * \brief Generates skin mesh (containing 2D cells) from 3D mesh
1037 * The created 2D mesh elements based on nodes of free faces of boundary volumes
1038 * \return TRUE if operation has been completed successfully, FALSE otherwise
1040 boolean Make2DMeshFrom3D();
1043 * \brief Creates missing boundary elements
1044 * \param elements - elements whose boundary is to be checked
1045 * \param dimension - defines type of boundary elements to create
1046 * BND_1DFROM3D creates mesh edges on all borders of free facets of 3D elements.
1047 * \param groupName - a name of group to store created boundary elements in,
1048 * "" means not to create the group
1049 * \param meshName - a name of new mesh to store created boundary elements in,
1050 * "" means not to create the new mesh
1051 * \param toCopyElements - if true, the checked elements will be copied into the new mesh
1052 * else only boundary elements will be copied into the new mesh
1053 * \param toCopyExistingBondary - if true, not only new but also pre-existing
1054 * boundary elements will be copied into the new mesh
1055 * \param group - returns the create group, if any
1056 * \retval SMESH::SMESH_Mesh - the mesh where elements were added to
1058 SMESH_Mesh MakeBoundaryMesh(in SMESH_IDSource elements,
1059 in Bnd_Dimension dimension,
1060 in string groupName,
1062 in boolean toCopyElements,
1063 in boolean toCopyExistingBondary,
1064 out SMESH_Group group);
1066 * \brief Creates missing boundary elements around either the whole mesh or
1067 * groups of 2D elements
1068 * \param dimension - defines type of boundary elements to create
1069 * \param groupName - a name of group to store all boundary elements in,
1070 * "" means not to create the group
1071 * \param meshName - a name of a new mesh, which is a copy of the initial
1072 * mesh + created boundary elements; "" means not to create the new mesh
1073 * \param toCopyAll - if true, the whole initial mesh will be copied into
1074 * the new mesh else only boundary elements will be copied into the new mesh
1075 * \param groups - optional groups of 2D elements to make boundary around
1076 * \param mesh - returns the mesh where elements were added to
1077 * \param group - returns the created group, if any
1078 * \retval long - number of added boundary elements
1080 long MakeBoundaryElements(in Bnd_Dimension dimension,
1081 in string groupName,
1083 in boolean toCopyAll,
1084 in ListOfIDSources groups,
1085 out SMESH_Mesh mesh,
1086 out SMESH_Group group) raises (SALOME::SALOME_Exception);
1089 * \brief Double nodes on shared faces between groups of volumes and create flat elements on demand.
1090 * Flat elements are mainly used by some types of mechanic calculations.
1092 * The list of groups must describe a partition of the mesh volumes.
1093 * The nodes of the internal faces at the boundaries of the groups are doubled.
1094 * In option, the internal faces are replaced by flat elements.
1095 * Triangles are transformed in prisms, and quadrangles in hexahedrons.
1096 * \param theDomains - list of groups of volumes
1097 * \param createJointElems - if TRUE, create the elements
1098 * \return TRUE if operation has been completed successfully, FALSE otherwise
1100 boolean DoubleNodesOnGroupBoundaries( in ListOfGroups theDomains,
1101 in boolean createJointElems )
1102 raises (SALOME::SALOME_Exception);
1105 * \brief Double nodes on some external faces and create flat elements.
1106 * Flat elements are mainly used by some types of mechanic calculations.
1108 * Each group of the list must be constituted of faces.
1109 * Triangles are transformed in prisms, and quadrangles in hexahedrons.
1110 * \param theGroupsOfFaces - list of groups of faces
1111 * \return TRUE if operation has been completed successfully, FALSE otherwise
1113 boolean CreateFlatElementsOnFacesGroups( in ListOfGroups theGroupsOfFaces );