]> SALOME platform Git repositories - modules/smesh.git/blob - src/SMESH_I/SMESH_MeshEditor_i.hxx
Salome HOME
untabify
[modules/smesh.git] / src / SMESH_I / SMESH_MeshEditor_i.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
23 //  File   : SMESH_MeshEditor_i.hxx
24 //  Author : Nicolas REJNERI
25 //  Module : SMESH
26 //
27 #ifndef _SMESH_MESHEDITOR_I_HXX_
28 #define _SMESH_MESHEDIOTR_I_HXX_
29
30 #include "SMESH.hxx"
31
32 #include <SALOMEconfig.h>
33 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
34
35 #include "SMESH_Mesh.hxx"
36 #include "SMESH_PythonDump.hxx"
37 #include <list>
38
39 class SMESH_MeshEditor;
40 class SMESH_Mesh_i;
41
42 class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
43 {
44  public:
45   SMESH_MeshEditor_i(SMESH_Mesh_i * theMesh, bool isPreview);
46
47   virtual ~ SMESH_MeshEditor_i();
48
49   // --- CORBA
50   CORBA::Boolean RemoveElements(const SMESH::long_array & IDsOfElements);
51   CORBA::Boolean RemoveNodes(const SMESH::long_array & IDsOfNodes);
52
53   /*!
54    * Methods for creation new elements.
55    * Returns ID of created element or 0 if element not created
56    */
57   CORBA::Long AddNode(CORBA::Double x, CORBA::Double y, CORBA::Double z);
58   CORBA::Long AddEdge(const SMESH::long_array & IDsOfNodes);
59   CORBA::Long AddFace(const SMESH::long_array & IDsOfNodes);
60   CORBA::Long AddPolygonalFace(const SMESH::long_array & IDsOfNodes);
61   CORBA::Long AddVolume(const SMESH::long_array & IDsOfNodes);
62   CORBA::Long AddPolyhedralVolume(const SMESH::long_array & IDsOfNodes,
63                                   const SMESH::long_array & Quantities);
64   CORBA::Long AddPolyhedralVolumeByFaces(const SMESH::long_array & IdsOfFaces);
65
66   /*!
67    * \brief Bind a node to a vertex
68    * \param NodeID - node ID
69    * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
70    */
71   void SetNodeOnVertex(CORBA::Long NodeID, CORBA::Long VertexID)
72     throw (SALOME::SALOME_Exception);
73   /*!
74    * \brief Store node position on an edge
75    * \param NodeID - node ID
76    * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
77    * \param paramOnEdge - parameter on edge where the node is located
78    */
79   void SetNodeOnEdge(CORBA::Long NodeID, CORBA::Long EdgeID,
80                      CORBA::Double paramOnEdge)
81     throw (SALOME::SALOME_Exception);
82   /*!
83    * \brief Store node position on a face
84    * \param NodeID - node ID
85    * \param FaceID - face ID available through GEOM_Object.GetSubShapeIndices()[0]
86    * \param u - U parameter on face where the node is located
87    * \param v - V parameter on face where the node is located
88    */
89   void SetNodeOnFace(CORBA::Long NodeID, CORBA::Long FaceID,
90                      CORBA::Double u, CORBA::Double v)
91     throw (SALOME::SALOME_Exception);
92   /*!
93    * \brief Bind a node to a solid
94    * \param NodeID - node ID
95    * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
96    */
97   void SetNodeInVolume(CORBA::Long NodeID, CORBA::Long SolidID)
98     throw (SALOME::SALOME_Exception);
99   /*!
100    * \brief Bind an element to a shape
101    * \param ElementID - element ID
102    * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0]
103    */
104   void SetMeshElementOnShape(CORBA::Long ElementID, CORBA::Long ShapeID)
105     throw (SALOME::SALOME_Exception);
106
107
108   CORBA::Boolean MoveNode(CORBA::Long NodeID,
109                           CORBA::Double x, CORBA::Double y, CORBA::Double z);
110
111   CORBA::Boolean InverseDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
112   CORBA::Boolean DeleteDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
113   CORBA::Boolean Reorient(const SMESH::long_array & IDsOfElements);
114   CORBA::Boolean ReorientObject(SMESH::SMESH_IDSource_ptr theObject);
115
116   // Split/Join faces
117   CORBA::Boolean TriToQuad       (const SMESH::long_array &   IDsOfElements,
118                                   SMESH::NumericalFunctor_ptr Criterion,
119                                   CORBA::Double               MaxAngle);
120   CORBA::Boolean TriToQuadObject (SMESH::SMESH_IDSource_ptr   theObject,
121                                   SMESH::NumericalFunctor_ptr Criterion,
122                                   CORBA::Double               MaxAngle);
123   CORBA::Boolean QuadToTri       (const SMESH::long_array &   IDsOfElements,
124                                   SMESH::NumericalFunctor_ptr Criterion);
125   CORBA::Boolean QuadToTriObject (SMESH::SMESH_IDSource_ptr   theObject,
126                                   SMESH::NumericalFunctor_ptr Criterion);
127   CORBA::Boolean SplitQuad       (const SMESH::long_array &   IDsOfElements,
128                                   CORBA::Boolean              Diag13);
129   CORBA::Boolean SplitQuadObject (SMESH::SMESH_IDSource_ptr   theObject,
130                                   CORBA::Boolean              Diag13);
131   CORBA::Long    BestSplit       (CORBA::Long                 IDOfQuad,
132                                   SMESH::NumericalFunctor_ptr Criterion);
133
134   CORBA::Boolean Smooth(const SMESH::long_array &              IDsOfElements,
135                         const SMESH::long_array &              IDsOfFixedNodes,
136                         CORBA::Long                            MaxNbOfIterations,
137                         CORBA::Double                          MaxAspectRatio,
138                         SMESH::SMESH_MeshEditor::Smooth_Method Method);
139   CORBA::Boolean SmoothObject(SMESH::SMESH_IDSource_ptr              theObject,
140                               const SMESH::long_array &              IDsOfFixedNodes,
141                               CORBA::Long                            MaxNbOfIterations,
142                               CORBA::Double                          MaxAspectRatio,
143                               SMESH::SMESH_MeshEditor::Smooth_Method Method);
144   CORBA::Boolean SmoothParametric(const SMESH::long_array &              IDsOfElements,
145                                   const SMESH::long_array &              IDsOfFixedNodes,
146                                   CORBA::Long                            MaxNbOfIterations,
147                                   CORBA::Double                          MaxAspectRatio,
148                                   SMESH::SMESH_MeshEditor::Smooth_Method Method);
149   CORBA::Boolean SmoothParametricObject(SMESH::SMESH_IDSource_ptr              theObject,
150                                         const SMESH::long_array &              IDsOfFixedNodes,
151                                         CORBA::Long                            MaxNbOfIterations,
152                                         CORBA::Double                          MaxAspectRatio,
153                                         SMESH::SMESH_MeshEditor::Smooth_Method Method);
154   CORBA::Boolean smooth(const SMESH::long_array &              IDsOfElements,
155                         const SMESH::long_array &              IDsOfFixedNodes,
156                         CORBA::Long                            MaxNbOfIterations,
157                         CORBA::Double                          MaxAspectRatio,
158                         SMESH::SMESH_MeshEditor::Smooth_Method Method,
159                         bool                                   IsParametric);
160   CORBA::Boolean smoothObject(SMESH::SMESH_IDSource_ptr              theObject,
161                               const SMESH::long_array &              IDsOfFixedNodes,
162                               CORBA::Long                            MaxNbOfIterations,
163                               CORBA::Double                          MaxAspectRatio,
164                               SMESH::SMESH_MeshEditor::Smooth_Method Method,
165                               bool                                   IsParametric);
166
167
168   void ConvertToQuadratic(CORBA::Boolean Force3d);
169   CORBA::Boolean ConvertFromQuadratic();
170
171   void RenumberNodes();
172   void RenumberElements();
173
174   void RotationSweep(const SMESH::long_array & IDsOfElements,
175                      const SMESH::AxisStruct & Axis,
176                      CORBA::Double             AngleInRadians,
177                      CORBA::Long               NbOfSteps,
178                      CORBA::Double             Tolerance);
179   void RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject,
180                            const SMESH::AxisStruct & Axis,
181                            CORBA::Double             AngleInRadians,
182                            CORBA::Long               NbOfSteps,
183                            CORBA::Double             Tolerance);
184
185   void ExtrusionSweep(const SMESH::long_array & IDsOfElements,
186                       const SMESH::DirStruct &  StepVector,
187                       CORBA::Long               NbOfSteps);
188   void ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObject,
189                             const SMESH::DirStruct &  StepVector,
190                             CORBA::Long               NbOfSteps);
191   void ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
192                               const SMESH::DirStruct &  StepVector,
193                               CORBA::Long               NbOfSteps);
194   void ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
195                               const SMESH::DirStruct &  StepVector,
196                               CORBA::Long               NbOfSteps);
197   void AdvancedExtrusion(const SMESH::long_array & theIDsOfElements,
198                          const SMESH::DirStruct &  theStepVector,
199                          CORBA::Long               theNbOfSteps,
200                          CORBA::Long               theExtrFlags,
201                          CORBA::Double             theSewTolerance);
202
203   SMESH::SMESH_MeshEditor::Extrusion_Error
204   ExtrusionAlongPath(const SMESH::long_array &   IDsOfElements,
205                      SMESH::SMESH_Mesh_ptr       PathMesh,
206                      GEOM::GEOM_Object_ptr       PathShape,
207                      CORBA::Long                 NodeStart,
208                      CORBA::Boolean              HasAngles,
209                      const SMESH::double_array & Angles,
210                      CORBA::Boolean              HasRefPoint,
211                      const SMESH::PointStruct &  RefPoint);
212
213   SMESH::SMESH_MeshEditor::Extrusion_Error
214   ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr   theObject,
215                            SMESH::SMESH_Mesh_ptr       PathMesh,
216                            GEOM::GEOM_Object_ptr       PathShape,
217                            CORBA::Long                 NodeStart,
218                            CORBA::Boolean              HasAngles,
219                            const SMESH::double_array & Angles,
220                            CORBA::Boolean              HasRefPoint,
221                            const SMESH::PointStruct &  RefPoint);
222
223   SMESH::double_array* LinearAnglesVariation(SMESH::SMESH_Mesh_ptr       PathMesh,
224                                              GEOM::GEOM_Object_ptr       PathShape,
225                                              const SMESH::double_array & Angles);
226
227   void Mirror(const SMESH::long_array &           IDsOfElements,
228               const SMESH::AxisStruct &           Axis,
229               SMESH::SMESH_MeshEditor::MirrorType MirrorType,
230               CORBA::Boolean                      Copy);
231   void MirrorObject(SMESH::SMESH_IDSource_ptr           theObject,
232                     const SMESH::AxisStruct &           Axis,
233                     SMESH::SMESH_MeshEditor::MirrorType MirrorType,
234                     CORBA::Boolean                      Copy);
235   void Translate(const SMESH::long_array & IDsOfElements,
236                  const SMESH::DirStruct &   Vector,
237                  CORBA::Boolean            Copy);
238   void TranslateObject(SMESH::SMESH_IDSource_ptr  theObject,
239                        const SMESH::DirStruct &   Vector,
240                        CORBA::Boolean             Copy);
241   void Rotate(const SMESH::long_array & IDsOfElements,
242               const SMESH::AxisStruct &  Axis,
243               CORBA::Double             Angle,
244               CORBA::Boolean            Copy);
245   void RotateObject(SMESH::SMESH_IDSource_ptr  theObject,
246                     const SMESH::AxisStruct &  Axis,
247                     CORBA::Double              Angle,
248                     CORBA::Boolean             Copy);
249
250   SMESH::ListOfGroups* RotationSweepMakeGroups(const SMESH::long_array& IDsOfElements,
251                                                const SMESH::AxisStruct& Axix,
252                                                CORBA::Double            AngleInRadians,
253                                                CORBA::Long              NbOfSteps,
254                                                CORBA::Double            Tolerance);
255   SMESH::ListOfGroups* RotationSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
256                                                      const SMESH::AxisStruct&  Axix,
257                                                      CORBA::Double             AngleInRadians,
258                                                      CORBA::Long               NbOfSteps,
259                                                      CORBA::Double             Tolerance);
260   SMESH::ListOfGroups* ExtrusionSweepMakeGroups(const SMESH::long_array& IDsOfElements,
261                                                 const SMESH::DirStruct&  StepVector,
262                                                 CORBA::Long              NbOfSteps);
263   SMESH::ListOfGroups* AdvancedExtrusionMakeGroups(const SMESH::long_array& IDsOfElements,
264                                                    const SMESH::DirStruct&  StepVector,
265                                                    CORBA::Long              NbOfSteps,
266                                                    CORBA::Long              ExtrFlags,
267                                                    CORBA::Double            SewTolerance);
268   SMESH::ListOfGroups* ExtrusionSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
269                                                       const SMESH::DirStruct&   StepVector,
270                                                       CORBA::Long               NbOfSteps);
271   SMESH::ListOfGroups* ExtrusionSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
272                                                         const SMESH::DirStruct&   StepVector,
273                                                         CORBA::Long               NbOfSteps);
274   SMESH::ListOfGroups* ExtrusionSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
275                                                         const SMESH::DirStruct&   StepVector,
276                                                         CORBA::Long               NbOfSteps);
277   SMESH::ListOfGroups* ExtrusionAlongPathMakeGroups(const SMESH::long_array&   IDsOfElements,
278                                                     SMESH::SMESH_Mesh_ptr      PathMesh,
279                                                     GEOM::GEOM_Object_ptr      PathShape,
280                                                     CORBA::Long                NodeStart,
281                                                     CORBA::Boolean             HasAngles,
282                                                     const SMESH::double_array& Angles,
283                                                     CORBA::Boolean             HasRefPoint,
284                                                     const SMESH::PointStruct&  RefPoint,
285                                                     SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
286   SMESH::ListOfGroups* ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr  Object,
287                                                           SMESH::SMESH_Mesh_ptr      PathMesh,
288                                                           GEOM::GEOM_Object_ptr      PathShape,
289                                                           CORBA::Long                NodeStart,
290                                                           CORBA::Boolean             HasAngles,
291                                                           const SMESH::double_array& Angles,
292                                                           CORBA::Boolean             HasRefPoint,
293                                                           const SMESH::PointStruct&  RefPoint,
294                                                           SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
295   SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::long_array&            IDsOfElements,
296                                         const SMESH::AxisStruct&            Mirror,
297                                         SMESH::SMESH_MeshEditor::MirrorType MirrorType);
298   SMESH::ListOfGroups* MirrorObjectMakeGroups(SMESH::SMESH_IDSource_ptr           Object,
299                                               const SMESH::AxisStruct&            Mirror,
300                                               SMESH::SMESH_MeshEditor::MirrorType MirrorType);
301   SMESH::ListOfGroups* TranslateMakeGroups(const SMESH::long_array& IDsOfElements,
302                                            const SMESH::DirStruct&  Vector);
303   SMESH::ListOfGroups* TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
304                                                  const SMESH::DirStruct&   Vector);
305   SMESH::ListOfGroups* RotateMakeGroups(const SMESH::long_array& IDsOfElements,
306                                         const SMESH::AxisStruct& Axis,
307                                         CORBA::Double            AngleInRadians);
308   SMESH::ListOfGroups* RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
309                                               const SMESH::AxisStruct&  Axis,
310                                               CORBA::Double             AngleInRadians);
311
312   SMESH::SMESH_Mesh_ptr MirrorMakeMesh(const SMESH::long_array&            IDsOfElements,
313                                        const SMESH::AxisStruct&            Mirror,
314                                        SMESH::SMESH_MeshEditor::MirrorType MirrorType,
315                                        CORBA::Boolean                      CopyGroups,
316                                        const char*                         MeshName);
317   SMESH::SMESH_Mesh_ptr MirrorObjectMakeMesh(SMESH::SMESH_IDSource_ptr           Object,
318                                              const SMESH::AxisStruct&            Mirror,
319                                              SMESH::SMESH_MeshEditor::MirrorType MirrorType,
320                                              CORBA::Boolean                      CopyGroups,
321                                              const char*                         MeshName);
322   SMESH::SMESH_Mesh_ptr TranslateMakeMesh(const SMESH::long_array& IDsOfElements,
323                                           const SMESH::DirStruct&  Vector,
324                                           CORBA::Boolean           CopyGroups,
325                                           const char*              MeshName);
326   SMESH::SMESH_Mesh_ptr TranslateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
327                                                 const SMESH::DirStruct&   Vector,
328                                                 CORBA::Boolean            CopyGroups,
329                                                 const char*               MeshName);
330   SMESH::SMESH_Mesh_ptr RotateMakeMesh(const SMESH::long_array& IDsOfElements,
331                                        const SMESH::AxisStruct& Axis,
332                                        CORBA::Double            AngleInRadians,
333                                        CORBA::Boolean           CopyGroups,
334                                        const char*              MeshName);
335   SMESH::SMESH_Mesh_ptr RotateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
336                                              const SMESH::AxisStruct&  Axis,
337                                              CORBA::Double             AngleInRadians,
338                                              CORBA::Boolean            CopyGroups,
339                                              const char*               MeshName);
340
341   void FindCoincidentNodes (CORBA::Double                  Tolerance,
342                             SMESH::array_of_long_array_out GroupsOfNodes);
343   void FindCoincidentNodesOnPart(SMESH::SMESH_IDSource_ptr      Object,
344                                  CORBA::Double                  Tolerance,
345                                  SMESH::array_of_long_array_out GroupsOfNodes);
346   void MergeNodes (const SMESH::array_of_long_array& GroupsOfNodes);
347   void FindEqualElements(SMESH::SMESH_IDSource_ptr      Object,
348                          SMESH::array_of_long_array_out GroupsOfElementsID);
349   void MergeElements(const SMESH::array_of_long_array& GroupsOfElementsID);
350   void MergeEqualElements();
351   CORBA::Long MoveClosestNodeToPoint(CORBA::Double x,
352                                      CORBA::Double y,
353                                      CORBA::Double z,
354                                      CORBA::Long   nodeID);
355   /*!
356    * \brief Return ID of node closest to a given point
357    */
358   CORBA::Long FindNodeClosestTo(CORBA::Double x,
359                                 CORBA::Double y,
360                                 CORBA::Double z);
361   /*!
362    * Return elements of given type where the given point is IN or ON.
363    *
364    * 'ALL' type means elements of any type excluding nodes
365    */
366   SMESH::long_array* FindElementsByPoint(CORBA::Double      x,
367                                          CORBA::Double      y,
368                                          CORBA::Double      z,
369                                          SMESH::ElementType type);
370
371
372   SMESH::SMESH_MeshEditor::Sew_Error
373   SewFreeBorders(CORBA::Long FirstNodeID1,
374                  CORBA::Long SecondNodeID1,
375                  CORBA::Long LastNodeID1,
376                  CORBA::Long FirstNodeID2,
377                  CORBA::Long SecondNodeID2,
378                  CORBA::Long LastNodeID2,
379                  CORBA::Boolean CreatePolygons,
380                  CORBA::Boolean CreatePolyedrs);
381   SMESH::SMESH_MeshEditor::Sew_Error
382   SewConformFreeBorders(CORBA::Long FirstNodeID1,
383                         CORBA::Long SecondNodeID1,
384                         CORBA::Long LastNodeID1,
385                         CORBA::Long FirstNodeID2,
386                         CORBA::Long SecondNodeID2);
387   SMESH::SMESH_MeshEditor::Sew_Error
388   SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder,
389                   CORBA::Long SecondNodeIDOnFreeBorder,
390                   CORBA::Long LastNodeIDOnFreeBorder,
391                   CORBA::Long FirstNodeIDOnSide,
392                   CORBA::Long LastNodeIDOnSide,
393                   CORBA::Boolean CreatePolygons,
394                   CORBA::Boolean CreatePolyedrs);
395   SMESH::SMESH_MeshEditor::Sew_Error
396   SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
397                   const SMESH::long_array& IDsOfSide2Elements,
398                   CORBA::Long NodeID1OfSide1ToMerge,
399                   CORBA::Long NodeID1OfSide2ToMerge,
400                   CORBA::Long NodeID2OfSide1ToMerge,
401                   CORBA::Long NodeID2OfSide2ToMerge);
402
403   /*!
404    * Set new nodes for given element.
405    * If number of nodes is not corresponded to type of
406    * element - returns false
407    */
408   CORBA::Boolean ChangeElemNodes(CORBA::Long ide, const SMESH::long_array& newIDs);
409
410   /*!
411    * Return data of mesh edition preview
412    */
413   SMESH::MeshPreviewStruct* GetPreviewData();
414
415   /*!
416    * If during last operation of MeshEditor some nodes were
417    * created this method returns list of it's IDs, if new nodes
418    * not creared - returns empty list
419    */
420   SMESH::long_array* GetLastCreatedNodes();
421
422   /*!
423    * If during last operation of MeshEditor some elements were
424    * created this method returns list of it's IDs, if new elements
425    * not creared - returns empty list
426    */
427   SMESH::long_array* GetLastCreatedElems();
428
429   /*!
430    * \brief Return edited mesh ID
431    * \retval int - mesh ID
432    */
433   int GetMeshId() const { return myMesh->GetId(); }
434
435
436   /*!
437    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
438    * \param theElems - the list of elements (edges or faces) to be replicated
439    *       The nodes for duplication could be found from these elements
440    * \param theNodesNot - list of nodes to NOT replicate
441    * \param theAffectedElems - the list of elements (cells and edges) to which the 
442    *       replicated nodes should be associated to.
443    * \return TRUE if operation has been completed successfully, FALSE otherwise
444    * \sa DoubleNodeGroup(), DoubleNodeGroups()
445    */
446   CORBA::Boolean DoubleNodes( const SMESH::long_array& theElems, 
447                               const SMESH::long_array& theNodesNot,
448                               const SMESH::long_array& theAffectedElems );
449
450   /*!
451    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
452    * \param theElems - the list of elements (edges or faces) to be replicated
453    *        The nodes for duplication could be found from these elements
454    * \param theNodesNot - list of nodes to NOT replicate
455    * \param theShape - shape to detect affected elements (element which geometric center
456    *        located on or inside shape).
457    *        The replicated nodes should be associated to affected elements.
458    * \return TRUE if operation has been completed successfully, FALSE otherwise
459    * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
460    */
461   CORBA::Boolean DoubleNodesInRegion( const SMESH::long_array& theElems, 
462                                       const SMESH::long_array& theNodesNot,
463                                       GEOM::GEOM_Object_ptr    theShape );
464
465   /*!
466    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
467    * \param theElems - group of of elements (edges or faces) to be replicated
468    * \param theNodesNot - group of nodes not to replicated
469    * \param theAffectedElems - group of elements to which the replicated nodes
470    *        should be associated to.
471    * \return TRUE if operation has been completed successfully, FALSE otherwise
472    * \sa DoubleNodes(), DoubleNodeGroups()
473    */
474   CORBA::Boolean DoubleNodeGroup( SMESH::SMESH_GroupBase_ptr theElems,
475                                   SMESH::SMESH_GroupBase_ptr theNodesNot,
476                                   SMESH::SMESH_GroupBase_ptr theAffectedElems );
477
478   /*!
479    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
480    * \param theElems - group of of elements (edges or faces) to be replicated
481    * \param theNodesNot - group of nodes not to replicated
482    * \param theShape - shape to detect affected elements (element which geometric center
483    *        located on or inside shape).
484    *        The replicated nodes should be associated to affected elements.
485    * \return TRUE if operation has been completed successfully, FALSE otherwise
486    * \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
487    */
488   CORBA::Boolean DoubleNodeGroupInRegion( SMESH::SMESH_GroupBase_ptr theElems,
489                                           SMESH::SMESH_GroupBase_ptr theNodesNot,
490                                           GEOM::GEOM_Object_ptr      theShape );
491
492   /*!
493    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
494    * This method provided for convenience works as DoubleNodes() described above.
495    * \param theElems - list of groups of elements (edges or faces) to be replicated
496    * \param theNodesNot - list of groups of nodes not to replicated
497    * \param theAffectedElems - group of elements to which the replicated nodes
498    *        should be associated to.
499    * \return TRUE if operation has been completed successfully, FALSE otherwise
500    * \sa DoubleNodeGroup(), DoubleNodes()
501    */
502   CORBA::Boolean DoubleNodeGroups( const SMESH::ListOfGroups& theElems,
503                                    const SMESH::ListOfGroups& theNodesNot,
504                                    const SMESH::ListOfGroups& theAffectedElems );
505
506
507   /*!
508    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
509    * This method provided for convenience works as DoubleNodes() described above.
510    * \param theElems - list of groups of elements (edges or faces) to be replicated
511    * \param theNodesNot - list of groups of nodes not to replicated
512    * \param theShape - shape to detect affected elements (element which geometric center
513    *        located on or inside shape).
514    *        The replicated nodes should be associated to affected elements.
515    * \return TRUE if operation has been completed successfully, FALSE otherwise
516    * \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
517    */
518   CORBA::Boolean DoubleNodeGroupsInRegion( const SMESH::ListOfGroups& theElems,
519                                            const SMESH::ListOfGroups& theNodesNot,
520                                            GEOM::GEOM_Object_ptr      theShape );
521
522 private: //!< private methods
523
524   SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); }
525
526   /*!
527    * \brief Update myLastCreated* or myPreviewData
528    * \param anEditor - it contains edition results
529    */
530   void storeResult(::SMESH_MeshEditor& anEditor);
531   /*!
532    * \brief Clear myLastCreated* or myPreviewData
533    */
534   void initData(bool deleteSearchers=true);
535
536   /*!
537    * \brief Return groups by their IDs
538    */
539   SMESH::ListOfGroups* getGroups(const std::list<int>* groupIDs);
540
541   SMESH::ListOfGroups* rotationSweep(const SMESH::long_array & IDsOfElements,
542                                      const SMESH::AxisStruct & Axis,
543                                      CORBA::Double             AngleInRadians,
544                                      CORBA::Long               NbOfSteps,
545                                      CORBA::Double             Tolerance,
546                                      const bool                MakeGroups,
547                                      const SMDSAbs_ElementType ElementType=SMDSAbs_All);
548   SMESH::ListOfGroups* extrusionSweep(const SMESH::long_array & IDsOfElements,
549                                       const SMESH::DirStruct &  StepVector,
550                                       CORBA::Long               NbOfSteps,
551                                       const bool                MakeGroups,
552                                       const SMDSAbs_ElementType ElementType=SMDSAbs_All);
553   SMESH::ListOfGroups* advancedExtrusion(const SMESH::long_array & theIDsOfElements,
554                                          const SMESH::DirStruct &  theStepVector,
555                                          CORBA::Long               theNbOfSteps,
556                                          CORBA::Long               theExtrFlags,
557                                          CORBA::Double             theSewTolerance,
558                                          const bool                MakeGroups);
559   SMESH::ListOfGroups* extrusionAlongPath(const SMESH::long_array &   IDsOfElements,
560                                           SMESH::SMESH_Mesh_ptr       PathMesh,
561                                           GEOM::GEOM_Object_ptr       PathShape,
562                                           CORBA::Long                 NodeStart,
563                                           CORBA::Boolean              HasAngles,
564                                           const SMESH::double_array & Angles,
565                                           CORBA::Boolean              HasRefPoint,
566                                           const SMESH::PointStruct &  RefPoint,
567                                           const bool                  MakeGroups,
568                                           SMESH::SMESH_MeshEditor::Extrusion_Error & Error,
569                                           const SMDSAbs_ElementType   ElementType=SMDSAbs_All);
570   SMESH::ListOfGroups* mirror(const SMESH::long_array &           IDsOfElements,
571                               const SMESH::AxisStruct &           Axis,
572                               SMESH::SMESH_MeshEditor::MirrorType MirrorType,
573                               CORBA::Boolean                      Copy,
574                               const bool                          MakeGroups,
575                               ::SMESH_Mesh*                       TargetMesh=0);
576   SMESH::ListOfGroups* translate(const SMESH::long_array & IDsOfElements,
577                                  const SMESH::DirStruct &  Vector,
578                                  CORBA::Boolean            Copy,
579                                  const bool                MakeGroups,
580                                  ::SMESH_Mesh*             TargetMesh=0);
581   SMESH::ListOfGroups* rotate(const SMESH::long_array & IDsOfElements,
582                               const SMESH::AxisStruct &  Axis,
583                               CORBA::Double             Angle,
584                               CORBA::Boolean            Copy,
585                               const bool                MakeGroups,
586                               ::SMESH_Mesh*             TargetMesh=0);
587
588   SMESH::SMESH_Mesh_ptr makeMesh(const char* theMeshName);
589
590   void DumpGroupsList(SMESH::TPythonDump & theDumpPython, 
591                       const SMESH::ListOfGroups * theGroupList);
592
593 private: //!< fields
594
595   SMESH_Mesh_i*         myMesh_i;
596   SMESH_Mesh *          myMesh;
597
598   SMESH::long_array_var myLastCreatedElems;
599   SMESH::long_array_var myLastCreatedNodes;
600
601   SMESH::MeshPreviewStruct_var myPreviewData;
602   bool                         myPreviewMode;
603 };
604
605 #endif