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"
43 class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
46 SMESH_MeshEditor_i(SMESH_Mesh_i * theMesh, bool isPreview);
48 virtual ~ SMESH_MeshEditor_i();
50 * \brief Return edited mesh ID
51 * \retval int - mesh ID
53 int GetMeshId() const { return myMesh->GetId(); }
58 * Return data of mesh edition preview
60 SMESH::MeshPreviewStruct* GetPreviewData();
62 * If during last operation of MeshEditor some nodes were
63 * created this method returns list of their IDs, if new nodes
64 * not created - returns an empty list
66 SMESH::long_array* GetLastCreatedNodes();
68 * If during last operation of MeshEditor some elements were
69 * created this method returns list of their IDs, if new elements
70 * not created - returns an empty list
72 SMESH::long_array* GetLastCreatedElems();
74 * \brief Returns description of an error/warning occured during the last operation
76 SMESH::ComputeError* GetLastError();
79 * \brief Wrap a sequence of ids in a SMESH_IDSource
81 SMESH::SMESH_IDSource_ptr MakeIDSource(const SMESH::long_array& IDsOfElements,
82 SMESH::ElementType type);
83 CORBA::Boolean RemoveElements(const SMESH::long_array & IDsOfElements);
84 CORBA::Boolean RemoveNodes(const SMESH::long_array & IDsOfNodes);
85 CORBA::Long RemoveOrphanNodes();
88 * Methods for creation new elements.
89 * Returns ID of created element or 0 if element not created
91 CORBA::Long AddNode(CORBA::Double x, CORBA::Double y, CORBA::Double z);
92 CORBA::Long Add0DElement(CORBA::Long IDOfNode);
93 CORBA::Long AddBall(CORBA::Long IDOfNodem, CORBA::Double diameter)
94 throw (SALOME::SALOME_Exception);
95 CORBA::Long AddEdge(const SMESH::long_array & IDsOfNodes);
96 CORBA::Long AddFace(const SMESH::long_array & IDsOfNodes);
97 CORBA::Long AddPolygonalFace(const SMESH::long_array & IDsOfNodes);
98 CORBA::Long AddVolume(const SMESH::long_array & IDsOfNodes);
99 CORBA::Long AddPolyhedralVolume(const SMESH::long_array & IDsOfNodes,
100 const SMESH::long_array & Quantities);
101 CORBA::Long AddPolyhedralVolumeByFaces(const SMESH::long_array & IdsOfFaces);
104 * \brief Bind a node to a vertex
105 * \param NodeID - node ID
106 * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
108 void SetNodeOnVertex(CORBA::Long NodeID, CORBA::Long VertexID)
109 throw (SALOME::SALOME_Exception);
111 * \brief Store node position on an edge
112 * \param NodeID - node ID
113 * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
114 * \param paramOnEdge - parameter on edge where the node is located
116 void SetNodeOnEdge(CORBA::Long NodeID, CORBA::Long EdgeID,
117 CORBA::Double paramOnEdge)
118 throw (SALOME::SALOME_Exception);
120 * \brief Store node position on a face
121 * \param NodeID - node ID
122 * \param FaceID - face ID available through GEOM_Object.GetSubShapeIndices()[0]
123 * \param u - U parameter on face where the node is located
124 * \param v - V parameter on face where the node is located
126 void SetNodeOnFace(CORBA::Long NodeID, CORBA::Long FaceID,
127 CORBA::Double u, CORBA::Double v)
128 throw (SALOME::SALOME_Exception);
130 * \brief Bind a node to a solid
131 * \param NodeID - node ID
132 * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
134 void SetNodeInVolume(CORBA::Long NodeID, CORBA::Long SolidID)
135 throw (SALOME::SALOME_Exception);
137 * \brief Bind an element to a shape
138 * \param ElementID - element ID
139 * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0]
141 void SetMeshElementOnShape(CORBA::Long ElementID, CORBA::Long ShapeID)
142 throw (SALOME::SALOME_Exception);
145 CORBA::Boolean MoveNode(CORBA::Long NodeID,
146 CORBA::Double x, CORBA::Double y, CORBA::Double z);
148 CORBA::Boolean InverseDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
149 CORBA::Boolean DeleteDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
150 CORBA::Boolean Reorient(const SMESH::long_array & IDsOfElements);
151 CORBA::Boolean ReorientObject(SMESH::SMESH_IDSource_ptr theObject);
153 * \brief Reorient faces contained in \a the2Dgroup.
154 * \param the2Dgroup - the mesh or its part to reorient
155 * \param theDirection - desired direction of normal of \a theFace
156 * \param theFace - ID of face whose orientation is checked.
157 * It can be < 1 then \a thePoint is used to find a face.
158 * \param thePoint - is used to find a face if \a theFace < 1.
159 * \return number of reoriented elements.
161 CORBA::Long Reorient2D(SMESH::SMESH_IDSource_ptr the2Dgroup,
162 const SMESH::DirStruct& theDirection,
164 const SMESH::PointStruct& thePoint) throw (SALOME::SALOME_Exception);
167 CORBA::Boolean TriToQuad (const SMESH::long_array & IDsOfElements,
168 SMESH::NumericalFunctor_ptr Criterion,
169 CORBA::Double MaxAngle);
170 CORBA::Boolean TriToQuadObject (SMESH::SMESH_IDSource_ptr theObject,
171 SMESH::NumericalFunctor_ptr Criterion,
172 CORBA::Double MaxAngle);
173 CORBA::Boolean QuadToTri (const SMESH::long_array & IDsOfElements,
174 SMESH::NumericalFunctor_ptr Criterion);
175 CORBA::Boolean QuadToTriObject (SMESH::SMESH_IDSource_ptr theObject,
176 SMESH::NumericalFunctor_ptr Criterion);
177 CORBA::Boolean SplitQuad (const SMESH::long_array & IDsOfElements,
178 CORBA::Boolean Diag13);
179 CORBA::Boolean SplitQuadObject (SMESH::SMESH_IDSource_ptr theObject,
180 CORBA::Boolean Diag13);
181 CORBA::Long BestSplit (CORBA::Long IDOfQuad,
182 SMESH::NumericalFunctor_ptr Criterion);
183 void SplitVolumesIntoTetra (SMESH::SMESH_IDSource_ptr elems,
184 CORBA::Short methodFlags) throw (SALOME::SALOME_Exception);
186 CORBA::Boolean Smooth(const SMESH::long_array & IDsOfElements,
187 const SMESH::long_array & IDsOfFixedNodes,
188 CORBA::Long MaxNbOfIterations,
189 CORBA::Double MaxAspectRatio,
190 SMESH::SMESH_MeshEditor::Smooth_Method Method);
191 CORBA::Boolean SmoothObject(SMESH::SMESH_IDSource_ptr theObject,
192 const SMESH::long_array & IDsOfFixedNodes,
193 CORBA::Long MaxNbOfIterations,
194 CORBA::Double MaxAspectRatio,
195 SMESH::SMESH_MeshEditor::Smooth_Method Method);
196 CORBA::Boolean SmoothParametric(const SMESH::long_array & IDsOfElements,
197 const SMESH::long_array & IDsOfFixedNodes,
198 CORBA::Long MaxNbOfIterations,
199 CORBA::Double MaxAspectRatio,
200 SMESH::SMESH_MeshEditor::Smooth_Method Method);
201 CORBA::Boolean SmoothParametricObject(SMESH::SMESH_IDSource_ptr theObject,
202 const SMESH::long_array & IDsOfFixedNodes,
203 CORBA::Long MaxNbOfIterations,
204 CORBA::Double MaxAspectRatio,
205 SMESH::SMESH_MeshEditor::Smooth_Method Method);
206 CORBA::Boolean smooth(const SMESH::long_array & IDsOfElements,
207 const SMESH::long_array & IDsOfFixedNodes,
208 CORBA::Long MaxNbOfIterations,
209 CORBA::Double MaxAspectRatio,
210 SMESH::SMESH_MeshEditor::Smooth_Method Method,
212 CORBA::Boolean smoothObject(SMESH::SMESH_IDSource_ptr theObject,
213 const SMESH::long_array & IDsOfFixedNodes,
214 CORBA::Long MaxNbOfIterations,
215 CORBA::Double MaxAspectRatio,
216 SMESH::SMESH_MeshEditor::Smooth_Method Method,
220 void ConvertToQuadratic(CORBA::Boolean Force3d);
221 CORBA::Boolean ConvertFromQuadratic();
222 void ConvertToQuadraticObject(CORBA::Boolean theForce3d,
223 SMESH::SMESH_IDSource_ptr theObject)
224 throw (SALOME::SALOME_Exception);
225 void ConvertFromQuadraticObject(SMESH::SMESH_IDSource_ptr theObject)
226 throw (SALOME::SALOME_Exception);
228 void RenumberNodes();
229 void RenumberElements();
231 void RotationSweep(const SMESH::long_array & IDsOfElements,
232 const SMESH::AxisStruct & Axis,
233 CORBA::Double AngleInRadians,
234 CORBA::Long NbOfSteps,
235 CORBA::Double Tolerance);
236 void RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject,
237 const SMESH::AxisStruct & Axis,
238 CORBA::Double AngleInRadians,
239 CORBA::Long NbOfSteps,
240 CORBA::Double Tolerance);
241 void RotationSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
242 const SMESH::AxisStruct & Axis,
243 CORBA::Double AngleInRadians,
244 CORBA::Long NbOfSteps,
245 CORBA::Double Tolerance);
246 void RotationSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
247 const SMESH::AxisStruct & Axis,
248 CORBA::Double AngleInRadians,
249 CORBA::Long NbOfSteps,
250 CORBA::Double Tolerance);
252 void ExtrusionSweep(const SMESH::long_array & IDsOfElements,
253 const SMESH::DirStruct & StepVector,
254 CORBA::Long NbOfSteps);
255 void ExtrusionSweep0D(const SMESH::long_array & IDsOfElements,
256 const SMESH::DirStruct & StepVector,
257 CORBA::Long NbOfSteps);
259 void ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObject,
260 const SMESH::DirStruct & StepVector,
261 CORBA::Long NbOfSteps);
263 void ExtrusionSweepObject0D(SMESH::SMESH_IDSource_ptr theObject,
264 const SMESH::DirStruct & StepVector,
265 CORBA::Long NbOfSteps);
266 void ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
267 const SMESH::DirStruct & StepVector,
268 CORBA::Long NbOfSteps);
269 void ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
270 const SMESH::DirStruct & StepVector,
271 CORBA::Long NbOfSteps);
272 void AdvancedExtrusion(const SMESH::long_array & theIDsOfElements,
273 const SMESH::DirStruct & theStepVector,
274 CORBA::Long theNbOfSteps,
275 CORBA::Long theExtrFlags,
276 CORBA::Double theSewTolerance);
278 SMESH::SMESH_MeshEditor::Extrusion_Error
279 ExtrusionAlongPath(const SMESH::long_array & IDsOfElements,
280 SMESH::SMESH_Mesh_ptr PathMesh,
281 GEOM::GEOM_Object_ptr PathShape,
282 CORBA::Long NodeStart,
283 CORBA::Boolean HasAngles,
284 const SMESH::double_array & Angles,
285 CORBA::Boolean HasRefPoint,
286 const SMESH::PointStruct & RefPoint);
288 SMESH::SMESH_MeshEditor::Extrusion_Error
289 ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr theObject,
290 SMESH::SMESH_Mesh_ptr PathMesh,
291 GEOM::GEOM_Object_ptr PathShape,
292 CORBA::Long NodeStart,
293 CORBA::Boolean HasAngles,
294 const SMESH::double_array & Angles,
295 CORBA::Boolean HasRefPoint,
296 const SMESH::PointStruct & RefPoint);
297 SMESH::SMESH_MeshEditor::Extrusion_Error
298 ExtrusionAlongPathObject1D(SMESH::SMESH_IDSource_ptr theObject,
299 SMESH::SMESH_Mesh_ptr PathMesh,
300 GEOM::GEOM_Object_ptr PathShape,
301 CORBA::Long NodeStart,
302 CORBA::Boolean HasAngles,
303 const SMESH::double_array & Angles,
304 CORBA::Boolean HasRefPoint,
305 const SMESH::PointStruct & RefPoint);
306 SMESH::SMESH_MeshEditor::Extrusion_Error
307 ExtrusionAlongPathObject2D(SMESH::SMESH_IDSource_ptr theObject,
308 SMESH::SMESH_Mesh_ptr PathMesh,
309 GEOM::GEOM_Object_ptr PathShape,
310 CORBA::Long NodeStart,
311 CORBA::Boolean HasAngles,
312 const SMESH::double_array & Angles,
313 CORBA::Boolean HasRefPoint,
314 const SMESH::PointStruct & RefPoint);
316 SMESH::double_array* LinearAnglesVariation(SMESH::SMESH_Mesh_ptr PathMesh,
317 GEOM::GEOM_Object_ptr PathShape,
318 const SMESH::double_array & Angles);
320 void Mirror(const SMESH::long_array & IDsOfElements,
321 const SMESH::AxisStruct & Axis,
322 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
323 CORBA::Boolean Copy);
324 void MirrorObject(SMESH::SMESH_IDSource_ptr theObject,
325 const SMESH::AxisStruct & Axis,
326 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
327 CORBA::Boolean Copy);
328 void Translate(const SMESH::long_array & IDsOfElements,
329 const SMESH::DirStruct & Vector,
330 CORBA::Boolean Copy);
331 void TranslateObject(SMESH::SMESH_IDSource_ptr theObject,
332 const SMESH::DirStruct & Vector,
333 CORBA::Boolean Copy);
334 void Rotate(const SMESH::long_array & IDsOfElements,
335 const SMESH::AxisStruct & Axis,
337 CORBA::Boolean Copy);
338 void RotateObject(SMESH::SMESH_IDSource_ptr theObject,
339 const SMESH::AxisStruct & Axis,
341 CORBA::Boolean Copy);
343 SMESH::ListOfGroups* RotationSweepMakeGroups(const SMESH::long_array& IDsOfElements,
344 const SMESH::AxisStruct& Axix,
345 CORBA::Double AngleInRadians,
346 CORBA::Long NbOfSteps,
347 CORBA::Double Tolerance);
348 SMESH::ListOfGroups* RotationSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
349 const SMESH::AxisStruct& Axix,
350 CORBA::Double AngleInRadians,
351 CORBA::Long NbOfSteps,
352 CORBA::Double Tolerance);
353 SMESH::ListOfGroups* RotationSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
354 const SMESH::AxisStruct& Axix,
355 CORBA::Double AngleInRadians,
356 CORBA::Long NbOfSteps,
357 CORBA::Double Tolerance);
358 SMESH::ListOfGroups* RotationSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
359 const SMESH::AxisStruct& Axix,
360 CORBA::Double AngleInRadians,
361 CORBA::Long NbOfSteps,
362 CORBA::Double Tolerance);
363 SMESH::ListOfGroups* ExtrusionSweepMakeGroups(const SMESH::long_array& IDsOfElements,
364 const SMESH::DirStruct& StepVector,
365 CORBA::Long NbOfSteps);
366 SMESH::ListOfGroups* ExtrusionSweepMakeGroups0D(const SMESH::long_array& IDsOfElements,
367 const SMESH::DirStruct& StepVector,
368 CORBA::Long NbOfSteps);
370 SMESH::ListOfGroups* AdvancedExtrusionMakeGroups(const SMESH::long_array& IDsOfElements,
371 const SMESH::DirStruct& StepVector,
372 CORBA::Long NbOfSteps,
373 CORBA::Long ExtrFlags,
374 CORBA::Double SewTolerance);
375 SMESH::ListOfGroups* ExtrusionSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
376 const SMESH::DirStruct& StepVector,
377 CORBA::Long NbOfSteps);
378 SMESH::ListOfGroups* ExtrusionSweepObject0DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
379 const SMESH::DirStruct& StepVector,
380 CORBA::Long NbOfSteps);
381 SMESH::ListOfGroups* ExtrusionSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
382 const SMESH::DirStruct& StepVector,
383 CORBA::Long NbOfSteps);
384 SMESH::ListOfGroups* ExtrusionSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
385 const SMESH::DirStruct& StepVector,
386 CORBA::Long NbOfSteps);
387 SMESH::ListOfGroups* ExtrusionAlongPathMakeGroups(const SMESH::long_array& IDsOfElements,
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);
396 SMESH::ListOfGroups* ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
397 SMESH::SMESH_Mesh_ptr PathMesh,
398 GEOM::GEOM_Object_ptr PathShape,
399 CORBA::Long NodeStart,
400 CORBA::Boolean HasAngles,
401 const SMESH::double_array& Angles,
402 CORBA::Boolean HasRefPoint,
403 const SMESH::PointStruct& RefPoint,
404 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
405 SMESH::ListOfGroups* ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
406 SMESH::SMESH_Mesh_ptr PathMesh,
407 GEOM::GEOM_Object_ptr PathShape,
408 CORBA::Long NodeStart,
409 CORBA::Boolean HasAngles,
410 const SMESH::double_array& Angles,
411 CORBA::Boolean HasRefPoint,
412 const SMESH::PointStruct& RefPoint,
413 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
414 SMESH::ListOfGroups* ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
415 SMESH::SMESH_Mesh_ptr PathMesh,
416 GEOM::GEOM_Object_ptr PathShape,
417 CORBA::Long NodeStart,
418 CORBA::Boolean HasAngles,
419 const SMESH::double_array& Angles,
420 CORBA::Boolean HasRefPoint,
421 const SMESH::PointStruct& RefPoint,
422 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
425 SMESH::ListOfGroups* ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr Object,
426 SMESH::SMESH_IDSource_ptr Path,
427 CORBA::Long NodeStart,
428 CORBA::Boolean HasAngles,
429 const SMESH::double_array& Angles,
430 CORBA::Boolean LinearVariation,
431 CORBA::Boolean HasRefPoint,
432 const SMESH::PointStruct& RefPoint,
433 CORBA::Boolean MakeGroups,
434 SMESH::ElementType ElemType,
435 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
436 SMESH::ListOfGroups* ExtrusionAlongPathX(const SMESH::long_array& IDsOfElements,
437 SMESH::SMESH_IDSource_ptr Path,
438 CORBA::Long NodeStart,
439 CORBA::Boolean HasAngles,
440 const SMESH::double_array& Angles,
441 CORBA::Boolean LinearVariation,
442 CORBA::Boolean HasRefPoint,
443 const SMESH::PointStruct& RefPoint,
444 CORBA::Boolean MakeGroups,
445 SMESH::ElementType ElemType,
446 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
448 SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::long_array& IDsOfElements,
449 const SMESH::AxisStruct& Mirror,
450 SMESH::SMESH_MeshEditor::MirrorType MirrorType);
451 SMESH::ListOfGroups* MirrorObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
452 const SMESH::AxisStruct& Mirror,
453 SMESH::SMESH_MeshEditor::MirrorType MirrorType);
454 SMESH::ListOfGroups* TranslateMakeGroups(const SMESH::long_array& IDsOfElements,
455 const SMESH::DirStruct& Vector);
456 SMESH::ListOfGroups* TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
457 const SMESH::DirStruct& Vector);
458 SMESH::ListOfGroups* RotateMakeGroups(const SMESH::long_array& IDsOfElements,
459 const SMESH::AxisStruct& Axis,
460 CORBA::Double AngleInRadians);
461 SMESH::ListOfGroups* RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
462 const SMESH::AxisStruct& Axis,
463 CORBA::Double AngleInRadians);
465 SMESH::SMESH_Mesh_ptr MirrorMakeMesh(const SMESH::long_array& IDsOfElements,
466 const SMESH::AxisStruct& Mirror,
467 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
468 CORBA::Boolean CopyGroups,
469 const char* MeshName);
470 SMESH::SMESH_Mesh_ptr MirrorObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
471 const SMESH::AxisStruct& Mirror,
472 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
473 CORBA::Boolean CopyGroups,
474 const char* MeshName);
475 SMESH::SMESH_Mesh_ptr TranslateMakeMesh(const SMESH::long_array& IDsOfElements,
476 const SMESH::DirStruct& Vector,
477 CORBA::Boolean CopyGroups,
478 const char* MeshName);
479 SMESH::SMESH_Mesh_ptr TranslateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
480 const SMESH::DirStruct& Vector,
481 CORBA::Boolean CopyGroups,
482 const char* MeshName);
483 SMESH::SMESH_Mesh_ptr RotateMakeMesh(const SMESH::long_array& IDsOfElements,
484 const SMESH::AxisStruct& Axis,
485 CORBA::Double AngleInRadians,
486 CORBA::Boolean CopyGroups,
487 const char* MeshName);
488 SMESH::SMESH_Mesh_ptr RotateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
489 const SMESH::AxisStruct& Axis,
490 CORBA::Double AngleInRadians,
491 CORBA::Boolean CopyGroups,
492 const char* MeshName);
494 void Scale(SMESH::SMESH_IDSource_ptr theObject,
495 const SMESH::PointStruct& thePoint,
496 const SMESH::double_array& theScaleFact,
497 CORBA::Boolean theCopy);
499 SMESH::ListOfGroups* ScaleMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
500 const SMESH::PointStruct& thePoint,
501 const SMESH::double_array& theScaleFact);
503 SMESH::SMESH_Mesh_ptr ScaleMakeMesh(SMESH::SMESH_IDSource_ptr Object,
504 const SMESH::PointStruct& Point,
505 const SMESH::double_array& theScaleFact,
506 CORBA::Boolean CopyGroups,
507 const char* MeshName);
509 void FindCoincidentNodes (CORBA::Double Tolerance,
510 SMESH::array_of_long_array_out GroupsOfNodes);
511 void FindCoincidentNodesOnPart(SMESH::SMESH_IDSource_ptr Object,
512 CORBA::Double Tolerance,
513 SMESH::array_of_long_array_out GroupsOfNodes);
514 void FindCoincidentNodesOnPartBut(SMESH::SMESH_IDSource_ptr Object,
515 CORBA::Double Tolerance,
516 SMESH::array_of_long_array_out GroupsOfNodes,
517 const SMESH::ListOfIDSources& ExceptSubMeshOrGroups);
518 void MergeNodes (const SMESH::array_of_long_array& GroupsOfNodes);
519 void FindEqualElements(SMESH::SMESH_IDSource_ptr Object,
520 SMESH::array_of_long_array_out GroupsOfElementsID);
521 void MergeElements(const SMESH::array_of_long_array& GroupsOfElementsID);
522 void MergeEqualElements();
523 CORBA::Long MoveClosestNodeToPoint(CORBA::Double x,
528 * \brief Return ID of node closest to a given point
530 CORBA::Long FindNodeClosestTo(CORBA::Double x,
534 * Return elements of given type where the given point is IN or ON.
535 * 'ALL' type means elements of any type excluding nodes
537 SMESH::long_array* FindElementsByPoint(CORBA::Double x,
540 SMESH::ElementType type);
542 * Searching among the given elements, return elements of given type
543 * where the given point is IN or ON.
544 * 'ALL' type means elements of any type excluding nodes
546 SMESH::long_array* FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elements,
550 SMESH::ElementType type);
553 * Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
554 * TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
556 CORBA::Short GetPointState(CORBA::Double x, CORBA::Double y, CORBA::Double z);
558 SMESH::SMESH_MeshEditor::Sew_Error
559 SewFreeBorders(CORBA::Long FirstNodeID1,
560 CORBA::Long SecondNodeID1,
561 CORBA::Long LastNodeID1,
562 CORBA::Long FirstNodeID2,
563 CORBA::Long SecondNodeID2,
564 CORBA::Long LastNodeID2,
565 CORBA::Boolean CreatePolygons,
566 CORBA::Boolean CreatePolyedrs);
567 SMESH::SMESH_MeshEditor::Sew_Error
568 SewConformFreeBorders(CORBA::Long FirstNodeID1,
569 CORBA::Long SecondNodeID1,
570 CORBA::Long LastNodeID1,
571 CORBA::Long FirstNodeID2,
572 CORBA::Long SecondNodeID2);
573 SMESH::SMESH_MeshEditor::Sew_Error
574 SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder,
575 CORBA::Long SecondNodeIDOnFreeBorder,
576 CORBA::Long LastNodeIDOnFreeBorder,
577 CORBA::Long FirstNodeIDOnSide,
578 CORBA::Long LastNodeIDOnSide,
579 CORBA::Boolean CreatePolygons,
580 CORBA::Boolean CreatePolyedrs);
581 SMESH::SMESH_MeshEditor::Sew_Error
582 SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
583 const SMESH::long_array& IDsOfSide2Elements,
584 CORBA::Long NodeID1OfSide1ToMerge,
585 CORBA::Long NodeID1OfSide2ToMerge,
586 CORBA::Long NodeID2OfSide1ToMerge,
587 CORBA::Long NodeID2OfSide2ToMerge);
590 * Set new nodes for given element.
591 * If number of nodes is not corresponded to type of
592 * element - returns false
594 CORBA::Boolean ChangeElemNodes(CORBA::Long ide, const SMESH::long_array& newIDs);
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;