Version: 9.12.0
SMESH_Gen.idl
Go to the documentation of this file.
1 // Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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, or (at your option) any later version.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 // File : SMESH_Gen.idl
23 // Author : Paul RASCLE, EDF
24 
25 #ifndef _SMESH_GEN_IDL_
26 #define _SMESH_GEN_IDL_
27 
28 #include "SALOME_Exception.idl"
29 #include "SALOME_Component.idl"
30 #include "SALOMEDS.idl"
31 
32 #include "GEOM_Gen.idl"
33 
34 #include "SMESH_Mesh.idl"
35 #include "SMESH_Hypothesis.idl"
36 #include "SMESH_smIdType.idl"
37 
39 {
40  interface HOMARD_Gen;
41 };
42 
43 module SMESH
44 {
45  typedef sequence<SALOMEDS::SObject> sobject_list;
46  typedef sequence<GEOM::GEOM_Object> object_array;
47  typedef sequence<SMESH_Mesh> mesh_array;
48 
49  interface FilterManager;
50  interface SMESH_Pattern;
51  interface Measurements;
52  interface MG_ADAPT;
53  interface MG_ADAPT_OBJECT;
54 
58  // Top level
59  const long Tag_HypothesisRoot = 1; // hypotheses root
60  const long Tag_AlgorithmsRoot = 2; // algorithms root
61  const long Tag_FirstMeshRoot = 3; // first mesh root
62  // Mesh/Submesh
63  const long Tag_RefOnShape = 1; // references to shape
64  const long Tag_RefOnAppliedHypothesis = 2; // applied hypotheses root
65  const long Tag_RefOnAppliedAlgorithms = 3; // applied algorithms root
66  // Mesh only: sub-meshes roots by type
67  const long Tag_FirstSubMesh = 4;
68  const long Tag_SubMeshOnVertex = 4;
69  const long Tag_SubMeshOnEdge = 5;
70  const long Tag_SubMeshOnWire = 6;
71  const long Tag_SubMeshOnFace = 7;
72  const long Tag_SubMeshOnShell = 8;
73  const long Tag_SubMeshOnSolid = 9;
74  const long Tag_SubMeshOnCompound = 10;
75  const long Tag_LastSubMesh = 10;
76  // Mesh only: group roots by type
77  const long Tag_FirstGroup = 11;
78  const long Tag_NodeGroups = 11;
79  const long Tag_EdgeGroups = 12;
80  const long Tag_FaceGroups = 13;
81  const long Tag_VolumeGroups = 14;
82  const long Tag_0DElementsGroups = 15;
83  const long Tag_BallElementsGroups = 16;
84  const long Tag_LastGroup = 16;
85 
90  {
92  string algoName;
93  long algoDim;
94  boolean isGlobalAlgo;
95  };
96  typedef sequence<AlgoStateError> algo_error_array;
97 
102  {
104  COMPERR_BAD_INPUT_MESH, // wrong mesh on lower submesh
105  COMPERR_STD_EXCEPTION , // some std exception raised
106  COMPERR_OCC_EXCEPTION , // OCC exception raised
107  COMPERR_SLM_EXCEPTION , // SALOME exception raised
108  COMPERR_EXCEPTION , // other exception raised
109  COMPERR_MEMORY_PB , // memory allocation problem
110  COMPERR_ALGO_FAILED , // computation failed
111  COMPERR_BAD_SHAPE , // bad geometry
112  COMPERR_WARNING , // algo reports error but sub-mesh is computed anyway
113  COMPERR_CANCELED , // compute canceled
114  COMPERR_NO_MESH_ON_SHAPE,// no mesh elements assigned to sub-mesh
115  COMPERR_BAD_PARMETERS // incorrect hypotheses parameters
116  };
118  {
119  short code; // ComputeErrorName or, if negative, algo specific code
120  string comment; // textual problem description
121  string algoName;
122  long subShapeID; // id of sub-shape of a shape to mesh
123  boolean hasBadMesh; // there are elements preventing computation available for visualization
124  };
125  typedef sequence<ComputeError> compute_error_array;
126 
131  {
132  short way; // 0 - by mesh, 1 - by geometry size + preferred parameters, 2 - by averageLength
134  boolean quadDominated;
135  };
136 
137  interface SMESH_Gen : Engines::EngineComponent, SALOMEDS::Driver
138  {
139  //GEOM::GEOM_Gen SetGeomEngine( in string containerLoc );
140  void SetGeomEngine( in GEOM::GEOM_Gen geomcompo );
141 
143 
145 
147 
151  void SetEmbeddedMode( in boolean theMode );
152 
156  boolean IsEmbeddedMode();
157 
161  void UpdateStudy();
162 
166  void SetEnablePublish( in boolean theIsEnablePublish );
167 
171  boolean IsEnablePublish();
172 
180  SMESH_Hypothesis CreateHypothesis( in string theHypName,
181  in string theLibName )
182  raises ( SALOME::SALOME_Exception );
183 
188  in string theLibName,
189  in double theAverageLength,
190  in boolean theQuadDominated)
191  raises ( SALOME::SALOME_Exception );
192 
201  in string theLibName,
202  in SMESH_Mesh theMesh,
203  in GEOM::GEOM_Object theGeom,
204  in HypInitParams theWay)
205  raises ( SALOME::SALOME_Exception );
206 
215  out SMESH_Mesh theMesh,
216  out GEOM::GEOM_Object theShape);
217 
222  void SetBoundaryBoxSegmentation( in long theNbSegments ) raises ( SALOME::SALOME_Exception );
226  void SetDefaultNbSegments( in long theNbSegments) raises ( SALOME::SALOME_Exception );
227 
231  void SetName( in string theObjectIOR,
232  in string theObjectName )
233  raises ( SALOME::SALOME_Exception );
234 
242  SMESH_Mesh CreateMesh( in GEOM::GEOM_Object theObject )
243  raises ( SALOME::SALOME_Exception );
244 
253  SMESH_ParallelMesh CreateParallelMesh( in GEOM::GEOM_Object theObject )
254  raises ( SALOME::SALOME_Exception );
259  raises ( SALOME::SALOME_Exception );
260 
265  SMESH_Mesh CreateMeshesFromUNV( in string theFileName )
266  raises ( SALOME::SALOME_Exception );
267 
271  mesh_array CreateMeshesFromMED( in string theFileName,
272  out SMESH::DriverMED_ReadStatus theStatus )
273  raises ( SALOME::SALOME_Exception );
274 
278  SMESH_Mesh CreateMeshesFromSTL( in string theFileName )
279  raises ( SALOME::SALOME_Exception );
280 
284  mesh_array CreateMeshesFromCGNS( in string theFileName,
285  out SMESH::DriverMED_ReadStatus theStatus )
286  raises ( SALOME::SALOME_Exception );
287 
293  SMESH_Mesh CreateMeshesFromGMF( in string theFileName,
294  in boolean theMakeRequiredGroups,
295  out SMESH::ComputeError theError)
296  raises ( SALOME::SALOME_Exception );
303  SMESH_Mesh CreateDualMesh(in SMESH_IDSource mesh,
304  in string meshName,
305  in boolean adaptToShape)
306  raises ( SALOME::SALOME_Exception );
307 
316  SMESH_Mesh CopyMesh(in SMESH_IDSource meshPart,
317  in string meshName,
318  in boolean toCopyGroups,
319  in boolean toKeepIDs)
320  raises ( SALOME::SALOME_Exception );
321 
340  boolean CopyMeshWithGeom( in SMESH_Mesh sourceMesh,
341  in GEOM::GEOM_Object newGeometry,
342  in string meshName,
343  in boolean toCopyGroups,
344  in boolean toReuseHypotheses,
345  in boolean toCopyElements,
346  out SMESH_Mesh newMesh,
347  out ListOfGroups newGroups,
348  out submesh_array newSubmeshes,
349  out ListOfHypothesis newHypotheses,
350  out string_array invalidEntries)
351  raises ( SALOME::SALOME_Exception );
352 
361  SMESH_Mesh Concatenate(in ListOfIDSources theMeshesArray,
362  in boolean theUniteIdenticalGroups,
363  in boolean theMergeNodesAndElements,
364  in double theMergeTolerance,
365  in SMESH_Mesh theMeshToAppendTo)
366  raises ( SALOME::SALOME_Exception );
367 
377  SMESH_Mesh ConcatenateWithGroups(in ListOfIDSources theMeshesArray,
378  in boolean theUniteIdenticalGroups,
379  in boolean theMergeNodesAndElements,
380  in double theMergeTolerance,
381  in SMESH_Mesh theMeshToAppendTo)
382  raises ( SALOME::SALOME_Exception );
383 
389  boolean Compute( in SMESH_Mesh theMesh,
390  in GEOM::GEOM_Object theSubObject )
391  raises ( SALOME::SALOME_Exception );
392 
396  void CancelCompute( in SMESH_Mesh theMesh,
397  in GEOM::GEOM_Object theSubObject );
398 
402  boolean IsReadyToCompute( in SMESH_Mesh theMesh,
403  in GEOM::GEOM_Object theSubObject )
404  raises ( SALOME::SALOME_Exception );
405 
410  in GEOM::GEOM_Object theSubObject)
411  raises ( SALOME::SALOME_Exception );
412 
418  MeshPreviewStruct Precompute( in SMESH_Mesh theMesh,
419  in GEOM::GEOM_Object theSubObject,
420  in Dimension theDimension,
421  inout long_array theShapesId )
422  raises ( SALOME::SALOME_Exception );
423 
429  in GEOM::GEOM_Object theSubObject )
430  raises ( SALOME::SALOME_Exception );
431 
436  compute_error_array GetComputeErrors( in SMESH_Mesh theMesh,
437  in GEOM::GEOM_Object theSubObject )
438  raises ( SALOME::SALOME_Exception );
439 
443  MeshPreviewStruct GetBadInputElements( in SMESH_Mesh theMesh,
444  in short theSubShapeID )
445  raises ( SALOME::SALOME_Exception );
446 
450  SMESH::ListOfGroups MakeGroupsOfBadInputElements( in SMESH_Mesh theMesh,
451  in short theSubShapeID,
452  in string theGroupName)
453  raises ( SALOME::SALOME_Exception );
454 
459  long_array GetSubShapesId( in GEOM::GEOM_Object theMainObject,
460  in object_array theListOfSubObjects )
461  raises ( SALOME::SALOME_Exception );
462 
468  GEOM::GEOM_Object GetGeometryByMeshElement( in SMESH_Mesh theMesh,
469  in smIdType theElementID,
470  in string theGeomName)
471  raises ( SALOME::SALOME_Exception );
472 
477  GEOM::GEOM_Object FindGeometryByMeshElement( in SMESH_Mesh theMesh,
478  in smIdType theElementID)
479  raises ( SALOME::SALOME_Exception );
480 
486  long GetObjectId(in Object theObject);
487 
491  string GetMEDFileVersion();
492 
496  string GetMEDVersion(in string theFileName);
497 
501  boolean CheckCompatibility(in string theFileName);
502 
506  boolean CheckWriteCompatibility(in string theFileName);
507 
511  string_array GetMeshNames(in string theFileName);
512 
521  void Move( in sobject_list what,
522  in SALOMEDS::SObject where,
523  in long row );
532  boolean IsApplicable( in string theAlgoType,
533  in string theLibName,
534  in GEOM::GEOM_Object theShapeObject,
535  in boolean toCheckAll );
536 
537 
547  long_array GetInsideSphere( in SMESH_IDSource theSource,
548  in ElementType theElemType,
549  in double theX,
550  in double theY,
551  in double theZ,
552  in double theR );
553 
565  long_array GetInsideBox( in SMESH_IDSource theSource,
566  in ElementType theElemType,
567  in double theX1,
568  in double theY1,
569  in double theZ1,
570  in double theX2,
571  in double theY2,
572  in double theZ2);
586  long_array GetInsideCylinder( in SMESH_IDSource theSource,
587  in ElementType theElemType,
588  in double theX,
589  in double theY,
590  in double theZ,
591  in double theDX,
592  in double theDY,
593  in double theDZ,
594  in double theH,
595  in double theR );
603  long_array GetInside( in SMESH_IDSource theSource,
604  in ElementType theElemType,
605  in GEOM::GEOM_Object theGeom,
606  in double theTolerance );
607 
608  MG_ADAPT CreateMG_ADAPT();
609  SMESHHOMARD::HOMARD_Gen CreateHOMARD_ADAPT() raises ( SALOME::SALOME_Exception );
610  //MG_ADAPT_OBJECT Adaptation(in string adaptType);
611  SALOME::GenericObj Adaptation(in string adaptType) raises ( SALOME::SALOME_Exception );
612  MG_ADAPT CreateAdaptationHypothesis();
613  };
614 
615 };
616 
617 #endif
@ COMPERR_CANCELED
compute canceled
Definition: SMESH_ComputeError.hxx:56
@ COMPERR_NO_MESH_ON_SHAPE
no mesh elements assigned to sub-shape
Definition: SMESH_ComputeError.hxx:57
@ COMPERR_WARNING
algo reports error but sub-mesh is computed anyway
Definition: SMESH_ComputeError.hxx:55
@ COMPERR_BAD_SHAPE
bad geometry
Definition: SMESH_ComputeError.hxx:54
@ COMPERR_SLM_EXCEPTION
SALOME exception raised.
Definition: SMESH_ComputeError.hxx:50
@ COMPERR_MEMORY_PB
std::bad_alloc exception
Definition: SMESH_ComputeError.hxx:52
@ COMPERR_BAD_INPUT_MESH
wrong mesh on lower submesh
Definition: SMESH_ComputeError.hxx:47
@ COMPERR_EXCEPTION
other exception raised
Definition: SMESH_ComputeError.hxx:51
@ COMPERR_OK
Definition: SMESH_ComputeError.hxx:46
@ COMPERR_ALGO_FAILED
algo failed for some reason
Definition: SMESH_ComputeError.hxx:53
@ COMPERR_BAD_PARMETERS
incorrect hypotheses parameters
Definition: SMESH_ComputeError.hxx:58
@ COMPERR_OCC_EXCEPTION
OCC exception raised.
Definition: SMESH_ComputeError.hxx:49
@ COMPERR_STD_EXCEPTION
some std exception raised
Definition: SMESH_ComputeError.hxx:48
bool Compute(::SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, const int aFlags=COMPACT_MESH, const ::MeshDimension aDim=::MeshDim_3D, TSetOfInt *aShapesId=0, TopTools_IndexedMapOfShape *anAllowedSubShapes=0)
Computes aMesh on aShape.
bool Evaluate(::SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, MapShapeNbElems &aResMap, const bool anUpward=false, TSetOfInt *aShapesId=0)
evaluates size of prospective mesh on a shape
void CancelCompute(::SMESH_Mesh &aMesh, const TopoDS_Shape &aShape)
bool GetAlgoState(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, std::list< SMESH_Gen::TAlgoStateError > &theErrors)
Definition: SMESH_Gen.cxx:1196
Definition: SMESH_Homard.idl:108
Interface of Filter manager.
Definition: SMESH_Filter.idl:581
Definition: MG_ADAPT.idl:138
Definition: SMESH_Measurements.idl:47
Definition: SMESH_Gen.idl:138
void SetDefaultNbSegments(in long theNbSegments)
Sets default number of segments per edge.
void SetEnablePublish(in boolean theIsEnablePublish)
Set enable publishing in the study.
void SetName(in string theObjectIOR, in string theObjectName)
Set the object name.
boolean IsEnablePublish()
Get enable publishing in the study.
boolean IsEmbeddedMode()
Get the current mode.
boolean GetSoleSubMeshUsingHyp(in SMESH_Hypothesis theHyp, out SMESH_Mesh theMesh, out GEOM::GEOM_Object theShape)
Returns True if a hypothesis is assigned to a sole sub-mesh in a current Study.
void SetEmbeddedMode(in boolean theMode)
Set the current mode.
SMESH_ParallelMesh CreateParallelMesh(in GEOM::GEOM_Object theObject)
Create a Mesh object, given a geometry shape.
SMESH_Pattern GetPattern()
Measurements CreateMeasurements()
SMESH_Hypothesis CreateHypothesisByAverageLength(in string theHypName, in string theLibName, in double theAverageLength, in boolean theQuadDominated)
Create a hypothesis and initialize it by average length.
void SetGeomEngine(in GEOM::GEOM_Gen geomcompo)
void UpdateStudy()
Update the study.
SMESH_Mesh CreateMesh(in GEOM::GEOM_Object theObject)
Create a Mesh object, given a geometry shape.
FilterManager CreateFilterManager()
SMESH_Hypothesis CreateHypothesis(in string theHypName, in string theLibName)
Create a hypothesis that can be shared by different parts of the mesh.
void SetBoundaryBoxSegmentation(in long theNbSegments)
Sets number of segments per diagonal of boundary box of geometry by which default segment length of a...
SMESH_Mesh CreateEmptyMesh()
Create an empty mesh object.
SMESH_Hypothesis GetHypothesisParameterValues(in string theHypName, in string theLibName, in SMESH_Mesh theMesh, in GEOM::GEOM_Object theGeom, in HypInitParams theWay)
Return a hypothesis holding parameter values corresponding either to the mesh existing on the given g...
Definition: SMESH_Hypothesis.idl:45
Definition: SMESH_Mesh.idl:286
Definition: SMESH_Mesh.idl:338
Definition: SMESH_Mesh.idl:1106
SMESH_Pattern: interface of mesh pattern.
Definition: SMESH_Pattern.idl:42
bool CheckCompatibility(const std::string &fileName, bool isForAppend)
: Check read or write(append) Compatibility of a med file
Definition: MED_Factory.cxx:114
bool GetMEDVersion(const std::string &fileName, int &major, int &minor, int &release)
Definition: MED_Factory.cxx:150
Definition: MG_ADAPT.hxx:36
Definition: SMESH_Gen.idl:39
Definition: SMESH_ControlsDef.hxx:64
const long Tag_NodeGroups
Definition: SMESH_Gen.idl:78
const long Tag_SubMeshOnFace
Definition: SMESH_Gen.idl:71
const long Tag_FirstMeshRoot
Definition: SMESH_Gen.idl:61
const long Tag_SubMeshOnCompound
Definition: SMESH_Gen.idl:74
const long Tag_FirstSubMesh
Definition: SMESH_Gen.idl:67
const long Tag_SubMeshOnSolid
Definition: SMESH_Gen.idl:73
sequence< AlgoStateError > algo_error_array
Definition: SMESH_Gen.idl:96
Hypothesis_Status
Enumeration for hypothesis status (used by AddHypothesis() and RemoveHypothesis() methods)
Definition: SMESH_Mesh.idl:208
bool IsApplicable(const QString &aHypType, GEOM::GEOM_Object_ptr theGeomObject, const bool toCheckAll)
Definition: SMESHGUI_HypothesesUtils.cxx:617
const long Tag_FaceGroups
Definition: SMESH_Gen.idl:80
sequence< GEOM::GEOM_Object > object_array
Definition: SMESH_Gen.idl:46
sequence< SMESH_subMesh > submesh_array
Definition: SMESH_Mesh.idl:332
const long Tag_SubMeshOnVertex
Definition: SMESH_Gen.idl:68
sequence< SMESH_IDSource > ListOfIDSources
Definition: SMESH_Mesh.idl:40
const long Tag_RefOnShape
Definition: SMESH_Gen.idl:63
sequence< ComputeError > compute_error_array
Definition: SMESH_Gen.idl:125
sequence< smIdType > smIdType_array
Definition: SMESH_Mesh.idl:45
ComputeErrorName
Mesh computation error.
Definition: SMESH_Gen.idl:102
const long Tag_EdgeGroups
Definition: SMESH_Gen.idl:79
const long Tag_AlgorithmsRoot
Definition: SMESH_Gen.idl:60
const long Tag_SubMeshOnWire
Definition: SMESH_Gen.idl:70
Dimension
Definition: SMESH_Hypothesis.idl:35
const long Tag_RefOnAppliedHypothesis
Definition: SMESH_Gen.idl:64
const long Tag_LastGroup
Definition: SMESH_Gen.idl:84
const long Tag_FirstGroup
Definition: SMESH_Gen.idl:77
const long Tag_SubMeshOnEdge
Definition: SMESH_Gen.idl:69
ElementType
Enumeration for element type, like in SMDS.
Definition: SMESH_Mesh.idl:128
sequence< string > string_array
Definition: SMESH_Mesh.idl:46
sequence< SMESH_Hypothesis > ListOfHypothesis
Definition: SMESH_Mesh.idl:36
sequence< SMESH_GroupBase > ListOfGroups
Definition: SMESH_Mesh.idl:38
sequence< SMESH_Mesh > mesh_array
Definition: SMESH_Gen.idl:47
sequence< SALOMEDS::SObject > sobject_list
Definition: SMESH_Gen.idl:45
const long Tag_RefOnAppliedAlgorithms
Definition: SMESH_Gen.idl:65
const long Tag_BallElementsGroups
Definition: SMESH_Gen.idl:83
DriverMED_ReadStatus
Enumeration for mesh read status (used by SMESH_Gen::CreateMeshesFrom*() methods)
Definition: SMESH_Mesh.idl:231
const long Tag_0DElementsGroups
Definition: SMESH_Gen.idl:82
const long Tag_VolumeGroups
Definition: SMESH_Gen.idl:81
sequence< long > long_array
Definition: SMESH_Mesh.idl:44
const long Tag_HypothesisRoot
Tags definition.
Definition: SMESH_Gen.idl:59
const long Tag_LastSubMesh
Definition: SMESH_Gen.idl:75
const long Tag_SubMeshOnShell
Definition: SMESH_Gen.idl:72
Hypothesis definition error.
Definition: SMESH_Gen.idl:90
string algoName
Definition: SMESH_Gen.idl:92
long algoDim
Definition: SMESH_Gen.idl:93
Hypothesis_Status state
Definition: SMESH_Gen.idl:91
boolean isGlobalAlgo
Definition: SMESH_Gen.idl:94
Definition: SMESH_Gen.idl:118
short code
Definition: SMESH_Gen.idl:119
string comment
Definition: SMESH_Gen.idl:120
boolean hasBadMesh
Definition: SMESH_Gen.idl:123
string algoName
Definition: SMESH_Gen.idl:121
long subShapeID
Definition: SMESH_Gen.idl:122
Way to initialize hypothesis.
Definition: SMESH_Gen.idl:131
short way
Definition: SMESH_Gen.idl:132
double averageLength
Definition: SMESH_Gen.idl:133
boolean quadDominated
Definition: SMESH_Gen.idl:134
Structure containing mesh edit preview data.
Definition: SMESH_Mesh.idl:279