1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : SMESH_Gen.idl
23 // Author : Paul RASCLE, EDF
25 #ifndef _SMESH_GEN_IDL_
26 #define _SMESH_GEN_IDL_
28 #include "SALOME_Exception.idl"
29 #include "SALOME_Component.idl"
30 #include "SALOMEDS.idl"
32 #include "GEOM_Gen.idl"
34 #include "SMESH_Mesh.idl"
35 #include "SMESH_Hypothesis.idl"
39 typedef sequence<SALOMEDS::SObject> sobject_list;
40 typedef sequence<GEOM::GEOM_Object> object_array;
41 typedef sequence<SMESH_Mesh> mesh_array;
43 interface FilterManager;
44 interface SMESH_Pattern;
45 interface Measurements;
51 const long Tag_HypothesisRoot = 1; // hypotheses root
52 const long Tag_AlgorithmsRoot = 2; // algorithms root
53 const long Tag_FirstMeshRoot = 3; // first mesh root
55 const long Tag_RefOnShape = 1; // references to shape
56 const long Tag_RefOnAppliedHypothesis = 2; // applied hypotheses root
57 const long Tag_RefOnAppliedAlgorithms = 3; // applied algorithms root
58 // Mesh only: sub-meshes roots by type
59 const long Tag_FirstSubMesh = 4;
60 const long Tag_SubMeshOnVertex = 4;
61 const long Tag_SubMeshOnEdge = 5;
62 const long Tag_SubMeshOnWire = 6;
63 const long Tag_SubMeshOnFace = 7;
64 const long Tag_SubMeshOnShell = 8;
65 const long Tag_SubMeshOnSolid = 9;
66 const long Tag_SubMeshOnCompound = 10;
67 const long Tag_LastSubMesh = 10;
68 // Mesh only: group roots by type
69 const long Tag_FirstGroup = 11;
70 const long Tag_NodeGroups = 11;
71 const long Tag_EdgeGroups = 12;
72 const long Tag_FaceGroups = 13;
73 const long Tag_VolumeGroups = 14;
74 const long Tag_0DElementsGroups = 15;
75 const long Tag_BallElementsGroups = 16;
76 const long Tag_LastGroup = 16;
79 * Hypothesis definintion error
83 Hypothesis_Status state;
88 typedef sequence<AlgoStateError> algo_error_array;
91 * Mesh computation error
96 COMPERR_BAD_INPUT_MESH, // wrong mesh on lower submesh
97 COMPERR_STD_EXCEPTION , // some std exception raised
98 COMPERR_OCC_EXCEPTION , // OCC exception raised
99 COMPERR_SLM_EXCEPTION , // SALOME exception raised
100 COMPERR_EXCEPTION , // other exception raised
101 COMPERR_MEMORY_PB , // memory allocation problem
102 COMPERR_ALGO_FAILED , // computation failed
103 COMPERR_BAD_SHAPE , // bad geometry
104 COMPERR_WARNING , // algo reports error but sub-mesh is computed anyway
105 COMPERR_CANCELED , // compute canceled
106 COMPERR_NO_MESH_ON_SHAPE // no mesh elements assigned to sub-mesh
110 short code; // ComputeErrorName or, if negative, algo specific code
111 string comment; // textual problem description
113 short subShapeID; // id of sub-shape of a shape to mesh
114 boolean hasBadMesh; // there are elements preventing computation available for visualization
116 typedef sequence<ComputeError> compute_error_array;
119 interface SMESH_Gen : Engines::EngineComponent, SALOMEDS::Driver
121 //GEOM::GEOM_Gen SetGeomEngine( in string containerLoc );
122 void SetGeomEngine( in GEOM::GEOM_Gen geomcompo );
124 FilterManager CreateFilterManager();
126 SMESH_Pattern GetPattern();
128 Measurements CreateMeasurements();
133 void SetEmbeddedMode( in boolean theMode );
138 boolean IsEmbeddedMode();
141 Set the current study
143 void SetCurrentStudy( in SALOMEDS::Study theStudy );
146 Get the current study
148 SALOMEDS::Study GetCurrentStudy();
151 * Create a hypothesis that can be shared by differents parts of the mesh.
152 * An hypothesis is either:
153 * - a method used to generate or modify a part of the mesh (algorithm).
154 * - a parameter or a law used by an algorithm.
155 * Algorithms are 1D, 2D or 3D.
157 SMESH_Hypothesis CreateHypothesis( in string theHypName,
158 in string theLibName )
159 raises ( SALOME::SALOME_Exception );
162 * Return a hypothesis holding parameter values corresponding either to the mesh
163 * existing on the given geometry or to size of the geometry.
164 * The returned hypothesis may be the one existing in a study and used
165 * to compute the mesh, or a temporary one created just to pass parameter
168 SMESH_Hypothesis GetHypothesisParameterValues( in string theHypName,
169 in string theLibName,
170 in SMESH_Mesh theMesh,
171 in GEOM::GEOM_Object theGeom,
173 raises ( SALOME::SALOME_Exception );
176 * Sets number of segments per diagonal of boundary box of geometry by which
177 * default segment length of appropriate 1D hypotheses is defined
179 void SetBoundaryBoxSegmentation( in long theNbSegments ) raises ( SALOME::SALOME_Exception );
181 * \brief Sets default number of segments per edge
183 void SetDefaultNbSegments( in long theNbSegments) raises ( SALOME::SALOME_Exception );
186 * Set the object name
188 void SetName( in string theObjectIOR,
189 in string theObjectName )
190 raises ( SALOME::SALOME_Exception );
193 * Create a Mesh object, given a geometry shape.
194 * Mesh is created empty (no points, no elements).
195 * Shape is explored via GEOM_Client to create local copies.
196 * of TopoDS_Shapes and bind CORBA references of shape & subshapes
199 SMESH_Mesh CreateMesh( in GEOM::GEOM_Object theObject )
200 raises ( SALOME::SALOME_Exception );
203 * Create an empty mesh object
205 SMESH_Mesh CreateEmptyMesh()
206 raises ( SALOME::SALOME_Exception );
209 * Create Mesh object importing data from given UNV file
210 * (UNV supported version is I-DEAS 10)
212 SMESH_Mesh CreateMeshesFromUNV( in string theFileName )
213 raises ( SALOME::SALOME_Exception );
216 * Create Mesh object(s) importing data from given MED file
218 mesh_array CreateMeshesFromMED( in string theFileName,
219 out SMESH::DriverMED_ReadStatus theStatus )
220 raises ( SALOME::SALOME_Exception );
223 * Create Mesh object(s) importing data from given MED file
225 mesh_array CreateMeshesFromSAUV( in string theFileName,
226 out SMESH::DriverMED_ReadStatus theStatus )
227 raises ( SALOME::SALOME_Exception );
230 * Create Mesh object importing data from given STL file
232 SMESH_Mesh CreateMeshesFromSTL( in string theFileName )
233 raises ( SALOME::SALOME_Exception );
236 * Create Mesh object(s) importing data from given CGNS file
238 mesh_array CreateMeshesFromCGNS( in string theFileName,
239 out SMESH::DriverMED_ReadStatus theStatus )
240 raises ( SALOME::SALOME_Exception );
243 * Create Mesh object importing data from given GMF file
244 * \param theFileName - a name of file to import
245 * \param theMakeRequiredGroups - if true, groups of required entities will be created
247 SMESH_Mesh CreateMeshesFromGMF( in string theFileName,
248 in boolean theMakeRequiredGroups,
249 out SMESH::ComputeError theError)
250 raises ( SALOME::SALOME_Exception );
253 * Create a mesh by copying a part of another mesh
254 * \param meshPart - a part of mesh to copy
255 * \param meshName - a name of the new mesh
256 * \param toCopyGroups - to create in the new mesh groups
257 * the copied elements belongs to
258 * \param toKeepIDs - to preserve IDs of the copied elements or not
260 SMESH_Mesh CopyMesh(in SMESH_IDSource meshPart,
262 in boolean toCopyGroups,
263 in boolean toKeepIDs)
264 raises ( SALOME::SALOME_Exception );
267 * Concatenate the given meshes into one mesh.
268 * Union groups with the same name and type if
269 * theUniteIdenticalGroups flag is true.
270 * Merge coincident nodes and elements if
271 * theMergeNodesAndElements flag is true.
273 SMESH_Mesh Concatenate(in mesh_array theMeshesArray,
274 in boolean theUniteIdenticalGroups,
275 in boolean theMergeNodesAndElements,
276 in double theMergeTolerance)
277 raises ( SALOME::SALOME_Exception );
280 * Concatenate the given meshes into one mesh.
281 * Union groups with the same name and type if
282 * theUniteIdenticalGroups flag is true.
283 * Merge coincident nodes and elements if
284 * theMergeNodesAndElements flag is true.
285 * Create the groups of all elements from initial meshes.
287 SMESH_Mesh ConcatenateWithGroups(in mesh_array theMeshesArray,
288 in boolean theUniteIdenticalGroups,
289 in boolean theMergeNodesAndElements,
290 in double theMergeTolerance)
291 raises ( SALOME::SALOME_Exception );
295 * First, verify list of hypothesis associated with the Sub-shape,
296 * return NOK if hypothesis are not sufficient
298 boolean Compute( in SMESH_Mesh theMesh,
299 in GEOM::GEOM_Object theSubObject )
300 raises ( SALOME::SALOME_Exception );
303 * Cancel a computation.
305 void CancelCompute( in SMESH_Mesh theMesh,
306 in GEOM::GEOM_Object theSubObject );
309 * Return true if hypotheses are defined well
311 boolean IsReadyToCompute( in SMESH_Mesh theMesh,
312 in GEOM::GEOM_Object theSubObject )
313 raises ( SALOME::SALOME_Exception );
316 * Evaluates size of prospective mesh on a shape
318 long_array Evaluate(in SMESH_Mesh theMesh,
319 in GEOM::GEOM_Object theSubObject)
320 raises ( SALOME::SALOME_Exception );
323 * Calculate Mesh as preview till indicated dimension
324 * First, verify list of hypothesis associated with the Sub-shape.
325 * Return mesh preview structure
327 MeshPreviewStruct Precompute( in SMESH_Mesh theMesh,
328 in GEOM::GEOM_Object theSubObject,
329 in Dimension theDimension,
330 inout long_array theShapesId )
331 raises ( SALOME::SALOME_Exception );
334 * Return errors of hypotheses definintion
335 * algo_error_array is empty if everything is OK
337 algo_error_array GetAlgoState( in SMESH_Mesh theMesh,
338 in GEOM::GEOM_Object theSubObject )
339 raises ( SALOME::SALOME_Exception );
342 * Return errors of mesh computation
343 * compute_error_array is empty if everything is OK
345 compute_error_array GetComputeErrors( in SMESH_Mesh theMesh,
346 in GEOM::GEOM_Object theSubObject )
347 raises ( SALOME::SALOME_Exception );
350 * Return mesh elements preventing computation of a sub-shape
352 MeshPreviewStruct GetBadInputElements( in SMESH_Mesh theMesh,
353 in short theSubShapeID )
354 raises ( SALOME::SALOME_Exception );
357 * Create groups of elements preventing computation of a sub-shape
359 SMESH::ListOfGroups MakeGroupsOfBadInputElements( in SMESH_Mesh theMesh,
360 in short theSubShapeID,
361 in string theGroupName)
362 raises ( SALOME::SALOME_Exception );
365 * Return indeces of faces, edges and vertices of given sub-shapes
366 * within theMainObject
368 long_array GetSubShapesId( in GEOM::GEOM_Object theMainObject,
369 in object_array theListOfSubObjects )
370 raises ( SALOME::SALOME_Exception );
373 * Return geometrical object the given element is built on.
374 * The returned geometrical object, if not nil, is either found in the
375 * study or is published by this method with the given name
377 GEOM::GEOM_Object GetGeometryByMeshElement( in SMESH_Mesh theMesh,
378 in long theElementID,
379 in string theGeomName)
380 raises ( SALOME::SALOME_Exception );
383 * Return geometrical object the given element is built on.
384 * The returned geometrical object not published in study by this method.
386 GEOM::GEOM_Object FindGeometryByMeshElement( in SMESH_Mesh theMesh,
387 in long theElementID)
388 raises ( SALOME::SALOME_Exception );
391 * \brief Return id of object, registered in current study context
393 * Can be used to check if the object was created in the same container, as this engine.
395 long GetObjectId(in Object theObject);
398 * \brief Get MED version of the file by its name.
400 boolean GetMEDVersion(in string theFileName, out MED_VERSION theVersion);
403 * \brief Get names of meshes defined in file with the specified name.
405 string_array GetMeshNames(in string theFileName);
408 * \brief Moves objects to the specified position
410 * This function is used in the drag-n-drop functionality.
412 * \param what objects being moved
413 * \param where parent object where objects are moved to
414 * \param row position in the parent object's children list at which objects are moved
416 void Move( in sobject_list what,
417 in SALOMEDS::SObject where,