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.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : SMESH_Gen.idl
23 // Author : Paul RASCLE, EDF
26 #ifndef _SMESH_GEN_IDL_
27 #define _SMESH_GEN_IDL_
29 #include "SALOME_Exception.idl"
30 #include "SALOME_Component.idl"
31 #include "SALOMEDS.idl"
33 #include "GEOM_Gen.idl"
35 #include "SMESH_Mesh.idl"
36 #include "SMESH_Hypothesis.idl"
40 typedef sequence<GEOM::GEOM_Object> object_array;
41 typedef sequence<SMESH_Mesh> mesh_array;
43 interface FilterManager;
44 interface SMESH_Pattern;
50 const long Tag_HypothesisRoot = 1; // hypotheses root
51 const long Tag_AlgorithmsRoot = 2; // algorithms root
52 const long Tag_FirstMeshRoot = 3; // first mesh root
54 const long Tag_RefOnShape = 1; // references to shape
55 const long Tag_RefOnAppliedHypothesis = 2; // applied hypotheses root
56 const long Tag_RefOnAppliedAlgorithms = 3; // applied algorithms root
57 // Mesh only: sub-meshes roots by type
58 const long Tag_FirstSubMesh = 4;
59 const long Tag_SubMeshOnVertex = 4;
60 const long Tag_SubMeshOnEdge = 5;
61 const long Tag_SubMeshOnWire = 6;
62 const long Tag_SubMeshOnFace = 7;
63 const long Tag_SubMeshOnShell = 8;
64 const long Tag_SubMeshOnSolid = 9;
65 const long Tag_SubMeshOnCompound = 10;
66 const long Tag_LastSubMesh = 10;
67 // Mesh only: group roots by type
68 const long Tag_FirstGroup = 11;
69 const long Tag_NodeGroups = 11;
70 const long Tag_EdgeGroups = 12;
71 const long Tag_FaceGroups = 13;
72 const long Tag_VolumeGroups = 14;
73 const long Tag_LastGroup = 14;
76 * Hypothesis definintion error
80 Hypothesis_Status state;
85 typedef sequence<AlgoStateError> algo_error_array;
88 * Mesh computation error
93 COMPERR_BAD_INPUT_MESH, // wrong mesh on lower submesh
94 COMPERR_STD_EXCEPTION , // some std exception raised
95 COMPERR_OCC_EXCEPTION , // OCC exception raised
96 COMPERR_SLM_EXCEPTION , // SALOME exception raised
97 COMPERR_EXCEPTION , // other exception raised
98 COMPERR_MEMORY_PB , // memory allocation problem
99 COMPERR_ALGO_FAILED , // computation failed
100 COMPERR_BAD_SHAPE // bad geometry
104 short code; // ComputeErrorName or, if negative, algo specific code
105 string comment; // textual problem description
107 short subShapeID; // id of subshape of a shape to mesh
108 boolean hasBadMesh; // there are elements preventing computation available for visualization
110 typedef sequence<ComputeError> compute_error_array;
113 interface SMESH_Gen : Engines::Component, SALOMEDS::Driver
115 //GEOM::GEOM_Gen SetGeomEngine( in string containerLoc );
116 void SetGeomEngine( in GEOM::GEOM_Gen geomcompo );
118 FilterManager CreateFilterManager();
120 SMESH_Pattern GetPattern();
125 void SetEmbeddedMode( in boolean theMode );
130 boolean IsEmbeddedMode();
133 Set the current study
135 void SetCurrentStudy( in SALOMEDS::Study theStudy );
138 Get the current study
140 SALOMEDS::Study GetCurrentStudy();
143 * Create a hypothesis that can be shared by differents parts of the mesh.
144 * An hypothesis is either:
145 * - a method used to generate or modify a part of the mesh (algorithm).
146 * - a parameter or a law used by an algorithm.
147 * Algorithms are 1D, 2D or 3D.
149 SMESH_Hypothesis CreateHypothesis( in string theHypName,
150 in string theLibName )
151 raises ( SALOME::SALOME_Exception );
154 * Return a hypothesis holding parameter values corresponding to the mesh
155 * existing on the given geometry.
156 * The returned hypothesis may be the one existing in a study and used
157 * to compute the mesh, or a temporary one created just to pass parameter
160 SMESH_Hypothesis GetHypothesisParameterValues( in string theHypName,
161 in string theLibName,
162 in SMESH_Mesh theMesh,
163 in GEOM::GEOM_Object theGeom)
164 raises ( SALOME::SALOME_Exception );
167 * Set the object name
169 void SetName( in string theObjectIOR,
170 in string theObjectName )
171 raises ( SALOME::SALOME_Exception );
174 * Create a Mesh object, given a geometry shape.
175 * Mesh is created empty (no points, no elements).
176 * Shape is explored via GEOM_Client to create local copies.
177 * of TopoDS_Shapes and bind CORBA references of shape & subshapes
180 SMESH_Mesh CreateMesh( in GEOM::GEOM_Object theObject )
181 raises ( SALOME::SALOME_Exception );
184 * Create an empty mesh object
186 SMESH_Mesh CreateEmptyMesh()
187 raises ( SALOME::SALOME_Exception );
190 * Create Mesh object importing data from given UNV file
191 * (UNV supported version is I-DEAS 10)
193 SMESH_Mesh CreateMeshesFromUNV( in string theFileName )
194 raises ( SALOME::SALOME_Exception );
197 * Create Mesh object(s) importing data from given MED file
199 mesh_array CreateMeshesFromMED( in string theFileName,
200 out SMESH::DriverMED_ReadStatus theStatus )
201 raises ( SALOME::SALOME_Exception );
204 * Create Mesh object importing data from given STL file
206 SMESH_Mesh CreateMeshesFromSTL( in string theFileName )
207 raises ( SALOME::SALOME_Exception );
210 * Create a Mesh object, without a geometry shape reference
212 // SMESH_Mesh NewEmpty()
213 // raises ( SALOME::SALOME_Exception );
217 * First, verify list of hypothesis associated with the subShape,
218 * return NOK if hypothesis are not sufficient
220 boolean Compute( in SMESH_Mesh theMesh,
221 in GEOM::GEOM_Object theSubObject )
222 raises ( SALOME::SALOME_Exception );
225 * Return true if hypotheses are defined well
227 boolean IsReadyToCompute( in SMESH_Mesh theMesh,
228 in GEOM::GEOM_Object theSubObject )
229 raises ( SALOME::SALOME_Exception );
232 * Calculate Mesh as preview till indicated dimension
233 * First, verify list of hypothesis associated with the subShape.
234 * Return mesh preview structure
236 MeshPreviewStruct Precompute( in SMESH_Mesh theMesh,
237 in GEOM::GEOM_Object theSubObject,
238 in Dimension theDimension,
239 inout long_array theShapesId )
240 raises ( SALOME::SALOME_Exception );
243 * Return errors of hypotheses definintion
244 * algo_error_array is empty if everything is OK
246 algo_error_array GetAlgoState( in SMESH_Mesh theMesh,
247 in GEOM::GEOM_Object theSubObject )
248 raises ( SALOME::SALOME_Exception );
251 * Return errors of mesh computation
252 * compute_error_array is empty if everything is OK
254 compute_error_array GetComputeErrors( in SMESH_Mesh theMesh,
255 in GEOM::GEOM_Object theSubObject )
256 raises ( SALOME::SALOME_Exception );
259 * Return mesh elements preventing computation of a subshape
261 MeshPreviewStruct GetBadInputElements( in SMESH_Mesh theMesh,
262 in short theSubShapeID )
263 raises ( SALOME::SALOME_Exception );
266 * Return indeces of faces, edges and vertices of given subshapes
267 * within theMainObject
269 long_array GetSubShapesId( in GEOM::GEOM_Object theMainObject,
270 in object_array theListOfSubObjects )
271 raises ( SALOME::SALOME_Exception );
274 * Return geometrical object the given element is built on.
275 * The returned geometrical object, if not nil, is either found in the
276 * study or is published by this method with the given name
278 GEOM::GEOM_Object GetGeometryByMeshElement( in SMESH_Mesh theMesh,
279 in long theElementID,
280 in string theGeomName)
281 raises ( SALOME::SALOME_Exception );
284 * Return geometrical object the given element is built on.
285 * The returned geometrical object not published in study by this method.
287 GEOM::GEOM_Object FindGeometryByMeshElement( in SMESH_Mesh theMesh,
288 in long theElementID)
289 raises ( SALOME::SALOME_Exception );
292 * Concatenate the given meshes into one mesh.
293 * Union groups with the same name and type if
294 * theUniteIdenticalGroups flag is true.
295 * Merge coincident nodes and elements if
296 * theMergeNodesAndElements flag is true.
298 SMESH_Mesh Concatenate(in mesh_array theMeshesArray,
299 in boolean theUniteIdenticalGroups,
300 in boolean theMergeNodesAndElements,
301 in double theMergeTolerance)
302 raises ( SALOME::SALOME_Exception );
305 * Concatenate the given meshes into one mesh.
306 * Union groups with the same name and type if
307 * theUniteIdenticalGroups flag is true.
308 * Merge coincident nodes and elements if
309 * theMergeNodesAndElements flag is true.
310 * Create the groups of all elements from initial meshes.
312 SMESH_Mesh ConcatenateWithGroups(in mesh_array theMeshesArray,
313 in boolean theUniteIdenticalGroups,
314 in boolean theMergeNodesAndElements,
315 in double theMergeTolerance)
316 raises ( SALOME::SALOME_Exception );
319 * \brief Return id of object, registered in current study context
321 * Can be used to check if the object was created in the same container, as this engine.
323 long GetObjectId(in Object theObject);