Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/visu.git] / src / CONVERTOR / VISUConvertor.cxx
index 60ce65673b63b74dd5c88197e35d95aeeca090b7..d92e9d8c2758bb49f232c619817ec42a35af08cc 100644 (file)
@@ -46,7 +46,8 @@ static int MYDEBUG = 1;
 static int MYDEBUG = 0;
 #endif
 
-//#define _DEXCEPT_
+//#define _DEBUG_ID_MAPPING_
+#define _DEXCEPT_
 
 typedef vtkUnstructuredGrid TOutput;
 
@@ -56,10 +57,12 @@ void parseFile(const char* theFileName)
   try{
 #endif
     MSG(MYDEBUG,"'"<<theFileName<<"'...");
+    //theFileName = "Apointe.med";
     auto_ptr<VISU_Convertor> aCon(CreateConvertor(theFileName));
     //aCon->GetSize();
     //return;
     aCon->BuildEntities();
+    aCon->BuildGroups();
     aCon->BuildFields();
     aCon->BuildMinMax();
     const VISU::TMeshMap& aMeshMap = aCon->GetMeshMap();
@@ -91,26 +94,32 @@ void parseFile(const char* theFileName)
            if(anEntity != VISU::NODE_ENTITY){
              VISU::PGaussPtsIDMapper aGaussMesh = 
                aCon->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
-             VISU::TVTKOutput* aDataSet = aGaussMesh->GetVTKOutput();
-             /*
+#ifdef _DEBUG_ID_MAPPING_
+             vtkDataSet* aDataSet = aGaussMesh->GetOutput();
+             aDataSet->Update();
              int aNbCells = aDataSet->GetNumberOfCells();
+             cout<<"aNbCells = "<<aNbCells<<endl;
              for(int anCellId = 0; anCellId < aNbCells; anCellId++){
                VISU::TGaussPointID anObjID = aGaussMesh->GetObjID(anCellId);
-               cout<<anObjID.first<<"; "<<anObjID.second<<endl;
+               cout<<anObjID.first<<"; "<<anObjID.second<<"; "<<aGaussMesh->GetNodeVTKID(anObjID.first)<<endl;
+               vtkFloatingPointType* aCoord = aGaussMesh->GetNodeCoord(anCellId);
+               cout<<aCoord[0]<<"; "<<aCoord[1]<<"; "<<aCoord[2]<<endl;
              }
-             */
+#endif
            }else{
+             //continue;
              VISU::PIDMapper anIDMapper = 
                aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
-             VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
-             /*
+#ifdef _DEBUG_ID_MAPPING_
+             vtkDataSet* aDataSet = anIDMapper->GetOutput();
+             aDataSet->Update();
              int aNbCells = aDataSet->GetNumberOfCells();
              for(int anCellId = 0; anCellId < aNbCells; anCellId++){
                int anObjID = anIDMapper->GetElemObjID(anCellId);
                int aVTKID  = anIDMapper->GetElemVTKID(anObjID);
                cout<<anObjID<<"; "<<aVTKID<<endl;
              }
-             */
+#endif
            }
            //goto OK;
          }
@@ -132,18 +141,16 @@ void parseFile(const char* theFileName)
       for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
        const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
        VISU::PIDMapper anIDMapper = aCon->GetMeshOnEntity(aMeshName,anEntity);
-       VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
-       {
-         /*
-         int aNbCells, anCellId, anObjID, aVTKID;
-         aNbCells = aDataSet->GetNumberOfCells();
-         for(anCellId = 0; anCellId < aNbCells; anCellId++){
-           anObjID = anIDMapper->GetElemObjID(anCellId);
-           aVTKID  = anIDMapper->GetElemVTKID(anObjID);
-           cout<<anObjID<<"; "<<aVTKID<<endl;
-         }
-         */
+#ifdef _DEBUG_ID_MAPPING_
+       vtkDataSet* aDataSet = anIDMapper->GetOutput();
+       int aNbCells, anCellId, anObjID, aVTKID;
+       aNbCells = aDataSet->GetNumberOfCells();
+       for(anCellId = 0; anCellId < aNbCells; anCellId++){
+         anObjID = anIDMapper->GetElemObjID(anCellId);
+         aVTKID  = anIDMapper->GetElemVTKID(anObjID);
+         cout<<anObjID<<"; "<<aVTKID<<endl;
        }
+#endif
       }
 
       //Import families