1 // SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
3 // Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SMESH_MeshEditor_i.hxx
25 // Author : Nicolas REJNERI
29 #ifndef _SMESH_MESHEDITOR_I_HXX_
30 #define _SMESH_MESHEDIOTR_I_HXX_
32 #include <SALOMEconfig.h>
33 #include CORBA_SERVER_HEADER(SMESH_Mesh)
35 #include "SMESH_Mesh.hxx"
37 class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
40 SMESH_MeshEditor_i(SMESH_Mesh * theMesh);
42 virtual ~ SMESH_MeshEditor_i()
47 CORBA::Boolean RemoveElements(const SMESH::long_array & IDsOfElements);
48 CORBA::Boolean RemoveNodes(const SMESH::long_array & IDsOfNodes);
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);
56 CORBA::Boolean AddPolyhedralVolume(const SMESH::long_array & IDsOfNodes,
57 const SMESH::long_array & Quantities);
58 CORBA::Boolean AddPolyhedralVolumeByFaces(const SMESH::long_array & IdsOfFaces);
60 CORBA::Boolean MoveNode(CORBA::Long NodeID,
61 CORBA::Double x, CORBA::Double y, CORBA::Double z);
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);
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);
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,
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,
120 void ConvertToQuadratic(CORBA::Boolean Force3d);
122 void RenumberNodes();
123 void RenumberElements();
125 void RotationSweep(const SMESH::long_array & IDsOfElements,
126 const SMESH::AxisStruct & Axis,
127 CORBA::Double AngleInRadians,
128 CORBA::Long NbOfSteps,
129 CORBA::Double Tolerance);
130 void RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject,
131 const SMESH::AxisStruct & Axis,
132 CORBA::Double AngleInRadians,
133 CORBA::Long NbOfSteps,
134 CORBA::Double Tolerance);
136 void ExtrusionSweep(const SMESH::long_array & IDsOfElements,
137 const SMESH::DirStruct & StepVector,
138 CORBA::Long NbOfSteps);
139 void ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObject,
140 const SMESH::DirStruct & StepVector,
141 CORBA::Long NbOfSteps);
142 void ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
143 const SMESH::DirStruct & StepVector,
144 CORBA::Long NbOfSteps);
145 void ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
146 const SMESH::DirStruct & StepVector,
147 CORBA::Long NbOfSteps);
148 void AdvancedExtrusion(const SMESH::long_array & theIDsOfElements,
149 const SMESH::DirStruct & theStepVector,
150 CORBA::Long theNbOfSteps,
151 CORBA::Long theExtrFlags,
152 CORBA::Double theSewTolerance);
154 SMESH::SMESH_MeshEditor::Extrusion_Error
155 ExtrusionAlongPath(const SMESH::long_array & IDsOfElements,
156 SMESH::SMESH_Mesh_ptr PathMesh,
157 GEOM::GEOM_Object_ptr PathShape,
158 CORBA::Long NodeStart,
159 CORBA::Boolean HasAngles,
160 const SMESH::double_array & Angles,
161 CORBA::Boolean HasRefPoint,
162 const SMESH::PointStruct & RefPoint);
164 SMESH::SMESH_MeshEditor::Extrusion_Error
165 ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr theObject,
166 SMESH::SMESH_Mesh_ptr PathMesh,
167 GEOM::GEOM_Object_ptr PathShape,
168 CORBA::Long NodeStart,
169 CORBA::Boolean HasAngles,
170 const SMESH::double_array & Angles,
171 CORBA::Boolean HasRefPoint,
172 const SMESH::PointStruct & RefPoint);
174 void Mirror(const SMESH::long_array & IDsOfElements,
175 const SMESH::AxisStruct & Axis,
176 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
177 CORBA::Boolean Copy);
178 void MirrorObject(SMESH::SMESH_IDSource_ptr theObject,
179 const SMESH::AxisStruct & Axis,
180 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
181 CORBA::Boolean Copy);
182 void Translate(const SMESH::long_array & IDsOfElements,
183 const SMESH::DirStruct & Vector,
184 CORBA::Boolean Copy);
185 void TranslateObject(SMESH::SMESH_IDSource_ptr theObject,
186 const SMESH::DirStruct & Vector,
187 CORBA::Boolean Copy);
188 void Rotate(const SMESH::long_array & IDsOfElements,
189 const SMESH::AxisStruct & Axis,
191 CORBA::Boolean Copy);
192 void RotateObject(SMESH::SMESH_IDSource_ptr theObject,
193 const SMESH::AxisStruct & Axis,
195 CORBA::Boolean Copy);
197 void FindCoincidentNodes (CORBA::Double Tolerance,
198 SMESH::array_of_long_array_out GroupsOfNodes);
199 void MergeNodes (const SMESH::array_of_long_array& GroupsOfNodes);
200 void MergeEqualElements();
202 SMESH::SMESH_MeshEditor::Sew_Error
203 SewFreeBorders(CORBA::Long FirstNodeID1,
204 CORBA::Long SecondNodeID1,
205 CORBA::Long LastNodeID1,
206 CORBA::Long FirstNodeID2,
207 CORBA::Long SecondNodeID2,
208 CORBA::Long LastNodeID2,
209 CORBA::Boolean CreatePolygons,
210 CORBA::Boolean CreatePolyedrs);
211 SMESH::SMESH_MeshEditor::Sew_Error
212 SewConformFreeBorders(CORBA::Long FirstNodeID1,
213 CORBA::Long SecondNodeID1,
214 CORBA::Long LastNodeID1,
215 CORBA::Long FirstNodeID2,
216 CORBA::Long SecondNodeID2);
217 SMESH::SMESH_MeshEditor::Sew_Error
218 SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder,
219 CORBA::Long SecondNodeIDOnFreeBorder,
220 CORBA::Long LastNodeIDOnFreeBorder,
221 CORBA::Long FirstNodeIDOnSide,
222 CORBA::Long LastNodeIDOnSide,
223 CORBA::Boolean CreatePolygons,
224 CORBA::Boolean CreatePolyedrs);
225 SMESH::SMESH_MeshEditor::Sew_Error
226 SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
227 const SMESH::long_array& IDsOfSide2Elements,
228 CORBA::Long NodeID1OfSide1ToMerge,
229 CORBA::Long NodeID1OfSide2ToMerge,
230 CORBA::Long NodeID2OfSide1ToMerge,
231 CORBA::Long NodeID2OfSide2ToMerge);
233 int GetMeshId() const { return _myMesh->GetId(); }
236 SMESHDS_Mesh * GetMeshDS() { return _myMesh->GetMeshDS(); }