Salome HOME
Join modifications from V3_2_0_maintainance (V3_2_6pre4 - T32x_16Aug2007_16h00m)
[modules/smesh.git] / idl / SMESH_Gen.idl
1 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
3 // 
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. 
8 // 
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. 
13 // 
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 
17 // 
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 //
21 //
22 //  File   : SMESH_Gen.idl
23 //  Author : Paul RASCLE, EDF
24 //  $Header$
25
26 #ifndef _SMESH_GEN_IDL_
27 #define _SMESH_GEN_IDL_
28
29 #include "SALOME_Exception.idl"
30 #include "SALOME_Component.idl"
31 #include "SALOMEDS.idl"
32
33 #include "GEOM_Gen.idl"
34
35 #include "SMESH_Mesh.idl"
36 #include "SMESH_Hypothesis.idl"
37
38 module SMESH
39 {
40   typedef sequence<GEOM::GEOM_Object> object_array;
41   typedef sequence<SMESH_Mesh>        mesh_array;
42
43   interface FilterManager;
44   interface SMESH_Pattern;
45
46   /*!
47    * Hypothesis definintion error
48    */
49   struct AlgoStateError 
50   {
51     Hypothesis_Status  state;
52     string             algoName;
53     long               algoDim;
54     boolean            isGlobalAlgo;
55   };
56   typedef sequence<AlgoStateError> algo_error_array;
57
58   /*!
59    * Mesh computation error
60    */
61   enum ComputeErrorName
62   {
63     COMPERR_OK            ,
64     COMPERR_BAD_INPUT_MESH,  // wrong mesh on lower submesh
65     COMPERR_STD_EXCEPTION ,  // some std exception raised
66     COMPERR_OCC_EXCEPTION ,  // OCC exception raised
67     COMPERR_SLM_EXCEPTION ,  // SALOME exception raised
68     COMPERR_EXCEPTION     ,  // other exception raised
69     COMPERR_MEMORY_PB     ,  // memory allocation problem
70     COMPERR_ALGO_FAILED   ,  // computation failed
71     COMPERR_BAD_SHAPE        // bad geometry
72   };
73   struct ComputeError
74   {
75     short  code;       // ComputeErrorName or, if negative, algo specific code
76     string comment;    // textual problem description
77     string algoName;
78     short  subShapeID; // id of subshape of a shape to mesh
79   };
80   typedef sequence<ComputeError> compute_error_array;
81
82
83   interface SMESH_Gen : Engines::Component, SALOMEDS::Driver
84   {
85     //GEOM::GEOM_Gen SetGeomEngine( in string containerLoc );
86     void SetGeomEngine( in GEOM::GEOM_Gen geomcompo );
87
88     FilterManager CreateFilterManager();
89
90     SMESH_Pattern GetPattern();
91
92     /*!
93       Set the current mode
94      */
95     void SetEmbeddedMode( in boolean theMode );
96
97     /*!
98       Get the current mode
99      */
100     boolean IsEmbeddedMode();
101
102     /*!
103       Set the current study
104      */
105     void SetCurrentStudy( in SALOMEDS::Study theStudy );
106
107     /*!
108       Get the current study
109      */
110     SALOMEDS::Study GetCurrentStudy();
111
112     /*!
113      * Create a hypothesis that can be shared by differents parts of the mesh.
114      * An hypothesis is either:
115      * - a method used to generate or modify a part of the mesh (algorithm).
116      * - a parameter or a law used by an algorithm.
117      * Algorithms are 1D, 2D or 3D.
118      */
119     SMESH_Hypothesis CreateHypothesis( in string theHypName,
120                                        in string theLibName )
121       raises ( SALOME::SALOME_Exception );
122
123     /*!
124      * Return a hypothesis holding parameter values corresponding to the mesh
125      * existing on the given geometry.
126      * The returned hypothesis may be the one existing in a study and used
127      * to compute the mesh, or a temporary one created just to pass parameter
128      * values
129      */
130     SMESH_Hypothesis GetHypothesisParameterValues( in string            theHypName,
131                                                    in string            theLibName,
132                                                    in SMESH_Mesh        theMesh,
133                                                    in GEOM::GEOM_Object theGeom)
134       raises ( SALOME::SALOME_Exception );
135
136     /*!
137      * Create a Mesh object, given a geometry shape.
138      * Mesh is created empty (no points, no elements).
139      * Shape is explored via GEOM_Client to create local copies.
140      * of TopoDS_Shapes and bind CORBA references of shape & subshapes
141      * with TopoDS_Shapes
142      */
143     SMESH_Mesh CreateMesh( in GEOM::GEOM_Object theObject )
144       raises ( SALOME::SALOME_Exception );
145     
146     /*!
147      * Create a empty mesh object
148      */
149     SMESH_Mesh CreateEmptyMesh()
150       raises ( SALOME::SALOME_Exception );
151     
152     /*!
153      * Create Mesh object importing data from given UNV file
154      * (UNV supported version is I-DEAS 10)
155      */
156     SMESH_Mesh CreateMeshesFromUNV( in string theFileName )
157       raises ( SALOME::SALOME_Exception );
158
159     /*!
160      * Create Mesh object(s) importing data from given MED file
161      */
162      mesh_array CreateMeshesFromMED( in string theFileName,
163                                      out SMESH::DriverMED_ReadStatus theStatus )
164        raises ( SALOME::SALOME_Exception );
165
166     /*!
167      * Create Mesh object importing data from given STL file
168      */
169     SMESH_Mesh CreateMeshesFromSTL( in string theFileName )
170       raises ( SALOME::SALOME_Exception );
171
172     /*!
173      * Create a Mesh object, without a geometry shape reference
174      */
175 //      SMESH_Mesh NewEmpty()
176 //        raises ( SALOME::SALOME_Exception );
177
178     /*!
179      * Mesh a subShape. 
180      * First, verify list of hypothesis associated with the subShape,
181      * return NOK if hypothesis are not sufficient
182      */
183     boolean Compute( in SMESH_Mesh        theMesh, 
184                      in GEOM::GEOM_Object theSubObject )
185       raises ( SALOME::SALOME_Exception );
186
187     /*!
188      * Return true if hypotheses are defined well
189      */
190     boolean IsReadyToCompute( in SMESH_Mesh        theMesh, 
191                               in GEOM::GEOM_Object theSubObject )
192       raises ( SALOME::SALOME_Exception );
193
194     /*!
195      * Return errors of hypotheses definintion
196      * algo_error_array is empty if everything is OK
197      */
198     algo_error_array GetAlgoState( in SMESH_Mesh        theMesh, 
199                                    in GEOM::GEOM_Object theSubObject )
200       raises ( SALOME::SALOME_Exception );
201
202     /*!
203      * Return errors of mesh computation
204      * compute_error_array is empty if everything is OK
205      */
206     compute_error_array GetComputeErrors( in SMESH_Mesh        theMesh, 
207                                           in GEOM::GEOM_Object theSubObject )
208       raises ( SALOME::SALOME_Exception );
209
210     /*!
211      * Return indeces of faces, edges and vertices of given subshapes
212      * within theMainObject
213      */
214     long_array GetSubShapesId( in GEOM::GEOM_Object theMainObject,
215                                in object_array      theListOfSubObjects )
216        raises ( SALOME::SALOME_Exception );
217
218     /*!
219      * Return geometrical object the given element is built on.
220      * The returned geometrical object, if not nil, is either found in the 
221      * study or is published by this method with the given name
222      */
223     GEOM::GEOM_Object GetGeometryByMeshElement( in SMESH_Mesh  theMesh,
224                                                 in long        theElementID,
225                                                 in string      theGeomName)
226       raises ( SALOME::SALOME_Exception );
227
228     /*!
229      * Return geometrical object the given element is built on.
230      * The returned geometrical object not published in study by this method.
231      */
232     GEOM::GEOM_Object FindGeometryByMeshElement( in SMESH_Mesh  theMesh,
233                                                  in long        theElementID)
234       raises ( SALOME::SALOME_Exception );
235
236     /*!
237      * Concatenate the given meshes into one mesh.
238      * Union groups with the same name and type if
239      * theUniteIdenticalGroups flag is true.
240      * Merge coincident nodes and elements if 
241      * theMergeNodesAndElements flag is true.
242      */
243     SMESH_Mesh Concatenate(in mesh_array theMeshesArray, 
244                            in boolean    theUniteIdenticalGroups, 
245                            in boolean    theMergeNodesAndElements, 
246                            in double     theMergeTolerance)
247       raises ( SALOME::SALOME_Exception );
248
249   };
250
251 };
252
253 #endif