Back to index

salome-smesh  6.5.0
SMESH_MEDMesh_i.hxx
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 //  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
00024 //  File   : SMESH_MEDMesh_i.hxx
00025 //  Module : SMESH
00026 //
00027 #ifndef _MED_SMESH_MESH_I_HXX_
00028 #define _MED_SMESH_MESH_I_HXX_
00029 
00030 #include "SMESH.hxx"
00031 
00032 #include <SALOMEconfig.h>
00033 #include CORBA_SERVER_HEADER(MED)
00034 #include <string>
00035 #include <vector>
00036 #include <map>
00037 
00038 #include "SMESHDS_Mesh.hxx"
00039 
00040 #include "SMDS_MeshElement.hxx"
00041 #include "SMDS_MeshNode.hxx"
00042 #include "SALOME_GenericObj_i.hh"
00043 
00044 #define MED_NBR_GEOMETRIE_MAILLE 15
00045 #define MED_NBR_TYPE 5
00046 
00047 class SMESH_Mesh_i;
00048 
00049 class SMESH_I_EXPORT SMESH_MEDMesh_i:
00050   public virtual POA_SALOME_MED::MESH, 
00051   public virtual SALOME::GenericObj_i
00052 {
00053 protected:
00054   // C++ object containing values
00055   ::SMESH_Mesh_i * _mesh_i;
00056   SMESHDS_Mesh *_meshDS;
00057   
00058   std::string _meshId;
00059   bool _compte;
00060   bool _creeFamily;
00061   int _indexElts;
00062   int _indexEnts;
00063   int _famIdent;
00064   
00065   std::map < SALOME_MED::medGeometryElement, int >_mapIndToSeqElts;
00066   SALOME_TYPES::ListOfLong_var _seq_elemId[MED_NBR_GEOMETRIE_MAILLE];
00067   
00068   std::map < SALOME_MED::medEntityMesh, int >_mapNbTypes;
00069   std::map < SALOME_MED::medEntityMesh, int >_mapIndToVectTypes;
00070   std::vector < SALOME_MED::medGeometryElement >
00071   _TypesId[MED_NBR_GEOMETRIE_MAILLE];
00072   
00073   std::vector < SALOME_MED::FAMILY_ptr > _families;
00074 public:
00075   
00076   // Constructors and associated internal methods
00077   SMESH_MEDMesh_i();
00078   SMESH_MEDMesh_i(SMESH_Mesh_i * m);
00079   ~SMESH_MEDMesh_i();
00080   
00081   // IDL Methods
00082   void setProtocol(SALOME::TypeOfCommunication typ) {}
00083   void release() {}
00084   SALOME::SenderDouble_ptr getSenderForCoordinates(SALOME_MED::medModeSwitch) {return SALOME::SenderDouble::_nil();}
00085   SALOME::SenderInt_ptr getSenderForConnectivity(SALOME_MED::medConnectivity, 
00086                                                  SALOME_MED::medEntityMesh, 
00087                                                  SALOME_MED::medGeometryElement) 
00088   {
00089     return SALOME::SenderInt::_nil();
00090   }  
00091   SALOME::SenderInt_ptr getSenderForConnectivityIndex(SALOME_MED::medConnectivity,
00092                                                       SALOME_MED::medEntityMesh,
00093                                                       SALOME_MED::medGeometryElement)
00094   {
00095     return SALOME::SenderInt::_nil();
00096   }  
00097   SALOME::SenderInt_ptr getSenderForPolygonsConnectivity(SALOME_MED::medConnectivity, SALOME_MED::medEntityMesh) {return SALOME::SenderInt::_nil();}
00098   SALOME::SenderInt_ptr getSenderForPolygonsConnectivityIndex(SALOME_MED::medConnectivity, SALOME_MED::medEntityMesh) {return SALOME::SenderInt::_nil();}
00099   SALOME::SenderInt_ptr getSenderForPolyhedronConnectivity(SALOME_MED::medConnectivity) {return SALOME::SenderInt::_nil();}
00100   SALOME::SenderInt_ptr getSenderForPolyhedronIndex(SALOME_MED::medConnectivity) {return SALOME::SenderInt::_nil();}
00101   SALOME::SenderInt_ptr getSenderForPolyhedronFacesIndex() {return SALOME::SenderInt::_nil();}
00102   
00103   char *getName() throw(SALOME::SALOME_Exception);
00104   CORBA::Long getSpaceDimension() throw(SALOME::SALOME_Exception);
00105   
00106   CORBA::Long getMeshDimension() throw(SALOME::SALOME_Exception);
00107   
00108   CORBA::Boolean  getIsAGrid() throw (SALOME::SALOME_Exception);
00109   
00110   CORBA::Boolean
00111   existConnectivity(SALOME_MED::medConnectivity connectivityType,
00112                     SALOME_MED::medEntityMesh entity)
00113     throw (SALOME::SALOME_Exception);
00114   
00115   char *getCoordinatesSystem() throw(SALOME::SALOME_Exception);
00116   
00117   CORBA::Double getCoordinate(CORBA::Long Number, CORBA::Long Axis)
00118     throw (SALOME::SALOME_Exception);
00119   
00120   SALOME_TYPES::ListOfDouble * getCoordinates(SALOME_MED::medModeSwitch typeSwitch)
00121     throw(SALOME::SALOME_Exception);
00122 
00123   SALOME_TYPES::ListOfString * getCoordinatesNames()
00124     throw(SALOME::SALOME_Exception);
00125   
00126   SALOME_TYPES::ListOfString * getCoordinatesUnits()
00127     throw(SALOME::SALOME_Exception);
00128   
00129   CORBA::Long getNumberOfNodes() throw(SALOME::SALOME_Exception);
00130   
00131   CORBA::Long getNumberOfTypes(SALOME_MED::medEntityMesh entity)
00132     throw(SALOME::SALOME_Exception);
00133   
00134   SALOME_MED::medGeometryElement_array *
00135   getTypes(SALOME_MED::medEntityMesh entity) throw(SALOME::
00136                                                    SALOME_Exception);
00137   
00138   SALOME_MED::medGeometryElement
00139   getElementType(SALOME_MED::medEntityMesh entity,
00140                  CORBA::Long number)
00141     throw   (SALOME::SALOME_Exception);
00142   
00143   CORBA::Long getNumberOfElements(SALOME_MED::medEntityMesh entity,
00144                                   SALOME_MED::medGeometryElement geomElement)
00145     throw(SALOME::SALOME_Exception);
00146   
00147   SALOME_TYPES::ListOfLong *
00148   getConnectivity(SALOME_MED::medConnectivity mode,
00149                   SALOME_MED::medEntityMesh entity,
00150                   SALOME_MED::medGeometryElement geomElement)
00151     throw(SALOME::SALOME_Exception);
00152   
00153   SALOME_TYPES::ListOfLong *
00154   getConnectivityIndex(SALOME_MED::medConnectivity mode,
00155                        SALOME_MED::medEntityMesh entity)
00156     throw(SALOME::SALOME_Exception);
00157   
00158   SALOME_TYPES::ListOfLong*
00159   getGlobalNumberingIndex(SALOME_MED::medEntityMesh entity)
00160     throw (SALOME::SALOME_Exception);
00161   
00162   CORBA::Long getElementNumber(SALOME_MED::medConnectivity mode,
00163                                SALOME_MED::medEntityMesh entity,
00164                                SALOME_MED::medGeometryElement type,
00165                                const SALOME_TYPES::ListOfLong & connectivity)
00166     throw(SALOME::SALOME_Exception);
00167   
00168   SALOME_TYPES::ListOfLong *
00169   getReverseConnectivity(SALOME_MED::medConnectivity mode)
00170     throw(SALOME::SALOME_Exception);
00171   
00172   SALOME_TYPES::ListOfLong *
00173   getReverseConnectivityIndex(SALOME_MED::medConnectivity mode) 
00174     throw(SALOME::SALOME_Exception);
00175   
00176   // Family and Group
00177   CORBA::Long getNumberOfFamilies(SALOME_MED::medEntityMesh entity)
00178     throw(SALOME::SALOME_Exception);
00179   
00180   CORBA::Long getNumberOfGroups(SALOME_MED::medEntityMesh entity)
00181     throw(SALOME::SALOME_Exception);
00182   
00183   SALOME_MED::Family_array *
00184   getFamilies(SALOME_MED::medEntityMesh entity)
00185     throw(SALOME::SALOME_Exception);
00186   
00187   SALOME_MED::FAMILY_ptr getFamily(SALOME_MED::medEntityMesh entity,
00188                                    CORBA::Long i) 
00189     throw(SALOME::SALOME_Exception);
00190   
00191   SALOME_MED::Group_array * getGroups(SALOME_MED::medEntityMesh entity)
00192     throw(SALOME::SALOME_Exception);
00193   
00194   SALOME_MED::GROUP_ptr getGroup(SALOME_MED::medEntityMesh entity,
00195                                  CORBA::Long i) 
00196     throw(SALOME::SALOME_Exception);
00197   
00198   SALOME_MED::SUPPORT_ptr
00199   getBoundaryElements(SALOME_MED::medEntityMesh entity)
00200     throw (SALOME::SALOME_Exception);
00201   
00202   SALOME_MED::SUPPORT_ptr
00203   getSupportOnAll(SALOME_MED::medEntityMesh entity)
00204     throw (SALOME::SALOME_Exception);
00205   
00206   SALOME_MED::SUPPORT_ptr getSkin(SALOME_MED::SUPPORT_ptr mySupport3D)
00207     throw (SALOME::SALOME_Exception);
00208   
00209   SALOME_MED::FIELD_ptr getVolume(SALOME_MED::SUPPORT_ptr mySupport)
00210     throw(SALOME::SALOME_Exception);
00211   
00212   SALOME_MED::FIELD_ptr getArea(SALOME_MED::SUPPORT_ptr mySupport)
00213     throw(SALOME::SALOME_Exception);
00214   
00215   SALOME_MED::FIELD_ptr getLength(SALOME_MED::SUPPORT_ptr mySupport)
00216     throw(SALOME::SALOME_Exception);
00217   
00218   SALOME_MED::FIELD_ptr getNormal(SALOME_MED::SUPPORT_ptr mySupport)
00219     throw(SALOME::SALOME_Exception);
00220   
00221   SALOME_MED::FIELD_ptr getBarycenter(SALOME_MED::SUPPORT_ptr mySupport)
00222     throw(SALOME::SALOME_Exception);
00223   
00224   SALOME_MED::FIELD_ptr getNeighbourhood(SALOME_MED::SUPPORT_ptr mySupport)
00225     throw(SALOME::SALOME_Exception);
00226   
00227   // Others
00228   void addInStudy(SALOMEDS::Study_ptr myStudy,
00229                   SALOME_MED::GMESH_ptr myIor) 
00230     throw(SALOME::SALOME_Exception);
00231   CORBA::Long addDriver(SALOME_MED::medDriverTypes driverType,
00232                         const char *fileName, const char *meshName)
00233     throw(SALOME::SALOME_Exception);
00234   void rmDriver(CORBA::Long i) throw(SALOME::SALOME_Exception);
00235   void read(CORBA::Long i) throw(SALOME::SALOME_Exception);
00236   void write(CORBA::Long i, const char *driverMeshName)
00237     throw(SALOME::SALOME_Exception);
00238   
00239   //                    Cuisine interne
00240   CORBA::Long getCorbaIndex() 
00241     throw(SALOME::SALOME_Exception);
00242   
00243   SALOME_MED::GMESH::meshInfos * getMeshGlobal()
00244     throw (SALOME::SALOME_Exception);
00245   
00246   bool areEquals(SALOME_MED::GMESH_ptr other) { return false;};
00247   
00248   SALOME_MED::MESH_ptr convertInMESH() throw (SALOME::SALOME_Exception);
00249   
00250   SALOME_MED::GMESH::coordinateInfos * getCoordGlobal()
00251     throw (SALOME::SALOME_Exception);
00252   
00253   SALOME_MED::MESH::connectivityInfos *
00254   getConnectGlobal(SALOME_MED::medEntityMesh entity)
00255     throw (SALOME::SALOME_Exception);
00256   
00257   //
00258   void calculeNbElts() throw(SALOME::SALOME_Exception);
00259   void createFamilies() throw(SALOME::SALOME_Exception);
00260 };
00261 
00262 #endif /* _MED_MESH_I_HXX_ */