Salome HOME
LOT7: fix compilation at med_int==int64 eap/LOT7
authoreap <eap@opencascade.com>
Thu, 19 Dec 2019 13:34:19 +0000 (16:34 +0300)
committereap <eap@opencascade.com>
Thu, 19 Dec 2019 13:34:19 +0000 (16:34 +0300)
12 files changed:
src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx
src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx
src/DriverMED/DriverMED_W_SMESHDS_Mesh.h
src/MEDWrapper/MED_Common.hxx
src/SMESH_I/CMakeLists.txt
src/SMESH_I/SMESH_PreMeshInfo.cxx
src/Tools/MeshCut/MeshCut_DC.cxx
src/Tools/MeshCut/MeshCut_Fonctions.cxx
src/Tools/MeshCut/MeshCut_Maillage.cxx
src/Tools/MeshCut/MeshCut_Maillage.hxx
src/Tools/MeshCut/MeshCut_Utils.cxx
src/Tools/MeshCut/MeshCut_Utils.hxx

index a8ed41c9c2a2f2e6badacd459d33d6ea5cc5ab25..68f17df380dcdfcb178840f1dc1c0c6085288f47 100644 (file)
@@ -266,7 +266,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
             }
 #endif
             if ( !anIsNodeNum )
-              aNodeIds.swap( *(aBallInfo->myConn ));
+              aNodeIds.assign( aBallInfo->myConn->begin(), aBallInfo->myConn->end());
 
             // allocate array of diameters
             vtkIdType maxID = myMesh->MaxElementID() + aNbBalls;
index a4774fe23b778595dce82f295a990c69d2755ce5..30f3ac4a31223b8caaadccd4bba229b0aee15e02 100644 (file)
@@ -34,6 +34,7 @@
 #include "SMDS_MeshNode.hxx"
 #include "SMDS_SetIterator.hxx"
 #include "SMESHDS_Mesh.hxx"
+#include "MED_Common.hxx"
 
 #include <med.h>
 
index 76d85a0ffde48694888d9ce7093fca8728e01b16..d36b2169a21790c9a18ae91c41134ce3dcc32f5f 100644 (file)
@@ -30,7 +30,7 @@
 #include "SMESH_DriverMED.hxx"
 
 #include "Driver_SMESHDS_Mesh.h"
-#include "MED_Common.hxx"
+//#include "MED_Common.hxx"
 
 #include <string>
 #include <list>
index f5bb08e403491f407ebbe3a2552219694f539301..26596f8b267404e47623f64534258a93894591bf 100644 (file)
@@ -31,7 +31,7 @@
 #include <set>
 #include <map>
 
-#include <hdf5.h>
+#include <med.h>
 
 #ifdef WIN32
 #pragma warning(disable:4099)
