1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
24 // File : SMESH_MeshEditor_i.hxx
25 // Author : Nicolas REJNERI
28 #ifndef _SMESH_MESHEDITOR_I_HXX_
29 #define _SMESH_MESHEDIOTR_I_HXX_
33 #include <SALOMEconfig.h>
34 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
36 #include "SMESH_Mesh.hxx"
37 #include "SMESH_PythonDump.hxx"
38 #include "SMESH_MeshEditor.hxx"
43 namespace MeshEditor_I {
45 struct ExtrusionParams;
48 class SMESH_I_EXPORT SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
51 SMESH_MeshEditor_i(SMESH_Mesh_i * theMesh, bool isPreview);
53 virtual ~ SMESH_MeshEditor_i();
55 * \brief Return edited mesh ID
56 * \retval int - mesh ID
58 int GetMeshId() const { return myMesh->GetId(); }
60 SMESH::SMESH_Mesh_ptr GetMesh();
65 * Return data of mesh edition preview
67 SMESH::MeshPreviewStruct* GetPreviewData() throw (SALOME::SALOME_Exception);
69 * If during last operation of MeshEditor some nodes were
70 * created this method returns list of their IDs, if new nodes
71 * not created - returns an empty list
73 SMESH::long_array* GetLastCreatedNodes() throw (SALOME::SALOME_Exception);
75 * If during last operation of MeshEditor some elements were
76 * created this method returns list of their IDs, if new elements
77 * not created - returns an empty list
79 SMESH::long_array* GetLastCreatedElems() throw (SALOME::SALOME_Exception);
81 * \brief Clears sequences of last created elements and nodes
83 void ClearLastCreated() throw (SALOME::SALOME_Exception);
85 * \brief Returns description of an error/warning occured during the last operation
87 SMESH::ComputeError* GetLastError() throw (SALOME::SALOME_Exception);
90 * \brief Wrap a sequence of ids in a SMESH_IDSource
92 SMESH::SMESH_IDSource_ptr MakeIDSource(const SMESH::long_array& IDsOfElements,
93 SMESH::ElementType type);
94 static bool IsTemporaryIDSource( SMESH::SMESH_IDSource_ptr& idSource );
95 static CORBA::Long* GetTemporaryIDs( SMESH::SMESH_IDSource_ptr& idSource, int& nbIds );
97 CORBA::Boolean RemoveElements(const SMESH::long_array & IDsOfElements)
98 throw (SALOME::SALOME_Exception);
99 CORBA::Boolean RemoveNodes (const SMESH::long_array & IDsOfNodes)
100 throw (SALOME::SALOME_Exception);
101 CORBA::Long RemoveOrphanNodes()
102 throw (SALOME::SALOME_Exception);
105 * Methods for creation new elements.
106 * Returns ID of created element or 0 if element not created
108 CORBA::Long AddNode(CORBA::Double x, CORBA::Double y, CORBA::Double z)
109 throw (SALOME::SALOME_Exception);
110 CORBA::Long Add0DElement(CORBA::Long IDOfNode)
111 throw (SALOME::SALOME_Exception);
112 CORBA::Long AddBall(CORBA::Long IDOfNodem, CORBA::Double diameter)
113 throw (SALOME::SALOME_Exception);
114 CORBA::Long AddEdge(const SMESH::long_array & IDsOfNodes)
115 throw (SALOME::SALOME_Exception);
116 CORBA::Long AddFace(const SMESH::long_array & IDsOfNodes)
117 throw (SALOME::SALOME_Exception);
118 CORBA::Long AddPolygonalFace(const SMESH::long_array & IDsOfNodes)
119 throw (SALOME::SALOME_Exception);
120 CORBA::Long AddQuadPolygonalFace(const SMESH::long_array & IDsOfNodes)
121 throw (SALOME::SALOME_Exception);
122 CORBA::Long AddVolume(const SMESH::long_array & IDsOfNodes)
123 throw (SALOME::SALOME_Exception);
124 CORBA::Long AddPolyhedralVolume(const SMESH::long_array & IDsOfNodes,
125 const SMESH::long_array & Quantities)
126 throw (SALOME::SALOME_Exception);
127 CORBA::Long AddPolyhedralVolumeByFaces(const SMESH::long_array & IdsOfFaces)
128 throw (SALOME::SALOME_Exception);
131 * \brief Create 0D elements on all nodes of the given object except those
132 * nodes on which a 0D element already exists.
133 * \param theObject object on whose nodes 0D elements will be created.
134 * \param theGroupName optional name of a group to add 0D elements created
135 * and/or found on nodes of \a theObject.
136 * \return an object (a new group or a temporary SMESH_IDSource) holding
137 * ids of new and/or found 0D elements.
139 SMESH::SMESH_IDSource_ptr Create0DElementsOnAllNodes(SMESH::SMESH_IDSource_ptr theObject,
140 const char* theGroupName)
141 throw (SALOME::SALOME_Exception);
144 * \brief Bind a node to a vertex
145 * \param NodeID - node ID
146 * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
148 void SetNodeOnVertex(CORBA::Long NodeID, CORBA::Long VertexID)
149 throw (SALOME::SALOME_Exception);
151 * \brief Store node position on an edge
152 * \param NodeID - node ID
153 * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
154 * \param paramOnEdge - parameter on edge where the node is located
156 void SetNodeOnEdge(CORBA::Long NodeID, CORBA::Long EdgeID,
157 CORBA::Double paramOnEdge)
158 throw (SALOME::SALOME_Exception);
160 * \brief Store node position on a face
161 * \param NodeID - node ID
162 * \param FaceID - face ID available through GEOM_Object.GetSubShapeIndices()[0]
163 * \param u - U parameter on face where the node is located
164 * \param v - V parameter on face where the node is located
166 void SetNodeOnFace(CORBA::Long NodeID, CORBA::Long FaceID,
167 CORBA::Double u, CORBA::Double v)
168 throw (SALOME::SALOME_Exception);
170 * \brief Bind a node to a solid
171 * \param NodeID - node ID
172 * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
174 void SetNodeInVolume(CORBA::Long NodeID, CORBA::Long SolidID)
175 throw (SALOME::SALOME_Exception);
177 * \brief Bind an element to a shape
178 * \param ElementID - element ID
179 * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0]
181 void SetMeshElementOnShape(CORBA::Long ElementID, CORBA::Long ShapeID)
182 throw (SALOME::SALOME_Exception);
185 CORBA::Boolean MoveNode(CORBA::Long NodeID,
186 CORBA::Double x, CORBA::Double y, CORBA::Double z)
187 throw (SALOME::SALOME_Exception);
189 CORBA::Boolean InverseDiag(CORBA::Long NodeID1, CORBA::Long NodeID2)
190 throw (SALOME::SALOME_Exception);
191 CORBA::Boolean DeleteDiag(CORBA::Long NodeID1, CORBA::Long NodeID2)
192 throw (SALOME::SALOME_Exception);
193 CORBA::Boolean Reorient(const SMESH::long_array & IDsOfElements)
194 throw (SALOME::SALOME_Exception);
195 CORBA::Boolean ReorientObject(SMESH::SMESH_IDSource_ptr theObject)
196 throw (SALOME::SALOME_Exception);
199 * \brief Reorient faces contained in \a the2Dgroup.
200 * \param the2Dgroup - the mesh or its part to reorient
201 * \param theDirection - desired direction of normal of \a theFace
202 * \param theFace - ID of face whose orientation is checked.
203 * It can be < 1 then \a thePoint is used to find a face.
204 * \param thePoint - is used to find a face if \a theFace < 1.
205 * \return number of reoriented elements.
207 CORBA::Long Reorient2D(SMESH::SMESH_IDSource_ptr the2Dgroup,
208 const SMESH::DirStruct& theDirection,
210 const SMESH::PointStruct& thePoint) throw (SALOME::SALOME_Exception);
212 * \brief Reorient faces basing on orientation of adjacent volumes.
213 * \param faces - a list of objects containing face to reorient
214 * \param volumes - an object containing volumes.
215 * \param outsideNormal - to orient faces to have their normal
216 * pointing either \a outside or \a inside the adjacent volumes.
217 * \return number of reoriented faces.
219 CORBA::Long Reorient2DBy3D(const SMESH::ListOfIDSources & faces,
220 SMESH::SMESH_IDSource_ptr volumes,
221 CORBA::Boolean outsideNormal)
222 throw (SALOME::SALOME_Exception);
225 CORBA::Boolean TriToQuad (const SMESH::long_array & IDsOfElements,
226 SMESH::NumericalFunctor_ptr Criterion,
227 CORBA::Double MaxAngle)
228 throw (SALOME::SALOME_Exception);
229 CORBA::Boolean TriToQuadObject (SMESH::SMESH_IDSource_ptr theObject,
230 SMESH::NumericalFunctor_ptr Criterion,
231 CORBA::Double MaxAngle)
232 throw (SALOME::SALOME_Exception);
233 CORBA::Boolean QuadToTri (const SMESH::long_array & IDsOfElements,
234 SMESH::NumericalFunctor_ptr Criterion)
235 throw (SALOME::SALOME_Exception);
236 CORBA::Boolean QuadToTriObject (SMESH::SMESH_IDSource_ptr theObject,
237 SMESH::NumericalFunctor_ptr Criterion)
238 throw (SALOME::SALOME_Exception);
239 void QuadTo4Tri (SMESH::SMESH_IDSource_ptr theObject)
240 throw (SALOME::SALOME_Exception);
241 CORBA::Boolean SplitQuad (const SMESH::long_array & IDsOfElements,
242 CORBA::Boolean Diag13)
243 throw (SALOME::SALOME_Exception);
244 CORBA::Boolean SplitQuadObject (SMESH::SMESH_IDSource_ptr theObject,
245 CORBA::Boolean Diag13)
246 throw (SALOME::SALOME_Exception);
247 CORBA::Long BestSplit (CORBA::Long IDOfQuad,
248 SMESH::NumericalFunctor_ptr Criterion)
249 throw (SALOME::SALOME_Exception);
250 void SplitVolumesIntoTetra(SMESH::SMESH_IDSource_ptr elems,
251 CORBA::Short methodFlags)
252 throw (SALOME::SALOME_Exception);
253 void SplitHexahedraIntoPrisms(SMESH::SMESH_IDSource_ptr elems,
254 const SMESH::PointStruct & startHexPoint,
255 const SMESH::DirStruct& facetToSplitNormal,
256 CORBA::Short methodFlags,
257 CORBA::Boolean allDomains)
258 throw (SALOME::SALOME_Exception);
259 void SplitBiQuadraticIntoLinear(const SMESH::ListOfIDSources& elems)
260 throw (SALOME::SALOME_Exception);
262 CORBA::Boolean Smooth(const SMESH::long_array & IDsOfElements,
263 const SMESH::long_array & IDsOfFixedNodes,
264 CORBA::Long MaxNbOfIterations,
265 CORBA::Double MaxAspectRatio,
266 SMESH::SMESH_MeshEditor::Smooth_Method Method)
267 throw (SALOME::SALOME_Exception);
268 CORBA::Boolean SmoothObject(SMESH::SMESH_IDSource_ptr theObject,
269 const SMESH::long_array & IDsOfFixedNodes,
270 CORBA::Long MaxNbOfIterations,
271 CORBA::Double MaxAspectRatio,
272 SMESH::SMESH_MeshEditor::Smooth_Method Method)
273 throw (SALOME::SALOME_Exception);
274 CORBA::Boolean SmoothParametric(const SMESH::long_array & IDsOfElements,
275 const SMESH::long_array & IDsOfFixedNodes,
276 CORBA::Long MaxNbOfIterations,
277 CORBA::Double MaxAspectRatio,
278 SMESH::SMESH_MeshEditor::Smooth_Method Method)
279 throw (SALOME::SALOME_Exception);
280 CORBA::Boolean SmoothParametricObject(SMESH::SMESH_IDSource_ptr theObject,
281 const SMESH::long_array & IDsOfFixedNodes,
282 CORBA::Long MaxNbOfIterations,
283 CORBA::Double MaxAspectRatio,
284 SMESH::SMESH_MeshEditor::Smooth_Method Method)
285 throw (SALOME::SALOME_Exception);
286 CORBA::Boolean smooth(const SMESH::long_array & IDsOfElements,
287 const SMESH::long_array & IDsOfFixedNodes,
288 CORBA::Long MaxNbOfIterations,
289 CORBA::Double MaxAspectRatio,
290 SMESH::SMESH_MeshEditor::Smooth_Method Method,
292 throw (SALOME::SALOME_Exception);
293 CORBA::Boolean smoothObject(SMESH::SMESH_IDSource_ptr theObject,
294 const SMESH::long_array & IDsOfFixedNodes,
295 CORBA::Long MaxNbOfIterations,
296 CORBA::Double MaxAspectRatio,
297 SMESH::SMESH_MeshEditor::Smooth_Method Method,
299 throw (SALOME::SALOME_Exception);
301 CORBA::Boolean ConvertFromQuadratic()
302 throw (SALOME::SALOME_Exception);
303 void ConvertFromQuadraticObject(SMESH::SMESH_IDSource_ptr theObject)
304 throw (SALOME::SALOME_Exception);
305 void ConvertToQuadratic(CORBA::Boolean Force3d)
306 throw (SALOME::SALOME_Exception);
307 void ConvertToQuadraticObject(CORBA::Boolean theForce3d,
308 SMESH::SMESH_IDSource_ptr theObject)
309 throw (SALOME::SALOME_Exception);
310 void ConvertToBiQuadratic(CORBA::Boolean theForce3d,
311 SMESH::SMESH_IDSource_ptr theObject)
312 throw (SALOME::SALOME_Exception);
314 void RenumberNodes() throw (SALOME::SALOME_Exception);
315 void RenumberElements() throw (SALOME::SALOME_Exception);
317 SMESH::ListOfGroups* RotationSweepObjects(const SMESH::ListOfIDSources & nodes,
318 const SMESH::ListOfIDSources & edges,
319 const SMESH::ListOfIDSources & faces,
320 const SMESH::AxisStruct & Axis,
321 CORBA::Double AngleInRadians,
322 CORBA::Long NbOfSteps,
323 CORBA::Double Tolerance,
324 CORBA::Boolean toMakeGroups)
325 throw (SALOME::SALOME_Exception);
327 SMESH::ListOfGroups* ExtrusionSweepObjects(const SMESH::ListOfIDSources & nodes,
328 const SMESH::ListOfIDSources & edges,
329 const SMESH::ListOfIDSources & faces,
330 const SMESH::DirStruct & stepVector,
331 CORBA::Long nbOfSteps,
332 CORBA::Boolean toMakeGroups)
333 throw (SALOME::SALOME_Exception);
335 SMESH::ListOfGroups* ExtrusionByNormal(const SMESH::ListOfIDSources& objects,
336 CORBA::Double stepSize,
337 CORBA::Long nbOfSteps,
338 CORBA::Boolean byAverageNormal,
339 CORBA::Boolean useInputElemsOnly,
340 CORBA::Boolean makeGroups,
342 throw (SALOME::SALOME_Exception);
343 SMESH::ListOfGroups* AdvancedExtrusion(const SMESH::long_array & theIDsOfElements,
344 const SMESH::DirStruct & theStepVector,
345 CORBA::Long theNbOfSteps,
346 CORBA::Long theExtrFlags,
347 CORBA::Double theSewTolerance,
348 CORBA::Boolean theMakeGroups)
349 throw (SALOME::SALOME_Exception);
352 ExtrusionAlongPathObjects(const SMESH::ListOfIDSources & nodes,
353 const SMESH::ListOfIDSources & edges,
354 const SMESH::ListOfIDSources & faces,
355 SMESH::SMESH_IDSource_ptr PathMesh,
356 GEOM::GEOM_Object_ptr PathShape,
357 CORBA::Long NodeStart,
358 CORBA::Boolean HasAngles,
359 const SMESH::double_array & Angles,
360 CORBA::Boolean LinearVariation,
361 CORBA::Boolean HasRefPoint,
362 const SMESH::PointStruct & RefPoint,
364 SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
365 throw (SALOME::SALOME_Exception);
367 SMESH::double_array* LinearAnglesVariation(SMESH::SMESH_Mesh_ptr PathMesh,
368 GEOM::GEOM_Object_ptr PathShape,
369 const SMESH::double_array & Angles);
371 void Mirror(const SMESH::long_array & IDsOfElements,
372 const SMESH::AxisStruct & Axis,
373 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
375 throw (SALOME::SALOME_Exception);
376 void MirrorObject(SMESH::SMESH_IDSource_ptr theObject,
377 const SMESH::AxisStruct & Axis,
378 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
380 throw (SALOME::SALOME_Exception);
381 void Translate(const SMESH::long_array & IDsOfElements,
382 const SMESH::DirStruct & Vector,
384 throw (SALOME::SALOME_Exception);
385 void TranslateObject(SMESH::SMESH_IDSource_ptr theObject,
386 const SMESH::DirStruct & Vector,
388 throw (SALOME::SALOME_Exception);
389 void Rotate(const SMESH::long_array & IDsOfElements,
390 const SMESH::AxisStruct & Axis,
393 throw (SALOME::SALOME_Exception);
394 void RotateObject(SMESH::SMESH_IDSource_ptr theObject,
395 const SMESH::AxisStruct & Axis,
398 throw (SALOME::SALOME_Exception);
400 SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::long_array& IDsOfElements,
401 const SMESH::AxisStruct& Mirror,
402 SMESH::SMESH_MeshEditor::MirrorType MirrorType)
403 throw (SALOME::SALOME_Exception);
404 SMESH::ListOfGroups* MirrorObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
405 const SMESH::AxisStruct& Mirror,
406 SMESH::SMESH_MeshEditor::MirrorType MirrorType)
407 throw (SALOME::SALOME_Exception);
408 SMESH::ListOfGroups* TranslateMakeGroups(const SMESH::long_array& IDsOfElements,
409 const SMESH::DirStruct& Vector)
410 throw (SALOME::SALOME_Exception);
411 SMESH::ListOfGroups* TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
412 const SMESH::DirStruct& Vector)
413 throw (SALOME::SALOME_Exception);
414 SMESH::ListOfGroups* RotateMakeGroups(const SMESH::long_array& IDsOfElements,
415 const SMESH::AxisStruct& Axis,
416 CORBA::Double AngleInRadians)
417 throw (SALOME::SALOME_Exception);
418 SMESH::ListOfGroups* RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
419 const SMESH::AxisStruct& Axis,
420 CORBA::Double AngleInRadians)
421 throw (SALOME::SALOME_Exception);
423 SMESH::SMESH_Mesh_ptr MirrorMakeMesh(const SMESH::long_array& IDsOfElements,
424 const SMESH::AxisStruct& Mirror,
425 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
426 CORBA::Boolean CopyGroups,
427 const char* MeshName)
428 throw (SALOME::SALOME_Exception);
429 SMESH::SMESH_Mesh_ptr MirrorObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
430 const SMESH::AxisStruct& Mirror,
431 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
432 CORBA::Boolean CopyGroups,
433 const char* MeshName)
434 throw (SALOME::SALOME_Exception);
435 SMESH::SMESH_Mesh_ptr TranslateMakeMesh(const SMESH::long_array& IDsOfElements,
436 const SMESH::DirStruct& Vector,
437 CORBA::Boolean CopyGroups,
438 const char* MeshName)
439 throw (SALOME::SALOME_Exception);
440 SMESH::SMESH_Mesh_ptr TranslateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
441 const SMESH::DirStruct& Vector,
442 CORBA::Boolean CopyGroups,
443 const char* MeshName)
444 throw (SALOME::SALOME_Exception);
445 SMESH::SMESH_Mesh_ptr RotateMakeMesh(const SMESH::long_array& IDsOfElements,
446 const SMESH::AxisStruct& Axis,
447 CORBA::Double AngleInRadians,
448 CORBA::Boolean CopyGroups,
449 const char* MeshName)
450 throw (SALOME::SALOME_Exception);
451 SMESH::SMESH_Mesh_ptr RotateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
452 const SMESH::AxisStruct& Axis,
453 CORBA::Double AngleInRadians,
454 CORBA::Boolean CopyGroups,
455 const char* MeshName)
456 throw (SALOME::SALOME_Exception);
458 void Scale(SMESH::SMESH_IDSource_ptr theObject,
459 const SMESH::PointStruct& thePoint,
460 const SMESH::double_array& theScaleFact,
461 CORBA::Boolean theCopy)
462 throw (SALOME::SALOME_Exception);
464 SMESH::ListOfGroups* ScaleMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
465 const SMESH::PointStruct& thePoint,
466 const SMESH::double_array& theScaleFact)
467 throw (SALOME::SALOME_Exception);
469 SMESH::SMESH_Mesh_ptr ScaleMakeMesh(SMESH::SMESH_IDSource_ptr Object,
470 const SMESH::PointStruct& Point,
471 const SMESH::double_array& theScaleFact,
472 CORBA::Boolean CopyGroups,
473 const char* MeshName)
474 throw (SALOME::SALOME_Exception);
476 void FindCoincidentNodes (CORBA::Double Tolerance,
477 SMESH::array_of_long_array_out GroupsOfNodes,
478 CORBA::Boolean SeparateCornersAndMedium)
479 throw (SALOME::SALOME_Exception);
480 void FindCoincidentNodesOnPart(SMESH::SMESH_IDSource_ptr Object,
481 CORBA::Double Tolerance,
482 SMESH::array_of_long_array_out GroupsOfNodes,
483 CORBA::Boolean SeparateCornersAndMedium)
484 throw (SALOME::SALOME_Exception);
485 void FindCoincidentNodesOnPartBut(SMESH::SMESH_IDSource_ptr Object,
486 CORBA::Double Tolerance,
487 SMESH::array_of_long_array_out GroupsOfNodes,
488 const SMESH::ListOfIDSources& ExceptSubMeshOrGroups,
489 CORBA::Boolean SeparateCornersAndMedium)
490 throw (SALOME::SALOME_Exception);
491 void MergeNodes (const SMESH::array_of_long_array& GroupsOfNodes)
492 throw (SALOME::SALOME_Exception);
493 void FindEqualElements(SMESH::SMESH_IDSource_ptr Object,
494 SMESH::array_of_long_array_out GroupsOfElementsID)
495 throw (SALOME::SALOME_Exception);
496 void MergeElements(const SMESH::array_of_long_array& GroupsOfElementsID)
497 throw (SALOME::SALOME_Exception);
498 void MergeEqualElements()
499 throw (SALOME::SALOME_Exception);
500 CORBA::Long MoveClosestNodeToPoint(CORBA::Double x,
504 throw (SALOME::SALOME_Exception);
506 * \brief Return ID of node closest to a given point
508 CORBA::Long FindNodeClosestTo(CORBA::Double x,
511 throw (SALOME::SALOME_Exception);
513 * Return elements of given type where the given point is IN or ON.
514 * 'ALL' type means elements of any type excluding nodes
516 SMESH::long_array* FindElementsByPoint(CORBA::Double x,
519 SMESH::ElementType type)
520 throw (SALOME::SALOME_Exception);
522 * Searching among the given elements, return elements of given type
523 * where the given point is IN or ON.
524 * 'ALL' type means elements of any type excluding nodes
526 SMESH::long_array* FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elements,
530 SMESH::ElementType type)
531 throw (SALOME::SALOME_Exception);
534 * Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
535 * TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
537 CORBA::Short GetPointState(CORBA::Double x, CORBA::Double y, CORBA::Double z)
538 throw (SALOME::SALOME_Exception);
540 SMESH::SMESH_MeshEditor::Sew_Error
541 SewFreeBorders(CORBA::Long FirstNodeID1,
542 CORBA::Long SecondNodeID1,
543 CORBA::Long LastNodeID1,
544 CORBA::Long FirstNodeID2,
545 CORBA::Long SecondNodeID2,
546 CORBA::Long LastNodeID2,
547 CORBA::Boolean CreatePolygons,
548 CORBA::Boolean CreatePolyedrs)
549 throw (SALOME::SALOME_Exception);
550 SMESH::SMESH_MeshEditor::Sew_Error
551 SewConformFreeBorders(CORBA::Long FirstNodeID1,
552 CORBA::Long SecondNodeID1,
553 CORBA::Long LastNodeID1,
554 CORBA::Long FirstNodeID2,
555 CORBA::Long SecondNodeID2)
556 throw (SALOME::SALOME_Exception);
557 SMESH::SMESH_MeshEditor::Sew_Error
558 SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder,
559 CORBA::Long SecondNodeIDOnFreeBorder,
560 CORBA::Long LastNodeIDOnFreeBorder,
561 CORBA::Long FirstNodeIDOnSide,
562 CORBA::Long LastNodeIDOnSide,
563 CORBA::Boolean CreatePolygons,
564 CORBA::Boolean CreatePolyedrs)
565 throw (SALOME::SALOME_Exception);
566 SMESH::SMESH_MeshEditor::Sew_Error
567 SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
568 const SMESH::long_array& IDsOfSide2Elements,
569 CORBA::Long NodeID1OfSide1ToMerge,
570 CORBA::Long NodeID1OfSide2ToMerge,
571 CORBA::Long NodeID2OfSide1ToMerge,
572 CORBA::Long NodeID2OfSide2ToMerge)
573 throw (SALOME::SALOME_Exception);
576 * Set new nodes for given element.
577 * If number of nodes is not corresponded to type of
578 * element - returns false
580 CORBA::Boolean ChangeElemNodes(CORBA::Long ide, const SMESH::long_array& newIDs)
581 throw (SALOME::SALOME_Exception);
583 SMESH::SMESH_Group_ptr DoubleElements(SMESH::SMESH_IDSource_ptr theElements,
584 const char* theGroupName)
585 throw (SALOME::SALOME_Exception);
587 CORBA::Boolean DoubleNodes( const SMESH::long_array& theNodes,
588 const SMESH::long_array& theModifiedElems )
589 throw (SALOME::SALOME_Exception);
591 CORBA::Boolean DoubleNode( CORBA::Long theNodeId,
592 const SMESH::long_array& theModifiedElems )
593 throw (SALOME::SALOME_Exception);
595 CORBA::Boolean DoubleNodeGroup( SMESH::SMESH_GroupBase_ptr theNodes,
596 SMESH::SMESH_GroupBase_ptr theModifiedElems )
597 throw (SALOME::SALOME_Exception);
600 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
601 * Works as DoubleNodeGroup(), but returns a new group with newly created nodes.
602 * \param theNodes - group of nodes to be doubled.
603 * \param theModifiedElems - group of elements to be updated.
604 * \return a new group with newly created nodes
605 * \sa DoubleNodeGroup()
607 SMESH::SMESH_Group_ptr DoubleNodeGroupNew( SMESH::SMESH_GroupBase_ptr theNodes,
608 SMESH::SMESH_GroupBase_ptr theModifiedElems )
609 throw (SALOME::SALOME_Exception);
611 CORBA::Boolean DoubleNodeGroups( const SMESH::ListOfGroups& theNodes,
612 const SMESH::ListOfGroups& theModifiedElems )
613 throw (SALOME::SALOME_Exception);
615 SMESH::SMESH_Group_ptr DoubleNodeGroupsNew( const SMESH::ListOfGroups& theNodes,
616 const SMESH::ListOfGroups& theModifiedElems )
617 throw (SALOME::SALOME_Exception);
620 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
621 * \param theElems - the list of elements (edges or faces) to be replicated
622 * The nodes for duplication could be found from these elements
623 * \param theNodesNot - list of nodes to NOT replicate
624 * \param theAffectedElems - the list of elements (cells and edges) to which the
625 * replicated nodes should be associated to.
626 * \return TRUE if operation has been completed successfully, FALSE otherwise
627 * \sa DoubleNodeGroup(), DoubleNodeGroups()
629 CORBA::Boolean DoubleNodeElem( const SMESH::long_array& theElems,
630 const SMESH::long_array& theNodesNot,
631 const SMESH::long_array& theAffectedElems )
632 throw (SALOME::SALOME_Exception);
635 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
636 * \param theElems - the list of elements (edges or faces) to be replicated
637 * The nodes for duplication could be found from these elements
638 * \param theNodesNot - list of nodes to NOT replicate
639 * \param theShape - shape to detect affected elements (element which geometric center
640 * located on or inside shape).
641 * The replicated nodes should be associated to affected elements.
642 * \return TRUE if operation has been completed successfully, FALSE otherwise
643 * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
645 CORBA::Boolean DoubleNodeElemInRegion( const SMESH::long_array& theElems,
646 const SMESH::long_array& theNodesNot,
647 GEOM::GEOM_Object_ptr theShape )
648 throw (SALOME::SALOME_Exception);
651 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
652 * \param theElems - group of of elements (edges or faces) to be replicated
653 * \param theNodesNot - group of nodes not to replicated
654 * \param theAffectedElems - group of elements to which the replicated nodes
655 * should be associated to.
656 * \return TRUE if operation has been completed successfully, FALSE otherwise
657 * \sa DoubleNodes(), DoubleNodeGroups(), DoubleNodeElemGroupNew()
659 CORBA::Boolean DoubleNodeElemGroup( SMESH::SMESH_GroupBase_ptr theElems,
660 SMESH::SMESH_GroupBase_ptr theNodesNot,
661 SMESH::SMESH_GroupBase_ptr theAffectedElems )
662 throw (SALOME::SALOME_Exception);
665 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
666 * Works as DoubleNodeElemGroup(), but returns a new group with newly created elements.
667 * \param theElems - group of of elements (edges or faces) to be replicated
668 * \param theNodesNot - group of nodes not to replicated
669 * \param theAffectedElems - group of elements to which the replicated nodes
670 * should be associated to.
671 * \return a new group with newly created elements
672 * \sa DoubleNodeElemGroup()
674 SMESH::SMESH_Group_ptr DoubleNodeElemGroupNew( SMESH::SMESH_GroupBase_ptr theElems,
675 SMESH::SMESH_GroupBase_ptr theNodesNot,
676 SMESH::SMESH_GroupBase_ptr theAffectedElems )
677 throw (SALOME::SALOME_Exception);
679 SMESH::ListOfGroups* DoubleNodeElemGroup2New(SMESH::SMESH_GroupBase_ptr theElems,
680 SMESH::SMESH_GroupBase_ptr theNodesNot,
681 SMESH::SMESH_GroupBase_ptr theAffectedElems,
682 CORBA::Boolean theElemGroupNeeded,
683 CORBA::Boolean theNodeGroupNeeded)
684 throw (SALOME::SALOME_Exception);
687 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
688 * \param theElems - group of of elements (edges or faces) to be replicated
689 * \param theNodesNot - group of nodes not to replicated
690 * \param theShape - shape to detect affected elements (element which geometric center
691 * located on or inside shape).
692 * The replicated nodes should be associated to affected elements.
693 * \return TRUE if operation has been completed successfully, FALSE otherwise
694 * \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
696 CORBA::Boolean DoubleNodeElemGroupInRegion( SMESH::SMESH_GroupBase_ptr theElems,
697 SMESH::SMESH_GroupBase_ptr theNodesNot,
698 GEOM::GEOM_Object_ptr theShape )
699 throw (SALOME::SALOME_Exception);
702 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
703 * This method provided for convenience works as DoubleNodes() described above.
704 * \param theElems - list of groups of elements (edges or faces) to be replicated
705 * \param theNodesNot - list of groups of nodes not to replicated
706 * \param theAffectedElems - group of elements to which the replicated nodes
707 * should be associated to.
708 * \return TRUE if operation has been completed successfully, FALSE otherwise
709 * \sa DoubleNodeGroup(), DoubleNodes(), DoubleNodeElemGroupsNew()
711 CORBA::Boolean DoubleNodeElemGroups( const SMESH::ListOfGroups& theElems,
712 const SMESH::ListOfGroups& theNodesNot,
713 const SMESH::ListOfGroups& theAffectedElems )
714 throw (SALOME::SALOME_Exception);
717 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
718 * Works as DoubleNodeElemGroups(), but returns a new group with newly created elements.
719 * \param theElems - list of groups of elements (edges or faces) to be replicated
720 * \param theNodesNot - list of groups of nodes not to replicated
721 * \param theAffectedElems - group of elements to which the replicated nodes
722 * should be associated to.
723 * \return a new group with newly created elements
724 * \sa DoubleNodeElemGroups()
726 SMESH::SMESH_Group_ptr DoubleNodeElemGroupsNew( const SMESH::ListOfGroups& theElems,
727 const SMESH::ListOfGroups& theNodesNot,
728 const SMESH::ListOfGroups& theAffectedElems )
729 throw (SALOME::SALOME_Exception);
731 SMESH::ListOfGroups* DoubleNodeElemGroups2New(const SMESH::ListOfGroups& theElems,
732 const SMESH::ListOfGroups& theNodesNot,
733 const SMESH::ListOfGroups& theAffectedElems,
734 CORBA::Boolean theElemGroupNeeded,
735 CORBA::Boolean theNodeGroupNeeded)
736 throw (SALOME::SALOME_Exception);
739 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
740 * This method provided for convenience works as DoubleNodes() described above.
741 * \param theElems - list of groups of elements (edges or faces) to be replicated
742 * \param theNodesNot - list of groups of nodes not to replicated
743 * \param theShape - shape to detect affected elements (element which geometric center
744 * located on or inside shape).
745 * The replicated nodes should be associated to affected elements.
746 * \return TRUE if operation has been completed successfully, FALSE otherwise
747 * \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
749 CORBA::Boolean DoubleNodeElemGroupsInRegion( const SMESH::ListOfGroups& theElems,
750 const SMESH::ListOfGroups& theNodesNot,
751 GEOM::GEOM_Object_ptr theShape )
752 throw (SALOME::SALOME_Exception);
755 * \brief Identify the elements that will be affected by node duplication (actual duplication is not performed.
756 * This method is the first step of DoubleNodeElemGroupsInRegion.
757 * \param theElems - list of groups of elements (edges or faces) to be replicated
758 * \param theNodesNot - list of groups of nodes not to replicated
759 * \param theShape - shape to detect affected elements (element which geometric center
760 * located on or inside shape).
761 * The replicated nodes should be associated to affected elements.
762 * \return groups of affected elements
763 * \sa DoubleNodeElemGroupsInRegion()
765 SMESH::ListOfGroups* AffectedElemGroupsInRegion( const SMESH::ListOfGroups& theElems,
766 const SMESH::ListOfGroups& theNodesNot,
767 GEOM::GEOM_Object_ptr theShape )
768 throw (SALOME::SALOME_Exception);
771 * \brief Double nodes on shared faces between groups of volumes and create flat elements on demand.
772 * The list of groups must describe a partition of the mesh volumes.
773 * The nodes of the internal faces at the boundaries of the groups are doubled.
774 * In option, the internal faces are replaced by flat elements.
775 * Triangles are transformed in prisms, and quadrangles in hexahedrons.
776 * \param theDomains - list of groups of volumes
777 * \param createJointElems - if TRUE, create the elements
778 * \param onAllBoundaries - if TRUE, the nodes and elements are also create on
779 * the boundary between \a theDomains and the rest mesh
780 * \return TRUE if operation has been completed successfully, FALSE otherwise
782 CORBA::Boolean DoubleNodesOnGroupBoundaries( const SMESH::ListOfGroups& theDomains,
783 CORBA::Boolean createJointElems,
784 CORBA::Boolean onAllBoundaries )
785 throw (SALOME::SALOME_Exception);
787 * \brief Double nodes on some external faces and create flat elements.
788 * Flat elements are mainly used by some types of mechanic calculations.
790 * Each group of the list must be constituted of faces.
791 * Triangles are transformed in prisms, and quadrangles in hexahedrons.
792 * @param theGroupsOfFaces - list of groups of faces
793 * @return TRUE if operation has been completed successfully, FALSE otherwise
795 CORBA::Boolean CreateFlatElementsOnFacesGroups( const SMESH::ListOfGroups& theGroupsOfFaces )
796 throw (SALOME::SALOME_Exception);
799 * \brief identify all the elements around a geom shape, get the faces delimiting the hole
800 * Build groups of volume to remove, groups of faces to replace on the skin of the object,
801 * groups of faces to remove insidethe object, (idem edges).
802 * Build ordered list of nodes at the border of each group of faces to replace (to be used to build a geom subshape)
804 void CreateHoleSkin(CORBA::Double radius,
805 GEOM::GEOM_Object_ptr theShape,
806 const char* groupName,
807 const SMESH::double_array& theNodesCoords,
808 SMESH::array_of_long_array_out GroupsOfNodes)
809 throw (SALOME::SALOME_Exception);
812 * \brief Generated skin mesh (containing 2D cells) from 3D mesh
813 * The created 2D mesh elements based on nodes of free faces of boundary volumes
814 * \return TRUE if operation has been completed successfully, FALSE otherwise
816 CORBA::Boolean Make2DMeshFrom3D()
817 throw (SALOME::SALOME_Exception);
819 SMESH::SMESH_Mesh_ptr MakeBoundaryMesh(SMESH::SMESH_IDSource_ptr elements,
820 SMESH::Bnd_Dimension dimension,
821 const char* groupName,
822 const char* meshName,
823 CORBA::Boolean toCopyElements,
824 CORBA::Boolean toCopyMissingBondary,
825 SMESH::SMESH_Group_out group)
826 throw (SALOME::SALOME_Exception);
828 CORBA::Long MakeBoundaryElements(SMESH::Bnd_Dimension dimension,
829 const char* groupName,
830 const char* meshName,
831 CORBA::Boolean toCopyAll,
832 const SMESH::ListOfIDSources& groups,
833 SMESH::SMESH_Mesh_out mesh,
834 SMESH::SMESH_Group_out group)
835 throw (SALOME::SALOME_Exception);
837 private: //!< private methods
839 ::SMESH_MeshEditor& getEditor();
841 SMESHDS_Mesh * getMeshDS() { return myMesh->GetMeshDS(); }
843 MeshEditor_I::TPreviewMesh * getPreviewMesh( SMDSAbs_ElementType previewType = SMDSAbs_All );
845 void declareMeshModified( bool isReComputeSafe );
848 * \brief Clear myLastCreated* or myPreviewData
850 void initData(bool deleteSearchers=true);
853 * \brief Return groups by their IDs
855 SMESH::ListOfGroups* getGroups(const std::list<int>* groupIDs)
856 throw (SALOME::SALOME_Exception);
858 SMESH::ListOfGroups* mirror(TIDSortedElemSet & IDsOfElements,
859 const SMESH::AxisStruct & Axis,
860 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
863 ::SMESH_Mesh* TargetMesh=0)
864 throw (SALOME::SALOME_Exception);
865 SMESH::ListOfGroups* translate(TIDSortedElemSet & IDsOfElements,
866 const SMESH::DirStruct & Vector,
869 ::SMESH_Mesh* TargetMesh=0)
870 throw (SALOME::SALOME_Exception);
871 SMESH::ListOfGroups* rotate(TIDSortedElemSet & IDsOfElements,
872 const SMESH::AxisStruct & Axis,
876 ::SMESH_Mesh* TargetMesh=0)
877 throw (SALOME::SALOME_Exception);
879 SMESH::ListOfGroups* scale(SMESH::SMESH_IDSource_ptr theObject,
880 const SMESH::PointStruct& thePoint,
881 const SMESH::double_array& theScaleFact,
882 CORBA::Boolean theCopy,
884 ::SMESH_Mesh* theTargetMesh=0)
885 throw (SALOME::SALOME_Exception);
887 void convertToQuadratic(CORBA::Boolean theForce3d,
888 CORBA::Boolean theToBiQuad,
889 SMESH::SMESH_IDSource_ptr theObject = SMESH::SMESH_IDSource::_nil())
890 throw (SALOME::SALOME_Exception);
892 SMESH::SMESH_Mesh_ptr makeMesh(const char* theMeshName);
894 void dumpGroupsList(SMESH::TPythonDump & theDumpPython,
895 const SMESH::ListOfGroups * theGroupList);
897 string generateGroupName(const string& thePrefix);
899 void prepareIdSource(SMESH::SMESH_IDSource_ptr theObject);
902 enum IDSource_Error { IDSource_OK, IDSource_INVALID, IDSource_EMPTY };
904 bool idSourceToSet(SMESH::SMESH_IDSource_ptr theIDSource,
905 const SMESHDS_Mesh* theMeshDS,
906 TIDSortedElemSet& theElemSet,
907 const SMDSAbs_ElementType theType,
908 const bool emptyIfIsMesh = false,
909 IDSource_Error* error = 0);
911 void findCoincidentNodes( TIDSortedNodeSet & Nodes,
912 CORBA::Double Tolerance,
913 SMESH::array_of_long_array_out GroupsOfNodes,
914 CORBA::Boolean SeparateCornersAndMedium);
920 SMESH_Mesh_i* myMesh_i;
922 ::SMESH_MeshEditor myEditor;
924 bool myIsPreviewMode;
925 MeshEditor_I::TPreviewMesh * myPreviewMesh;
926 ::SMESH_MeshEditor * myPreviewEditor;
927 SMESH::MeshPreviewStruct_var myPreviewData;
929 // temporary IDSources
931 // std::list< _IDSource* > myAuxIDSources;
932 // void deleteAuxIDSources();