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();
52 * \brief Wrap a sequence of ids in a SMESH_IDSource
54 SMESH::SMESH_IDSource_ptr MakeIDSource(const SMESH::long_array& IDsOfElements);
56 CORBA::Boolean RemoveElements(const SMESH::long_array & IDsOfElements);
57 CORBA::Boolean RemoveNodes(const SMESH::long_array & IDsOfNodes);
60 * Methods for creation new elements.
61 * Returns ID of created element or 0 if element not created
63 CORBA::Long AddNode(CORBA::Double x, CORBA::Double y, CORBA::Double z);
64 CORBA::Long Add0DElement(CORBA::Long IDOfNode);
65 CORBA::Long AddEdge(const SMESH::long_array & IDsOfNodes);
66 CORBA::Long AddFace(const SMESH::long_array & IDsOfNodes);
67 CORBA::Long AddPolygonalFace(const SMESH::long_array & IDsOfNodes);
68 CORBA::Long AddVolume(const SMESH::long_array & IDsOfNodes);
69 CORBA::Long AddPolyhedralVolume(const SMESH::long_array & IDsOfNodes,
70 const SMESH::long_array & Quantities);
71 CORBA::Long AddPolyhedralVolumeByFaces(const SMESH::long_array & IdsOfFaces);
74 * \brief Bind a node to a vertex
75 * \param NodeID - node ID
76 * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
78 void SetNodeOnVertex(CORBA::Long NodeID, CORBA::Long VertexID)
79 throw (SALOME::SALOME_Exception);
81 * \brief Store node position on an edge
82 * \param NodeID - node ID
83 * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
84 * \param paramOnEdge - parameter on edge where the node is located
86 void SetNodeOnEdge(CORBA::Long NodeID, CORBA::Long EdgeID,
87 CORBA::Double paramOnEdge)
88 throw (SALOME::SALOME_Exception);
90 * \brief Store node position on a face
91 * \param NodeID - node ID
92 * \param FaceID - face ID available through GEOM_Object.GetSubShapeIndices()[0]
93 * \param u - U parameter on face where the node is located
94 * \param v - V parameter on face where the node is located
96 void SetNodeOnFace(CORBA::Long NodeID, CORBA::Long FaceID,
97 CORBA::Double u, CORBA::Double v)
98 throw (SALOME::SALOME_Exception);
100 * \brief Bind a node to a solid
101 * \param NodeID - node ID
102 * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
104 void SetNodeInVolume(CORBA::Long NodeID, CORBA::Long SolidID)
105 throw (SALOME::SALOME_Exception);
107 * \brief Bind an element to a shape
108 * \param ElementID - element ID
109 * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0]
111 void SetMeshElementOnShape(CORBA::Long ElementID, CORBA::Long ShapeID)
112 throw (SALOME::SALOME_Exception);
115 CORBA::Boolean MoveNode(CORBA::Long NodeID,
116 CORBA::Double x, CORBA::Double y, CORBA::Double z);
118 CORBA::Boolean InverseDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
119 CORBA::Boolean DeleteDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
120 CORBA::Boolean Reorient(const SMESH::long_array & IDsOfElements);
121 CORBA::Boolean ReorientObject(SMESH::SMESH_IDSource_ptr theObject);
124 CORBA::Boolean TriToQuad (const SMESH::long_array & IDsOfElements,
125 SMESH::NumericalFunctor_ptr Criterion,
126 CORBA::Double MaxAngle);
127 CORBA::Boolean TriToQuadObject (SMESH::SMESH_IDSource_ptr theObject,
128 SMESH::NumericalFunctor_ptr Criterion,
129 CORBA::Double MaxAngle);
130 CORBA::Boolean QuadToTri (const SMESH::long_array & IDsOfElements,
131 SMESH::NumericalFunctor_ptr Criterion);
132 CORBA::Boolean QuadToTriObject (SMESH::SMESH_IDSource_ptr theObject,
133 SMESH::NumericalFunctor_ptr Criterion);
134 CORBA::Boolean SplitQuad (const SMESH::long_array & IDsOfElements,
135 CORBA::Boolean Diag13);
136 CORBA::Boolean SplitQuadObject (SMESH::SMESH_IDSource_ptr theObject,
137 CORBA::Boolean Diag13);
138 CORBA::Long BestSplit (CORBA::Long IDOfQuad,
139 SMESH::NumericalFunctor_ptr Criterion);
141 CORBA::Boolean Smooth(const SMESH::long_array & IDsOfElements,
142 const SMESH::long_array & IDsOfFixedNodes,
143 CORBA::Long MaxNbOfIterations,
144 CORBA::Double MaxAspectRatio,
145 SMESH::SMESH_MeshEditor::Smooth_Method Method);
146 CORBA::Boolean SmoothObject(SMESH::SMESH_IDSource_ptr theObject,
147 const SMESH::long_array & IDsOfFixedNodes,
148 CORBA::Long MaxNbOfIterations,
149 CORBA::Double MaxAspectRatio,
150 SMESH::SMESH_MeshEditor::Smooth_Method Method);
151 CORBA::Boolean SmoothParametric(const SMESH::long_array & IDsOfElements,
152 const SMESH::long_array & IDsOfFixedNodes,
153 CORBA::Long MaxNbOfIterations,
154 CORBA::Double MaxAspectRatio,
155 SMESH::SMESH_MeshEditor::Smooth_Method Method);
156 CORBA::Boolean SmoothParametricObject(SMESH::SMESH_IDSource_ptr theObject,
157 const SMESH::long_array & IDsOfFixedNodes,
158 CORBA::Long MaxNbOfIterations,
159 CORBA::Double MaxAspectRatio,
160 SMESH::SMESH_MeshEditor::Smooth_Method Method);
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,
167 CORBA::Boolean smoothObject(SMESH::SMESH_IDSource_ptr theObject,
168 const SMESH::long_array & IDsOfFixedNodes,
169 CORBA::Long MaxNbOfIterations,
170 CORBA::Double MaxAspectRatio,
171 SMESH::SMESH_MeshEditor::Smooth_Method Method,
175 void ConvertToQuadratic(CORBA::Boolean Force3d);
176 CORBA::Boolean ConvertFromQuadratic();
178 void RenumberNodes();
179 void RenumberElements();
181 void RotationSweep(const SMESH::long_array & IDsOfElements,
182 const SMESH::AxisStruct & Axis,
183 CORBA::Double AngleInRadians,
184 CORBA::Long NbOfSteps,
185 CORBA::Double Tolerance);
186 void RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject,
187 const SMESH::AxisStruct & Axis,
188 CORBA::Double AngleInRadians,
189 CORBA::Long NbOfSteps,
190 CORBA::Double Tolerance);
191 void RotationSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
192 const SMESH::AxisStruct & Axis,
193 CORBA::Double AngleInRadians,
194 CORBA::Long NbOfSteps,
195 CORBA::Double Tolerance);
196 void RotationSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
197 const SMESH::AxisStruct & Axis,
198 CORBA::Double AngleInRadians,
199 CORBA::Long NbOfSteps,
200 CORBA::Double Tolerance);
202 void ExtrusionSweep(const SMESH::long_array & IDsOfElements,
203 const SMESH::DirStruct & StepVector,
204 CORBA::Long NbOfSteps);
205 void ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObject,
206 const SMESH::DirStruct & StepVector,
207 CORBA::Long NbOfSteps);
208 void ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
209 const SMESH::DirStruct & StepVector,
210 CORBA::Long NbOfSteps);
211 void ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
212 const SMESH::DirStruct & StepVector,
213 CORBA::Long NbOfSteps);
214 void AdvancedExtrusion(const SMESH::long_array & theIDsOfElements,
215 const SMESH::DirStruct & theStepVector,
216 CORBA::Long theNbOfSteps,
217 CORBA::Long theExtrFlags,
218 CORBA::Double theSewTolerance);
220 SMESH::SMESH_MeshEditor::Extrusion_Error
221 ExtrusionAlongPath(const SMESH::long_array & IDsOfElements,
222 SMESH::SMESH_Mesh_ptr PathMesh,
223 GEOM::GEOM_Object_ptr PathShape,
224 CORBA::Long NodeStart,
225 CORBA::Boolean HasAngles,
226 const SMESH::double_array & Angles,
227 CORBA::Boolean HasRefPoint,
228 const SMESH::PointStruct & RefPoint);
230 SMESH::SMESH_MeshEditor::Extrusion_Error
231 ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr theObject,
232 SMESH::SMESH_Mesh_ptr PathMesh,
233 GEOM::GEOM_Object_ptr PathShape,
234 CORBA::Long NodeStart,
235 CORBA::Boolean HasAngles,
236 const SMESH::double_array & Angles,
237 CORBA::Boolean HasRefPoint,
238 const SMESH::PointStruct & RefPoint);
239 SMESH::SMESH_MeshEditor::Extrusion_Error
240 ExtrusionAlongPathObject1D(SMESH::SMESH_IDSource_ptr theObject,
241 SMESH::SMESH_Mesh_ptr PathMesh,
242 GEOM::GEOM_Object_ptr PathShape,
243 CORBA::Long NodeStart,
244 CORBA::Boolean HasAngles,
245 const SMESH::double_array & Angles,
246 CORBA::Boolean HasRefPoint,
247 const SMESH::PointStruct & RefPoint);
248 SMESH::SMESH_MeshEditor::Extrusion_Error
249 ExtrusionAlongPathObject2D(SMESH::SMESH_IDSource_ptr theObject,
250 SMESH::SMESH_Mesh_ptr PathMesh,
251 GEOM::GEOM_Object_ptr PathShape,
252 CORBA::Long NodeStart,
253 CORBA::Boolean HasAngles,
254 const SMESH::double_array & Angles,
255 CORBA::Boolean HasRefPoint,
256 const SMESH::PointStruct & RefPoint);
258 SMESH::double_array* LinearAnglesVariation(SMESH::SMESH_Mesh_ptr PathMesh,
259 GEOM::GEOM_Object_ptr PathShape,
260 const SMESH::double_array & Angles);
262 void Mirror(const SMESH::long_array & IDsOfElements,
263 const SMESH::AxisStruct & Axis,
264 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
265 CORBA::Boolean Copy);
266 void MirrorObject(SMESH::SMESH_IDSource_ptr theObject,
267 const SMESH::AxisStruct & Axis,
268 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
269 CORBA::Boolean Copy);
270 void Translate(const SMESH::long_array & IDsOfElements,
271 const SMESH::DirStruct & Vector,
272 CORBA::Boolean Copy);
273 void TranslateObject(SMESH::SMESH_IDSource_ptr theObject,
274 const SMESH::DirStruct & Vector,
275 CORBA::Boolean Copy);
276 void Rotate(const SMESH::long_array & IDsOfElements,
277 const SMESH::AxisStruct & Axis,
279 CORBA::Boolean Copy);
280 void RotateObject(SMESH::SMESH_IDSource_ptr theObject,
281 const SMESH::AxisStruct & Axis,
283 CORBA::Boolean Copy);
285 SMESH::ListOfGroups* RotationSweepMakeGroups(const SMESH::long_array& IDsOfElements,
286 const SMESH::AxisStruct& Axix,
287 CORBA::Double AngleInRadians,
288 CORBA::Long NbOfSteps,
289 CORBA::Double Tolerance);
290 SMESH::ListOfGroups* RotationSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
291 const SMESH::AxisStruct& Axix,
292 CORBA::Double AngleInRadians,
293 CORBA::Long NbOfSteps,
294 CORBA::Double Tolerance);
295 SMESH::ListOfGroups* RotationSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
296 const SMESH::AxisStruct& Axix,
297 CORBA::Double AngleInRadians,
298 CORBA::Long NbOfSteps,
299 CORBA::Double Tolerance);
300 SMESH::ListOfGroups* RotationSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
301 const SMESH::AxisStruct& Axix,
302 CORBA::Double AngleInRadians,
303 CORBA::Long NbOfSteps,
304 CORBA::Double Tolerance);
305 SMESH::ListOfGroups* ExtrusionSweepMakeGroups(const SMESH::long_array& IDsOfElements,
306 const SMESH::DirStruct& StepVector,
307 CORBA::Long NbOfSteps);
308 SMESH::ListOfGroups* AdvancedExtrusionMakeGroups(const SMESH::long_array& IDsOfElements,
309 const SMESH::DirStruct& StepVector,
310 CORBA::Long NbOfSteps,
311 CORBA::Long ExtrFlags,
312 CORBA::Double SewTolerance);
313 SMESH::ListOfGroups* ExtrusionSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
314 const SMESH::DirStruct& StepVector,
315 CORBA::Long NbOfSteps);
316 SMESH::ListOfGroups* ExtrusionSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
317 const SMESH::DirStruct& StepVector,
318 CORBA::Long NbOfSteps);
319 SMESH::ListOfGroups* ExtrusionSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
320 const SMESH::DirStruct& StepVector,
321 CORBA::Long NbOfSteps);
322 SMESH::ListOfGroups* ExtrusionAlongPathMakeGroups(const SMESH::long_array& IDsOfElements,
323 SMESH::SMESH_Mesh_ptr PathMesh,
324 GEOM::GEOM_Object_ptr PathShape,
325 CORBA::Long NodeStart,
326 CORBA::Boolean HasAngles,
327 const SMESH::double_array& Angles,
328 CORBA::Boolean HasRefPoint,
329 const SMESH::PointStruct& RefPoint,
330 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
331 SMESH::ListOfGroups* ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
332 SMESH::SMESH_Mesh_ptr PathMesh,
333 GEOM::GEOM_Object_ptr PathShape,
334 CORBA::Long NodeStart,
335 CORBA::Boolean HasAngles,
336 const SMESH::double_array& Angles,
337 CORBA::Boolean HasRefPoint,
338 const SMESH::PointStruct& RefPoint,
339 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
340 SMESH::ListOfGroups* ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
341 SMESH::SMESH_Mesh_ptr PathMesh,
342 GEOM::GEOM_Object_ptr PathShape,
343 CORBA::Long NodeStart,
344 CORBA::Boolean HasAngles,
345 const SMESH::double_array& Angles,
346 CORBA::Boolean HasRefPoint,
347 const SMESH::PointStruct& RefPoint,
348 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
349 SMESH::ListOfGroups* ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
350 SMESH::SMESH_Mesh_ptr PathMesh,
351 GEOM::GEOM_Object_ptr PathShape,
352 CORBA::Long NodeStart,
353 CORBA::Boolean HasAngles,
354 const SMESH::double_array& Angles,
355 CORBA::Boolean HasRefPoint,
356 const SMESH::PointStruct& RefPoint,
357 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
360 SMESH::ListOfGroups* ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr Object,
361 SMESH::SMESH_IDSource_ptr Path,
362 CORBA::Long NodeStart,
363 CORBA::Boolean HasAngles,
364 const SMESH::double_array& Angles,
365 CORBA::Boolean LinearVariation,
366 CORBA::Boolean HasRefPoint,
367 const SMESH::PointStruct& RefPoint,
368 CORBA::Boolean MakeGroups,
369 SMESH::ElementType ElemType,
370 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
371 SMESH::ListOfGroups* ExtrusionAlongPathX(const SMESH::long_array& IDsOfElements,
372 SMESH::SMESH_IDSource_ptr Path,
373 CORBA::Long NodeStart,
374 CORBA::Boolean HasAngles,
375 const SMESH::double_array& Angles,
376 CORBA::Boolean LinearVariation,
377 CORBA::Boolean HasRefPoint,
378 const SMESH::PointStruct& RefPoint,
379 CORBA::Boolean MakeGroups,
380 SMESH::ElementType ElemType,
381 SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
383 SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::long_array& IDsOfElements,
384 const SMESH::AxisStruct& Mirror,
385 SMESH::SMESH_MeshEditor::MirrorType MirrorType);
386 SMESH::ListOfGroups* MirrorObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
387 const SMESH::AxisStruct& Mirror,
388 SMESH::SMESH_MeshEditor::MirrorType MirrorType);
389 SMESH::ListOfGroups* TranslateMakeGroups(const SMESH::long_array& IDsOfElements,
390 const SMESH::DirStruct& Vector);
391 SMESH::ListOfGroups* TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
392 const SMESH::DirStruct& Vector);
393 SMESH::ListOfGroups* RotateMakeGroups(const SMESH::long_array& IDsOfElements,
394 const SMESH::AxisStruct& Axis,
395 CORBA::Double AngleInRadians);
396 SMESH::ListOfGroups* RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
397 const SMESH::AxisStruct& Axis,
398 CORBA::Double AngleInRadians);
400 SMESH::SMESH_Mesh_ptr MirrorMakeMesh(const SMESH::long_array& IDsOfElements,
401 const SMESH::AxisStruct& Mirror,
402 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
403 CORBA::Boolean CopyGroups,
404 const char* MeshName);
405 SMESH::SMESH_Mesh_ptr MirrorObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
406 const SMESH::AxisStruct& Mirror,
407 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
408 CORBA::Boolean CopyGroups,
409 const char* MeshName);
410 SMESH::SMESH_Mesh_ptr TranslateMakeMesh(const SMESH::long_array& IDsOfElements,
411 const SMESH::DirStruct& Vector,
412 CORBA::Boolean CopyGroups,
413 const char* MeshName);
414 SMESH::SMESH_Mesh_ptr TranslateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
415 const SMESH::DirStruct& Vector,
416 CORBA::Boolean CopyGroups,
417 const char* MeshName);
418 SMESH::SMESH_Mesh_ptr RotateMakeMesh(const SMESH::long_array& IDsOfElements,
419 const SMESH::AxisStruct& Axis,
420 CORBA::Double AngleInRadians,
421 CORBA::Boolean CopyGroups,
422 const char* MeshName);
423 SMESH::SMESH_Mesh_ptr RotateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
424 const SMESH::AxisStruct& Axis,
425 CORBA::Double AngleInRadians,
426 CORBA::Boolean CopyGroups,
427 const char* MeshName);
429 void Scale(SMESH::SMESH_IDSource_ptr theObject,
430 const SMESH::PointStruct& thePoint,
431 const SMESH::double_array& theScaleFact,
432 CORBA::Boolean theCopy);
434 SMESH::ListOfGroups* ScaleMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
435 const SMESH::PointStruct& thePoint,
436 const SMESH::double_array& theScaleFact);
438 SMESH::SMESH_Mesh_ptr ScaleMakeMesh(SMESH::SMESH_IDSource_ptr Object,
439 const SMESH::PointStruct& Point,
440 const SMESH::double_array& theScaleFact,
441 CORBA::Boolean CopyGroups,
442 const char* MeshName);
444 void FindCoincidentNodes (CORBA::Double Tolerance,
445 SMESH::array_of_long_array_out GroupsOfNodes);
446 void FindCoincidentNodesOnPart(SMESH::SMESH_IDSource_ptr Object,
447 CORBA::Double Tolerance,
448 SMESH::array_of_long_array_out GroupsOfNodes);
449 void MergeNodes (const SMESH::array_of_long_array& GroupsOfNodes);
450 void FindEqualElements(SMESH::SMESH_IDSource_ptr Object,
451 SMESH::array_of_long_array_out GroupsOfElementsID);
452 void MergeElements(const SMESH::array_of_long_array& GroupsOfElementsID);
453 void MergeEqualElements();
454 CORBA::Long MoveClosestNodeToPoint(CORBA::Double x,
459 * \brief Return ID of node closest to a given point
461 CORBA::Long FindNodeClosestTo(CORBA::Double x,
465 * Return elements of given type where the given point is IN or ON.
467 * 'ALL' type means elements of any type excluding nodes
469 SMESH::long_array* FindElementsByPoint(CORBA::Double x,
472 SMESH::ElementType type);
475 SMESH::SMESH_MeshEditor::Sew_Error
476 SewFreeBorders(CORBA::Long FirstNodeID1,
477 CORBA::Long SecondNodeID1,
478 CORBA::Long LastNodeID1,
479 CORBA::Long FirstNodeID2,
480 CORBA::Long SecondNodeID2,
481 CORBA::Long LastNodeID2,
482 CORBA::Boolean CreatePolygons,
483 CORBA::Boolean CreatePolyedrs);
484 SMESH::SMESH_MeshEditor::Sew_Error
485 SewConformFreeBorders(CORBA::Long FirstNodeID1,
486 CORBA::Long SecondNodeID1,
487 CORBA::Long LastNodeID1,
488 CORBA::Long FirstNodeID2,
489 CORBA::Long SecondNodeID2);
490 SMESH::SMESH_MeshEditor::Sew_Error
491 SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder,
492 CORBA::Long SecondNodeIDOnFreeBorder,
493 CORBA::Long LastNodeIDOnFreeBorder,
494 CORBA::Long FirstNodeIDOnSide,
495 CORBA::Long LastNodeIDOnSide,
496 CORBA::Boolean CreatePolygons,
497 CORBA::Boolean CreatePolyedrs);
498 SMESH::SMESH_MeshEditor::Sew_Error
499 SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
500 const SMESH::long_array& IDsOfSide2Elements,
501 CORBA::Long NodeID1OfSide1ToMerge,
502 CORBA::Long NodeID1OfSide2ToMerge,
503 CORBA::Long NodeID2OfSide1ToMerge,
504 CORBA::Long NodeID2OfSide2ToMerge);
507 * Set new nodes for given element.
508 * If number of nodes is not corresponded to type of
509 * element - returns false
511 CORBA::Boolean ChangeElemNodes(CORBA::Long ide, const SMESH::long_array& newIDs);
514 * Return data of mesh edition preview
516 SMESH::MeshPreviewStruct* GetPreviewData();
519 * If during last operation of MeshEditor some nodes were
520 * created this method returns list of it's IDs, if new nodes
521 * not creared - returns empty list
523 SMESH::long_array* GetLastCreatedNodes();
526 * If during last operation of MeshEditor some elements were
527 * created this method returns list of it's IDs, if new elements
528 * not creared - returns empty list
530 SMESH::long_array* GetLastCreatedElems();
533 * \brief Return edited mesh ID
534 * \retval int - mesh ID
536 int GetMeshId() const { return myMesh->GetId(); }
538 CORBA::Boolean DoubleNodes( const SMESH::long_array& theNodes,
539 const SMESH::long_array& theModifiedElems );
541 CORBA::Boolean DoubleNode( CORBA::Long theNodeId,
542 const SMESH::long_array& theModifiedElems );
544 CORBA::Boolean DoubleNodeGroup( SMESH::SMESH_GroupBase_ptr theNodes,
545 SMESH::SMESH_GroupBase_ptr theModifiedElems );
547 CORBA::Boolean DoubleNodeGroups( const SMESH::ListOfGroups& theNodes,
548 const SMESH::ListOfGroups& theModifiedElems);
551 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
552 * \param theElems - the list of elements (edges or faces) to be replicated
553 * The nodes for duplication could be found from these elements
554 * \param theNodesNot - list of nodes to NOT replicate
555 * \param theAffectedElems - the list of elements (cells and edges) to which the
556 * replicated nodes should be associated to.
557 * \return TRUE if operation has been completed successfully, FALSE otherwise
558 * \sa DoubleNodeGroup(), DoubleNodeGroups()
560 CORBA::Boolean DoubleNodeElem( const SMESH::long_array& theElems,
561 const SMESH::long_array& theNodesNot,
562 const SMESH::long_array& theAffectedElems );
565 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
566 * \param theElems - the list of elements (edges or faces) to be replicated
567 * The nodes for duplication could be found from these elements
568 * \param theNodesNot - list of nodes to NOT replicate
569 * \param theShape - shape to detect affected elements (element which geometric center
570 * located on or inside shape).
571 * The replicated nodes should be associated to affected elements.
572 * \return TRUE if operation has been completed successfully, FALSE otherwise
573 * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
575 CORBA::Boolean DoubleNodeElemInRegion( const SMESH::long_array& theElems,
576 const SMESH::long_array& theNodesNot,
577 GEOM::GEOM_Object_ptr theShape );
580 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
581 * \param theElems - group of of elements (edges or faces) to be replicated
582 * \param theNodesNot - group of nodes not to replicated
583 * \param theAffectedElems - group of elements to which the replicated nodes
584 * should be associated to.
585 * \return TRUE if operation has been completed successfully, FALSE otherwise
586 * \sa DoubleNodes(), DoubleNodeGroups()
588 CORBA::Boolean DoubleNodeElemGroup( SMESH::SMESH_GroupBase_ptr theElems,
589 SMESH::SMESH_GroupBase_ptr theNodesNot,
590 SMESH::SMESH_GroupBase_ptr theAffectedElems );
593 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
594 * \param theElems - group of of elements (edges or faces) to be replicated
595 * \param theNodesNot - group of nodes not to replicated
596 * \param theShape - shape to detect affected elements (element which geometric center
597 * located on or inside shape).
598 * The replicated nodes should be associated to affected elements.
599 * \return TRUE if operation has been completed successfully, FALSE otherwise
600 * \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
602 CORBA::Boolean DoubleNodeElemGroupInRegion( SMESH::SMESH_GroupBase_ptr theElems,
603 SMESH::SMESH_GroupBase_ptr theNodesNot,
604 GEOM::GEOM_Object_ptr theShape );
607 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
608 * This method provided for convenience works as DoubleNodes() described above.
609 * \param theElems - list of groups of elements (edges or faces) to be replicated
610 * \param theNodesNot - list of groups of nodes not to replicated
611 * \param theAffectedElems - group of elements to which the replicated nodes
612 * should be associated to.
613 * \return TRUE if operation has been completed successfully, FALSE otherwise
614 * \sa DoubleNodeGroup(), DoubleNodes()
616 CORBA::Boolean DoubleNodeElemGroups( const SMESH::ListOfGroups& theElems,
617 const SMESH::ListOfGroups& theNodesNot,
618 const SMESH::ListOfGroups& theAffectedElems );
622 * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
623 * This method provided for convenience works as DoubleNodes() described above.
624 * \param theElems - list of groups of elements (edges or faces) to be replicated
625 * \param theNodesNot - list of groups of nodes not to replicated
626 * \param theShape - shape to detect affected elements (element which geometric center
627 * located on or inside shape).
628 * The replicated nodes should be associated to affected elements.
629 * \return TRUE if operation has been completed successfully, FALSE otherwise
630 * \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
632 CORBA::Boolean DoubleNodeElemGroupsInRegion( const SMESH::ListOfGroups& theElems,
633 const SMESH::ListOfGroups& theNodesNot,
634 GEOM::GEOM_Object_ptr theShape );
637 * \brief Generated skin mesh (containing 2D cells) from 3D mesh
638 * The created 2D mesh elements based on nodes of free faces of boundary volumes
639 * \return TRUE if operation has been completed successfully, FALSE otherwise
641 CORBA::Boolean Make2DMeshFrom3D();
643 private: //!< private methods
645 SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); }
648 * \brief Update myLastCreated* or myPreviewData
649 * \param anEditor - it contains edition results
651 void storeResult(::SMESH_MeshEditor& anEditor);
653 * \brief Clear myLastCreated* or myPreviewData
655 void initData(bool deleteSearchers=true);
658 * \brief Return groups by their IDs
660 SMESH::ListOfGroups* getGroups(const std::list<int>* groupIDs);
662 SMESH::ListOfGroups* rotationSweep(const SMESH::long_array & IDsOfElements,
663 const SMESH::AxisStruct & Axis,
664 CORBA::Double AngleInRadians,
665 CORBA::Long NbOfSteps,
666 CORBA::Double Tolerance,
667 const bool MakeGroups,
668 const SMDSAbs_ElementType ElementType=SMDSAbs_All);
669 SMESH::ListOfGroups* extrusionSweep(const SMESH::long_array & IDsOfElements,
670 const SMESH::DirStruct & StepVector,
671 CORBA::Long NbOfSteps,
672 const bool MakeGroups,
673 const SMDSAbs_ElementType ElementType=SMDSAbs_All);
674 SMESH::ListOfGroups* advancedExtrusion(const SMESH::long_array & theIDsOfElements,
675 const SMESH::DirStruct & theStepVector,
676 CORBA::Long theNbOfSteps,
677 CORBA::Long theExtrFlags,
678 CORBA::Double theSewTolerance,
679 const bool MakeGroups);
680 SMESH::ListOfGroups* extrusionAlongPath(const SMESH::long_array & IDsOfElements,
681 SMESH::SMESH_Mesh_ptr PathMesh,
682 GEOM::GEOM_Object_ptr PathShape,
683 CORBA::Long NodeStart,
684 CORBA::Boolean HasAngles,
685 const SMESH::double_array & Angles,
686 CORBA::Boolean HasRefPoint,
687 const SMESH::PointStruct & RefPoint,
688 const bool MakeGroups,
689 SMESH::SMESH_MeshEditor::Extrusion_Error & Error,
690 const SMDSAbs_ElementType ElementType=SMDSAbs_All);
691 SMESH::ListOfGroups* extrusionAlongPathX(const SMESH::long_array & IDsOfElements,
692 SMESH::SMESH_IDSource_ptr Path,
693 CORBA::Long NodeStart,
694 CORBA::Boolean HasAngles,
695 const SMESH::double_array& Angles,
696 CORBA::Boolean LinearVariation,
697 CORBA::Boolean HasRefPoint,
698 const SMESH::PointStruct& RefPoint,
699 const bool MakeGroups,
700 const SMDSAbs_ElementType ElementType,
701 SMESH::SMESH_MeshEditor::Extrusion_Error & theError);
702 SMESH::ListOfGroups* mirror(const SMESH::long_array & IDsOfElements,
703 const SMESH::AxisStruct & Axis,
704 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
706 const bool MakeGroups,
707 ::SMESH_Mesh* TargetMesh=0);
708 SMESH::ListOfGroups* translate(const SMESH::long_array & IDsOfElements,
709 const SMESH::DirStruct & Vector,
711 const bool MakeGroups,
712 ::SMESH_Mesh* TargetMesh=0);
713 SMESH::ListOfGroups* rotate(const SMESH::long_array & IDsOfElements,
714 const SMESH::AxisStruct & Axis,
717 const bool MakeGroups,
718 ::SMESH_Mesh* TargetMesh=0);
720 SMESH::ListOfGroups* scale(const SMESH::long_array & theIDsOfElements,
721 const SMESH::PointStruct& thePoint,
722 const SMESH::double_array& theScaleFact,
723 CORBA::Boolean theCopy,
724 const bool theMakeGroups,
725 ::SMESH_Mesh* theTargetMesh=0);
727 SMESH::SMESH_Mesh_ptr makeMesh(const char* theMeshName);
729 void DumpGroupsList(SMESH::TPythonDump & theDumpPython,
730 const SMESH::ListOfGroups * theGroupList);
734 SMESH_Mesh_i* myMesh_i;
737 SMESH::long_array_var myLastCreatedElems;
738 SMESH::long_array_var myLastCreatedNodes;
740 SMESH::MeshPreviewStruct_var myPreviewData;