@@ -41,11 +41,12 @@ namespace MED
 {
   typedef enum {eFAUX, eVRAI} EBooleen;
   typedef double TFloat;
-#if defined(HAVE_F77INT64)
-  typedef long TInt;
-#else
-  typedef int TInt;
-#endif
+// #if defined(HAVE_F77INT64)
+//   typedef long TInt;
+// #else
+//   typedef int TInt;
+// #endif
+  typedef med_int TInt;
   typedef hid_t TIdt;
   typedef herr_t TErr;
 
index e274c7728dc70554614ac8bebfb962d1b3128f43..9bb707929b50d852d27f1949fdb068a5ee77f8c8 100644 (file)
@@ -23,6 +23,7 @@ INCLUDE_DIRECTORIES(
   ${OMNIORB_INCLUDE_DIR}
   ${OpenCASCADE_INCLUDE_DIR}
   ${HDF5_INCLUDE_DIRS}
+  ${MEDFILE_INCLUDE_DIRS}
   ${VTK_INCLUDE_DIRS}
   ${Boost_INCLUDE_DIRS}
   ${KERNEL_INCLUDE_DIRS}
index 58701b12364f4d179e4ece3be0b8763e77838e79..275acb0430aaf220fc1791cf56a1e0af42b2e892 100644 (file)
@@ -479,7 +479,7 @@ bool SMESH_PreMeshInfo::readMeshInfo()
   MED::PMeshInfo medMeshInfo = aMed->CrMeshInfo(3,3,SMESH_Comment( _meshID ));
 
   // read nb nodes
-  int nbNodes = std::max( 0, aMed->GetNbNodes( medMeshInfo ));
+  int nbNodes = Max( 0, aMed->GetNbNodes( medMeshInfo ));
   if ( nbNodes > 0 )
   {
     setNb( SMDSEntity_Node, nbNodes);
index fb80f4696be431a7e84ce81f5ec13fdb9b9a8abc..224667f60fdfebf77ee317bdceeacda3bcaa359d 100644 (file)
@@ -211,7 +211,7 @@ int main(int argc, char *argv[])
     {
       bool plus = false;
       bool moins = false;
-      int *offset = MAILLAGE1->CNX[TETRA4] + 4 * it4;
+      med_int *offset = MAILLAGE1->CNX[TETRA4] + 4 * it4;
       for (int is = 0; is < 4; is++)
         {
           int ng = *(offset + is);
@@ -1065,7 +1065,7 @@ int main(int argc, char *argv[])
           // cout << "Legacy " << tm << " effectif " << MAILLAGE1->EFFECTIFS_TYPES[tm] << endl;
           int tailleType = Nnoeuds(tm);
 
-          MAILLAGE2->CNX[tm] = (int*) malloc(sizeof(int) * tailleType * (MAILLAGE1->EFFECTIFS_TYPES[tm]
+          MAILLAGE2->CNX[tm] = (med_int*) malloc(sizeof(med_int) * tailleType * (MAILLAGE1->EFFECTIFS_TYPES[tm]
               + cptNouvellesMailles[tm]));
           for (int i = 0; i < MAILLAGE1->EFFECTIFS_TYPES[tm]; i++)
             for (int j = 0; j < tailleType; j++)
index ba8284d0da116b8e6270f2f5083acb7cd8d8e216..e99da4fc55fdc97a957726591e07db6b4dbf806e 100644 (file)
@@ -89,7 +89,7 @@ int MESHCUT::intersectionSegmentPlan(int it4, int na)
   float A[3], B[3];
 
   // Détermination des ng des extrémités de l'arête passée en argument na
-  int * offset = MAILLAGE1->CNX[TETRA4] + 4 * it4;
+  med_int * offset = MAILLAGE1->CNX[TETRA4] + 4 * it4;
   if (na == 0)
     {
       ngA = *(offset + 0);
index c6cc137dd2331d146d6a1ade23ac2cde2a0ba427..d7e41ccb6b5f8dcd8311abd756e46c51a4de0985 100644 (file)
@@ -66,7 +66,7 @@ void Maillage::afficheMailles(TYPE_MAILLE tm)
         {
           cout << "\tMaille " << i << " :" << endl;
           //Boucle sur les noeuds de la maille de numéro local i dans le type tm
-          int * offset = CNX[tm] + nnoeuds * i;
+          med_int * offset = CNX[tm] + nnoeuds * i;
           for (int j = 0; j < nnoeuds; j++)
             {
               int ngnoeud = *(offset + j);
@@ -868,7 +868,7 @@ void Maillage::acquisitionTYPE_inputMED(TYPE_MAILLE TYPE, int nTYPE, med_idt fid
   med_int *famTYPE = (med_int*) malloc(sizeof(med_int) * nTYPE);
 
   //med_int *conTYPE = (med_int*) malloc(sizeof(med_int)*tTYPE*nTYPE);
-  CNX[TYPE] = (int*) malloc(sizeof(int) * tTYPE * nTYPE);
+  CNX[TYPE] = (med_int*) malloc(sizeof(med_int) * tTYPE * nTYPE);
 
   med_bool inomTYPE, inumTYPE, ifamTYPE;
   med_geometry_type typeBanaliseMED = InstanceMGE(TYPE);
@@ -1705,10 +1705,10 @@ void Maillage::eliminationMailles(TYPE_MAILLE tm, vector<int> listeMaillesSuppr)
 
   // ************* Modification de la connectivité du type concerné
 
-  int* CNX2;
+  med_int* CNX2;
   int nNoeudsType = Nnoeuds(tm);
   int tailleCNX2 = nNoeudsType * (EFFECTIFS_TYPES[tm] - listeMaillesSuppr.size());
-  CNX2 = (int*) malloc(sizeof(int) * tailleCNX2);
+  CNX2 = (med_int*) malloc(sizeof(med_int) * tailleCNX2);
   // Recopie sélective des connectivités
   int isuppr = 0; // indice dans listeMaillesSuppr
   int ih2 = 0; // nouveau numéro local ( remarque: ih2 = ih1 - isuppr )
index 7ec14de78af5133b0d4aba49a898659525fd781c..6f984dd094e8d8af16a9e9e045364f2121b0b784 100644 (file)
@@ -75,7 +75,7 @@ namespace MESHCUT
       // Le numéro global du j-ième noeud de la maille de numéro global i est stocké à l'adresse
       //           CNX[tm]+t*(i-1)+(j-1)
       // (t = taille du type, i.e. nombre de noeuds de l'élément)
-      std::map<TYPE_MAILLE, int*> CNX; // ****** MED-OBLIGATOIRE ******
+      std::map<TYPE_MAILLE, med_int*> CNX; // ****** MED-OBLIGATOIRE ******
 
       // Enveloppes cubiques
       std::map<TYPE_MAILLE, float*> EC;
index 5aa78dbb6bc377d2b00486d8151c2256505d7234..059ca3c8b952d6bfb20be6c8c2ea669093d9bfd8 100644 (file)
@@ -1035,7 +1035,7 @@ float MESHCUT::distance2(float x1, float y1, float z1, float x2, float y2, float
 /*!
  *  Conversion HL-MED d'une table de connectivités
  */
-void MESHCUT::conversionCNX(int *CNXtm, TYPE_MAILLE tm, int N)
+void MESHCUT::conversionCNX(med_int *CNXtm, TYPE_MAILLE tm, int N)
 {
 
   int n = Nnoeuds(tm);
index 94b3eb9688e516299414da20f511bb67dab2d287..72b9bfd4ea3d81325e5f82cf3749c1947860dbf2 100644 (file)
@@ -71,7 +71,7 @@ namespace MESHCUT
     std::string nomMaille(TYPE_MAILLE tm, int nl);
     bool appartientVN(int n, std::vector<int> V);
     float distance2(float x1, float y1, float z1, float x2, float y2, float z2);
-    void conversionCNX(int *CNXtm, TYPE_MAILLE tm, int N);
+    void conversionCNX(med_int *CNXtm, TYPE_MAILLE tm, int N);
 
   }