idl/SMESH_Mesh.idl

Go to the documentation of this file.
00001 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00002 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00003 //
00004 //  This library is free software; you can redistribute it and/or
00005 //  modify it under the terms of the GNU Lesser General Public
00006 //  License as published by the Free Software Foundation; either
00007 //  version 2.1 of the License.
00008 //
00009 //  This library is distributed in the hope that it will be useful,
00010 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 //  Lesser General Public License for more details.
00013 //
00014 //  You should have received a copy of the GNU Lesser General Public
00015 //  License along with this library; if not, write to the Free Software
00016 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00017 //
00018 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00019 //
00020 //
00021 //
00022 //  File   : SMESH_Mesh.idl
00023 //  Author : Paul RASCLE, EDF
00024 //  $Header: /home/server/cvs/SMESH/SMESH_SRC/idl/SMESH_Mesh.idl,v 1.18.2.9 2007/03/15 06:55:40 jfa Exp $
00025 
00026 #ifndef _SMESH_MESH_IDL_
00027 #define _SMESH_MESH_IDL_
00028 
00029 #include "SALOME_Exception.idl"
00030 #include "SALOME_GenericObj.idl"
00031 #include "GEOM_Gen.idl"
00032 #include "MED.idl"
00033 
00034 module SMESH
00035 {
00036   interface SMESH_Hypothesis;
00037   typedef sequence<SMESH_Hypothesis> ListOfHypothesis;
00038   interface SMESH_GroupBase;
00039   typedef sequence<SMESH_GroupBase> ListOfGroups;
00040 
00041   typedef sequence<double    > double_array ;
00042   typedef sequence<long      > long_array ;
00043   typedef sequence<string    > string_array ;
00044   typedef sequence<long_array> array_of_long_array ;
00045 
00046   enum log_command
00047     {
00048       ADD_NODE,
00049       ADD_EDGE,
00050       ADD_TRIANGLE,
00051       ADD_QUADRANGLE,
00052       ADD_POLYGON,
00053       ADD_TETRAHEDRON,
00054       ADD_PYRAMID,
00055       ADD_PRISM,
00056       ADD_HEXAHEDRON,
00057       ADD_POLYHEDRON,
00058       REMOVE_NODE,
00059       REMOVE_ELEMENT,
00060       MOVE_NODE,
00061       CHANGE_ELEMENT_NODES,
00062       CHANGE_POLYHEDRON_NODES,
00063       RENUMBER,
00064       ADD_QUADEDGE,
00065       ADD_QUADTRIANGLE,
00066       ADD_QUADQUADRANGLE,
00067       ADD_QUADTETRAHEDRON,
00068       ADD_QUADPYRAMID,
00069       ADD_QUADPENTAHEDRON,
00070       ADD_QUADHEXAHEDRON
00071     };
00072 
00073   struct log_block
00074   {
00075     long commandType;
00076     long number;
00077     double_array coords;
00078     long_array indexes;
00079   };
00080 
00081   struct PointStruct { double x;
00082                  double y;
00083                  double z; } ;
00084 
00085   typedef sequence<PointStruct> nodes_array;
00086 
00087   struct DirStruct   { PointStruct PS ; } ;          // analog to Occ Direction
00088 
00089   struct AxisStruct  { double x;
00090                  double y;
00091                  double z;
00092                  double vx;
00093                  double vy;
00094                  double vz; } ;
00095 
00096 
00100   enum ElementType
00101   {
00102     ALL,
00103     NODE,
00104     EDGE,
00105     FACE,
00106     VOLUME
00107   };
00108   
00112   enum ElementOrder {
00113     ORDER_ANY,          
00114     ORDER_LINEAR,       
00115     ORDER_QUADRATIC     
00116   };
00117 
00121   enum Hypothesis_Status // in the order of severity
00122   {
00123     HYP_OK,
00124     HYP_MISSING,      // algo misses a hypothesis
00125     HYP_CONCURENT,    // several applicable hypotheses
00126     HYP_BAD_PARAMETER,// hypothesis has a bad parameter value
00127     HYP_HIDDEN_ALGO,  // an algo is hidden by an upper dim algo generating all-dim elements
00128     HYP_HIDING_ALGO,  // an algo hides lower dim algos by generating all-dim elements
00129     HYP_UNKNOWN_FATAL,//  --- all statuses below should be considered as fatal
00130                       //      for Add/RemoveHypothesis operations
00131     HYP_INCOMPATIBLE, // hypothesis does not fit algo
00132     HYP_NOTCONFORM,   // not conform mesh is produced appling a hypothesis
00133     HYP_ALREADY_EXIST,// such hypothesis already exist
00134     HYP_BAD_DIM,      // bad dimension
00135     HYP_BAD_SUBSHAPE, // shape is neither the main one, nor its subshape, nor a group
00136     HYP_BAD_GEOMETRY  // geometry mismatches algorithm's expectation
00137   };
00138 
00142   enum DriverMED_ReadStatus // in the order of severity
00143   {
00144     DRS_OK,
00145     DRS_EMPTY,          // a MED file contains no mesh with the given name
00146     DRS_WARN_RENUMBER,  // a MED file has overlapped ranges of element numbers,
00147                         // so the numbers from the file are ignored
00148     DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
00149     DRS_FAIL            // general failure (exception etc.)
00150   };
00151 
00155   enum MED_VERSION // in the order of severity
00156   {
00157     MED_V2_1,
00158     MED_V2_2
00159   };
00160 
00161   typedef sequence<log_block> log_array;
00162 
00163 
00169   const long EXTRUSION_FLAG_BOUNDARY = 1;
00170   const long EXTRUSION_FLAG_SEW = 2;
00171   
00172   interface SMESH_IDSource
00173   {
00177     long_array GetIDs();
00178   };
00179 
00180   interface SMESH_Group;
00181   interface SMESH_GroupOnGeom;
00182   interface SMESH_subMesh;
00183   interface SMESH_MeshEditor;
00184   interface SMESH_Mesh : SALOME::GenericObj, SMESH_IDSource
00185   {
00189     boolean HasShapeToMesh()
00190       raises (SALOME::SALOME_Exception);
00191 
00196     GEOM::GEOM_Object GetShapeToMesh()
00197       raises (SALOME::SALOME_Exception);
00198 
00199 
00206     SMESH_subMesh GetSubMesh(in GEOM::GEOM_Object aSubObject, in string name)
00207       raises (SALOME::SALOME_Exception);
00208 
00212     void RemoveSubMesh(in SMESH_subMesh aSubMesh)
00213       raises (SALOME::SALOME_Exception);
00214 
00215 
00219     SMESH_Group CreateGroup( in ElementType elem_type,
00220                     in string name )
00221       raises (SALOME::SALOME_Exception);
00222 
00226     SMESH_GroupOnGeom CreateGroupFromGEOM( in ElementType elem_type,
00227                                           in string name,
00228                                           in GEOM::GEOM_Object theGeomObject )
00229       raises (SALOME::SALOME_Exception);
00230 
00234     void RemoveGroup(in SMESH_GroupBase aGroup)
00235       raises (SALOME::SALOME_Exception);
00236 
00240     void RemoveGroupWithContents( in SMESH_GroupBase aGroup )
00241       raises (SALOME::SALOME_Exception);
00242 
00246     ListOfGroups GetGroups()
00247       raises (SALOME::SALOME_Exception);
00248 
00254     SMESH_Group UnionGroups (in SMESH_GroupBase aGroup1,
00255                              in SMESH_GroupBase aGroup2,
00256                              in string          name )
00257       raises (SALOME::SALOME_Exception);
00258 
00264     SMESH_Group IntersectGroups (in SMESH_GroupBase aGroup1,
00265                                  in SMESH_GroupBase aGroup2,
00266                                  in string          name )
00267       raises (SALOME::SALOME_Exception);
00268 
00274     SMESH_Group CutGroups (in SMESH_GroupBase aMainGroup,
00275                   in SMESH_GroupBase aToolGroup,
00276                   in string          name )
00277       raises (SALOME::SALOME_Exception);
00278 
00296     Hypothesis_Status AddHypothesis(in GEOM::GEOM_Object aSubObject,
00297                         in SMESH_Hypothesis anHyp)
00298       raises (SALOME::SALOME_Exception);
00299 //     boolean AddHypothesis(in SMESH_subMesh aSubMesh, in SMESH_Hypothesis anHyp)
00300 //       raises (SALOME::SALOME_Exception);
00301 
00305     Hypothesis_Status RemoveHypothesis(in GEOM::GEOM_Object aSubObject,
00306                            in SMESH_Hypothesis anHyp)
00307       raises (SALOME::SALOME_Exception);
00308 //     boolean RemoveHypothesis(in SMESH_subMesh aSubMesh,
00309 //                  in SMESH_Hypothesis anHyp)
00310 //       raises (SALOME::SALOME_Exception);
00311 
00315     ListOfHypothesis GetHypothesisList(in GEOM::GEOM_Object aSubObject)
00316       raises (SALOME::SALOME_Exception);
00317 //     ListOfHypothesis GetHypothesisList(in SMESH_subMesh aSubMesh)
00318 //       raises (SALOME::SALOME_Exception);
00319 
00326     //    string_array GetLog(in boolean clearAfterGet)
00327     //      raises (SALOME::SALOME_Exception);
00328     log_array GetLog(in boolean clearAfterGet)
00329       raises (SALOME::SALOME_Exception);
00330 
00335     void ClearLog()
00336       raises (SALOME::SALOME_Exception);
00337 
00341     long GetId();
00342 
00346     long GetStudyId();
00347 
00351     SMESH_MeshEditor GetMeshEditor()
00352       raises (SALOME::SALOME_Exception);
00353 
00358     SMESH_MeshEditor GetMeshEditPreviewer()
00359       raises (SALOME::SALOME_Exception);
00360 
00364     boolean HasDuplicatedGroupNamesMED();
00365 
00374     void ExportToMED( in string file, in boolean auto_groups, in MED_VERSION theVersion )
00375       raises (SALOME::SALOME_Exception);
00376 
00382     void ExportMED( in string file, in boolean auto_groups )
00383       raises (SALOME::SALOME_Exception);
00384 
00389     void ExportDAT( in string file )
00390       raises (SALOME::SALOME_Exception);
00391     void ExportUNV( in string file )
00392       raises (SALOME::SALOME_Exception);
00393     void ExportSTL( in string file, in boolean isascii )
00394       raises (SALOME::SALOME_Exception);
00395 
00399     SALOME_MED::MESH GetMEDMesh()
00400       raises (SALOME::SALOME_Exception);
00401 
00405     long NbNodes()
00406       raises (SALOME::SALOME_Exception);
00407 
00408     long NbElements()
00409       raises (SALOME::SALOME_Exception);
00410 
00411     long NbEdges()
00412       raises (SALOME::SALOME_Exception);
00413 
00414     long NbEdgesOfOrder(in ElementOrder order)
00415       raises (SALOME::SALOME_Exception);
00416 
00417     long NbFaces()
00418       raises (SALOME::SALOME_Exception);
00419 
00420     long NbFacesOfOrder(in ElementOrder order)
00421       raises (SALOME::SALOME_Exception);
00422 
00423     long NbTriangles()
00424       raises (SALOME::SALOME_Exception);
00425 
00426     long NbTrianglesOfOrder(in ElementOrder order)
00427       raises (SALOME::SALOME_Exception);
00428 
00429     long NbQuadrangles()
00430       raises (SALOME::SALOME_Exception);
00431 
00432     long NbQuadranglesOfOrder(in ElementOrder order)
00433       raises (SALOME::SALOME_Exception);
00434 
00435     long NbPolygons()
00436       raises (SALOME::SALOME_Exception);
00437 
00438     long NbVolumes()
00439       raises (SALOME::SALOME_Exception);
00440 
00441     long NbVolumesOfOrder(in ElementOrder order)
00442       raises (SALOME::SALOME_Exception);
00443 
00444     long NbTetras()
00445       raises (SALOME::SALOME_Exception);
00446 
00447     long NbTetrasOfOrder(in ElementOrder order)
00448       raises (SALOME::SALOME_Exception);
00449 
00450     long NbHexas()
00451       raises (SALOME::SALOME_Exception);
00452 
00453     long NbHexasOfOrder(in ElementOrder order)
00454       raises (SALOME::SALOME_Exception);
00455 
00456     long NbPyramids()
00457       raises (SALOME::SALOME_Exception);
00458 
00459     long NbPyramidsOfOrder(in ElementOrder order)
00460       raises (SALOME::SALOME_Exception);
00461 
00462     long NbPrisms()
00463       raises (SALOME::SALOME_Exception);
00464 
00465     long NbPrismsOfOrder(in ElementOrder order)
00466       raises (SALOME::SALOME_Exception);
00467 
00468     long NbPolyhedrons()
00469       raises (SALOME::SALOME_Exception);
00470 
00471     long NbSubMesh()
00472       raises (SALOME::SALOME_Exception);
00473 
00474     long_array GetElementsId()
00475       raises (SALOME::SALOME_Exception);
00476 
00477     long_array GetElementsByType( in ElementType theType )
00478       raises (SALOME::SALOME_Exception);
00479 
00480     long_array GetNodesId()
00481       raises (SALOME::SALOME_Exception);
00482     
00486     ElementType GetElementType( in long id, in boolean iselem )
00487       raises (SALOME::SALOME_Exception);
00488 
00489     long_array GetSubMeshElementsId(in long ShapeID)
00490       raises (SALOME::SALOME_Exception);
00491 
00492     long_array GetSubMeshNodesId(in long ShapeID, in boolean all )
00493       raises (SALOME::SALOME_Exception);
00494     
00495     ElementType GetSubMeshElementType(in long ShapeID)
00496       raises (SALOME::SALOME_Exception);
00497 
00501     string Dump();
00502 
00506     long long GetMeshPtr();
00507 
00512     double_array GetNodeXYZ(in long id);
00513 
00518     long_array GetNodeInverseElements(in long id);
00519 
00524     long GetShapeID(in long id);
00525 
00531     long GetShapeIDForElem(in long id);
00532 
00537     long GetElemNbNodes(in long id);
00538 
00542     long_array GetElemNodes(in long id);
00543 
00549     long GetElemNode(in long id, in long index);
00550 
00555     boolean IsMediumNode(in long ide, in long idn);
00556 
00561     boolean IsMediumNodeOfAnyElem(in long idn, in ElementType elem_type);
00562 
00566     long ElemNbEdges(in long id);
00567 
00571     long ElemNbFaces(in long id);
00572 
00576     boolean IsPoly(in long id);
00577 
00581     boolean IsQuadratic(in long id);
00582 
00588     double_array BaryCenter(in long id);
00589 
00590   };
00591 
00592   interface SMESH_subMesh : SALOME::GenericObj, SMESH_IDSource
00593   {
00597     long GetNumberOfElements()
00598       raises (SALOME::SALOME_Exception);
00599 
00603     long GetNumberOfNodes( in boolean all )
00604       raises (SALOME::SALOME_Exception);
00605 
00609     long_array GetElementsId()
00610       raises (SALOME::SALOME_Exception);
00611 
00615     long_array GetElementsByType( in ElementType theType )
00616       raises (SALOME::SALOME_Exception);
00617     
00621     ElementType GetElementType( in long id, in boolean iselem )
00622       raises (SALOME::SALOME_Exception);
00623 
00627     long_array GetNodesId()
00628       raises (SALOME::SALOME_Exception);
00629 
00633     GEOM::GEOM_Object GetSubShape()
00634       raises (SALOME::SALOME_Exception);
00635 
00639     SMESH_Mesh GetFather()
00640       raises (SALOME::SALOME_Exception);
00641 
00645     long GetId();
00646 
00650     SALOME_MED::FAMILY GetFamily()
00651       raises (SALOME::SALOME_Exception);
00652   };
00653 
00654 };
00655 
00656 #endif