Salome HOME
fix PythonDump: do not write distruction in PythonDump as creation is not written
[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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
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   enum AlgoStateErrorName { MISSING_ALGO, MISSING_HYPO, NOT_CONFORM_MESH };
47   struct AlgoStateError {
48     AlgoStateErrorName name;
49     string             algoName;
50     long               algoDim;
51     boolean            isGlobalAlgo;
52   };
53   typedef sequence<AlgoStateError> algo_error_array;
54     
55   interface SMESH_Gen : Engines::Component, SALOMEDS::Driver
56   {
57
58     FilterManager CreateFilterManager();
59
60     SMESH_Pattern GetPattern();
61
62     /*!
63       Set the current mode
64      */
65     void SetEmbeddedMode( in boolean theMode );
66
67     /*!
68       Get the current mode
69      */
70     boolean IsEmbeddedMode();
71
72     /*!
73       Set the current study
74      */
75     void SetCurrentStudy( in SALOMEDS::Study theStudy );
76
77     /*!
78       Get the current study
79      */
80     SALOMEDS::Study GetCurrentStudy();
81
82     /*!
83      * Create a hypothesis that can be shared by differents parts of the mesh.
84      * An hypothesis is either:
85      * - a method used to generate or modify a part of the mesh (algorithm).
86      * - a parameter or a law used by an algorithm.
87      * Algorithms are 1D, 2D or 3D.
88      */
89     SMESH_Hypothesis CreateHypothesis( in string theHypName,
90                                        in string theLibName )
91       raises ( SALOME::SALOME_Exception );
92
93     /*!
94      * Return a hypothesis holding parameter values corresponding to the mesh
95      * existing on the given geometry.
96      * The returned hypothesis may be the one existing in a study and used
97      * to compute the mesh, or a temporary one created just to pass parameter
98      * values
99      */
100     SMESH_Hypothesis GetHypothesisParameterValues( in string            theHypName,
101                                                    in string            theLibName,
102                                                    in SMESH_Mesh        theMesh,
103                                                    in GEOM::GEOM_Object theGeom)
104       raises ( SALOME::SALOME_Exception );
105
106     /*!
107      * Create a Mesh object, given a geometry shape.
108      * Mesh is created empty (no points, no elements).
109      * Shape is explored via GEOM_Client to create local copies.
110      * of TopoDS_Shapes and bind CORBA references of shape & subshapes
111      * with TopoDS_Shapes
112      */
113     SMESH_Mesh CreateMesh( in GEOM::GEOM_Object theObject )
114       raises ( SALOME::SALOME_Exception );
115     
116     /*!
117      * Create a empty mesh object
118      */
119     SMESH_Mesh CreateEmptyMesh()
120       raises ( SALOME::SALOME_Exception );
121     
122     /*!
123      * Create Mesh object importing data from given UNV file
124      */
125     SMESH_Mesh CreateMeshesFromUNV( in string theFileName )
126       raises ( SALOME::SALOME_Exception );
127
128     /*!
129      * Create Mesh object(s) importing data from given MED file
130      */
131      mesh_array CreateMeshesFromMED( in string theFileName,
132                                      out SMESH::DriverMED_ReadStatus theStatus )
133        raises ( SALOME::SALOME_Exception );
134
135     /*!
136      * Create Mesh object importing data from given STL file
137      */
138     SMESH_Mesh CreateMeshesFromSTL( in string theFileName )
139       raises ( SALOME::SALOME_Exception );
140
141     /*!
142      * Create a Mesh object, without a geometry shape reference
143      */
144 //      SMESH_Mesh NewEmpty()
145 //        raises ( SALOME::SALOME_Exception );
146
147     /*!
148      * Mesh a subShape. 
149      * First, verify list of hypothesis associated with the subShape,
150      * return NOK if hypothesis are not sufficient
151      */
152     boolean Compute( in SMESH_Mesh        theMesh, 
153                      in GEOM::GEOM_Object theSubObject )
154       raises ( SALOME::SALOME_Exception );
155
156     /*!
157      * Return true if hypotheses are defined well
158      */
159     boolean IsReadyToCompute( in SMESH_Mesh        theMesh, 
160                               in GEOM::GEOM_Object theSubObject )
161       raises ( SALOME::SALOME_Exception );
162
163     /*!
164      * Return errors of hypotheses definintion
165      * algo_error_array is empty if everything is OK
166      */
167     algo_error_array GetAlgoState( in SMESH_Mesh        theMesh, 
168                                    in GEOM::GEOM_Object theSubObject )
169       raises ( SALOME::SALOME_Exception );
170
171     /*!
172      * 
173      */
174     long_array GetSubShapesId( in GEOM::GEOM_Object theMainObject,
175                                in object_array      theListOfSubObjects )
176        raises ( SALOME::SALOME_Exception );
177
178     /*!
179      * Return geometrical object the given element is built on.
180      * The returned geometrical object, if not nil, is either found in the 
181      * study or is published by this method with the given name
182      */
183     GEOM::GEOM_Object GetGeometryByMeshElement( in SMESH_Mesh  theMesh,
184                                                 in long        theElementID,
185                                                 in string      theGeomName)
186       raises ( SALOME::SALOME_Exception );
187
188   };
189
190 };
191
192 #endif