Salome HOME
Merge from PortingMED3 07Apr11
[modules/smesh.git] / src / SMESH_I / SMESH_MEDMesh_i.cxx
index e69b00e4534936ef7abd42f0447ffac3dab01e6f..ac16b41861673838c048cf0bd7631edde63e5e4d 100644 (file)
@@ -465,7 +465,7 @@ SMESH_MEDMesh_i::getTypes(SALOME_MED::medEntityMesh entity) throw(SALOME::
 //=============================================================================
 /*!
  * CORBA: Returns number of elements of type medGeometryElement
- *        Not implemented for MED_ALL_ELEMENTS 
+ *        Not implemented for MEDMEM_ALL_ELEMENTS 
  *        implemented for MED_ALL_ENTITIES
  *
  * Dans cette implementation, il n est pas prevu de tenir compte du entity
@@ -479,8 +479,8 @@ CORBA::Long SMESH_MEDMesh_i::getNumberOfElements(SALOME_MED::
   if (_mesh_i == 0)
     THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
                                  SALOME::INTERNAL_ERROR);
-  if (geomElement == SALOME_MED::MED_ALL_ELEMENTS)
-    THROW_SALOME_CORBA_EXCEPTION("Not implemented for MED_ALL_ELEMENTS",
+  if (geomElement == SALOME_MED::MEDMEM_ALL_ELEMENTS)
+    THROW_SALOME_CORBA_EXCEPTION("Not implemented for MEDMEM_ALL_ELEMENTS",
                                  SALOME::BAD_PARAM);
   if (!_compte)
     calculeNbElts();
@@ -510,8 +510,7 @@ CORBA::Long SMESH_MEDMesh_i::getNumberOfElements(SALOME_MED::
  */
 //=============================================================================
 SALOME_TYPES::ListOfLong *
-SMESH_MEDMesh_i::getConnectivity(SALOME_MED::medModeSwitch typeSwitch,
-                                 SALOME_MED::medConnectivity mode,
+SMESH_MEDMesh_i::getConnectivity(SALOME_MED::medConnectivity mode,
                                  SALOME_MED::medEntityMesh entity,
                                  SALOME_MED::medGeometryElement geomElement)
   throw(SALOME::SALOME_Exception)
@@ -521,8 +520,8 @@ SMESH_MEDMesh_i::getConnectivity(SALOME_MED::medModeSwitch typeSwitch,
                                  SALOME::INTERNAL_ERROR);
   if (mode != SALOME_MED::MED_NODAL)
     THROW_SALOME_CORBA_EXCEPTION("Not Implemented", SALOME::BAD_PARAM);
-  if (typeSwitch == SALOME_MED::MED_NO_INTERLACE)
-    THROW_SALOME_CORBA_EXCEPTION("Not Yet Implemented", SALOME::BAD_PARAM);
+  /*if (typeSwitch == SALOME_MED::MED_NO_INTERLACE)
+    THROW_SALOME_CORBA_EXCEPTION("Not Yet Implemented", SALOME::BAD_PARAM);*/
   if (!_compte)
     calculeNbElts();
 
@@ -851,7 +850,7 @@ SALOME_MED::FIELD_ptr SMESH_MEDMesh_i::getNeighbourhood(SALOME_MED::
  */
 //=============================================================================
 void SMESH_MEDMesh_i::addInStudy(SALOMEDS::Study_ptr myStudy,
-                                 SALOME_MED::MESH_ptr myIor) throw(SALOME::SALOME_Exception)
+                                 SALOME_MED::GMESH_ptr myIor) throw(SALOME::SALOME_Exception)
 {
   BEGIN_OF("MED_Mesh_i::addInStudy");
   if (_meshId != "")
@@ -963,11 +962,11 @@ void SMESH_MEDMesh_i::calculeNbElts() throw(SALOME::SALOME_Exception)
     _compte = true;
 
     _mapNbTypes[SALOME_MED::MED_NODE] = 1;
-    // On compte les aretes MED_SEG2 ou MED_SEG3
+    // On compte les aretes MEDMEM_SEG2 ou MEDMEM_SEG3
     // On range les elements dans  les vecteurs correspondants 
 
-    _mapIndToSeqElts[SALOME_MED::MED_SEG2] = _indexElts++;
-    _mapIndToSeqElts[SALOME_MED::MED_SEG3] = _indexElts++;
+    _mapIndToSeqElts[SALOME_MED::MEDMEM_SEG2] = _indexElts++;
+    _mapIndToSeqElts[SALOME_MED::MEDMEM_SEG3] = _indexElts++;
     _mapIndToVectTypes[SALOME_MED::MED_EDGE] = _indexEnts++;
 
     int trouveSeg2 = 0;
@@ -984,23 +983,23 @@ void SMESH_MEDMesh_i::calculeNbElts() throw(SALOME::SALOME_Exception)
       {
       case 2:
         {
-          medElement = SALOME_MED::MED_SEG2;
+          medElement = SALOME_MED::MEDMEM_SEG2;
           if (trouveSeg2 == 0)
           {
             trouveSeg2 = 1;
             _TypesId[SALOME_MED::MED_EDGE].
-              push_back(SALOME_MED::MED_SEG2);
+              push_back(SALOME_MED::MEDMEM_SEG2);
           }
           break;
         }
       case 3:
         {
-          medElement = SALOME_MED::MED_SEG3;
+          medElement = SALOME_MED::MEDMEM_SEG3;
           if (trouveSeg3 == 0)
           {
             trouveSeg3 = 1;
             _TypesId[SALOME_MED::MED_EDGE].
-              push_back(SALOME_MED::MED_SEG3);
+              push_back(SALOME_MED::MEDMEM_SEG3);
           }
           break;
         }
@@ -1020,15 +1019,15 @@ void SMESH_MEDMesh_i::calculeNbElts() throw(SALOME::SALOME_Exception)
 
     _mapNbTypes[SALOME_MED::MED_EDGE] = trouveSeg2 + trouveSeg3;
 
-    // On compte les faces MED_TRIA3, MED_HEXA8, MED_TRIA6
+    // On compte les faces MEDMEM_TRIA3, MEDMEM_HEXA8, MEDMEM_TRIA6
     // On range les elements dans  les vecteurs correspondants 
     int trouveTria3 = 0;
     int trouveTria6 = 0;
     int trouveQuad4 = 0;
 
-    _mapIndToSeqElts[SALOME_MED::MED_TRIA3] = _indexElts++;
-    _mapIndToSeqElts[SALOME_MED::MED_TRIA6] = _indexElts++;
-    _mapIndToSeqElts[SALOME_MED::MED_QUAD4] = _indexElts++;
+    _mapIndToSeqElts[SALOME_MED::MEDMEM_TRIA3] = _indexElts++;
+    _mapIndToSeqElts[SALOME_MED::MEDMEM_TRIA6] = _indexElts++;
+    _mapIndToSeqElts[SALOME_MED::MEDMEM_QUAD4] = _indexElts++;
     _mapIndToVectTypes[SALOME_MED::MED_FACE] = _indexEnts++;
 
     SMDS_FaceIteratorPtr itFaces=_meshDS->facesIterator();
@@ -1041,34 +1040,34 @@ void SMESH_MEDMesh_i::calculeNbElts() throw(SALOME::SALOME_Exception)
       {
       case 3:
         {
-          medElement = SALOME_MED::MED_TRIA3;
+          medElement = SALOME_MED::MEDMEM_TRIA3;
           if (trouveTria3 == 0)
           {
             trouveTria3 = 1;
             _TypesId[SALOME_MED::MED_FACE].
-              push_back(SALOME_MED::MED_TRIA3);
+              push_back(SALOME_MED::MEDMEM_TRIA3);
           }
           break;
         }
       case 4:
         {
-          medElement = SALOME_MED::MED_QUAD4;
+          medElement = SALOME_MED::MEDMEM_QUAD4;
           if (trouveQuad4 == 0)
           {
             trouveQuad4 = 1;
             _TypesId[SALOME_MED::MED_FACE].
-              push_back(SALOME_MED::MED_QUAD4);
+              push_back(SALOME_MED::MEDMEM_QUAD4);
           }
           break;
         }
       case 6:
         {
-          medElement = SALOME_MED::MED_TRIA6;
+          medElement = SALOME_MED::MEDMEM_TRIA6;
           if (trouveTria6 == 0)
           {
             trouveTria6 = 1;
             _TypesId[SALOME_MED::MED_FACE].
-              push_back(SALOME_MED::MED_TRIA6);
+              push_back(SALOME_MED::MEDMEM_TRIA6);
           }
           break;
         }
@@ -1091,7 +1090,7 @@ void SMESH_MEDMesh_i::calculeNbElts() throw(SALOME::SALOME_Exception)
     _mapNbTypes[SALOME_MED::MED_FACE] =
       trouveTria3 + trouveTria6 + trouveQuad4;
 
-    _mapIndToSeqElts[SALOME_MED::MED_HEXA8] = _indexElts++;
+    _mapIndToSeqElts[SALOME_MED::MEDMEM_HEXA8] = _indexElts++;
     _mapIndToVectTypes[SALOME_MED::MED_CELL] = _indexEnts++;
     int index = _mapIndToSeqElts[medElement];
 
@@ -1103,13 +1102,13 @@ void SMESH_MEDMesh_i::calculeNbElts() throw(SALOME::SALOME_Exception)
       const SMDS_MeshVolume * elem = itVolumes->next();
 
       int nb_of_nodes = elem->NbNodes();
-      medElement = SALOME_MED::MED_HEXA8;
+      medElement = SALOME_MED::MEDMEM_HEXA8;
       ASSERT(nb_of_nodes == 8);
 
       if (trouveHexa8 == 0)
       {
         trouveHexa8 = 1;
-        _TypesId[SALOME_MED::MED_CELL].push_back(SALOME_MED::MED_HEXA8);
+        _TypesId[SALOME_MED::MED_CELL].push_back(SALOME_MED::MEDMEM_HEXA8);
       };
       // Traitement de la maille
       int longueur = _seq_elemId[index]->length();
@@ -1178,7 +1177,7 @@ void SMESH_MEDMesh_i::createFamilies() throw(SALOME::SALOME_Exception)
  * Gives informations of the considered mesh.
  */
 //=============================================================================
-SALOME_MED::MESH::meshInfos * SMESH_MEDMesh_i::getMeshGlobal()
+SALOME_MED::GMESH::meshInfos * SMESH_MEDMesh_i::getMeshGlobal()
   throw (SALOME::SALOME_Exception)
 {
   MESSAGE("!!!! NOT YET IMPLEMENTED !!!!!");
@@ -1187,12 +1186,28 @@ SALOME_MED::MESH::meshInfos * SMESH_MEDMesh_i::getMeshGlobal()
 
   return NULL;
 }
+
+//================================================================================
+/*!
+ * \brief Converts this GMESH into MESH
+ */
+//================================================================================
+
+SALOME_MED::MESH_ptr SMESH_MEDMesh_i::convertInMESH() throw (SALOME::SALOME_Exception)
+{
+  MESSAGE("!!!! NOT YET IMPLEMENTED !!!!!");
+
+  THROW_SALOME_CORBA_EXCEPTION("Unimplemented Method", SALOME::BAD_PARAM);
+
+  return NULL;
+}
+
 //=============================================================================
 /*!
  * Gives informations on coordinates of the considered mesh.
  */
 //=============================================================================
-SALOME_MED::MESH::coordinateInfos * SMESH_MEDMesh_i::getCoordGlobal()
+SALOME_MED::GMESH::coordinateInfos * SMESH_MEDMesh_i::getCoordGlobal()
   throw (SALOME::SALOME_Exception)
 {
   MESSAGE("!!!! NOT YET IMPLEMENTED !!!!!");