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
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"
41 class SMESH_MeshEditor;
44 class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
47 SMESH_MeshEditor_i(SMESH_Mesh_i * theMesh, bool isPreview);
49 virtual ~ SMESH_MeshEditor_i();
54 * \brief Wrap a sequence of ids in a SMESH_IDSource
56 SMESH::SMESH_IDSource_ptr MakeIDSource(const SMESH::long_array& IDsOfElements,
57 SMESH::ElementType type);
58 CORBA::Boolean RemoveElements(const SMESH::long_array & IDsOfElements);
59 CORBA::Boolean RemoveNodes(const SMESH::long_array & IDsOfNodes);
60 CORBA::Long RemoveOrphanNodes();
63 * Methods for creation new elements.
64 * Returns ID of created element or 0 if element not created
66 CORBA::Long AddNode(CORBA::Double x, CORBA::Double y, CORBA::Double z);
67 CORBA::Long Add0DElement(CORBA::Long IDOfNode);
68 CORBA::Long AddEdge(const SMESH::long_array & IDsOfNodes);
69 CORBA::Long AddFace(const SMESH::long_array & IDsOfNodes);
70 CORBA::Long AddPolygonalFace(const SMESH::long_array & IDsOfNodes);
71 CORBA::Long AddVolume(const SMESH::long_array & IDsOfNodes);
72 CORBA::Long AddPolyhedralVolume(const SMESH::long_array & IDsOfNodes,
73 const SMESH::long_array & Quantities);
74 CORBA::Long AddPolyhedralVolumeByFaces(const SMESH::long_array & IdsOfFaces);
77 * \brief Bind a node to a vertex
78 * \param NodeID - node ID
79 * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
81 void SetNodeOnVertex(CORBA::Long NodeID, CORBA::Long VertexID)
82 throw (SALOME::SALOME_Exception);
84 * \brief Store node position on an edge
85 * \param NodeID - node ID
86 * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
87 * \param paramOnEdge - parameter on edge where the node is located
89 void SetNodeOnEdge(CORBA::Long NodeID, CORBA::Long EdgeID,
90 CORBA::Double paramOnEdge)
91 throw (SALOME::SALOME_Exception);
93 * \brief Store node position on a face
94 * \param NodeID - node ID
95 * \param FaceID - face ID available through GEOM_Object.GetSubShapeIndices()[0]
96 * \param u - U parameter on face where the node is located
97 * \param v - V parameter on face where the node is located
99 void SetNodeOnFace(CORBA::Long NodeID, CORBA::Long FaceID,
100 CORBA::Double u, CORBA::Double v)
101 throw (SALOME::SALOME_Exception);
103 * \brief Bind a node to a solid
104 * \param NodeID - node ID
105 * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
107 void SetNodeInVolume(CORBA::Long NodeID, CORBA::Long SolidID)
108 throw (SALOME::SALOME_Exception);
110 * \brief Bind an element to a shape
111 * \param ElementID - element ID
112 * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0]
114 void SetMeshElementOnShape(CORBA::Long ElementID, CORBA::Long ShapeID)
115 throw (SALOME::SALOME_Exception);
118 CORBA::Boolean MoveNode(CORBA::Long NodeID,
119 CORBA::Double x, CORBA::Double y, CORBA::Double z);
121 CORBA::Boolean InverseDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
122 CORBA::Boolean DeleteDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
123 CORBA::Boolean Reorient(const SMESH::long_array & IDsOfElements);
124 CORBA::Boolean ReorientObject(SMESH::SMESH_IDSource_ptr theObject);
126 * \brief Reorient faces contained in \a the2Dgroup.
127 * \param the2Dgroup - the mesh or its part to reorient
128 * \param theDirection - desired direction of normal of \a theFace
129 * \param theFace - ID of face whose orientation is checked.
130 * It can be < 1 then \a thePoint is used to find a face.
131 * \param thePoint - is used to find a face if \a theFace < 1.
132 * \return number of reoriented elements.
134 CORBA::Long Reorient2D(SMESH::SMESH_IDSource_ptr the2Dgroup,
135 const SMESH::DirStruct& theDirection,
137 const SMESH::PointStruct& thePoint) throw (SALOME::SALOME_Exception);
140 CORBA::Boolean TriToQuad (const SMESH::long_array & IDsOfElements,
141 SMESH::NumericalFunctor_ptr Criterion,
142 CORBA::Double MaxAngle);
143 CORBA::Boolean TriToQuadObject (SMESH::SMESH_IDSource_ptr theObject,
144 SMESH::NumericalFunctor_ptr Criterion,
145 CORBA::Double MaxAngle);
146 CORBA::Boolean QuadToTri (const SMESH::long_array & IDsOfElements,
147 SMESH::NumericalFunctor_ptr Criterion);
148 CORBA::Boolean QuadToTriObject (SMESH::SMESH_IDSource_ptr theObject,
149 SMESH::NumericalFunctor_ptr Criterion);
150 CORBA::Boolean SplitQuad (const SMESH::long_array & IDsOfElements,
151 CORBA::Boolean Diag13);
152 CORBA::Boolean SplitQuadObject (SMESH::SMESH_IDSource_ptr theObject,
153 CORBA::Boolean Diag13);
154 CORBA::Long BestSplit (CORBA::Long IDOfQuad,
155 SMESH::NumericalFunctor_ptr Criterion);
156 void SplitVolumesIntoTetra (SMESH::SMESH_IDSource_ptr elems,
157 CORBA::Short methodFlags) throw (SALOME::SALOME_Exception);
159 CORBA::Boolean Smooth(const SMESH::long_array & IDsOfElements,
160 const SMESH::long_array & IDsOfFixedNodes,
161 CORBA::Long MaxNbOfIterations,
162 CORBA::Double MaxAspectRatio,
163 SMESH::SMESH_MeshEditor::Smooth_Method Method);
164 CORBA::Boolean SmoothObject(SMESH::SMESH_IDSource_ptr theObject,
165 const SMESH::long_array & IDsOfFixedNodes,
166 CORBA::Long MaxNbOfIterations,
167 CORBA::Double MaxAspectRatio,
168 SMESH::SMESH_MeshEditor::Smooth_Method Method);
169 CORBA::Boolean SmoothParametric(const SMESH::long_array & IDsOfElements,
170 const SMESH::long_array & IDsOfFixedNodes,
171 CORBA::Long MaxNbOfIterations,
172 CORBA::Double MaxAspectRatio,
173 SMESH::SMESH_MeshEditor::Smooth_Method Method);
174 CORBA::Boolean SmoothParametricObject(SMESH::SMESH_IDSource_ptr theObject,
175 const SMESH::long_array & IDsOfFixedNodes,
176 CORBA::Long MaxNbOfIterations,
177 CORBA::Double MaxAspectRatio,
178 SMESH::SMESH_MeshEditor::Smooth_Method Method);
179 CORBA::Boolean smooth(const SMESH::long_array & IDsOfElements,
180 const SMESH::long_array & IDsOfFixedNodes,
181 CORBA::Long MaxNbOfIterations,
182 CORBA::Double MaxAspectRatio,
183 SMESH::SMESH_MeshEditor::Smooth_Method Method,
185 CORBA::Boolean smoothObject(SMESH::SMESH_IDSource_ptr theObject,
186 const SMESH::long_array & IDsOfFixedNodes,
187 CORBA::Long MaxNbOfIterations,
188 CORBA::Double MaxAspectRatio,
189 SMESH::SMESH_MeshEditor::Smooth_Method Method,
193 void ConvertToQuadratic(CORBA::Boolean Force3d);
194 CORBA::Boolean ConvertFromQuadratic();
195 void ConvertToQuadraticObject(CORBA::Boolean theForce3d,
196 SMESH::SMESH_IDSource_ptr theObject)
197 throw (SALOME::SALOME_Exception);
198 void ConvertFromQuadraticObject(SMESH::SMESH_IDSource_ptr theObject)
199 throw (SALOME::SALOME_Exception);
201 void RenumberNodes();
202 void RenumberElements();
204 void RotationSweep(const SMESH::long_array & IDsOfElements,
205 const SMESH::AxisStruct & Axis,
206 CORBA::Double AngleInRadians,
207 CORBA::Long NbOfSteps,
208 CORBA::Double Tolerance);
209 void RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject,
210 const SMESH::AxisStruct & Axis,
211 CORBA::Double AngleInRadians,
212 CORBA::Long NbOfSteps,
213 CORBA::Double Tolerance);
214 void RotationSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
215 const SMESH::AxisStruct & Axis,
216 CORBA::Double AngleInRadians,
217 CORBA::Long NbOfSteps,
218 CORBA::Double Tolerance);
219 void RotationSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
220 const SMESH::AxisStruct & Axis,
221 CORBA::Double AngleInRadians,
222 CORBA::Long NbOfSteps,
223 CORBA::Double Tolerance);
225 void ExtrusionSweep(const SMESH::long_array & IDsOfElements,
226 const SMESH::DirStruct & StepVector,
227 CORBA::Long NbOfSteps);
228 void ExtrusionSweep0D(const SMESH::long_array & IDsOfElements,
229 const SMESH::DirStruct & StepVector,
230 CORBA::Long NbOfSteps);
232 void ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObject,
233 const SMESH::DirStruct & StepVector,
234 CORBA::Long NbOfSteps);
236 void ExtrusionSweepObject0D(SMESH::SMESH_IDSource_ptr theObject,
237 const SMESH::DirStruct & StepVector,
238 CORBA::Long NbOfSteps);
239 void ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
240 const SMESH::DirStruct & StepVector,
241 CORBA::Long NbOfSteps);
242 void ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
243 const SMESH::DirStruct & StepVector,
244 CORBA::Long NbOfSteps);
245 void AdvancedExtrusion(const SMESH::long_array & theIDsOfElements,
246 const SMESH::DirStruct & theStepVector,
247 CORBA::Long theNbOfSteps,
248 CORBA::Long theExtrFlags,
249 CORBA::Double theSewTolerance);
251 SMESH::SMESH_MeshEditor::Extrusion_Error
252 ExtrusionAlongPath(const SMESH::long_array & IDsOfElements,
253 SMESH::SMESH_Mesh_ptr PathMesh,
254 GEOM::GEOM_Object_ptr PathShape,
255 CORBA::Long NodeStart,
256 CORBA::Boolean HasAngles,
257 const SMESH::double_array & Angles,
258 CORBA::Boolean HasRefPoint,
259 const SMESH::PointStruct & RefPoint);
261 SMESH::SMESH_MeshEditor::Extrusion_Error
262 ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr theObject,
263 SMESH::SMESH_Mesh_ptr PathMesh,
264 GEOM::GEOM_Object_ptr PathShape,
265 CORBA::Long NodeStart,
266 CORBA::Boolean HasAngles,
267 const SMESH::double_array & Angles,
268 CORBA::Boolean HasRefPoint,
269 const SMESH::PointStruct & RefPoint);
270 SMESH::SMESH_MeshEditor::Extrusion_Error
271 ExtrusionAlongPathObject1D(SMESH::SMESH_IDSource_ptr theObject,
272 SMESH::SMESH_Mesh_ptr PathMesh,
273 GEOM::GEOM_Object_ptr PathShape,
274 CORBA::Long NodeStart,
275 CORBA::Boolean HasAngles,
276 const SMESH::double_array & Angles,
277 CORBA::Boolean HasRefPoint,
278 const SMESH::PointStruct & RefPoint);
279 SMESH::SMESH_MeshEditor::Extrusion_Error
280 ExtrusionAlongPathObject2D(SMESH::SMESH_IDSource_ptr theObject,
281 SMESH::SMESH_Mesh_ptr PathMesh,
282 GEOM::GEOM_Object_ptr PathShape,
283 CORBA::Long NodeStart,
284 CORBA::Boolean HasAngles,
285 const SMESH::double_array & Angles,
286 CORBA::Boolean HasRefPoint,
287 const SMESH::PointStruct & RefPoint);
289 SMESH::double_array* LinearAnglesVariation(SMESH::SMESH_Mesh_ptr PathMesh,
290 GEOM::GEOM_Object_ptr PathShape,
291 const SMESH::double_array & Angles);
293 void Mirror(const SMESH::long_array & IDsOfElements,
294 const SMESH::AxisStruct & Axis,
295 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
296 CORBA::Boolean Copy);
297 void MirrorObject(SMESH::SMESH_IDSource_ptr theObject,
298 const SMESH::AxisStruct & Axis,
299 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
300 CORBA::Boolean Copy);
301 void Translate(const SMESH::long_array & IDsOfElements,
302 const SMESH::DirStruct & Vector,
303 CORBA::Boolean Copy);
304 void TranslateObject(SMESH::SMESH_IDSource_ptr theObject,
305 const SMESH::DirStruct & Vector,
306 CORBA::Boolean Copy);
307 void Rotate(const SMESH::long_array & IDsOfElements,
308 const SMESH::AxisStruct & Axis,
310 CORBA::Boolean Copy);
311 void RotateObject(SMESH::SMESH_IDSource_ptr theObject,
312 const SMESH::AxisStruct & Axis,
314 CORBA::Boolean Copy);
316 SMESH::ListOfGroups* RotationSweepMakeGroups(const SMESH::long_array& IDsOfElements,
317 const SMESH::AxisStruct& Axix,
318 CORBA::Double AngleInRadians,
319 CORBA::Long NbOfSteps,
320 CORBA::Double Tolerance);
321 SMESH::ListOfGroups* RotationSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
322 const SMESH::AxisStruct& Axix,
323 CORBA::Double AngleInRadians,
324 CORBA::Long NbOfSteps,
325 CORBA::Double Tolerance);
326 SMESH::ListOfGroups* RotationSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
327 const SMESH::AxisStruct& Axix,
328 CORBA::Double AngleInRadians,
329 CORBA::Long NbOfSteps,
330 CORBA::Double Tolerance);
331 SMESH::ListOfGroups* RotationSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
332 const SMESH::AxisStruct& Axix,
333 CORBA::Double AngleInRadians,
334 CORBA::Long NbOfSteps,
335 CORBA::Double Tolerance);
336 SMESH::ListOfGroups* ExtrusionSweepMakeGroups(const SMESH::long_array& IDsOfElements,
337 const SMESH::DirStruct& StepVector,
338 CORBA::Long NbOfSteps);
339 SMESH::ListOfGroups* ExtrusionSweepMakeGroups0D(const SMESH::long_array& IDsOfElements,
340 const SMESH::DirStruct& StepVector,
341 CORBA::Long NbOfSteps);
343 SMESH::ListOfGroups* AdvancedExtrusionMakeGroups(const SMESH::long_array& IDsOfElements,
344 const SMESH::DirStruct& StepVector,
345 CORBA::Long NbOfSteps,
346 CORBA::Long ExtrFlags,
347 CORBA::Double SewTolerance);
348 SMESH::ListOfGroups* ExtrusionSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
349 const SMESH::DirStruct& StepVector,
350 CORBA::Long NbOfSteps);
351 SMESH::ListOfGroups* ExtrusionSweepObject0DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
352 const SMESH::DirStruct& StepVector,
353 CORBA::Long NbOfSteps);
354 SMESH::ListOfGroups* ExtrusionSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
355 const SMESH::DirStruct& StepVector,
356 CORBA::Long NbOfSteps);
357 SMESH::ListOfGroups* ExtrusionSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
358 const SMESH::DirStruct& StepVector,
359 CORBA::Long NbOfSteps);
360 SMESH::ListOfGroups* ExtrusionAlongPathMakeGroups(const SMESH::long_array& IDsOfElements,
361 SMESH::SMESH_Mesh_ptr PathMesh,
362 GEOM::GEOM_Object_ptr PathShape,
363 CORBA::Long NodeStart,
364 CORBA::Boolean HasAngles,
365 const SMESH::double_array& Angles,
366 CORBA::Boolean HasRefPoint,
367 const SMESH::PointStruct& RefPoint,
368 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
369 SMESH::ListOfGroups* ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
370 SMESH::SMESH_Mesh_ptr PathMesh,
371 GEOM::GEOM_Object_ptr PathShape,
372 CORBA::Long NodeStart,
373 CORBA::Boolean HasAngles,
374 const SMESH::double_array& Angles,
375 CORBA::Boolean HasRefPoint,
376 const SMESH::PointStruct& RefPoint,
377 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
378 SMESH::ListOfGroups* ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
379 SMESH::SMESH_Mesh_ptr PathMesh,
380 GEOM::GEOM_Object_ptr PathShape,
381 CORBA::Long NodeStart,
382 CORBA::Boolean HasAngles,
383 const SMESH::double_array& Angles,
384 CORBA::Boolean HasRefPoint,
385 const SMESH::PointStruct& RefPoint,
386 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
387 SMESH::ListOfGroups* ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
388 SMESH::SMESH_Mesh_ptr PathMesh,
389 GEOM::GEOM_Object_ptr PathShape,
390 CORBA::Long NodeStart,
391 CORBA::Boolean HasAngles,
392 const SMESH::double_array& Angles,
393 CORBA::Boolean HasRefPoint,
394 const SMESH::PointStruct& RefPoint,
395 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
398 SMESH::ListOfGroups* ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr Object,
399 SMESH::SMESH_IDSource_ptr Path,
400 CORBA::Long NodeStart,
401 CORBA::Boolean HasAngles,
402 const SMESH::double_array& Angles,
403 CORBA::Boolean LinearVariation,
404 CORBA::Boolean HasRefPoint,
405 const SMESH::PointStruct& RefPoint,
406 CORBA::Boolean MakeGroups,
407 SMESH::ElementType ElemType,
408 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
409 SMESH::ListOfGroups* ExtrusionAlongPathX(const SMESH::long_array& IDsOfElements,
410 SMESH::SMESH_IDSource_ptr Path,
411 CORBA::Long NodeStart,
412 CORBA::Boolean HasAngles,
413 const SMESH::double_array& Angles,
414 CORBA::Boolean LinearVariation,
415 CORBA::Boolean HasRefPoint,
416 const SMESH::PointStruct& RefPoint,
417 CORBA::Boolean MakeGroups,
418 SMESH::ElementType ElemType,
419 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
421 SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::long_array& IDsOfElements,
422 const SMESH::AxisStruct& Mirror,
423 SMESH::SMESH_MeshEditor::MirrorType MirrorType);
424 SMESH::ListOfGroups* MirrorObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
425 const SMESH::AxisStruct& Mirror,
426 SMESH::SMESH_MeshEditor::MirrorType MirrorType);
427 SMESH::ListOfGroups* TranslateMakeGroups(const SMESH::long_array& IDsOfElements,
428 const SMESH::DirStruct& Vector);
429 SMESH::ListOfGroups* TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
430 const SMESH::DirStruct& Vector);
431 SMESH::ListOfGroups* RotateMakeGroups(const SMESH::long_array& IDsOfElements,
432 const SMESH::AxisStruct& Axis,
433 CORBA::Double AngleInRadians);
434 SMESH::ListOfGroups* RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
435 const SMESH::AxisStruct& Axis,
436 CORBA::Double AngleInRadians);
438 SMESH::SMESH_Mesh_ptr MirrorMakeMesh(const SMESH::long_array& IDsOfElements,
439 const SMESH::AxisStruct& Mirror,
440 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
441 CORBA::Boolean CopyGroups,
442 const char* MeshName);
443 SMESH::SMESH_Mesh_ptr MirrorObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
444 const SMESH::AxisStruct& Mirror,
445 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
446 CORBA::Boolean CopyGroups,
447 const char* MeshName);
448 SMESH::SMESH_Mesh_ptr TranslateMakeMesh(const SMESH::long_array& IDsOfElements,
449 const SMESH::DirStruct& Vector,
450 CORBA::Boolean CopyGroups,
451 const char* MeshName);
452 SMESH::SMESH_Mesh_ptr TranslateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
453 const SMESH::DirStruct& Vector,
454 CORBA::Boolean CopyGroups,
455 const char* MeshName);
456 SMESH::SMESH_Mesh_ptr RotateMakeMesh(const SMESH::long_array& IDsOfElements,
457 const SMESH::AxisStruct& Axis,
458 CORBA::Double AngleInRadians,
459 CORBA::Boolean CopyGroups,
460 const char* MeshName);
461 SMESH::SMESH_Mesh_ptr RotateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
462 const SMESH::AxisStruct& Axis,
463 CORBA::Double AngleInRadians,
464 CORBA::Boolean CopyGroups,
465 const char* MeshName);
467 void Scale(SMESH::SMESH_IDSource_ptr theObject,
468 const SMESH::PointStruct& thePoint,
469 const SMESH::double_array& theScaleFact,
470 CORBA::Boolean theCopy);
472 SMESH::ListOfGroups* ScaleMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
473 const SMESH::PointStruct& thePoint,
474 const SMESH::double_array& theScaleFact);
476 SMESH::SMESH_Mesh_ptr ScaleMakeMesh(SMESH::SMESH_IDSource_ptr Object,
477 const SMESH::PointStruct& Point,
478 const SMESH::double_array& theScaleFact,
479 CORBA::Boolean CopyGroups,
480 const char* MeshName);
482 void FindCoincidentNodes (CORBA::Double Tolerance,
483 SMESH::array_of_long_array_out GroupsOfNodes);
484 void FindCoincidentNodesOnPart(SMESH::SMESH_IDSource_ptr Object,
485 CORBA::Double Tolerance,
486 SMESH::array_of_long_array_out GroupsOfNodes);
487 void FindCoincidentNodesOnPartBut(SMESH::SMESH_IDSource_ptr Object,
488 CORBA::Double Tolerance,
489 SMESH::array_of_long_array_out GroupsOfNodes,
490 const SMESH::ListOfIDSources& ExceptSubMeshOrGroups);
491 void MergeNodes (const SMESH::array_of_long_array& GroupsOfNodes);
492 void FindEqualElements(SMESH::SMESH_IDSource_ptr Object,
493 SMESH::array_of_long_array_out GroupsOfElementsID);
494 void MergeElements(const SMESH::array_of_long_array& GroupsOfElementsID);
495 void MergeEqualElements();
496 CORBA::Long MoveClosestNodeToPoint(CORBA::Double x,
501 * \brief Return ID of node closest to a given point
503 CORBA::Long FindNodeClosestTo(CORBA::Double x,
507 * Return elements of given type where the given point is IN or ON.
508 * 'ALL' type means elements of any type excluding nodes
510 SMESH::long_array* FindElementsByPoint(CORBA::Double x,
513 SMESH::ElementType type);
515 * Searching among the given elements, return elements of given type
516 * where the given point is IN or ON.
517 * 'ALL' type means elements of any type excluding nodes
519 SMESH::long_array* FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elements,
523 SMESH::ElementType type);
526 * Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
527 * TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
529 CORBA::Short GetPointState(CORBA::Double x, CORBA::Double y, CORBA::Double z);
531 SMESH::SMESH_MeshEditor::Sew_Error
532 SewFreeBorders(CORBA::Long FirstNodeID1,
533 CORBA::Long SecondNodeID1,
534 CORBA::Long LastNodeID1,
535 CORBA::Long FirstNodeID2,
536 CORBA::Long SecondNodeID2,
537 CORBA::Long LastNodeID2,
538 CORBA::Boolean CreatePolygons,
539 CORBA::Boolean CreatePolyedrs);
540 SMESH::SMESH_MeshEditor::Sew_Error
541 SewConformFreeBorders(CORBA::Long FirstNodeID1,
542 CORBA::Long SecondNodeID1,
543 CORBA::Long LastNodeID1,
544 CORBA::Long FirstNodeID2,
545 CORBA::Long SecondNodeID2);
546 SMESH::SMESH_MeshEditor::Sew_Error
547 SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder,
548 CORBA::Long SecondNodeIDOnFreeBorder,
549 CORBA::Long LastNodeIDOnFreeBorder,
550 CORBA::Long FirstNodeIDOnSide,
551 CORBA::Long LastNodeIDOnSide,
552 CORBA::Boolean CreatePolygons,
553 CORBA::Boolean CreatePolyedrs);
554 SMESH::SMESH_MeshEditor::Sew_Error
555 SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
556 const SMESH::long_array& IDsOfSide2Elements,
557 CORBA::Long NodeID1OfSide1ToMerge,
558 CORBA::Long NodeID1OfSide2ToMerge,
559 CORBA::Long NodeID2OfSide1ToMerge,
560 CORBA::Long NodeID2OfSide2ToMerge);
563 * Set new nodes for given element.
564 * If number of nodes is not corresponded to type of
565 * element - returns false
567 CORBA::Boolean ChangeElemNodes(CORBA::Long ide, const SMESH::long_array& newIDs);
570 * Return data of mesh edition preview
572 SMESH::MeshPreviewStruct* GetPreviewData();
575 * If during last operation of MeshEditor some nodes were
576 * created this method returns list of it's IDs, if new nodes
577 * not creared - returns empty list
579 SMESH::long_array* GetLastCreatedNodes();
582 * If during last operation of MeshEditor some elements were
583 * created this method returns list of it's IDs, if new elements
584 * not creared - returns empty list
586 SMESH::long_array* GetLastCreatedElems();
589 * \brief Return edited mesh ID
590 * \retval int - mesh ID
592 int GetMeshId() const { return myMesh->GetId(); }
594 CORBA::Boolean DoubleNodes( const SMESH::long_array& theNodes,
595 const SMESH::long_array& theModifiedElems );
597 CORBA::Boolean DoubleNode( CORBA::Long theNodeId,
598 const SMESH::long_array& theModifiedElems );
600 CORBA::Boolean DoubleNodeGroup( SMESH::SMESH_GroupBase_ptr theNodes,
601 SMESH::SMESH_GroupBase_ptr theModifiedElems );
604 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
605 * Works as DoubleNodeGroup(), but returns a new group with newly created nodes.
606 * \param theNodes - group of nodes to be doubled.
607 * \param theModifiedElems - group of elements to be updated.
608 * \return a new group with newly created nodes
609 * \sa DoubleNodeGroup()
611 SMESH::SMESH_Group_ptr DoubleNodeGroupNew( SMESH::SMESH_GroupBase_ptr theNodes,
612 SMESH::SMESH_GroupBase_ptr theModifiedElems );
614 CORBA::Boolean DoubleNodeGroups( const SMESH::ListOfGroups& theNodes,
615 const SMESH::ListOfGroups& theModifiedElems );
617 SMESH::SMESH_Group_ptr DoubleNodeGroupsNew( const SMESH::ListOfGroups& theNodes,
618 const SMESH::ListOfGroups& theModifiedElems );
621 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
622 * \param theElems - the list of elements (edges or faces) to be replicated
623 * The nodes for duplication could be found from these elements
624 * \param theNodesNot - list of nodes to NOT replicate
625 * \param theAffectedElems - the list of elements (cells and edges) to which the
626 * replicated nodes should be associated to.
627 * \return TRUE if operation has been completed successfully, FALSE otherwise
628 * \sa DoubleNodeGroup(), DoubleNodeGroups()
630 CORBA::Boolean DoubleNodeElem( const SMESH::long_array& theElems,
631 const SMESH::long_array& theNodesNot,
632 const SMESH::long_array& theAffectedElems );
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 );
650 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
651 * \param theElems - group of of elements (edges or faces) to be replicated
652 * \param theNodesNot - group of nodes not to replicated
653 * \param theAffectedElems - group of elements to which the replicated nodes
654 * should be associated to.
655 * \return TRUE if operation has been completed successfully, FALSE otherwise
656 * \sa DoubleNodes(), DoubleNodeGroups(), DoubleNodeElemGroupNew()
658 CORBA::Boolean DoubleNodeElemGroup( SMESH::SMESH_GroupBase_ptr theElems,
659 SMESH::SMESH_GroupBase_ptr theNodesNot,
660 SMESH::SMESH_GroupBase_ptr theAffectedElems );
663 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
664 * Works as DoubleNodeElemGroup(), but returns a new group with newly created elements.
665 * \param theElems - group of of elements (edges or faces) to be replicated
666 * \param theNodesNot - group of nodes not to replicated
667 * \param theAffectedElems - group of elements to which the replicated nodes
668 * should be associated to.
669 * \return a new group with newly created elements
670 * \sa DoubleNodeElemGroup()
672 SMESH::SMESH_Group_ptr DoubleNodeElemGroupNew( SMESH::SMESH_GroupBase_ptr theElems,
673 SMESH::SMESH_GroupBase_ptr theNodesNot,
674 SMESH::SMESH_GroupBase_ptr theAffectedElems );
676 SMESH::ListOfGroups* DoubleNodeElemGroup2New(SMESH::SMESH_GroupBase_ptr theElems,
677 SMESH::SMESH_GroupBase_ptr theNodesNot,
678 SMESH::SMESH_GroupBase_ptr theAffectedElems,
679 CORBA::Boolean theElemGroupNeeded,
680 CORBA::Boolean theNodeGroupNeeded);
683 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
684 * \param theElems - group of of elements (edges or faces) to be replicated
685 * \param theNodesNot - group of nodes not to replicated
686 * \param theShape - shape to detect affected elements (element which geometric center
687 * located on or inside shape).
688 * The replicated nodes should be associated to affected elements.
689 * \return TRUE if operation has been completed successfully, FALSE otherwise
690 * \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
692 CORBA::Boolean DoubleNodeElemGroupInRegion( SMESH::SMESH_GroupBase_ptr theElems,
693 SMESH::SMESH_GroupBase_ptr theNodesNot,
694 GEOM::GEOM_Object_ptr theShape );
697 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
698 * This method provided for convenience works as DoubleNodes() described above.
699 * \param theElems - list of groups of elements (edges or faces) to be replicated
700 * \param theNodesNot - list of groups of nodes not to replicated
701 * \param theAffectedElems - group of elements to which the replicated nodes
702 * should be associated to.
703 * \return TRUE if operation has been completed successfully, FALSE otherwise
704 * \sa DoubleNodeGroup(), DoubleNodes(), DoubleNodeElemGroupsNew()
706 CORBA::Boolean DoubleNodeElemGroups( const SMESH::ListOfGroups& theElems,
707 const SMESH::ListOfGroups& theNodesNot,
708 const SMESH::ListOfGroups& theAffectedElems );
711 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
712 * Works as DoubleNodeElemGroups(), but returns a new group with newly created elements.
713 * \param theElems - list of groups of elements (edges or faces) to be replicated
714 * \param theNodesNot - list of groups of nodes not to replicated
715 * \param theAffectedElems - group of elements to which the replicated nodes
716 * should be associated to.
717 * \return a new group with newly created elements
718 * \sa DoubleNodeElemGroups()
720 SMESH::SMESH_Group_ptr DoubleNodeElemGroupsNew( const SMESH::ListOfGroups& theElems,
721 const SMESH::ListOfGroups& theNodesNot,
722 const SMESH::ListOfGroups& theAffectedElems );
724 SMESH::ListOfGroups* DoubleNodeElemGroups2New(const SMESH::ListOfGroups& theElems,
725 const SMESH::ListOfGroups& theNodesNot,
726 const SMESH::ListOfGroups& theAffectedElems,
727 CORBA::Boolean theElemGroupNeeded,
728 CORBA::Boolean theNodeGroupNeeded);
731 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
732 * This method provided for convenience works as DoubleNodes() described above.
733 * \param theElems - list of groups of elements (edges or faces) to be replicated
734 * \param theNodesNot - list of groups of nodes not to replicated
735 * \param theShape - shape to detect affected elements (element which geometric center
736 * located on or inside shape).
737 * The replicated nodes should be associated to affected elements.
738 * \return TRUE if operation has been completed successfully, FALSE otherwise
739 * \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
741 CORBA::Boolean DoubleNodeElemGroupsInRegion( const SMESH::ListOfGroups& theElems,
742 const SMESH::ListOfGroups& theNodesNot,
743 GEOM::GEOM_Object_ptr theShape );
745 * \brief Double nodes on shared faces between groups of volumes and create flat elements on demand.
746 * The list of groups must describe a partition of the mesh volumes.
747 * The nodes of the internal faces at the boundaries of the groups are doubled.
748 * In option, the internal faces are replaced by flat elements.
749 * Triangles are transformed in prisms, and quadrangles in hexahedrons.
750 * @param theDomains - list of groups of volumes
751 * @param createJointElems - if TRUE, create the elements
752 * @return TRUE if operation has been completed successfully, FALSE otherwise
754 CORBA::Boolean DoubleNodesOnGroupBoundaries( const SMESH::ListOfGroups& theDomains,
755 CORBA::Boolean createJointElems )
756 throw (SALOME::SALOME_Exception);
758 * \brief Double nodes on some external faces and create flat elements.
759 * Flat elements are mainly used by some types of mechanic calculations.
761 * Each group of the list must be constituted of faces.
762 * Triangles are transformed in prisms, and quadrangles in hexahedrons.
763 * @param theGroupsOfFaces - list of groups of faces
764 * @return TRUE if operation has been completed successfully, FALSE otherwise
766 CORBA::Boolean CreateFlatElementsOnFacesGroups( const SMESH::ListOfGroups& theGroupsOfFaces );
769 * \brief Generated skin mesh (containing 2D cells) from 3D mesh
770 * The created 2D mesh elements based on nodes of free faces of boundary volumes
771 * \return TRUE if operation has been completed successfully, FALSE otherwise
773 CORBA::Boolean Make2DMeshFrom3D();
775 SMESH::SMESH_Mesh_ptr MakeBoundaryMesh(SMESH::SMESH_IDSource_ptr elements,
776 SMESH::Bnd_Dimension dimension,
777 const char* groupName,
778 const char* meshName,
779 CORBA::Boolean toCopyElements,
780 CORBA::Boolean toCopyMissingBondary,
781 SMESH::SMESH_Group_out group);
783 CORBA::Long MakeBoundaryElements(SMESH::Bnd_Dimension dimension,
784 const char* groupName,
785 const char* meshName,
786 CORBA::Boolean toCopyAll,
787 const SMESH::ListOfIDSources& groups,
788 SMESH::SMESH_Mesh_out mesh,
789 SMESH::SMESH_Group_out group)
790 throw (SALOME::SALOME_Exception);
792 private: //!< private methods
794 SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); }
797 * \brief Update myLastCreated* or myPreviewData
798 * \param anEditor - it contains edition results
800 void storeResult(::SMESH_MeshEditor& anEditor);
802 * \brief Clear myLastCreated* or myPreviewData
804 void initData(bool deleteSearchers=true);
807 * \brief Return groups by their IDs
809 SMESH::ListOfGroups* getGroups(const std::list<int>* groupIDs);
811 SMESH::ListOfGroups* rotationSweep(const SMESH::long_array & IDsOfElements,
812 const SMESH::AxisStruct & Axis,
813 CORBA::Double AngleInRadians,
814 CORBA::Long NbOfSteps,
815 CORBA::Double Tolerance,
816 const bool MakeGroups,
817 const SMDSAbs_ElementType ElementType=SMDSAbs_All);
818 SMESH::ListOfGroups* extrusionSweep(const SMESH::long_array & IDsOfElements,
819 const SMESH::DirStruct & StepVector,
820 CORBA::Long NbOfSteps,
822 const SMDSAbs_ElementType ElementType=SMDSAbs_All);
823 SMESH::ListOfGroups* advancedExtrusion(const SMESH::long_array & theIDsOfElements,
824 const SMESH::DirStruct & theStepVector,
825 CORBA::Long theNbOfSteps,
826 CORBA::Long theExtrFlags,
827 CORBA::Double theSewTolerance,
828 const bool MakeGroups);
829 SMESH::ListOfGroups* extrusionAlongPath(const SMESH::long_array & IDsOfElements,
830 SMESH::SMESH_Mesh_ptr PathMesh,
831 GEOM::GEOM_Object_ptr PathShape,
832 CORBA::Long NodeStart,
833 CORBA::Boolean HasAngles,
834 const SMESH::double_array & Angles,
835 CORBA::Boolean HasRefPoint,
836 const SMESH::PointStruct & RefPoint,
837 const bool MakeGroups,
838 SMESH::SMESH_MeshEditor::Extrusion_Error & Error,
839 const SMDSAbs_ElementType ElementType=SMDSAbs_All);
840 SMESH::ListOfGroups* extrusionAlongPathX(const SMESH::long_array & IDsOfElements,
841 SMESH::SMESH_IDSource_ptr Path,
842 CORBA::Long NodeStart,
843 CORBA::Boolean HasAngles,
844 const SMESH::double_array& Angles,
845 CORBA::Boolean LinearVariation,
846 CORBA::Boolean HasRefPoint,
847 const SMESH::PointStruct& RefPoint,
849 const SMDSAbs_ElementType ElementType,
850 SMESH::SMESH_MeshEditor::Extrusion_Error & theError);
851 SMESH::ListOfGroups* mirror(TIDSortedElemSet & IDsOfElements,
852 const SMESH::AxisStruct & Axis,
853 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
856 ::SMESH_Mesh* TargetMesh=0);
857 SMESH::ListOfGroups* translate(TIDSortedElemSet & IDsOfElements,
858 const SMESH::DirStruct & Vector,
861 ::SMESH_Mesh* TargetMesh=0);
862 SMESH::ListOfGroups* rotate(TIDSortedElemSet & IDsOfElements,
863 const SMESH::AxisStruct & Axis,
867 ::SMESH_Mesh* TargetMesh=0);
869 SMESH::ListOfGroups* scale(SMESH::SMESH_IDSource_ptr theObject,
870 const SMESH::PointStruct& thePoint,
871 const SMESH::double_array& theScaleFact,
872 CORBA::Boolean theCopy,
874 ::SMESH_Mesh* theTargetMesh=0);
876 SMESH::SMESH_Mesh_ptr makeMesh(const char* theMeshName);
878 void DumpGroupsList(SMESH::TPythonDump & theDumpPython,
879 const SMESH::ListOfGroups * theGroupList);
881 string generateGroupName(const string& thePrefix);
885 SMESH_Mesh_i* myMesh_i;
888 SMESH::long_array_var myLastCreatedElems;
889 SMESH::long_array_var myLastCreatedNodes;
891 SMESH::MeshPreviewStruct_var myPreviewData;