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_
34 #include <SALOMEconfig.h>
35 #include CORBA_SERVER_HEADER(SMESH_Mesh)
37 #include "SMESH_Mesh.hxx"
39 class SMESH_I_EXPORT SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
42 SMESH_MeshEditor_i(SMESH_Mesh * theMesh);
44 virtual ~ SMESH_MeshEditor_i()
49 CORBA::Boolean RemoveElements(const SMESH::long_array & IDsOfElements);
50 CORBA::Boolean RemoveNodes(const SMESH::long_array & IDsOfNodes);
52 CORBA::Boolean AddNode(CORBA::Double x, CORBA::Double y, CORBA::Double z);
53 CORBA::Boolean AddEdge(const SMESH::long_array & IDsOfNodes);
54 CORBA::Boolean AddFace(const SMESH::long_array & IDsOfNodes);
55 CORBA::Boolean AddVolume(const SMESH::long_array & IDsOfNodes);
57 CORBA::Boolean AddPolyhedralVolume(const SMESH::long_array & IDsOfNodes,
58 const SMESH::long_array & Quantities);
59 CORBA::Boolean AddPolyhedralVolumeByFaces(const SMESH::long_array & IdsOfFaces);
61 CORBA::Boolean MoveNode(CORBA::Long NodeID,
62 CORBA::Double x, CORBA::Double y, CORBA::Double z);
64 CORBA::Boolean InverseDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
65 CORBA::Boolean DeleteDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
66 CORBA::Boolean Reorient(const SMESH::long_array & IDsOfElements);
67 CORBA::Boolean ReorientObject(SMESH::SMESH_IDSource_ptr theObject);
70 CORBA::Boolean TriToQuad (const SMESH::long_array & IDsOfElements,
71 SMESH::NumericalFunctor_ptr Criterion,
72 CORBA::Double MaxAngle);
73 CORBA::Boolean TriToQuadObject (SMESH::SMESH_IDSource_ptr theObject,
74 SMESH::NumericalFunctor_ptr Criterion,
75 CORBA::Double MaxAngle);
76 CORBA::Boolean QuadToTri (const SMESH::long_array & IDsOfElements,
77 SMESH::NumericalFunctor_ptr Criterion);
78 CORBA::Boolean QuadToTriObject (SMESH::SMESH_IDSource_ptr theObject,
79 SMESH::NumericalFunctor_ptr Criterion);
80 CORBA::Boolean SplitQuad (const SMESH::long_array & IDsOfElements,
81 CORBA::Boolean Diag13);
82 CORBA::Boolean SplitQuadObject (SMESH::SMESH_IDSource_ptr theObject,
83 CORBA::Boolean Diag13);
84 CORBA::Long BestSplit (CORBA::Long IDOfQuad,
85 SMESH::NumericalFunctor_ptr Criterion);
87 CORBA::Boolean Smooth(const SMESH::long_array & IDsOfElements,
88 const SMESH::long_array & IDsOfFixedNodes,
89 CORBA::Long MaxNbOfIterations,
90 CORBA::Double MaxAspectRatio,
91 SMESH::SMESH_MeshEditor::Smooth_Method Method);
92 CORBA::Boolean SmoothObject(SMESH::SMESH_IDSource_ptr theObject,
93 const SMESH::long_array & IDsOfFixedNodes,
94 CORBA::Long MaxNbOfIterations,
95 CORBA::Double MaxAspectRatio,
96 SMESH::SMESH_MeshEditor::Smooth_Method Method);
97 CORBA::Boolean SmoothParametric(const SMESH::long_array & IDsOfElements,
98 const SMESH::long_array & IDsOfFixedNodes,
99 CORBA::Long MaxNbOfIterations,
100 CORBA::Double MaxAspectRatio,
101 SMESH::SMESH_MeshEditor::Smooth_Method Method);
102 CORBA::Boolean SmoothParametricObject(SMESH::SMESH_IDSource_ptr theObject,
103 const SMESH::long_array & IDsOfFixedNodes,
104 CORBA::Long MaxNbOfIterations,
105 CORBA::Double MaxAspectRatio,
106 SMESH::SMESH_MeshEditor::Smooth_Method Method);
107 CORBA::Boolean smooth(const SMESH::long_array & IDsOfElements,
108 const SMESH::long_array & IDsOfFixedNodes,
109 CORBA::Long MaxNbOfIterations,
110 CORBA::Double MaxAspectRatio,
111 SMESH::SMESH_MeshEditor::Smooth_Method Method,
113 CORBA::Boolean smoothObject(SMESH::SMESH_IDSource_ptr theObject,
114 const SMESH::long_array & IDsOfFixedNodes,
115 CORBA::Long MaxNbOfIterations,
116 CORBA::Double MaxAspectRatio,
117 SMESH::SMESH_MeshEditor::Smooth_Method Method,
120 void RenumberNodes();
121 void RenumberElements();
123 void RotationSweep(const SMESH::long_array & IDsOfElements,
124 const SMESH::AxisStruct & Axis,
125 CORBA::Double AngleInRadians,
126 CORBA::Long NbOfSteps,
127 CORBA::Double Tolerance);
128 void RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject,
129 const SMESH::AxisStruct & Axis,
130 CORBA::Double AngleInRadians,
131 CORBA::Long NbOfSteps,
132 CORBA::Double Tolerance);
134 void ExtrusionSweep(const SMESH::long_array & IDsOfElements,
135 const SMESH::DirStruct & StepVector,
136 CORBA::Long NbOfSteps);
137 void ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObject,
138 const SMESH::DirStruct & StepVector,
139 CORBA::Long NbOfSteps);
140 void ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
141 const SMESH::DirStruct & StepVector,
142 CORBA::Long NbOfSteps);
143 void ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
144 const SMESH::DirStruct & StepVector,
145 CORBA::Long NbOfSteps);
146 void AdvancedExtrusion(const SMESH::long_array & theIDsOfElements,
147 const SMESH::DirStruct & theStepVector,
148 CORBA::Long theNbOfSteps,
149 CORBA::Long theExtrFlags,
150 CORBA::Double theSewTolerance);
152 SMESH::SMESH_MeshEditor::Extrusion_Error
153 ExtrusionAlongPath(const SMESH::long_array & IDsOfElements,
154 SMESH::SMESH_Mesh_ptr PathMesh,
155 GEOM::GEOM_Object_ptr PathShape,
156 CORBA::Long NodeStart,
157 CORBA::Boolean HasAngles,
158 const SMESH::double_array & Angles,
159 CORBA::Boolean HasRefPoint,
160 const SMESH::PointStruct & RefPoint);
162 SMESH::SMESH_MeshEditor::Extrusion_Error
163 ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr theObject,
164 SMESH::SMESH_Mesh_ptr PathMesh,
165 GEOM::GEOM_Object_ptr PathShape,
166 CORBA::Long NodeStart,
167 CORBA::Boolean HasAngles,
168 const SMESH::double_array & Angles,
169 CORBA::Boolean HasRefPoint,
170 const SMESH::PointStruct & RefPoint);
172 void Mirror(const SMESH::long_array & IDsOfElements,
173 const SMESH::AxisStruct & Axis,
174 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
175 CORBA::Boolean Copy);
176 void MirrorObject(SMESH::SMESH_IDSource_ptr theObject,
177 const SMESH::AxisStruct & Axis,
178 SMESH::SMESH_MeshEditor::MirrorType MirrorType,
179 CORBA::Boolean Copy);
180 void Translate(const SMESH::long_array & IDsOfElements,
181 const SMESH::DirStruct & Vector,
182 CORBA::Boolean Copy);
183 void TranslateObject(SMESH::SMESH_IDSource_ptr theObject,
184 const SMESH::DirStruct & Vector,
185 CORBA::Boolean Copy);
186 void Rotate(const SMESH::long_array & IDsOfElements,
187 const SMESH::AxisStruct & Axis,
189 CORBA::Boolean Copy);
190 void RotateObject(SMESH::SMESH_IDSource_ptr theObject,
191 const SMESH::AxisStruct & Axis,
193 CORBA::Boolean Copy);
195 void FindCoincidentNodes (CORBA::Double Tolerance,
196 SMESH::array_of_long_array_out GroupsOfNodes);
197 void MergeNodes (const SMESH::array_of_long_array& GroupsOfNodes);
198 void MergeEqualElements();
200 SMESH::SMESH_MeshEditor::Sew_Error
201 SewFreeBorders(CORBA::Long FirstNodeID1,
202 CORBA::Long SecondNodeID1,
203 CORBA::Long LastNodeID1,
204 CORBA::Long FirstNodeID2,
205 CORBA::Long SecondNodeID2,
206 CORBA::Long LastNodeID2,
207 CORBA::Boolean CreatePolygons,
208 CORBA::Boolean CreatePolyedrs);
209 SMESH::SMESH_MeshEditor::Sew_Error
210 SewConformFreeBorders(CORBA::Long FirstNodeID1,
211 CORBA::Long SecondNodeID1,
212 CORBA::Long LastNodeID1,
213 CORBA::Long FirstNodeID2,
214 CORBA::Long SecondNodeID2);
215 SMESH::SMESH_MeshEditor::Sew_Error
216 SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder,
217 CORBA::Long SecondNodeIDOnFreeBorder,
218 CORBA::Long LastNodeIDOnFreeBorder,
219 CORBA::Long FirstNodeIDOnSide,
220 CORBA::Long LastNodeIDOnSide,
221 CORBA::Boolean CreatePolygons,
222 CORBA::Boolean CreatePolyedrs);
223 SMESH::SMESH_MeshEditor::Sew_Error
224 SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
225 const SMESH::long_array& IDsOfSide2Elements,
226 CORBA::Long NodeID1OfSide1ToMerge,
227 CORBA::Long NodeID1OfSide2ToMerge,
228 CORBA::Long NodeID2OfSide1ToMerge,
229 CORBA::Long NodeID2OfSide2ToMerge);
232 SMESHDS_Mesh * GetMeshDS() { return _myMesh->GetMeshDS(); }