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 AddBall(CORBA::Long IDOfNodem, CORBA::Double diameter)
69 throw (SALOME::SALOME_Exception);
70 CORBA::Long AddEdge(const SMESH::long_array & IDsOfNodes);
71 CORBA::Long AddFace(const SMESH::long_array & IDsOfNodes);
72 CORBA::Long AddPolygonalFace(const SMESH::long_array & IDsOfNodes);
73 CORBA::Long AddVolume(const SMESH::long_array & IDsOfNodes);
74 CORBA::Long AddPolyhedralVolume(const SMESH::long_array & IDsOfNodes,
75 const SMESH::long_array & Quantities);
76 CORBA::Long AddPolyhedralVolumeByFaces(const SMESH::long_array & IdsOfFaces);
79 * \brief Bind a node to a vertex
80 * \param NodeID - node ID
81 * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
83 void SetNodeOnVertex(CORBA::Long NodeID, CORBA::Long VertexID)
84 throw (SALOME::SALOME_Exception);
86 * \brief Store node position on an edge
87 * \param NodeID - node ID
88 * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
89 * \param paramOnEdge - parameter on edge where the node is located
91 void SetNodeOnEdge(CORBA::Long NodeID, CORBA::Long EdgeID,
92 CORBA::Double paramOnEdge)
93 throw (SALOME::SALOME_Exception);
95 * \brief Store node position on a face
96 * \param NodeID - node ID
97 * \param FaceID - face ID available through GEOM_Object.GetSubShapeIndices()[0]
98 * \param u - U parameter on face where the node is located
99 * \param v - V parameter on face where the node is located
101 void SetNodeOnFace(CORBA::Long NodeID, CORBA::Long FaceID,
102 CORBA::Double u, CORBA::Double v)
103 throw (SALOME::SALOME_Exception);
105 * \brief Bind a node to a solid
106 * \param NodeID - node ID
107 * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
109 void SetNodeInVolume(CORBA::Long NodeID, CORBA::Long SolidID)
110 throw (SALOME::SALOME_Exception);
112 * \brief Bind an element to a shape
113 * \param ElementID - element ID
114 * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0]
116 void SetMeshElementOnShape(CORBA::Long ElementID, CORBA::Long ShapeID)
117 throw (SALOME::SALOME_Exception);
120 CORBA::Boolean MoveNode(CORBA::Long NodeID,
121 CORBA::Double x, CORBA::Double y, CORBA::Double z);
123 CORBA::Boolean InverseDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
124 CORBA::Boolean DeleteDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
125 CORBA::Boolean Reorient(const SMESH::long_array & IDsOfElements);
126 CORBA::Boolean ReorientObject(SMESH::SMESH_IDSource_ptr theObject);
128 * \brief Reorient faces contained in \a the2Dgroup.
129 * \param the2Dgroup - the mesh or its part to reorient
130 * \param theDirection - desired direction of normal of \a theFace
131 * \param theFace - ID of face whose orientation is checked.
132 * It can be < 1 then \a thePoint is used to find a face.
133 * \param thePoint - is used to find a face if \a theFace < 1.
134 * \return number of reoriented elements.
136 CORBA::Long Reorient2D(SMESH::SMESH_IDSource_ptr the2Dgroup,
137 const SMESH::DirStruct& theDirection,
139 const SMESH::PointStruct& thePoint) throw (SALOME::SALOME_Exception);
142 CORBA::Boolean TriToQuad (const SMESH::long_array & IDsOfElements,
143 SMESH::NumericalFunctor_ptr Criterion,
144 CORBA::Double MaxAngle);
145 CORBA::Boolean TriToQuadObject (SMESH::SMESH_IDSource_ptr theObject,
146 SMESH::NumericalFunctor_ptr Criterion,
147 CORBA::Double MaxAngle);
148 CORBA::Boolean QuadToTri (const SMESH::long_array & IDsOfElements,
149 SMESH::NumericalFunctor_ptr Criterion);
150 CORBA::Boolean QuadToTriObject (SMESH::SMESH_IDSource_ptr theObject,
151 SMESH::NumericalFunctor_ptr Criterion);
152 CORBA::Boolean SplitQuad (const SMESH::long_array & IDsOfElements,
153 CORBA::Boolean Diag13);
154 CORBA::Boolean SplitQuadObject (SMESH::SMESH_IDSource_ptr theObject,
155 CORBA::Boolean Diag13);
156 CORBA::Long BestSplit (CORBA::Long IDOfQuad,
157 SMESH::NumericalFunctor_ptr Criterion);
158 void SplitVolumesIntoTetra (SMESH::SMESH_IDSource_ptr elems,
159 CORBA::Short methodFlags) throw (SALOME::SALOME_Exception);
161 CORBA::Boolean Smooth(const SMESH::long_array & IDsOfElements,
162 const SMESH::long_array & IDsOfFixedNodes,
163 CORBA::Long MaxNbOfIterations,
164 CORBA::Double MaxAspectRatio,
165 SMESH::SMESH_MeshEditor::Smooth_Method Method);
166 CORBA::Boolean SmoothObject(SMESH::SMESH_IDSource_ptr theObject,
167 const SMESH::long_array & IDsOfFixedNodes,
168 CORBA::Long MaxNbOfIterations,
169 CORBA::Double MaxAspectRatio,
170 SMESH::SMESH_MeshEditor::Smooth_Method Method);
171 CORBA::Boolean SmoothParametric(const SMESH::long_array & IDsOfElements,
172 const SMESH::long_array & IDsOfFixedNodes,
173 CORBA::Long MaxNbOfIterations,
174 CORBA::Double MaxAspectRatio,
175 SMESH::SMESH_MeshEditor::Smooth_Method Method);
176 CORBA::Boolean SmoothParametricObject(SMESH::SMESH_IDSource_ptr theObject,
177 const SMESH::long_array & IDsOfFixedNodes,
178 CORBA::Long MaxNbOfIterations,
179 CORBA::Double MaxAspectRatio,
180 SMESH::SMESH_MeshEditor::Smooth_Method Method);
181 CORBA::Boolean smooth(const SMESH::long_array & IDsOfElements,
182 const SMESH::long_array & IDsOfFixedNodes,
183 CORBA::Long MaxNbOfIterations,
184 CORBA::Double MaxAspectRatio,
185 SMESH::SMESH_MeshEditor::Smooth_Method Method,
187 CORBA::Boolean smoothObject(SMESH::SMESH_IDSource_ptr theObject,
188 const SMESH::long_array & IDsOfFixedNodes,
189 CORBA::Long MaxNbOfIterations,
190 CORBA::Double MaxAspectRatio,
191 SMESH::SMESH_MeshEditor::Smooth_Method Method,
195 void ConvertToQuadratic(CORBA::Boolean Force3d);
196 CORBA::Boolean ConvertFromQuadratic();
197 void ConvertToQuadraticObject(CORBA::Boolean theForce3d,
198 SMESH::SMESH_IDSource_ptr theObject)
199 throw (SALOME::SALOME_Exception);
200 void ConvertFromQuadraticObject(SMESH::SMESH_IDSource_ptr theObject)
201 throw (SALOME::SALOME_Exception);
203 void RenumberNodes();
204 void RenumberElements();
206 void RotationSweep(const SMESH::long_array & IDsOfElements,
207 const SMESH::AxisStruct & Axis,
208 CORBA::Double AngleInRadians,
209 CORBA::Long NbOfSteps,
210 CORBA::Double Tolerance);
211 void RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject,
212 const SMESH::AxisStruct & Axis,
213 CORBA::Double AngleInRadians,
214 CORBA::Long NbOfSteps,
215 CORBA::Double Tolerance);
216 void RotationSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
217 const SMESH::AxisStruct & Axis,
218 CORBA::Double AngleInRadians,
219 CORBA::Long NbOfSteps,
220 CORBA::Double Tolerance);
221 void RotationSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
222 const SMESH::AxisStruct & Axis,
223 CORBA::Double AngleInRadians,
224 CORBA::Long NbOfSteps,
225 CORBA::Double Tolerance);
227 void ExtrusionSweep(const SMESH::long_array & IDsOfElements,
228 const SMESH::DirStruct & StepVector,
229 CORBA::Long NbOfSteps);
230 void ExtrusionSweep0D(const SMESH::long_array & IDsOfElements,
231 const SMESH::DirStruct & StepVector,
232 CORBA::Long NbOfSteps);
234 void ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObject,
235 const SMESH::DirStruct & StepVector,
236 CORBA::Long NbOfSteps);
238 void ExtrusionSweepObject0D(SMESH::SMESH_IDSource_ptr theObject,
239 const SMESH::DirStruct & StepVector,
240 CORBA::Long NbOfSteps);
241 void ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
242 const SMESH::DirStruct & StepVector,
243 CORBA::Long NbOfSteps);
244 void ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
245 const SMESH::DirStruct & StepVector,
246 CORBA::Long NbOfSteps);
247 void AdvancedExtrusion(const SMESH::long_array & theIDsOfElements,
248 const SMESH::DirStruct & theStepVector,
249 CORBA::Long theNbOfSteps,
250 CORBA::Long theExtrFlags,
251 CORBA::Double theSewTolerance);
253 SMESH::SMESH_MeshEditor::Extrusion_Error
254 ExtrusionAlongPath(const SMESH::long_array & IDsOfElements,
255 SMESH::SMESH_Mesh_ptr PathMesh,
256 GEOM::GEOM_Object_ptr PathShape,
257 CORBA::Long NodeStart,
258 CORBA::Boolean HasAngles,
259 const SMESH::double_array & Angles,
260 CORBA::Boolean HasRefPoint,
261 const SMESH::PointStruct & RefPoint);
263 SMESH::SMESH_MeshEditor::Extrusion_Error
264 ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr theObject,
265 SMESH::SMESH_Mesh_ptr PathMesh,
266 GEOM::GEOM_Object_ptr PathShape,
267 CORBA::Long NodeStart,
268 CORBA::Boolean HasAngles,
269 const SMESH::double_array & Angles,
270 CORBA::Boolean HasRefPoint,
271 const SMESH::PointStruct & RefPoint);
272 SMESH::SMESH_MeshEditor::Extrusion_Error
273 ExtrusionAlongPathObject1D(SMESH::SMESH_IDSource_ptr theObject,
274 SMESH::SMESH_Mesh_ptr PathMesh,
275 GEOM::GEOM_Object_ptr PathShape,
276 CORBA::Long NodeStart,
277 CORBA::Boolean HasAngles,
278 const SMESH::double_array & Angles,
279 CORBA::Boolean HasRefPoint,
280 const SMESH::PointStruct & RefPoint);
281 SMESH::SMESH_MeshEditor::Extrusion_Error
282 ExtrusionAlongPathObject2D(SMESH::SMESH_IDSource_ptr theObject,
283 SMESH::SMESH_Mesh_ptr PathMesh,
284 GEOM::GEOM_Object_ptr PathShape,
285 CORBA::Long NodeStart,
286 CORBA::Boolean HasAngles,
287 const SMESH::double_array & Angles,
288 CORBA::Boolean HasRefPoint,
289 const SMESH::PointStruct & RefPoint);
291 SMESH::double_array* LinearAnglesVariation(SMESH::SMESH_Mesh_ptr PathMesh,
292 GEOM::GEOM_Object_ptr PathShape,
293 const SMESH::double_array & Angles);
295 void Mirror(const SMESH::long_array & IDsOfElements,
296 const SMESH::AxisStruct & Axis,
297 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
298 CORBA::Boolean Copy);
299 void MirrorObject(SMESH::SMESH_IDSource_ptr theObject,
300 const SMESH::AxisStruct & Axis,
301 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
302 CORBA::Boolean Copy);
303 void Translate(const SMESH::long_array & IDsOfElements,
304 const SMESH::DirStruct & Vector,
305 CORBA::Boolean Copy);
306 void TranslateObject(SMESH::SMESH_IDSource_ptr theObject,
307 const SMESH::DirStruct & Vector,
308 CORBA::Boolean Copy);
309 void Rotate(const SMESH::long_array & IDsOfElements,
310 const SMESH::AxisStruct & Axis,
312 CORBA::Boolean Copy);
313 void RotateObject(SMESH::SMESH_IDSource_ptr theObject,
314 const SMESH::AxisStruct & Axis,
316 CORBA::Boolean Copy);
318 SMESH::ListOfGroups* RotationSweepMakeGroups(const SMESH::long_array& IDsOfElements,
319 const SMESH::AxisStruct& Axix,
320 CORBA::Double AngleInRadians,
321 CORBA::Long NbOfSteps,
322 CORBA::Double Tolerance);
323 SMESH::ListOfGroups* RotationSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
324 const SMESH::AxisStruct& Axix,
325 CORBA::Double AngleInRadians,
326 CORBA::Long NbOfSteps,
327 CORBA::Double Tolerance);
328 SMESH::ListOfGroups* RotationSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
329 const SMESH::AxisStruct& Axix,
330 CORBA::Double AngleInRadians,
331 CORBA::Long NbOfSteps,
332 CORBA::Double Tolerance);
333 SMESH::ListOfGroups* RotationSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
334 const SMESH::AxisStruct& Axix,
335 CORBA::Double AngleInRadians,
336 CORBA::Long NbOfSteps,
337 CORBA::Double Tolerance);
338 SMESH::ListOfGroups* ExtrusionSweepMakeGroups(const SMESH::long_array& IDsOfElements,
339 const SMESH::DirStruct& StepVector,
340 CORBA::Long NbOfSteps);
341 SMESH::ListOfGroups* ExtrusionSweepMakeGroups0D(const SMESH::long_array& IDsOfElements,
342 const SMESH::DirStruct& StepVector,
343 CORBA::Long NbOfSteps);
345 SMESH::ListOfGroups* AdvancedExtrusionMakeGroups(const SMESH::long_array& IDsOfElements,
346 const SMESH::DirStruct& StepVector,
347 CORBA::Long NbOfSteps,
348 CORBA::Long ExtrFlags,
349 CORBA::Double SewTolerance);
350 SMESH::ListOfGroups* ExtrusionSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
351 const SMESH::DirStruct& StepVector,
352 CORBA::Long NbOfSteps);
353 SMESH::ListOfGroups* ExtrusionSweepObject0DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
354 const SMESH::DirStruct& StepVector,
355 CORBA::Long NbOfSteps);
356 SMESH::ListOfGroups* ExtrusionSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
357 const SMESH::DirStruct& StepVector,
358 CORBA::Long NbOfSteps);
359 SMESH::ListOfGroups* ExtrusionSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
360 const SMESH::DirStruct& StepVector,
361 CORBA::Long NbOfSteps);
362 SMESH::ListOfGroups* ExtrusionAlongPathMakeGroups(const SMESH::long_array& IDsOfElements,
363 SMESH::SMESH_Mesh_ptr PathMesh,
364 GEOM::GEOM_Object_ptr PathShape,
365 CORBA::Long NodeStart,
366 CORBA::Boolean HasAngles,
367 const SMESH::double_array& Angles,
368 CORBA::Boolean HasRefPoint,
369 const SMESH::PointStruct& RefPoint,
370 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
371 SMESH::ListOfGroups* ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
372 SMESH::SMESH_Mesh_ptr PathMesh,
373 GEOM::GEOM_Object_ptr PathShape,
374 CORBA::Long NodeStart,
375 CORBA::Boolean HasAngles,
376 const SMESH::double_array& Angles,
377 CORBA::Boolean HasRefPoint,
378 const SMESH::PointStruct& RefPoint,
379 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
380 SMESH::ListOfGroups* ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
381 SMESH::SMESH_Mesh_ptr PathMesh,
382 GEOM::GEOM_Object_ptr PathShape,
383 CORBA::Long NodeStart,
384 CORBA::Boolean HasAngles,
385 const SMESH::double_array& Angles,
386 CORBA::Boolean HasRefPoint,
387 const SMESH::PointStruct& RefPoint,
388 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
389 SMESH::ListOfGroups* ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
390 SMESH::SMESH_Mesh_ptr PathMesh,
391 GEOM::GEOM_Object_ptr PathShape,
392 CORBA::Long NodeStart,
393 CORBA::Boolean HasAngles,
394 const SMESH::double_array& Angles,
395 CORBA::Boolean HasRefPoint,
396 const SMESH::PointStruct& RefPoint,
397 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
400 SMESH::ListOfGroups* ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr Object,
401 SMESH::SMESH_IDSource_ptr Path,
402 CORBA::Long NodeStart,
403 CORBA::Boolean HasAngles,
404 const SMESH::double_array& Angles,
405 CORBA::Boolean LinearVariation,
406 CORBA::Boolean HasRefPoint,
407 const SMESH::PointStruct& RefPoint,
408 CORBA::Boolean MakeGroups,
409 SMESH::ElementType ElemType,
410 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
411 SMESH::ListOfGroups* ExtrusionAlongPathX(const SMESH::long_array& IDsOfElements,
412 SMESH::SMESH_IDSource_ptr Path,
413 CORBA::Long NodeStart,
414 CORBA::Boolean HasAngles,
415 const SMESH::double_array& Angles,
416 CORBA::Boolean LinearVariation,
417 CORBA::Boolean HasRefPoint,
418 const SMESH::PointStruct& RefPoint,
419 CORBA::Boolean MakeGroups,
420 SMESH::ElementType ElemType,
421 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
423 SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::long_array& IDsOfElements,
424 const SMESH::AxisStruct& Mirror,
425 SMESH::SMESH_MeshEditor::MirrorType MirrorType);
426 SMESH::ListOfGroups* MirrorObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
427 const SMESH::AxisStruct& Mirror,
428 SMESH::SMESH_MeshEditor::MirrorType MirrorType);
429 SMESH::ListOfGroups* TranslateMakeGroups(const SMESH::long_array& IDsOfElements,
430 const SMESH::DirStruct& Vector);
431 SMESH::ListOfGroups* TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
432 const SMESH::DirStruct& Vector);
433 SMESH::ListOfGroups* RotateMakeGroups(const SMESH::long_array& IDsOfElements,
434 const SMESH::AxisStruct& Axis,
435 CORBA::Double AngleInRadians);
436 SMESH::ListOfGroups* RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
437 const SMESH::AxisStruct& Axis,
438 CORBA::Double AngleInRadians);
440 SMESH::SMESH_Mesh_ptr MirrorMakeMesh(const SMESH::long_array& IDsOfElements,
441 const SMESH::AxisStruct& Mirror,
442 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
443 CORBA::Boolean CopyGroups,
444 const char* MeshName);
445 SMESH::SMESH_Mesh_ptr MirrorObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
446 const SMESH::AxisStruct& Mirror,
447 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
448 CORBA::Boolean CopyGroups,
449 const char* MeshName);
450 SMESH::SMESH_Mesh_ptr TranslateMakeMesh(const SMESH::long_array& IDsOfElements,
451 const SMESH::DirStruct& Vector,
452 CORBA::Boolean CopyGroups,
453 const char* MeshName);
454 SMESH::SMESH_Mesh_ptr TranslateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
455 const SMESH::DirStruct& Vector,
456 CORBA::Boolean CopyGroups,
457 const char* MeshName);
458 SMESH::SMESH_Mesh_ptr RotateMakeMesh(const SMESH::long_array& IDsOfElements,
459 const SMESH::AxisStruct& Axis,
460 CORBA::Double AngleInRadians,
461 CORBA::Boolean CopyGroups,
462 const char* MeshName);
463 SMESH::SMESH_Mesh_ptr RotateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
464 const SMESH::AxisStruct& Axis,
465 CORBA::Double AngleInRadians,
466 CORBA::Boolean CopyGroups,
467 const char* MeshName);
469 void Scale(SMESH::SMESH_IDSource_ptr theObject,
470 const SMESH::PointStruct& thePoint,
471 const SMESH::double_array& theScaleFact,
472 CORBA::Boolean theCopy);
474 SMESH::ListOfGroups* ScaleMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
475 const SMESH::PointStruct& thePoint,
476 const SMESH::double_array& theScaleFact);
478 SMESH::SMESH_Mesh_ptr ScaleMakeMesh(SMESH::SMESH_IDSource_ptr Object,
479 const SMESH::PointStruct& Point,
480 const SMESH::double_array& theScaleFact,
481 CORBA::Boolean CopyGroups,
482 const char* MeshName);
484 void FindCoincidentNodes (CORBA::Double Tolerance,
485 SMESH::array_of_long_array_out GroupsOfNodes);
486 void FindCoincidentNodesOnPart(SMESH::SMESH_IDSource_ptr Object,
487 CORBA::Double Tolerance,
488 SMESH::array_of_long_array_out GroupsOfNodes);
489 void FindCoincidentNodesOnPartBut(SMESH::SMESH_IDSource_ptr Object,
490 CORBA::Double Tolerance,
491 SMESH::array_of_long_array_out GroupsOfNodes,
492 const SMESH::ListOfIDSources& ExceptSubMeshOrGroups);
493 void MergeNodes (const SMESH::array_of_long_array& GroupsOfNodes);
494 void FindEqualElements(SMESH::SMESH_IDSource_ptr Object,
495 SMESH::array_of_long_array_out GroupsOfElementsID);
496 void MergeElements(const SMESH::array_of_long_array& GroupsOfElementsID);
497 void MergeEqualElements();
498 CORBA::Long MoveClosestNodeToPoint(CORBA::Double x,
503 * \brief Return ID of node closest to a given point
505 CORBA::Long FindNodeClosestTo(CORBA::Double x,
509 * Return elements of given type where the given point is IN or ON.
510 * 'ALL' type means elements of any type excluding nodes
512 SMESH::long_array* FindElementsByPoint(CORBA::Double x,
515 SMESH::ElementType type);
517 * Searching among the given elements, return elements of given type
518 * where the given point is IN or ON.
519 * 'ALL' type means elements of any type excluding nodes
521 SMESH::long_array* FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elements,
525 SMESH::ElementType type);
528 * Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
529 * TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
531 CORBA::Short GetPointState(CORBA::Double x, CORBA::Double y, CORBA::Double z);
533 SMESH::SMESH_MeshEditor::Sew_Error
534 SewFreeBorders(CORBA::Long FirstNodeID1,
535 CORBA::Long SecondNodeID1,
536 CORBA::Long LastNodeID1,
537 CORBA::Long FirstNodeID2,
538 CORBA::Long SecondNodeID2,
539 CORBA::Long LastNodeID2,
540 CORBA::Boolean CreatePolygons,
541 CORBA::Boolean CreatePolyedrs);
542 SMESH::SMESH_MeshEditor::Sew_Error
543 SewConformFreeBorders(CORBA::Long FirstNodeID1,
544 CORBA::Long SecondNodeID1,
545 CORBA::Long LastNodeID1,
546 CORBA::Long FirstNodeID2,
547 CORBA::Long SecondNodeID2);
548 SMESH::SMESH_MeshEditor::Sew_Error
549 SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder,
550 CORBA::Long SecondNodeIDOnFreeBorder,
551 CORBA::Long LastNodeIDOnFreeBorder,
552 CORBA::Long FirstNodeIDOnSide,
553 CORBA::Long LastNodeIDOnSide,
554 CORBA::Boolean CreatePolygons,
555 CORBA::Boolean CreatePolyedrs);
556 SMESH::SMESH_MeshEditor::Sew_Error
557 SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
558 const SMESH::long_array& IDsOfSide2Elements,
559 CORBA::Long NodeID1OfSide1ToMerge,
560 CORBA::Long NodeID1OfSide2ToMerge,
561 CORBA::Long NodeID2OfSide1ToMerge,
562 CORBA::Long NodeID2OfSide2ToMerge);
565 * Set new nodes for given element.
566 * If number of nodes is not corresponded to type of
567 * element - returns false
569 CORBA::Boolean ChangeElemNodes(CORBA::Long ide, const SMESH::long_array& newIDs);
572 * Return data of mesh edition preview
574 SMESH::MeshPreviewStruct* GetPreviewData();
577 * If during last operation of MeshEditor some nodes were
578 * created this method returns list of it's IDs, if new nodes
579 * not creared - returns empty list
581 SMESH::long_array* GetLastCreatedNodes();
584 * If during last operation of MeshEditor some elements were
585 * created this method returns list of it's IDs, if new elements
586 * not creared - returns empty list
588 SMESH::long_array* GetLastCreatedElems();
591 * \brief Return edited mesh ID
592 * \retval int - mesh ID
594 int GetMeshId() const { return myMesh->GetId(); }
596 CORBA::Boolean DoubleNodes( const SMESH::long_array& theNodes,
597 const SMESH::long_array& theModifiedElems );
599 CORBA::Boolean DoubleNode( CORBA::Long theNodeId,
600 const SMESH::long_array& theModifiedElems );
602 CORBA::Boolean DoubleNodeGroup( SMESH::SMESH_GroupBase_ptr theNodes,
603 SMESH::SMESH_GroupBase_ptr theModifiedElems );
606 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
607 * Works as DoubleNodeGroup(), but returns a new group with newly created nodes.
608 * \param theNodes - group of nodes to be doubled.
609 * \param theModifiedElems - group of elements to be updated.
610 * \return a new group with newly created nodes
611 * \sa DoubleNodeGroup()
613 SMESH::SMESH_Group_ptr DoubleNodeGroupNew( SMESH::SMESH_GroupBase_ptr theNodes,
614 SMESH::SMESH_GroupBase_ptr theModifiedElems );
616 CORBA::Boolean DoubleNodeGroups( const SMESH::ListOfGroups& theNodes,
617 const SMESH::ListOfGroups& theModifiedElems );
619 SMESH::SMESH_Group_ptr DoubleNodeGroupsNew( const SMESH::ListOfGroups& theNodes,
620 const SMESH::ListOfGroups& theModifiedElems );
623 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
624 * \param theElems - the list of elements (edges or faces) to be replicated
625 * The nodes for duplication could be found from these elements
626 * \param theNodesNot - list of nodes to NOT replicate
627 * \param theAffectedElems - the list of elements (cells and edges) to which the
628 * replicated nodes should be associated to.
629 * \return TRUE if operation has been completed successfully, FALSE otherwise
630 * \sa DoubleNodeGroup(), DoubleNodeGroups()
632 CORBA::Boolean DoubleNodeElem( const SMESH::long_array& theElems,
633 const SMESH::long_array& theNodesNot,
634 const SMESH::long_array& theAffectedElems );
637 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
638 * \param theElems - the list of elements (edges or faces) to be replicated
639 * The nodes for duplication could be found from these elements
640 * \param theNodesNot - list of nodes to NOT replicate
641 * \param theShape - shape to detect affected elements (element which geometric center
642 * located on or inside shape).
643 * The replicated nodes should be associated to affected elements.
644 * \return TRUE if operation has been completed successfully, FALSE otherwise
645 * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
647 CORBA::Boolean DoubleNodeElemInRegion( const SMESH::long_array& theElems,
648 const SMESH::long_array& theNodesNot,
649 GEOM::GEOM_Object_ptr theShape );
652 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
653 * \param theElems - group of of elements (edges or faces) to be replicated
654 * \param theNodesNot - group of nodes not to replicated
655 * \param theAffectedElems - group of elements to which the replicated nodes
656 * should be associated to.
657 * \return TRUE if operation has been completed successfully, FALSE otherwise
658 * \sa DoubleNodes(), DoubleNodeGroups(), DoubleNodeElemGroupNew()
660 CORBA::Boolean DoubleNodeElemGroup( SMESH::SMESH_GroupBase_ptr theElems,
661 SMESH::SMESH_GroupBase_ptr theNodesNot,
662 SMESH::SMESH_GroupBase_ptr theAffectedElems );
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 );
678 SMESH::ListOfGroups* DoubleNodeElemGroup2New(SMESH::SMESH_GroupBase_ptr theElems,
679 SMESH::SMESH_GroupBase_ptr theNodesNot,
680 SMESH::SMESH_GroupBase_ptr theAffectedElems,
681 CORBA::Boolean theElemGroupNeeded,
682 CORBA::Boolean theNodeGroupNeeded);
685 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
686 * \param theElems - group of of elements (edges or faces) to be replicated
687 * \param theNodesNot - group of nodes not to replicated
688 * \param theShape - shape to detect affected elements (element which geometric center
689 * located on or inside shape).
690 * The replicated nodes should be associated to affected elements.
691 * \return TRUE if operation has been completed successfully, FALSE otherwise
692 * \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
694 CORBA::Boolean DoubleNodeElemGroupInRegion( SMESH::SMESH_GroupBase_ptr theElems,
695 SMESH::SMESH_GroupBase_ptr theNodesNot,
696 GEOM::GEOM_Object_ptr theShape );
699 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
700 * This method provided for convenience works as DoubleNodes() described above.
701 * \param theElems - list of groups of elements (edges or faces) to be replicated
702 * \param theNodesNot - list of groups of nodes not to replicated
703 * \param theAffectedElems - group of elements to which the replicated nodes
704 * should be associated to.
705 * \return TRUE if operation has been completed successfully, FALSE otherwise
706 * \sa DoubleNodeGroup(), DoubleNodes(), DoubleNodeElemGroupsNew()
708 CORBA::Boolean DoubleNodeElemGroups( const SMESH::ListOfGroups& theElems,
709 const SMESH::ListOfGroups& theNodesNot,
710 const SMESH::ListOfGroups& theAffectedElems );
713 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
714 * Works as DoubleNodeElemGroups(), but returns a new group with newly created elements.
715 * \param theElems - list of groups of elements (edges or faces) to be replicated
716 * \param theNodesNot - list of groups of nodes not to replicated
717 * \param theAffectedElems - group of elements to which the replicated nodes
718 * should be associated to.
719 * \return a new group with newly created elements
720 * \sa DoubleNodeElemGroups()
722 SMESH::SMESH_Group_ptr DoubleNodeElemGroupsNew( const SMESH::ListOfGroups& theElems,
723 const SMESH::ListOfGroups& theNodesNot,
724 const SMESH::ListOfGroups& theAffectedElems );
726 SMESH::ListOfGroups* DoubleNodeElemGroups2New(const SMESH::ListOfGroups& theElems,
727 const SMESH::ListOfGroups& theNodesNot,
728 const SMESH::ListOfGroups& theAffectedElems,
729 CORBA::Boolean theElemGroupNeeded,
730 CORBA::Boolean theNodeGroupNeeded);
733 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
734 * This method provided for convenience works as DoubleNodes() described above.
735 * \param theElems - list of groups of elements (edges or faces) to be replicated
736 * \param theNodesNot - list of groups of nodes not to replicated
737 * \param theShape - shape to detect affected elements (element which geometric center
738 * located on or inside shape).
739 * The replicated nodes should be associated to affected elements.
740 * \return TRUE if operation has been completed successfully, FALSE otherwise
741 * \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
743 CORBA::Boolean DoubleNodeElemGroupsInRegion( const SMESH::ListOfGroups& theElems,
744 const SMESH::ListOfGroups& theNodesNot,
745 GEOM::GEOM_Object_ptr theShape );
748 * \brief Identify the elements that will be affected by node duplication (actual duplication is not performed.
749 * This method is the first step of DoubleNodeElemGroupsInRegion.
750 * \param theElems - list of groups of elements (edges or faces) to be replicated
751 * \param theNodesNot - list of groups of nodes not to replicated
752 * \param theShape - shape to detect affected elements (element which geometric center
753 * located on or inside shape).
754 * The replicated nodes should be associated to affected elements.
755 * \return groups of affected elements
756 * \sa DoubleNodeElemGroupsInRegion()
758 SMESH::ListOfGroups* AffectedElemGroupsInRegion( const SMESH::ListOfGroups& theElems,
759 const SMESH::ListOfGroups& theNodesNot,
760 GEOM::GEOM_Object_ptr theShape );
763 * \brief Double nodes on shared faces between groups of volumes and create flat elements on demand.
764 * The list of groups must describe a partition of the mesh volumes.
765 * The nodes of the internal faces at the boundaries of the groups are doubled.
766 * In option, the internal faces are replaced by flat elements.
767 * Triangles are transformed in prisms, and quadrangles in hexahedrons.
768 * @param theDomains - list of groups of volumes
769 * @param createJointElems - if TRUE, create the elements
770 * @return TRUE if operation has been completed successfully, FALSE otherwise
772 CORBA::Boolean DoubleNodesOnGroupBoundaries( const SMESH::ListOfGroups& theDomains,
773 CORBA::Boolean createJointElems )
774 throw (SALOME::SALOME_Exception);
776 * \brief Double nodes on some external faces and create flat elements.
777 * Flat elements are mainly used by some types of mechanic calculations.
779 * Each group of the list must be constituted of faces.
780 * Triangles are transformed in prisms, and quadrangles in hexahedrons.
781 * @param theGroupsOfFaces - list of groups of faces
782 * @return TRUE if operation has been completed successfully, FALSE otherwise
784 CORBA::Boolean CreateFlatElementsOnFacesGroups( const SMESH::ListOfGroups& theGroupsOfFaces );
787 * \brief identify all the elements around a geom shape, get the faces delimiting the hole
788 * Build groups of volume to remove, groups of faces to replace on the skin of the object,
789 * groups of faces to remove insidethe object, (idem edges).
790 * Build ordered list of nodes at the border of each group of faces to replace (to be used to build a geom subshape)
792 void CreateHoleSkin(CORBA::Double radius,
793 GEOM::GEOM_Object_ptr theShape,
794 const char* groupName,
795 const SMESH::double_array& theNodesCoords,
796 SMESH::array_of_long_array_out GroupsOfNodes)
797 throw (SALOME::SALOME_Exception);
800 * \brief Generated skin mesh (containing 2D cells) from 3D mesh
801 * The created 2D mesh elements based on nodes of free faces of boundary volumes
802 * \return TRUE if operation has been completed successfully, FALSE otherwise
804 CORBA::Boolean Make2DMeshFrom3D();
806 SMESH::SMESH_Mesh_ptr MakeBoundaryMesh(SMESH::SMESH_IDSource_ptr elements,
807 SMESH::Bnd_Dimension dimension,
808 const char* groupName,
809 const char* meshName,
810 CORBA::Boolean toCopyElements,
811 CORBA::Boolean toCopyMissingBondary,
812 SMESH::SMESH_Group_out group);
814 CORBA::Long MakeBoundaryElements(SMESH::Bnd_Dimension dimension,
815 const char* groupName,
816 const char* meshName,
817 CORBA::Boolean toCopyAll,
818 const SMESH::ListOfIDSources& groups,
819 SMESH::SMESH_Mesh_out mesh,
820 SMESH::SMESH_Group_out group)
821 throw (SALOME::SALOME_Exception);
823 private: //!< private methods
825 SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); }
828 * \brief Update myLastCreated* or myPreviewData
829 * \param anEditor - it contains edition results
831 void storeResult(::SMESH_MeshEditor& anEditor);
833 * \brief Clear myLastCreated* or myPreviewData
835 void initData(bool deleteSearchers=true);
838 * \brief Return groups by their IDs
840 SMESH::ListOfGroups* getGroups(const std::list<int>* groupIDs);
842 SMESH::ListOfGroups* rotationSweep(const SMESH::long_array & IDsOfElements,
843 const SMESH::AxisStruct & Axis,
844 CORBA::Double AngleInRadians,
845 CORBA::Long NbOfSteps,
846 CORBA::Double Tolerance,
847 const bool MakeGroups,
848 const SMDSAbs_ElementType ElementType=SMDSAbs_All);
849 SMESH::ListOfGroups* extrusionSweep(const SMESH::long_array & IDsOfElements,
850 const SMESH::DirStruct & StepVector,
851 CORBA::Long NbOfSteps,
853 const SMDSAbs_ElementType ElementType=SMDSAbs_All);
854 SMESH::ListOfGroups* advancedExtrusion(const SMESH::long_array & theIDsOfElements,
855 const SMESH::DirStruct & theStepVector,
856 CORBA::Long theNbOfSteps,
857 CORBA::Long theExtrFlags,
858 CORBA::Double theSewTolerance,
859 const bool MakeGroups);
860 SMESH::ListOfGroups* extrusionAlongPath(const SMESH::long_array & IDsOfElements,
861 SMESH::SMESH_Mesh_ptr PathMesh,
862 GEOM::GEOM_Object_ptr PathShape,
863 CORBA::Long NodeStart,
864 CORBA::Boolean HasAngles,
865 const SMESH::double_array & Angles,
866 CORBA::Boolean HasRefPoint,
867 const SMESH::PointStruct & RefPoint,
868 const bool MakeGroups,
869 SMESH::SMESH_MeshEditor::Extrusion_Error & Error,
870 const SMDSAbs_ElementType ElementType=SMDSAbs_All);
871 SMESH::ListOfGroups* extrusionAlongPathX(const SMESH::long_array & IDsOfElements,
872 SMESH::SMESH_IDSource_ptr Path,
873 CORBA::Long NodeStart,
874 CORBA::Boolean HasAngles,
875 const SMESH::double_array& Angles,
876 CORBA::Boolean LinearVariation,
877 CORBA::Boolean HasRefPoint,
878 const SMESH::PointStruct& RefPoint,
880 const SMDSAbs_ElementType ElementType,
881 SMESH::SMESH_MeshEditor::Extrusion_Error & theError);
882 SMESH::ListOfGroups* mirror(TIDSortedElemSet & IDsOfElements,
883 const SMESH::AxisStruct & Axis,
884 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
887 ::SMESH_Mesh* TargetMesh=0);
888 SMESH::ListOfGroups* translate(TIDSortedElemSet & IDsOfElements,
889 const SMESH::DirStruct & Vector,
892 ::SMESH_Mesh* TargetMesh=0);
893 SMESH::ListOfGroups* rotate(TIDSortedElemSet & IDsOfElements,
894 const SMESH::AxisStruct & Axis,
898 ::SMESH_Mesh* TargetMesh=0);
900 SMESH::ListOfGroups* scale(SMESH::SMESH_IDSource_ptr theObject,
901 const SMESH::PointStruct& thePoint,
902 const SMESH::double_array& theScaleFact,
903 CORBA::Boolean theCopy,
905 ::SMESH_Mesh* theTargetMesh=0);
907 SMESH::SMESH_Mesh_ptr makeMesh(const char* theMeshName);
909 void DumpGroupsList(SMESH::TPythonDump & theDumpPython,
910 const SMESH::ListOfGroups * theGroupList);
912 string generateGroupName(const string& thePrefix);
916 SMESH_Mesh_i* myMesh_i;
918 ::SMESH_MeshEditor myEditor;
920 SMESH::MeshPreviewStruct_var myPreviewData;