]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To improve Gauss Points mapping
authorapo <apo@opencascade.com>
Fri, 2 Sep 2005 06:24:02 +0000 (06:24 +0000)
committerapo <apo@opencascade.com>
Fri, 2 Sep 2005 06:24:02 +0000 (06:24 +0000)
src/CONVERTOR/VISUConvertor.cxx
src/CONVERTOR/VISU_MedConvertor.cxx

index a45cbf73e04ab9e9c5b4c56ca23c5c03bbfe671b..8fc31f24c1c694f6c603276a642f7eae2bf615d1 100644 (file)
@@ -69,16 +69,6 @@ void parseFile(const char* theFileName)
       const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
       VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter;
 
-      //Importing groups
-      const VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
-      VISU::TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
-      for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
-       const string& aGroupName = aGroupMapIter->first;
-       aCon->GetMeshOnGroup(aMeshName,aGroupName);
-      }
-
-      continue;
-
       //Import fields
       aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
       for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
@@ -94,27 +84,44 @@ void parseFile(const char* theFileName)
          for(; aValFieldIter != aValField.end(); aValFieldIter++){
            int aTimeStamp = aValFieldIter->first;
 
-           VISU::PIDMapper anIDMapper = 
-             aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
-           VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
-           
-           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;
-           }
-           
-           //goto OK;
-           if(anEntity != VISU::NODE_ENTITY)
-             aCon->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
-           else{
-             aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+           if(anEntity != VISU::NODE_ENTITY){
+             VISU::TVTKOutput* aDataSet = 
+               aCon->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
+             VISU::PGaussMesh aGaussMesh = 
+               aCon->GetGaussMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+             
+             int aNbCells = aDataSet->GetNumberOfCells();
+             for(int anCellId = 0; anCellId < aNbCells; anCellId++){
+               VISU::TGaussPointID anObjID = aGaussMesh->GetObjID(anCellId);
+               cout<<anObjID.first<<"; "<<anObjID.second<<endl;
+             }
+           }else{
+             VISU::PIDMapper anIDMapper = 
+               aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+             VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
+             
+             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;
+             }
            }
+           goto OK;
          }
        }
       }
 
+      //Importing groups
+      const VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
+      VISU::TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
+      for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
+       const string& aGroupName = aGroupMapIter->first;
+       aCon->GetMeshOnGroup(aMeshName,aGroupName);
+      }
+
+      //continue;
+
       //Import mesh on entity
       cout << "\n\n ** TEST GetMeshOnEntityIDMapper ***" << endl;
       aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
index 6d53a6d385d32d0d8f7e42ff67e82c84c155ba76..c9d54906b77f9e795be97dba3eaebb1f5275dc88 100644 (file)
@@ -737,13 +737,12 @@ namespace
   TMEDGaussSubMesh
   ::GetObjID(vtkIdType theID) const
   {
-    TCellID aCellID = theID / myGauss->myNbPoints;
-    TLocalPntID aLocalPntID = theID % myGauss->myNbPoints;
-    
+    TInt aNbPoints = myGauss->myNbPoints;
+    TCellID aCellID = theID / aNbPoints;
     if(myIsElemNum)
-      aCellID = myElemNum[theID];
-    else
-      aCellID = theID;
+      aCellID = myElemNum[aCellID];
+
+    TLocalPntID aLocalPntID = theID % aNbPoints;
 
     return TGaussPointID(aCellID,aLocalPntID);
   }