1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
23 // File : SMESH_MeshEditor_i.hxx
24 // Author : Nicolas REJNERI
27 #ifndef _SMESH_MESHEDITOR_I_HXX_
28 #define _SMESH_MESHEDIOTR_I_HXX_
32 #include <SALOMEconfig.h>
33 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
35 #include "SMESH_Mesh.hxx"
36 #include "SMESH_PythonDump.hxx"
39 class SMESH_MeshEditor;
42 class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
45 SMESH_MeshEditor_i(SMESH_Mesh_i * theMesh, bool isPreview);
47 virtual ~ SMESH_MeshEditor_i();
50 CORBA::Boolean RemoveElements(const SMESH::long_array & IDsOfElements);
51 CORBA::Boolean RemoveNodes(const SMESH::long_array & IDsOfNodes);
54 * Methods for creation new elements.
55 * Returns ID of created element or 0 if element not created
57 CORBA::Long AddNode(CORBA::Double x, CORBA::Double y, CORBA::Double z);
58 CORBA::Long Add0DElement(CORBA::Long IDOfNode);
59 CORBA::Long AddEdge(const SMESH::long_array & IDsOfNodes);
60 CORBA::Long AddFace(const SMESH::long_array & IDsOfNodes);
61 CORBA::Long AddPolygonalFace(const SMESH::long_array & IDsOfNodes);
62 CORBA::Long AddVolume(const SMESH::long_array & IDsOfNodes);
63 CORBA::Long AddPolyhedralVolume(const SMESH::long_array & IDsOfNodes,
64 const SMESH::long_array & Quantities);
65 CORBA::Long AddPolyhedralVolumeByFaces(const SMESH::long_array & IdsOfFaces);
68 * \brief Bind a node to a vertex
69 * \param NodeID - node ID
70 * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
72 void SetNodeOnVertex(CORBA::Long NodeID, CORBA::Long VertexID)
73 throw (SALOME::SALOME_Exception);
75 * \brief Store node position on an edge
76 * \param NodeID - node ID
77 * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
78 * \param paramOnEdge - parameter on edge where the node is located
80 void SetNodeOnEdge(CORBA::Long NodeID, CORBA::Long EdgeID,
81 CORBA::Double paramOnEdge)
82 throw (SALOME::SALOME_Exception);
84 * \brief Store node position on a face
85 * \param NodeID - node ID
86 * \param FaceID - face ID available through GEOM_Object.GetSubShapeIndices()[0]
87 * \param u - U parameter on face where the node is located
88 * \param v - V parameter on face where the node is located
90 void SetNodeOnFace(CORBA::Long NodeID, CORBA::Long FaceID,
91 CORBA::Double u, CORBA::Double v)
92 throw (SALOME::SALOME_Exception);
94 * \brief Bind a node to a solid
95 * \param NodeID - node ID
96 * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
98 void SetNodeInVolume(CORBA::Long NodeID, CORBA::Long SolidID)
99 throw (SALOME::SALOME_Exception);
101 * \brief Bind an element to a shape
102 * \param ElementID - element ID
103 * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0]
105 void SetMeshElementOnShape(CORBA::Long ElementID, CORBA::Long ShapeID)
106 throw (SALOME::SALOME_Exception);
109 CORBA::Boolean MoveNode(CORBA::Long NodeID,
110 CORBA::Double x, CORBA::Double y, CORBA::Double z);
112 CORBA::Boolean InverseDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
113 CORBA::Boolean DeleteDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
114 CORBA::Boolean Reorient(const SMESH::long_array & IDsOfElements);
115 CORBA::Boolean ReorientObject(SMESH::SMESH_IDSource_ptr theObject);
118 CORBA::Boolean TriToQuad (const SMESH::long_array & IDsOfElements,
119 SMESH::NumericalFunctor_ptr Criterion,
120 CORBA::Double MaxAngle);
121 CORBA::Boolean TriToQuadObject (SMESH::SMESH_IDSource_ptr theObject,
122 SMESH::NumericalFunctor_ptr Criterion,
123 CORBA::Double MaxAngle);
124 CORBA::Boolean QuadToTri (const SMESH::long_array & IDsOfElements,
125 SMESH::NumericalFunctor_ptr Criterion);
126 CORBA::Boolean QuadToTriObject (SMESH::SMESH_IDSource_ptr theObject,
127 SMESH::NumericalFunctor_ptr Criterion);
128 CORBA::Boolean SplitQuad (const SMESH::long_array & IDsOfElements,
129 CORBA::Boolean Diag13);
130 CORBA::Boolean SplitQuadObject (SMESH::SMESH_IDSource_ptr theObject,
131 CORBA::Boolean Diag13);
132 CORBA::Long BestSplit (CORBA::Long IDOfQuad,
133 SMESH::NumericalFunctor_ptr Criterion);
135 CORBA::Boolean Smooth(const SMESH::long_array & IDsOfElements,
136 const SMESH::long_array & IDsOfFixedNodes,
137 CORBA::Long MaxNbOfIterations,
138 CORBA::Double MaxAspectRatio,
139 SMESH::SMESH_MeshEditor::Smooth_Method Method);
140 CORBA::Boolean SmoothObject(SMESH::SMESH_IDSource_ptr theObject,
141 const SMESH::long_array & IDsOfFixedNodes,
142 CORBA::Long MaxNbOfIterations,
143 CORBA::Double MaxAspectRatio,
144 SMESH::SMESH_MeshEditor::Smooth_Method Method);
145 CORBA::Boolean SmoothParametric(const SMESH::long_array & IDsOfElements,
146 const SMESH::long_array & IDsOfFixedNodes,
147 CORBA::Long MaxNbOfIterations,
148 CORBA::Double MaxAspectRatio,
149 SMESH::SMESH_MeshEditor::Smooth_Method Method);
150 CORBA::Boolean SmoothParametricObject(SMESH::SMESH_IDSource_ptr theObject,
151 const SMESH::long_array & IDsOfFixedNodes,
152 CORBA::Long MaxNbOfIterations,
153 CORBA::Double MaxAspectRatio,
154 SMESH::SMESH_MeshEditor::Smooth_Method Method);
155 CORBA::Boolean smooth(const SMESH::long_array & IDsOfElements,
156 const SMESH::long_array & IDsOfFixedNodes,
157 CORBA::Long MaxNbOfIterations,
158 CORBA::Double MaxAspectRatio,
159 SMESH::SMESH_MeshEditor::Smooth_Method Method,
161 CORBA::Boolean smoothObject(SMESH::SMESH_IDSource_ptr theObject,
162 const SMESH::long_array & IDsOfFixedNodes,
163 CORBA::Long MaxNbOfIterations,
164 CORBA::Double MaxAspectRatio,
165 SMESH::SMESH_MeshEditor::Smooth_Method Method,
169 void ConvertToQuadratic(CORBA::Boolean Force3d);
170 CORBA::Boolean ConvertFromQuadratic();
172 void RenumberNodes();
173 void RenumberElements();
175 void RotationSweep(const SMESH::long_array & IDsOfElements,
176 const SMESH::AxisStruct & Axis,
177 CORBA::Double AngleInRadians,
178 CORBA::Long NbOfSteps,
179 CORBA::Double Tolerance);
180 void RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject,
181 const SMESH::AxisStruct & Axis,
182 CORBA::Double AngleInRadians,
183 CORBA::Long NbOfSteps,
184 CORBA::Double Tolerance);
185 void RotationSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
186 const SMESH::AxisStruct & Axis,
187 CORBA::Double AngleInRadians,
188 CORBA::Long NbOfSteps,
189 CORBA::Double Tolerance);
190 void RotationSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
191 const SMESH::AxisStruct & Axis,
192 CORBA::Double AngleInRadians,
193 CORBA::Long NbOfSteps,
194 CORBA::Double Tolerance);
196 void ExtrusionSweep(const SMESH::long_array & IDsOfElements,
197 const SMESH::DirStruct & StepVector,
198 CORBA::Long NbOfSteps);
199 void ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObject,
200 const SMESH::DirStruct & StepVector,
201 CORBA::Long NbOfSteps);
202 void ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
203 const SMESH::DirStruct & StepVector,
204 CORBA::Long NbOfSteps);
205 void ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
206 const SMESH::DirStruct & StepVector,
207 CORBA::Long NbOfSteps);
208 void AdvancedExtrusion(const SMESH::long_array & theIDsOfElements,
209 const SMESH::DirStruct & theStepVector,
210 CORBA::Long theNbOfSteps,
211 CORBA::Long theExtrFlags,
212 CORBA::Double theSewTolerance);
214 SMESH::SMESH_MeshEditor::Extrusion_Error
215 ExtrusionAlongPath(const SMESH::long_array & IDsOfElements,
216 SMESH::SMESH_Mesh_ptr PathMesh,
217 GEOM::GEOM_Object_ptr PathShape,
218 CORBA::Long NodeStart,
219 CORBA::Boolean HasAngles,
220 const SMESH::double_array & Angles,
221 CORBA::Boolean HasRefPoint,
222 const SMESH::PointStruct & RefPoint);
224 SMESH::SMESH_MeshEditor::Extrusion_Error
225 ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr theObject,
226 SMESH::SMESH_Mesh_ptr PathMesh,
227 GEOM::GEOM_Object_ptr PathShape,
228 CORBA::Long NodeStart,
229 CORBA::Boolean HasAngles,
230 const SMESH::double_array & Angles,
231 CORBA::Boolean HasRefPoint,
232 const SMESH::PointStruct & RefPoint);
233 SMESH::SMESH_MeshEditor::Extrusion_Error
234 ExtrusionAlongPathObject1D(SMESH::SMESH_IDSource_ptr theObject,
235 SMESH::SMESH_Mesh_ptr PathMesh,
236 GEOM::GEOM_Object_ptr PathShape,
237 CORBA::Long NodeStart,
238 CORBA::Boolean HasAngles,
239 const SMESH::double_array & Angles,
240 CORBA::Boolean HasRefPoint,
241 const SMESH::PointStruct & RefPoint);
242 SMESH::SMESH_MeshEditor::Extrusion_Error
243 ExtrusionAlongPathObject2D(SMESH::SMESH_IDSource_ptr theObject,
244 SMESH::SMESH_Mesh_ptr PathMesh,
245 GEOM::GEOM_Object_ptr PathShape,
246 CORBA::Long NodeStart,
247 CORBA::Boolean HasAngles,
248 const SMESH::double_array & Angles,
249 CORBA::Boolean HasRefPoint,
250 const SMESH::PointStruct & RefPoint);
252 SMESH::double_array* LinearAnglesVariation(SMESH::SMESH_Mesh_ptr PathMesh,
253 GEOM::GEOM_Object_ptr PathShape,
254 const SMESH::double_array & Angles);
256 void Mirror(const SMESH::long_array & IDsOfElements,
257 const SMESH::AxisStruct & Axis,
258 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
259 CORBA::Boolean Copy);
260 void MirrorObject(SMESH::SMESH_IDSource_ptr theObject,
261 const SMESH::AxisStruct & Axis,
262 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
263 CORBA::Boolean Copy);
264 void Translate(const SMESH::long_array & IDsOfElements,
265 const SMESH::DirStruct & Vector,
266 CORBA::Boolean Copy);
267 void TranslateObject(SMESH::SMESH_IDSource_ptr theObject,
268 const SMESH::DirStruct & Vector,
269 CORBA::Boolean Copy);
270 void Rotate(const SMESH::long_array & IDsOfElements,
271 const SMESH::AxisStruct & Axis,
273 CORBA::Boolean Copy);
274 void RotateObject(SMESH::SMESH_IDSource_ptr theObject,
275 const SMESH::AxisStruct & Axis,
277 CORBA::Boolean Copy);
279 SMESH::ListOfGroups* RotationSweepMakeGroups(const SMESH::long_array& IDsOfElements,
280 const SMESH::AxisStruct& Axix,
281 CORBA::Double AngleInRadians,
282 CORBA::Long NbOfSteps,
283 CORBA::Double Tolerance);
284 SMESH::ListOfGroups* RotationSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
285 const SMESH::AxisStruct& Axix,
286 CORBA::Double AngleInRadians,
287 CORBA::Long NbOfSteps,
288 CORBA::Double Tolerance);
289 SMESH::ListOfGroups* RotationSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
290 const SMESH::AxisStruct& Axix,
291 CORBA::Double AngleInRadians,
292 CORBA::Long NbOfSteps,
293 CORBA::Double Tolerance);
294 SMESH::ListOfGroups* RotationSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
295 const SMESH::AxisStruct& Axix,
296 CORBA::Double AngleInRadians,
297 CORBA::Long NbOfSteps,
298 CORBA::Double Tolerance);
299 SMESH::ListOfGroups* ExtrusionSweepMakeGroups(const SMESH::long_array& IDsOfElements,
300 const SMESH::DirStruct& StepVector,
301 CORBA::Long NbOfSteps);
302 SMESH::ListOfGroups* AdvancedExtrusionMakeGroups(const SMESH::long_array& IDsOfElements,
303 const SMESH::DirStruct& StepVector,
304 CORBA::Long NbOfSteps,
305 CORBA::Long ExtrFlags,
306 CORBA::Double SewTolerance);
307 SMESH::ListOfGroups* ExtrusionSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
308 const SMESH::DirStruct& StepVector,
309 CORBA::Long NbOfSteps);
310 SMESH::ListOfGroups* ExtrusionSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
311 const SMESH::DirStruct& StepVector,
312 CORBA::Long NbOfSteps);
313 SMESH::ListOfGroups* ExtrusionSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
314 const SMESH::DirStruct& StepVector,
315 CORBA::Long NbOfSteps);
316 SMESH::ListOfGroups* ExtrusionAlongPathMakeGroups(const SMESH::long_array& IDsOfElements,
317 SMESH::SMESH_Mesh_ptr PathMesh,
318 GEOM::GEOM_Object_ptr PathShape,
319 CORBA::Long NodeStart,
320 CORBA::Boolean HasAngles,
321 const SMESH::double_array& Angles,
322 CORBA::Boolean HasRefPoint,
323 const SMESH::PointStruct& RefPoint,
324 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
325 SMESH::ListOfGroups* ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
326 SMESH::SMESH_Mesh_ptr PathMesh,
327 GEOM::GEOM_Object_ptr PathShape,
328 CORBA::Long NodeStart,
329 CORBA::Boolean HasAngles,
330 const SMESH::double_array& Angles,
331 CORBA::Boolean HasRefPoint,
332 const SMESH::PointStruct& RefPoint,
333 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
334 SMESH::ListOfGroups* ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
335 SMESH::SMESH_Mesh_ptr PathMesh,
336 GEOM::GEOM_Object_ptr PathShape,
337 CORBA::Long NodeStart,
338 CORBA::Boolean HasAngles,
339 const SMESH::double_array& Angles,
340 CORBA::Boolean HasRefPoint,
341 const SMESH::PointStruct& RefPoint,
342 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
343 SMESH::ListOfGroups* ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
344 SMESH::SMESH_Mesh_ptr PathMesh,
345 GEOM::GEOM_Object_ptr PathShape,
346 CORBA::Long NodeStart,
347 CORBA::Boolean HasAngles,
348 const SMESH::double_array& Angles,
349 CORBA::Boolean HasRefPoint,
350 const SMESH::PointStruct& RefPoint,
351 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
354 SMESH::ListOfGroups* ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr Object,
355 SMESH::SMESH_IDSource_ptr Path,
356 CORBA::Long NodeStart,
357 CORBA::Boolean HasAngles,
358 const SMESH::double_array& Angles,
359 CORBA::Boolean LinearVariation,
360 CORBA::Boolean HasRefPoint,
361 const SMESH::PointStruct& RefPoint,
362 CORBA::Boolean MakeGroups,
363 SMESH::ElementType ElemType,
364 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
365 SMESH::ListOfGroups* ExtrusionAlongPathX(const SMESH::long_array& IDsOfElements,
366 SMESH::SMESH_IDSource_ptr Path,
367 CORBA::Long NodeStart,
368 CORBA::Boolean HasAngles,
369 const SMESH::double_array& Angles,
370 CORBA::Boolean LinearVariation,
371 CORBA::Boolean HasRefPoint,
372 const SMESH::PointStruct& RefPoint,
373 CORBA::Boolean MakeGroups,
374 SMESH::ElementType ElemType,
375 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
377 SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::long_array& IDsOfElements,
378 const SMESH::AxisStruct& Mirror,
379 SMESH::SMESH_MeshEditor::MirrorType MirrorType);
380 SMESH::ListOfGroups* MirrorObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
381 const SMESH::AxisStruct& Mirror,
382 SMESH::SMESH_MeshEditor::MirrorType MirrorType);
383 SMESH::ListOfGroups* TranslateMakeGroups(const SMESH::long_array& IDsOfElements,
384 const SMESH::DirStruct& Vector);
385 SMESH::ListOfGroups* TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
386 const SMESH::DirStruct& Vector);
387 SMESH::ListOfGroups* RotateMakeGroups(const SMESH::long_array& IDsOfElements,
388 const SMESH::AxisStruct& Axis,
389 CORBA::Double AngleInRadians);
390 SMESH::ListOfGroups* RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
391 const SMESH::AxisStruct& Axis,
392 CORBA::Double AngleInRadians);
394 SMESH::SMESH_Mesh_ptr MirrorMakeMesh(const SMESH::long_array& IDsOfElements,
395 const SMESH::AxisStruct& Mirror,
396 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
397 CORBA::Boolean CopyGroups,
398 const char* MeshName);
399 SMESH::SMESH_Mesh_ptr MirrorObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
400 const SMESH::AxisStruct& Mirror,
401 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
402 CORBA::Boolean CopyGroups,
403 const char* MeshName);
404 SMESH::SMESH_Mesh_ptr TranslateMakeMesh(const SMESH::long_array& IDsOfElements,
405 const SMESH::DirStruct& Vector,
406 CORBA::Boolean CopyGroups,
407 const char* MeshName);
408 SMESH::SMESH_Mesh_ptr TranslateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
409 const SMESH::DirStruct& Vector,
410 CORBA::Boolean CopyGroups,
411 const char* MeshName);
412 SMESH::SMESH_Mesh_ptr RotateMakeMesh(const SMESH::long_array& IDsOfElements,
413 const SMESH::AxisStruct& Axis,
414 CORBA::Double AngleInRadians,
415 CORBA::Boolean CopyGroups,
416 const char* MeshName);
417 SMESH::SMESH_Mesh_ptr RotateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
418 const SMESH::AxisStruct& Axis,
419 CORBA::Double AngleInRadians,
420 CORBA::Boolean CopyGroups,
421 const char* MeshName);
423 void FindCoincidentNodes (CORBA::Double Tolerance,
424 SMESH::array_of_long_array_out GroupsOfNodes);
425 void FindCoincidentNodesOnPart(SMESH::SMESH_IDSource_ptr Object,
426 CORBA::Double Tolerance,
427 SMESH::array_of_long_array_out GroupsOfNodes);
428 void MergeNodes (const SMESH::array_of_long_array& GroupsOfNodes);
429 void FindEqualElements(SMESH::SMESH_IDSource_ptr Object,
430 SMESH::array_of_long_array_out GroupsOfElementsID);
431 void MergeElements(const SMESH::array_of_long_array& GroupsOfElementsID);
432 void MergeEqualElements();
433 CORBA::Long MoveClosestNodeToPoint(CORBA::Double x,
440 SMESH::SMESH_MeshEditor::Sew_Error
441 SewFreeBorders(CORBA::Long FirstNodeID1,
442 CORBA::Long SecondNodeID1,
443 CORBA::Long LastNodeID1,
444 CORBA::Long FirstNodeID2,
445 CORBA::Long SecondNodeID2,
446 CORBA::Long LastNodeID2,
447 CORBA::Boolean CreatePolygons,
448 CORBA::Boolean CreatePolyedrs);
449 SMESH::SMESH_MeshEditor::Sew_Error
450 SewConformFreeBorders(CORBA::Long FirstNodeID1,
451 CORBA::Long SecondNodeID1,
452 CORBA::Long LastNodeID1,
453 CORBA::Long FirstNodeID2,
454 CORBA::Long SecondNodeID2);
455 SMESH::SMESH_MeshEditor::Sew_Error
456 SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder,
457 CORBA::Long SecondNodeIDOnFreeBorder,
458 CORBA::Long LastNodeIDOnFreeBorder,
459 CORBA::Long FirstNodeIDOnSide,
460 CORBA::Long LastNodeIDOnSide,
461 CORBA::Boolean CreatePolygons,
462 CORBA::Boolean CreatePolyedrs);
463 SMESH::SMESH_MeshEditor::Sew_Error
464 SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
465 const SMESH::long_array& IDsOfSide2Elements,
466 CORBA::Long NodeID1OfSide1ToMerge,
467 CORBA::Long NodeID1OfSide2ToMerge,
468 CORBA::Long NodeID2OfSide1ToMerge,
469 CORBA::Long NodeID2OfSide2ToMerge);
472 * Set new nodes for given element.
473 * If number of nodes is not corresponded to type of
474 * element - returns false
476 CORBA::Boolean ChangeElemNodes(CORBA::Long ide, const SMESH::long_array& newIDs);
479 * Return data of mesh edition preview
481 SMESH::MeshPreviewStruct* GetPreviewData();
484 * If during last operation of MeshEditor some nodes were
485 * created this method returns list of it's IDs, if new nodes
486 * not creared - returns empty list
488 SMESH::long_array* GetLastCreatedNodes();
491 * If during last operation of MeshEditor some elements were
492 * created this method returns list of it's IDs, if new elements
493 * not creared - returns empty list
495 SMESH::long_array* GetLastCreatedElems();
498 * \brief Return edited mesh ID
499 * \retval int - mesh ID
501 int GetMeshId() const { return myMesh->GetId(); }
505 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
506 * \param theElems - the list of elements (edges or faces) to be replicated
507 * The nodes for duplication could be found from these elements
508 * \param theNodesNot - list of nodes to NOT replicate
509 * \param theAffectedElems - the list of elements (cells and edges) to which the
510 * replicated nodes should be associated to.
511 * \return TRUE if operation has been completed successfully, FALSE otherwise
512 * \sa DoubleNodeGroup(), DoubleNodeGroups()
514 CORBA::Boolean DoubleNodes( const SMESH::long_array& theElems,
515 const SMESH::long_array& theNodesNot,
516 const SMESH::long_array& theAffectedElems );
519 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
520 * \param theElems - the list of elements (edges or faces) to be replicated
521 * The nodes for duplication could be found from these elements
522 * \param theNodesNot - list of nodes to NOT replicate
523 * \param theShape - shape to detect affected elements (element which geometric center
524 * located on or inside shape).
525 * The replicated nodes should be associated to affected elements.
526 * \return TRUE if operation has been completed successfully, FALSE otherwise
527 * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
529 CORBA::Boolean DoubleNodesInRegion( const SMESH::long_array& theElems,
530 const SMESH::long_array& theNodesNot,
531 GEOM::GEOM_Object_ptr theShape );
534 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
535 * \param theElems - group of of elements (edges or faces) to be replicated
536 * \param theNodesNot - group of nodes not to replicated
537 * \param theAffectedElems - group of elements to which the replicated nodes
538 * should be associated to.
539 * \return TRUE if operation has been completed successfully, FALSE otherwise
540 * \sa DoubleNodes(), DoubleNodeGroups()
542 CORBA::Boolean DoubleNodeGroup( SMESH::SMESH_GroupBase_ptr theElems,
543 SMESH::SMESH_GroupBase_ptr theNodesNot,
544 SMESH::SMESH_GroupBase_ptr theAffectedElems );
547 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
548 * \param theElems - group of of elements (edges or faces) to be replicated
549 * \param theNodesNot - group of nodes not to replicated
550 * \param theShape - shape to detect affected elements (element which geometric center
551 * located on or inside shape).
552 * The replicated nodes should be associated to affected elements.
553 * \return TRUE if operation has been completed successfully, FALSE otherwise
554 * \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
556 CORBA::Boolean DoubleNodeGroupInRegion( SMESH::SMESH_GroupBase_ptr theElems,
557 SMESH::SMESH_GroupBase_ptr theNodesNot,
558 GEOM::GEOM_Object_ptr theShape );
561 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
562 * This method provided for convenience works as DoubleNodes() described above.
563 * \param theElems - list of groups of elements (edges or faces) to be replicated
564 * \param theNodesNot - list of groups of nodes not to replicated
565 * \param theAffectedElems - group of elements to which the replicated nodes
566 * should be associated to.
567 * \return TRUE if operation has been completed successfully, FALSE otherwise
568 * \sa DoubleNodeGroup(), DoubleNodes()
570 CORBA::Boolean DoubleNodeGroups( const SMESH::ListOfGroups& theElems,
571 const SMESH::ListOfGroups& theNodesNot,
572 const SMESH::ListOfGroups& theAffectedElems );
576 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
577 * This method provided for convenience works as DoubleNodes() described above.
578 * \param theElems - list of groups of elements (edges or faces) to be replicated
579 * \param theNodesNot - list of groups of nodes not to replicated
580 * \param theShape - shape to detect affected elements (element which geometric center
581 * located on or inside shape).
582 * The replicated nodes should be associated to affected elements.
583 * \return TRUE if operation has been completed successfully, FALSE otherwise
584 * \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
586 CORBA::Boolean DoubleNodeGroupsInRegion( const SMESH::ListOfGroups& theElems,
587 const SMESH::ListOfGroups& theNodesNot,
588 GEOM::GEOM_Object_ptr theShape );
590 private: //!< private methods
592 SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); }
595 * \brief Update myLastCreated* or myPreviewData
596 * \param anEditor - it contains edition results
598 void storeResult(::SMESH_MeshEditor& anEditor);
600 * \brief Clear myLastCreated* or myPreviewData
605 * \brief Return groups by their IDs
607 SMESH::ListOfGroups* getGroups(const std::list<int>* groupIDs);
609 SMESH::ListOfGroups* rotationSweep(const SMESH::long_array & IDsOfElements,
610 const SMESH::AxisStruct & Axis,
611 CORBA::Double AngleInRadians,
612 CORBA::Long NbOfSteps,
613 CORBA::Double Tolerance,
614 const bool MakeGroups,
615 const SMDSAbs_ElementType ElementType=SMDSAbs_All);
616 SMESH::ListOfGroups* extrusionSweep(const SMESH::long_array & IDsOfElements,
617 const SMESH::DirStruct & StepVector,
618 CORBA::Long NbOfSteps,
619 const bool MakeGroups,
620 const SMDSAbs_ElementType ElementType=SMDSAbs_All);
621 SMESH::ListOfGroups* advancedExtrusion(const SMESH::long_array & theIDsOfElements,
622 const SMESH::DirStruct & theStepVector,
623 CORBA::Long theNbOfSteps,
624 CORBA::Long theExtrFlags,
625 CORBA::Double theSewTolerance,
626 const bool MakeGroups);
627 SMESH::ListOfGroups* extrusionAlongPath(const SMESH::long_array & IDsOfElements,
628 SMESH::SMESH_Mesh_ptr PathMesh,
629 GEOM::GEOM_Object_ptr PathShape,
630 CORBA::Long NodeStart,
631 CORBA::Boolean HasAngles,
632 const SMESH::double_array & Angles,
633 CORBA::Boolean HasRefPoint,
634 const SMESH::PointStruct & RefPoint,
635 const bool MakeGroups,
636 SMESH::SMESH_MeshEditor::Extrusion_Error & Error,
637 const SMDSAbs_ElementType ElementType=SMDSAbs_All);
638 SMESH::ListOfGroups* extrusionAlongPathX(const SMESH::long_array & IDsOfElements,
639 SMESH::SMESH_IDSource_ptr Path,
640 CORBA::Long NodeStart,
641 CORBA::Boolean HasAngles,
642 const SMESH::double_array& Angles,
643 CORBA::Boolean LinearVariation,
644 CORBA::Boolean HasRefPoint,
645 const SMESH::PointStruct& RefPoint,
646 const bool MakeGroups,
647 const SMDSAbs_ElementType ElementType,
648 SMESH::SMESH_MeshEditor::Extrusion_Error & theError);
649 SMESH::ListOfGroups* mirror(const SMESH::long_array & IDsOfElements,
650 const SMESH::AxisStruct & Axis,
651 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
653 const bool MakeGroups,
654 ::SMESH_Mesh* TargetMesh=0);
655 SMESH::ListOfGroups* translate(const SMESH::long_array & IDsOfElements,
656 const SMESH::DirStruct & Vector,
658 const bool MakeGroups,
659 ::SMESH_Mesh* TargetMesh=0);
660 SMESH::ListOfGroups* rotate(const SMESH::long_array & IDsOfElements,
661 const SMESH::AxisStruct & Axis,
664 const bool MakeGroups,
665 ::SMESH_Mesh* TargetMesh=0);
667 SMESH::SMESH_Mesh_ptr makeMesh(const char* theMeshName);
669 void DumpGroupsList(SMESH::TPythonDump & theDumpPython,
670 const SMESH::ListOfGroups * theGroupList);
674 SMESH_Mesh_i* myMesh_i;
677 SMESH::long_array_var myLastCreatedElems;
678 SMESH::long_array_var myLastCreatedNodes;
680 SMESH::MeshPreviewStruct_var myPreviewData;