Salome HOME
Join modifications from branch OCC_development_for_3_2_0a2
[modules/smesh.git] / src / SMESH_I / SMESH_MeshEditor_i.hxx
1 //  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
2 //
3 //  Copyright (C) 2003  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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
21 //
22 //
23 //
24 //  File   : SMESH_MeshEditor_i.hxx
25 //  Author : Nicolas REJNERI
26 //  Module : SMESH
27 //  $Header$
28
29 #ifndef _SMESH_MESHEDITOR_I_HXX_
30 #define _SMESH_MESHEDIOTR_I_HXX_
31
32 #include <SALOMEconfig.h>
33 #include CORBA_SERVER_HEADER(SMESH_Mesh)
34
35 #include "SMESH_Mesh.hxx"
36
37 class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
38 {
39  public:
40   SMESH_MeshEditor_i(SMESH_Mesh * theMesh);
41
42   virtual ~ SMESH_MeshEditor_i()
43   {
44   };
45
46   // --- CORBA
47   CORBA::Boolean RemoveElements(const SMESH::long_array & IDsOfElements);
48   CORBA::Boolean RemoveNodes(const SMESH::long_array & IDsOfNodes);
49
50   CORBA::Boolean AddNode(CORBA::Double x, CORBA::Double y, CORBA::Double z);
51   CORBA::Boolean AddEdge(const SMESH::long_array & IDsOfNodes);
52   CORBA::Boolean AddFace(const SMESH::long_array & IDsOfNodes);
53   CORBA::Boolean AddPolygonalFace(const SMESH::long_array & IDsOfNodes);
54   CORBA::Boolean AddVolume(const SMESH::long_array & IDsOfNodes);
55
56   CORBA::Boolean AddPolyhedralVolume(const SMESH::long_array & IDsOfNodes,
57                                      const SMESH::long_array & Quantities);
58   CORBA::Boolean AddPolyhedralVolumeByFaces(const SMESH::long_array & IdsOfFaces);
59
60   CORBA::Boolean MoveNode(CORBA::Long NodeID,
61                           CORBA::Double x, CORBA::Double y, CORBA::Double z);
62
63   CORBA::Boolean InverseDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
64   CORBA::Boolean DeleteDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
65   CORBA::Boolean Reorient(const SMESH::long_array & IDsOfElements);
66   CORBA::Boolean ReorientObject(SMESH::SMESH_IDSource_ptr theObject);
67
68   // Split/Join faces
69   CORBA::Boolean TriToQuad       (const SMESH::long_array &   IDsOfElements,
70                                   SMESH::NumericalFunctor_ptr Criterion,
71                                   CORBA::Double               MaxAngle);
72   CORBA::Boolean TriToQuadObject (SMESH::SMESH_IDSource_ptr   theObject,
73                                   SMESH::NumericalFunctor_ptr Criterion,
74                                   CORBA::Double               MaxAngle);
75   CORBA::Boolean QuadToTri       (const SMESH::long_array &   IDsOfElements,
76                                   SMESH::NumericalFunctor_ptr Criterion);
77   CORBA::Boolean QuadToTriObject (SMESH::SMESH_IDSource_ptr   theObject,
78                                   SMESH::NumericalFunctor_ptr Criterion);
79   CORBA::Boolean SplitQuad       (const SMESH::long_array &   IDsOfElements,
80                                   CORBA::Boolean              Diag13);
81   CORBA::Boolean SplitQuadObject (SMESH::SMESH_IDSource_ptr   theObject,
82                                   CORBA::Boolean              Diag13);
83   CORBA::Long    BestSplit       (CORBA::Long                 IDOfQuad,
84                                   SMESH::NumericalFunctor_ptr Criterion);
85
86   CORBA::Boolean Smooth(const SMESH::long_array &              IDsOfElements,
87                         const SMESH::long_array &              IDsOfFixedNodes,
88                         CORBA::Long                            MaxNbOfIterations,
89                         CORBA::Double                          MaxAspectRatio,
90                         SMESH::SMESH_MeshEditor::Smooth_Method Method);
91   CORBA::Boolean SmoothObject(SMESH::SMESH_IDSource_ptr              theObject,
92                               const SMESH::long_array &              IDsOfFixedNodes,
93                               CORBA::Long                            MaxNbOfIterations,
94                               CORBA::Double                          MaxAspectRatio,
95                               SMESH::SMESH_MeshEditor::Smooth_Method Method);
96   CORBA::Boolean SmoothParametric(const SMESH::long_array &              IDsOfElements,
97                                   const SMESH::long_array &              IDsOfFixedNodes,
98                                   CORBA::Long                            MaxNbOfIterations,
99                                   CORBA::Double                          MaxAspectRatio,
100                                   SMESH::SMESH_MeshEditor::Smooth_Method Method);
101   CORBA::Boolean SmoothParametricObject(SMESH::SMESH_IDSource_ptr              theObject,
102                                         const SMESH::long_array &              IDsOfFixedNodes,
103                                         CORBA::Long                            MaxNbOfIterations,
104                                         CORBA::Double                          MaxAspectRatio,
105                                         SMESH::SMESH_MeshEditor::Smooth_Method Method);
106   CORBA::Boolean smooth(const SMESH::long_array &              IDsOfElements,
107                         const SMESH::long_array &              IDsOfFixedNodes,
108                         CORBA::Long                            MaxNbOfIterations,
109                         CORBA::Double                          MaxAspectRatio,
110                         SMESH::SMESH_MeshEditor::Smooth_Method Method,
111                         bool                                   IsParametric);
112   CORBA::Boolean smoothObject(SMESH::SMESH_IDSource_ptr              theObject,
113                               const SMESH::long_array &              IDsOfFixedNodes,
114                               CORBA::Long                            MaxNbOfIterations,
115                               CORBA::Double                          MaxAspectRatio,
116                               SMESH::SMESH_MeshEditor::Smooth_Method Method,
117                               bool                                   IsParametric);
118
119   void RenumberNodes();
120   void RenumberElements();
121
122   void RotationSweep(const SMESH::long_array & IDsOfElements,
123                      const SMESH::AxisStruct & Axis,
124                      CORBA::Double             AngleInRadians,
125                      CORBA::Long               NbOfSteps,
126                      CORBA::Double             Tolerance);
127   void RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject,
128                            const SMESH::AxisStruct & Axis,
129                            CORBA::Double             AngleInRadians,
130                            CORBA::Long               NbOfSteps,
131                            CORBA::Double             Tolerance);
132
133   void ExtrusionSweep(const SMESH::long_array & IDsOfElements,
134                       const SMESH::DirStruct &  StepVector,
135                       CORBA::Long               NbOfSteps);
136   void ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObject,
137                             const SMESH::DirStruct &  StepVector,
138                             CORBA::Long               NbOfSteps);
139   void ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
140                               const SMESH::DirStruct &  StepVector,
141                               CORBA::Long               NbOfSteps);
142   void ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
143                               const SMESH::DirStruct &  StepVector,
144                               CORBA::Long               NbOfSteps);
145   void AdvancedExtrusion(const SMESH::long_array & theIDsOfElements,
146                          const SMESH::DirStruct &  theStepVector,
147                          CORBA::Long               theNbOfSteps,
148                          CORBA::Long               theExtrFlags,
149                          CORBA::Double             theSewTolerance);
150
151   SMESH::SMESH_MeshEditor::Extrusion_Error
152     ExtrusionAlongPath(const SMESH::long_array &   IDsOfElements,
153                        SMESH::SMESH_Mesh_ptr       PathMesh,
154                        GEOM::GEOM_Object_ptr       PathShape,
155                        CORBA::Long                 NodeStart,
156                        CORBA::Boolean              HasAngles,
157                        const SMESH::double_array & Angles,
158                        CORBA::Boolean              HasRefPoint,
159                        const SMESH::PointStruct &  RefPoint);
160
161   SMESH::SMESH_MeshEditor::Extrusion_Error
162     ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr   theObject,
163                              SMESH::SMESH_Mesh_ptr       PathMesh,
164                              GEOM::GEOM_Object_ptr       PathShape,
165                              CORBA::Long                 NodeStart,
166                              CORBA::Boolean              HasAngles,
167                              const SMESH::double_array & Angles,
168                              CORBA::Boolean              HasRefPoint,
169                              const SMESH::PointStruct &  RefPoint);
170
171   void Mirror(const SMESH::long_array &           IDsOfElements,
172               const SMESH::AxisStruct &           Axis,
173               SMESH::SMESH_MeshEditor::MirrorType MirrorType,
174               CORBA::Boolean                      Copy);
175   void MirrorObject(SMESH::SMESH_IDSource_ptr           theObject,
176                     const SMESH::AxisStruct &           Axis,
177                     SMESH::SMESH_MeshEditor::MirrorType MirrorType,
178                     CORBA::Boolean                      Copy);
179   void Translate(const SMESH::long_array & IDsOfElements,
180                  const SMESH::DirStruct &   Vector,
181                  CORBA::Boolean            Copy);
182   void TranslateObject(SMESH::SMESH_IDSource_ptr  theObject,
183                        const SMESH::DirStruct &   Vector,
184                        CORBA::Boolean             Copy);
185   void Rotate(const SMESH::long_array & IDsOfElements,
186               const SMESH::AxisStruct &  Axis,
187               CORBA::Double             Angle,
188               CORBA::Boolean            Copy);
189   void RotateObject(SMESH::SMESH_IDSource_ptr  theObject,
190                     const SMESH::AxisStruct &  Axis,
191                     CORBA::Double              Angle,
192                     CORBA::Boolean             Copy);
193
194   void FindCoincidentNodes (CORBA::Double                  Tolerance,
195                             SMESH::array_of_long_array_out GroupsOfNodes);
196   void MergeNodes (const SMESH::array_of_long_array& GroupsOfNodes);
197   void MergeEqualElements();
198
199   SMESH::SMESH_MeshEditor::Sew_Error
200     SewFreeBorders(CORBA::Long FirstNodeID1,
201                    CORBA::Long SecondNodeID1,
202                    CORBA::Long LastNodeID1,
203                    CORBA::Long FirstNodeID2,
204                    CORBA::Long SecondNodeID2,
205                    CORBA::Long LastNodeID2,
206                    CORBA::Boolean CreatePolygons,
207                    CORBA::Boolean CreatePolyedrs);
208   SMESH::SMESH_MeshEditor::Sew_Error
209     SewConformFreeBorders(CORBA::Long FirstNodeID1,
210                           CORBA::Long SecondNodeID1,
211                           CORBA::Long LastNodeID1,
212                           CORBA::Long FirstNodeID2,
213                           CORBA::Long SecondNodeID2);
214   SMESH::SMESH_MeshEditor::Sew_Error
215     SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder,
216                     CORBA::Long SecondNodeIDOnFreeBorder,
217                     CORBA::Long LastNodeIDOnFreeBorder,
218                     CORBA::Long FirstNodeIDOnSide,
219                     CORBA::Long LastNodeIDOnSide,
220                     CORBA::Boolean CreatePolygons,
221                     CORBA::Boolean CreatePolyedrs);
222   SMESH::SMESH_MeshEditor::Sew_Error
223     SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
224                     const SMESH::long_array& IDsOfSide2Elements,
225                     CORBA::Long NodeID1OfSide1ToMerge,
226                     CORBA::Long NodeID1OfSide2ToMerge,
227                     CORBA::Long NodeID2OfSide1ToMerge,
228                     CORBA::Long NodeID2OfSide2ToMerge);
229
230  private:
231   SMESHDS_Mesh * GetMeshDS() { return _myMesh->GetMeshDS(); }
232   SMESH_Mesh   *_myMesh;
233 };
234
235 #endif