1 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
22 // File : SMESH_Mesh.idl
23 // Author : Paul RASCLE, EDF
26 #ifndef _SMESH_MESH_IDL_
27 #define _SMESH_MESH_IDL_
29 #include "SALOME_Exception.idl"
30 #include "SMESH_Hypothesis.idl"
32 #include "GEOM_Shape.idl"
37 typedef sequence<double> double_array ;
38 typedef sequence<long> long_array ;
39 typedef sequence<string> string_array ;
64 typedef sequence<log_block> log_array;
66 interface SMESH_subMesh;
67 interface SMESH_MeshEditor;
71 * Associate a Shape to a Mesh created with NewEmpty
74 // boolean SetMesh(in GEOM::GEOM_Shape aShape)
75 // raises (SALOME::SALOME_Exception);
78 * Get the subMesh object associated to a subShape. The subMesh object
79 * gives access to nodes and elements IDs.
80 * SubMesh will be used instead of SubShape in a next idl version to
81 * adress a specific subMesh...
83 SMESH_subMesh GetElementsOnShape(in GEOM::GEOM_Shape aSubShape)
84 raises (SALOME::SALOME_Exception);
87 * Create a subMesh without reference to a subShape
89 // SMESH_subMesh NewEmpty()
90 // raises (SALOME::SALOME_Exception);
93 * Add hypothesis to the mesh, under a particular subShape
94 * (or the main shape itself)
95 * The Add method is only used to prepare the build of the mesh and store
96 * the algorithms and associated parameters.
97 * Actual job of mesh the shape is done by MESH_Gen.
99 * - aSubShape : subShape obtained by a shape explode in GEOM
101 * - anHyp : hypothesis object
103 * - OK if the hypothesis is compatible with the subShape
104 * (and all previous hypothesis on the subShape)
105 * - NOK if the hypothesis is not compatible with the subShape
106 * (or one previous hypothesis on the subShape)
107 * raises exception if hypothesis has not been created
109 boolean AddHypothesis(in GEOM::GEOM_Shape aSubShape, in SMESH_Hypothesis anHyp)
110 raises (SALOME::SALOME_Exception);
111 // boolean AddHypothesis(in SMESH_subMesh aSubMesh, in SMESH_Hypothesis anHyp)
112 // raises (SALOME::SALOME_Exception);
116 * Remove an hypothesis previouly added with AddHypothesis.
118 boolean RemoveHypothesis(in GEOM::GEOM_Shape aSubShape,
119 in SMESH_Hypothesis anHyp)
120 raises (SALOME::SALOME_Exception);
121 // boolean RemoveHypothesis(in SMESH_subMesh aSubMesh,
122 // in SMESH_Hypothesis anHyp)
123 // raises (SALOME::SALOME_Exception);
126 * Get the list of hypothesis added on a subShape
128 ListOfHypothesis GetHypothesisList(in GEOM::GEOM_Shape aSubShape)
129 raises (SALOME::SALOME_Exception);
130 // ListOfHypothesis GetHypothesisList(in SMESH_subMesh aSubMesh)
131 // raises (SALOME::SALOME_Exception);
134 * Get the log of nodes and elements added or removed since previous
137 * - clearAfterGet : log is emptied after Get (safe if concurrents access)
139 // string_array GetLog(in boolean clearAfterGet)
140 // raises (SALOME::SALOME_Exception);
141 log_array GetLog(in boolean clearAfterGet)
142 raises (SALOME::SALOME_Exception);
145 * Clear the log of nodes and elements added or removed since previous
146 * clear. Must be used immediately after GetLog if clearAfterGet is false.
149 raises (SALOME::SALOME_Exception);
152 * Get the internal Id
161 SMESH_MeshEditor GetMeshEditor()
162 raises (SALOME::SALOME_Exception);
165 * Export mesh to a file
166 * @param fileName file name where to export the file
167 * @param fileType Currently it could be either "DAT", "UNV" or "MED".
169 void Export( in string fileName, in string fileType )
170 raises (SALOME::SALOME_Exception);
175 SALOME_MED::MESH GetMEDMesh()
176 raises (SALOME::SALOME_Exception);
179 raises (SALOME::SALOME_Exception);
182 raises (SALOME::SALOME_Exception);
185 raises (SALOME::SALOME_Exception);
188 raises (SALOME::SALOME_Exception);
191 raises (SALOME::SALOME_Exception);
194 raises (SALOME::SALOME_Exception);
197 raises (SALOME::SALOME_Exception);
200 raises (SALOME::SALOME_Exception);
203 raises (SALOME::SALOME_Exception);
206 interface SMESH_subMesh
211 long GetNumberOfElements()
212 raises (SALOME::SALOME_Exception);
217 long GetNumberOfNodes()
218 raises (SALOME::SALOME_Exception);
223 long_array GetElementsId()
224 raises (SALOME::SALOME_Exception);
229 long_array GetNodesId()
230 raises (SALOME::SALOME_Exception);
233 * Get SMESH_Mesh which stores nodes coordinates & elements definition
235 SMESH_Mesh GetFather()
236 raises (SALOME::SALOME_Exception);
239 * Get the internal Id
246 SALOME_MED::FAMILY GetFamily()
247 raises (SALOME::SALOME_Exception);
251 * This interface makes modifications on the Mesh - removing elements and nodes
253 interface SMESH_MeshEditor {
256 boolean RemoveElements(in long_array IDsOfElements)
257 raises (SALOME::SALOME_Exception);
259 boolean RemoveNodes(in long_array IDsOfNodes)
260 raises (SALOME::SALOME_Exception);
262 boolean AddNode(in double x, in double y, in double z)
263 raises (SALOME::SALOME_Exception);
265 boolean AddEdge(in long_array IDsOfNodes)
266 raises (SALOME::SALOME_Exception);
268 boolean AddFace(in long_array IDsOfNodes)
269 raises (SALOME::SALOME_Exception);
271 boolean AddVolume(in long_array IDsOfNodes)
272 raises (SALOME::SALOME_Exception);