Back to index

salome-smesh  6.5.0
SMESH_Mesh.idl
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  File   : SMESH_Mesh.idl
00024 //  Author : Paul RASCLE, EDF
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   interface SMESH_IDSource;
00041   typedef sequence<SMESH_IDSource> ListOfIDSources;
00042 
00043   typedef sequence<double    > double_array ;
00044   typedef sequence<long      > long_array ;
00045   typedef sequence<string    > string_array ;
00046   typedef sequence<long_array> array_of_long_array ;
00047 
00048   enum log_command
00049     {
00050       ADD_NODE,
00051       ADD_EDGE,
00052       ADD_TRIANGLE,
00053       ADD_QUADRANGLE,
00054       ADD_POLYGON,
00055       ADD_TETRAHEDRON,
00056       ADD_PYRAMID,
00057       ADD_PRISM,
00058       ADD_HEXAHEDRON,
00059       ADD_POLYHEDRON,
00060       REMOVE_NODE,
00061       REMOVE_ELEMENT,
00062       MOVE_NODE,
00063       CHANGE_ELEMENT_NODES,
00064       CHANGE_POLYHEDRON_NODES,
00065       RENUMBER,
00066       CLEAR_MESH,
00067       ADD_QUADEDGE,
00068       ADD_QUADTRIANGLE,
00069       ADD_QUADQUADRANGLE,
00070       ADD_QUADTETRAHEDRON,
00071       ADD_QUADPYRAMID,
00072       ADD_QUADPENTAHEDRON,
00073       ADD_QUADHEXAHEDRON,
00074       ADD_ELEM0D,
00075       ADD_BIQUAD_QUADRANGLE,
00076       ADD_TRIQUAD_HEXA,
00077       ADD_HEXAGONAL_PRISM
00078     };
00079 
00080   struct log_block
00081   {
00082     long commandType;
00083     long number;
00084     double_array coords;
00085     long_array indexes;
00086   };
00087 
00088   struct PointStruct { double x;
00089                      double y;
00090                      double z; } ;
00091 
00092   typedef sequence<PointStruct> nodes_array;
00093 
00094   struct DirStruct   { PointStruct PS ; } ;          // analog to Occ Direction
00095 
00096   struct AxisStruct  { double x;
00097                      double y;
00098                      double z;
00099                      double vx;
00100                      double vy;
00101                      double vz; } ;
00102 
00106   struct NodePosition {
00107     long             shapeID;
00108     GEOM::shape_type shapeType;
00109     double_array     params; // [U] on EDGE, [U,V] on FACE, [] on the rest shapes
00110   };
00111 
00115   enum ElementType
00116   {
00117     ALL,
00118     NODE,
00119     EDGE,
00120     FACE,
00121     VOLUME,
00122     ELEM0D
00123   };
00124   typedef sequence<ElementType> array_of_ElementType ;
00125 
00129   enum GeometryType
00130   {
00131     Geom_POINT,
00132     Geom_EDGE,
00133     Geom_TRIANGLE,
00134     Geom_QUADRANGLE,
00135     Geom_POLYGON,
00136     Geom_TETRA,
00137     Geom_PYRAMID,
00138     Geom_HEXA,
00139     Geom_PENTA,
00140     Geom_HEXAGONAL_PRISM,
00141     Geom_POLYHEDRA
00142   };
00143   
00147   enum ElementOrder {
00148     ORDER_ANY,          
00149     ORDER_LINEAR,       
00150     ORDER_QUADRATIC     
00151   };
00152 
00153 
00158   enum EntityType
00159   {
00160     Entity_Node,
00161     Entity_0D,
00162     Entity_Edge,
00163     Entity_Quad_Edge,
00164     Entity_Triangle,
00165     Entity_Quad_Triangle,
00166     Entity_Quadrangle,
00167     Entity_Quad_Quadrangle,
00168     Entity_BiQuad_Quadrangle,
00169     Entity_Polygon,
00170     Entity_Quad_Polygon,
00171     Entity_Tetra,
00172     Entity_Quad_Tetra,
00173     Entity_Pyramid,
00174     Entity_Quad_Pyramid,
00175     Entity_Hexa,
00176     Entity_Quad_Hexa,
00177     Entity_TriQuad_Hexa,
00178     Entity_Penta,
00179     Entity_Quad_Penta,
00180     Entity_Hexagonal_Prism,
00181     Entity_Polyhedra,
00182     Entity_Quad_Polyhedra,
00183     Entity_Last
00184   };
00185 
00186 
00190   enum Hypothesis_Status // in the order of severity
00191   {
00192     HYP_OK,
00193     HYP_MISSING,      // algo misses a hypothesis
00194     HYP_CONCURENT,    // several applicable hypotheses
00195     HYP_BAD_PARAMETER,// hypothesis has a bad parameter value
00196     HYP_HIDDEN_ALGO,  // an algo is hidden by an upper dim algo generating all-dim elements
00197     HYP_HIDING_ALGO,  // an algo hides lower dim algos by generating all-dim elements
00198     HYP_UNKNOWN_FATAL,//  --- all statuses below should be considered as fatal
00199                       //      for Add/RemoveHypothesis operations
00200     HYP_INCOMPATIBLE, // hypothesis does not fit algo
00201     HYP_NOTCONFORM,   // not conform mesh is produced appling a hypothesis
00202     HYP_ALREADY_EXIST,// such hypothesis already exist
00203     HYP_BAD_DIM,      // bad dimension
00204     HYP_BAD_SUBSHAPE, // shape is neither the main one, nor its sub-shape, nor a group
00205     HYP_BAD_GEOMETRY, // geometry mismatches algorithm's expectation
00206     HYP_NEED_SHAPE    // algorithm can work on shape only
00207   };
00208 
00212   enum DriverMED_ReadStatus // in the order of severity
00213   {
00214     DRS_OK,
00215     DRS_EMPTY,          // a MED file contains no mesh with the given name
00216     DRS_WARN_RENUMBER,  // a MED file has overlapped ranges of element numbers,
00217                         // so the numbers from the file are ignored
00218     DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
00219     DRS_FAIL            // general failure (exception etc.)
00220   };
00221 
00225   enum MED_VERSION // in the order of severity
00226   {
00227     MED_V2_1,
00228     MED_V2_2
00229   };
00230 
00231   typedef sequence<log_block> log_array;
00232 
00233 
00239   const long EXTRUSION_FLAG_BOUNDARY = 1;
00240   const long EXTRUSION_FLAG_SEW = 2;
00241   
00245   struct ElementSubType { ElementType SMDS_ElementType;
00246                           boolean     isPoly;
00247                           long        nbNodesInElement; };
00248 
00249   typedef sequence<ElementSubType> types_array;
00250 
00254   struct MeshPreviewStruct { nodes_array nodesXYZ;
00255                              long_array  elementConnectivities;
00256                              types_array elementTypes; };
00257 
00258   interface SMESH_Mesh;
00259 
00260   interface SMESH_IDSource
00261   {
00265     long_array GetIDs();
00266 
00271     long_array GetMeshInfo();
00272 
00277     array_of_ElementType GetTypes();
00278 
00282     SMESH_Mesh GetMesh();
00283 
00288     boolean IsMeshInfoCorrect();
00289   };
00290 
00291   interface SMESH_Group;
00292   interface SMESH_GroupOnGeom;
00293   interface Filter;
00294   interface SMESH_GroupOnFilter;
00295   interface SMESH_subMesh;
00296   interface SMESH_MeshEditor;
00297 
00298   typedef sequence<SMESH_subMesh>     submesh_array;
00299   typedef sequence<submesh_array>     submesh_array_array;
00300 
00301   interface SMESH_Mesh : SALOME::GenericObj, SMESH_IDSource
00302   {
00306     boolean HasShapeToMesh()
00307       raises (SALOME::SALOME_Exception);
00308 
00313     GEOM::GEOM_Object GetShapeToMesh()
00314       raises (SALOME::SALOME_Exception);
00315 
00319     boolean IsLoaded()
00320       raises (SALOME::SALOME_Exception);
00321 
00325     void Load()
00326       raises (SALOME::SALOME_Exception);
00327 
00331     void Clear()
00332       raises (SALOME::SALOME_Exception);
00333 
00337     submesh_array GetSubMeshes()
00338       raises (SALOME::SALOME_Exception);
00339 
00343     void ClearSubMesh(in long ShapeID)
00344       raises (SALOME::SALOME_Exception);
00345 
00352     SMESH_subMesh GetSubMesh(in GEOM::GEOM_Object aSubObject, in string name)
00353       raises (SALOME::SALOME_Exception);
00354 
00358     void RemoveSubMesh(in SMESH_subMesh aSubMesh)
00359       raises (SALOME::SALOME_Exception);
00360 
00361 
00365     SMESH_Group CreateGroup( in ElementType elem_type,
00366                           in string      name )
00367       raises (SALOME::SALOME_Exception);
00368 
00372     SMESH_GroupOnGeom CreateGroupFromGEOM( in ElementType       elemType,
00373                                            in string            name,
00374                                            in GEOM::GEOM_Object geomObject )
00375       raises (SALOME::SALOME_Exception);
00376 
00380     SMESH_GroupOnFilter CreateGroupFromFilter( in ElementType   elemType,
00381                                                in string        name,
00382                                                in SMESH::Filter filter )
00383       raises (SALOME::SALOME_Exception);
00384 
00388     void RemoveGroup(in SMESH_GroupBase aGroup)
00389       raises (SALOME::SALOME_Exception);
00390 
00394     void RemoveGroupWithContents( in SMESH_GroupBase aGroup )
00395       raises (SALOME::SALOME_Exception);
00396 
00400     ListOfGroups GetGroups()
00401       raises (SALOME::SALOME_Exception);
00402 
00406     long NbGroups()
00407       raises (SALOME::SALOME_Exception);
00408 
00414     SMESH_Group UnionGroups (in SMESH_GroupBase aGroup1,
00415                              in SMESH_GroupBase aGroup2,
00416                              in string          name )
00417       raises (SALOME::SALOME_Exception);
00418       
00424     SMESH_Group UnionListOfGroups (in ListOfGroups aListOfGroups,
00425                                    in string       name )
00426       raises (SALOME::SALOME_Exception);
00427 
00433     SMESH_Group IntersectGroups (in SMESH_GroupBase aGroup1,
00434                                  in SMESH_GroupBase aGroup2,
00435                                  in string          name )
00436       raises (SALOME::SALOME_Exception);
00437       
00443     SMESH_Group IntersectListOfGroups (in ListOfGroups aListOfGroups,
00444                                        in string       name)
00445       raises (SALOME::SALOME_Exception);
00446 
00452     SMESH_Group CutGroups (in SMESH_GroupBase aMainGroup,
00453                            in SMESH_GroupBase aToolGroup,
00454                            in string          name )
00455       raises (SALOME::SALOME_Exception);
00456       
00462     SMESH_Group CutListOfGroups (in ListOfGroups aMainGroups,
00463                                  in ListOfGroups aToolGroups,
00464                                  in string       name)
00465       raises (SALOME::SALOME_Exception);
00466       
00473     SMESH_Group CreateDimGroup( in ListOfGroups aListOfGroups,
00474                                 in ElementType  anElemType,
00475                                 in string       name )
00476       raises (SALOME::SALOME_Exception);
00477 
00481     SMESH_Group ConvertToStandalone( in SMESH_GroupBase theGroupOn )
00482       raises (SALOME::SALOME_Exception);
00483 
00501     Hypothesis_Status AddHypothesis(in GEOM::GEOM_Object aSubObject,
00502                                 in SMESH_Hypothesis anHyp)
00503       raises (SALOME::SALOME_Exception);
00504 //     boolean AddHypothesis(in SMESH_subMesh aSubMesh, in SMESH_Hypothesis anHyp)
00505 //       raises (SALOME::SALOME_Exception);
00506 
00510     Hypothesis_Status RemoveHypothesis(in GEOM::GEOM_Object aSubObject,
00511                                    in SMESH_Hypothesis anHyp)
00512       raises (SALOME::SALOME_Exception);
00513 //     boolean RemoveHypothesis(in SMESH_subMesh aSubMesh,
00514 //                        in SMESH_Hypothesis anHyp)
00515 //       raises (SALOME::SALOME_Exception);
00516 
00520     ListOfHypothesis GetHypothesisList(in GEOM::GEOM_Object aSubObject)
00521       raises (SALOME::SALOME_Exception);
00522 //     ListOfHypothesis GetHypothesisList(in SMESH_subMesh aSubMesh)
00523 //       raises (SALOME::SALOME_Exception);
00524 
00531     //    string_array GetLog(in boolean clearAfterGet)
00532     //      raises (SALOME::SALOME_Exception);
00533     log_array GetLog(in boolean clearAfterGet)
00534       raises (SALOME::SALOME_Exception);
00535 
00540     void ClearLog()
00541       raises (SALOME::SALOME_Exception);
00542 
00548     void SetAutoColor(in boolean theAutoColor)
00549       raises (SALOME::SALOME_Exception);
00550 
00554     boolean GetAutoColor()
00555       raises (SALOME::SALOME_Exception);
00556 
00560     long GetId();
00561 
00565     long GetStudyId();
00566 
00570     SMESH_MeshEditor GetMeshEditor()
00571       raises (SALOME::SALOME_Exception);
00572 
00577     SMESH_MeshEditor GetMeshEditPreviewer()
00578       raises (SALOME::SALOME_Exception);
00579 
00584     boolean HasModificationsToDiscard()
00585       raises (SALOME::SALOME_Exception);
00586 
00590     boolean HasDuplicatedGroupNamesMED();
00591 
00602     void ExportToMEDX( in string      file, 
00603                        in boolean     auto_groups, 
00604                        in MED_VERSION version, 
00605                        in boolean     overwrite ) raises (SALOME::SALOME_Exception);
00606 
00615     void ExportPartToMED( in SMESH_IDSource meshPart, 
00616                           in string         file, 
00617                           in boolean        auto_groups,
00618                           in MED_VERSION    version,
00619                           in boolean        overwrite ) raises (SALOME::SALOME_Exception);
00620 
00626     void ExportToMED( in string file, in boolean auto_groups, in MED_VERSION theVersion )
00627       raises (SALOME::SALOME_Exception);
00628 
00635     void ExportMED( in string file, in boolean auto_groups )
00636       raises (SALOME::SALOME_Exception);
00637 
00642     void ExportSAUV( in string file, in boolean auto_groups )
00643       raises (SALOME::SALOME_Exception);
00644 
00648     string GetVersionString(in MED_VERSION version, in short nbDigits);
00649 
00654     void ExportDAT( in string file ) raises (SALOME::SALOME_Exception);
00655     void ExportUNV( in string file ) raises (SALOME::SALOME_Exception);
00656     void ExportSTL( in string  file,
00657                     in boolean isascii ) raises (SALOME::SALOME_Exception);
00658     void ExportCGNS( in SMESH_IDSource meshPart, 
00659                      in string         file,
00660                      in boolean        overwrite ) raises (SALOME::SALOME_Exception);
00661     void ExportPartToDAT( in SMESH_IDSource meshPart, 
00662                           in string         file ) raises (SALOME::SALOME_Exception);
00663     void ExportPartToUNV( in SMESH_IDSource meshPart, 
00664                           in string         file ) raises (SALOME::SALOME_Exception);
00665     void ExportPartToSTL( in SMESH_IDSource meshPart,
00666                           in string         file,
00667                           in boolean        isascii ) raises (SALOME::SALOME_Exception);
00668 
00672     SALOME_MED::MESH GetMEDMesh()
00673       raises (SALOME::SALOME_Exception);
00674 
00678     long NbNodes()
00679       raises (SALOME::SALOME_Exception);
00680 
00681     long NbElements()
00682       raises (SALOME::SALOME_Exception);
00683 
00684     long Nb0DElements()
00685       raises (SALOME::SALOME_Exception);
00686 
00687     long NbEdges()
00688       raises (SALOME::SALOME_Exception);
00689 
00690     long NbEdgesOfOrder(in ElementOrder order)
00691       raises (SALOME::SALOME_Exception);
00692 
00693     long NbFaces()
00694       raises (SALOME::SALOME_Exception);
00695 
00696     long NbFacesOfOrder(in ElementOrder order)
00697       raises (SALOME::SALOME_Exception);
00698 
00699     long NbTriangles()
00700       raises (SALOME::SALOME_Exception);
00701 
00702     long NbTrianglesOfOrder(in ElementOrder order)
00703       raises (SALOME::SALOME_Exception);
00704 
00705     long NbQuadrangles()
00706       raises (SALOME::SALOME_Exception);
00707 
00708     long NbQuadranglesOfOrder(in ElementOrder order)
00709       raises (SALOME::SALOME_Exception);
00710 
00711     long NbBiQuadQuadrangles()
00712       raises (SALOME::SALOME_Exception);
00713 
00714     long NbPolygons()
00715       raises (SALOME::SALOME_Exception);
00716 
00717     long NbVolumes()
00718       raises (SALOME::SALOME_Exception);
00719 
00720     long NbVolumesOfOrder(in ElementOrder order)
00721       raises (SALOME::SALOME_Exception);
00722 
00723     long NbTetras()
00724       raises (SALOME::SALOME_Exception);
00725 
00726     long NbTetrasOfOrder(in ElementOrder order)
00727       raises (SALOME::SALOME_Exception);
00728 
00729     long NbHexas()
00730       raises (SALOME::SALOME_Exception);
00731 
00732     long NbHexasOfOrder(in ElementOrder order)
00733       raises (SALOME::SALOME_Exception);
00734 
00735     long NbTriQuadraticHexas()
00736       raises (SALOME::SALOME_Exception);
00737 
00738     long NbPyramids()
00739       raises (SALOME::SALOME_Exception);
00740 
00741     long NbPyramidsOfOrder(in ElementOrder order)
00742       raises (SALOME::SALOME_Exception);
00743 
00744     long NbPrisms()
00745       raises (SALOME::SALOME_Exception);
00746 
00747     long NbPrismsOfOrder(in ElementOrder order)
00748       raises (SALOME::SALOME_Exception);
00749 
00750     long NbHexagonalPrisms()
00751       raises (SALOME::SALOME_Exception);
00752 
00753     long NbPolyhedrons()
00754       raises (SALOME::SALOME_Exception);
00755 
00756     long NbSubMesh()
00757       raises (SALOME::SALOME_Exception);
00758 
00759     long_array GetElementsId()
00760       raises (SALOME::SALOME_Exception);
00761 
00762     long_array GetElementsByType( in ElementType theType )
00763       raises (SALOME::SALOME_Exception);
00764 
00765     long_array GetNodesId()
00766       raises (SALOME::SALOME_Exception);
00767     
00771     ElementType GetElementType( in long id, in boolean iselem )
00772       raises (SALOME::SALOME_Exception);
00773 
00774     EntityType GetElementGeomType( in long id )
00775       raises (SALOME::SALOME_Exception);
00776 
00777     long_array GetSubMeshElementsId(in long ShapeID)
00778       raises (SALOME::SALOME_Exception);
00779 
00780     long_array GetSubMeshNodesId(in long ShapeID, in boolean all )
00781       raises (SALOME::SALOME_Exception);
00782     
00783     ElementType GetSubMeshElementType(in long ShapeID)
00784       raises (SALOME::SALOME_Exception);
00785 
00786 
00794     submesh_array_array GetMeshOrder();
00795 
00799     boolean SetMeshOrder(in submesh_array_array theSubMeshArray);
00800 
00801 
00805     string Dump();
00806 
00810     long long GetMeshPtr();
00811 
00816     double_array GetNodeXYZ(in long id);
00817 
00822     long_array GetNodeInverseElements(in long id);
00823 
00827     NodePosition GetNodePosition(in long NodeID);
00828 
00833     long GetShapeID(in long id);
00834 
00840     long GetShapeIDForElem(in long id);
00841 
00846     long GetElemNbNodes(in long id);
00847 
00851     long_array GetElemNodes(in long id);
00852 
00858     long GetElemNode(in long id, in long index);
00859 
00864     boolean IsMediumNode(in long ide, in long idn);
00865 
00870     boolean IsMediumNodeOfAnyElem(in long idn, in ElementType elem_type);
00871 
00875     long ElemNbEdges(in long id);
00876 
00880     long ElemNbFaces(in long id);
00881 
00885     long_array GetElemFaceNodes(in long elemId, in short faceIndex);
00886 
00890     long FindElementByNodes(in long_array nodes);
00891 
00895     boolean IsPoly(in long id);
00896 
00900     boolean IsQuadratic(in long id);
00901 
00907     double_array BaryCenter(in long id);
00908 
00910     SALOME_MED::MedFileInfo GetMEDFileInfo();
00911 
00916     void SetParameters (in string theParameters);
00917 
00921     string GetParameters();
00922 
00926     string_array GetLastParameters();
00927   };
00928 
00929   interface SMESH_subMesh : SALOME::GenericObj, SMESH_IDSource
00930   {
00934     long GetNumberOfElements()
00935       raises (SALOME::SALOME_Exception);
00936 
00940     long GetNumberOfNodes( in boolean all )
00941       raises (SALOME::SALOME_Exception);
00942 
00946     long_array GetElementsId()
00947       raises (SALOME::SALOME_Exception);
00948 
00952     long_array GetElementsByType( in ElementType theType )
00953       raises (SALOME::SALOME_Exception);
00954     
00958     ElementType GetElementType( in long id, in boolean iselem )
00959       raises (SALOME::SALOME_Exception);
00960 
00964     long_array GetNodesId()
00965       raises (SALOME::SALOME_Exception);
00966 
00970     GEOM::GEOM_Object GetSubShape()
00971       raises (SALOME::SALOME_Exception);
00972 
00976     SMESH_Mesh GetFather()
00977       raises (SALOME::SALOME_Exception);
00978 
00982     long GetId();
00983 
00987     SALOME_MED::FAMILY GetFamily()
00988       raises (SALOME::SALOME_Exception);
00989   };
00990 
00991 };
00992 
00993 #endif