]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To introduce ID's mapping (improve MeshOnEntity ID's mapping)
authorapo <apo@opencascade.com>
Thu, 1 Sep 2005 05:50:51 +0000 (05:50 +0000)
committerapo <apo@opencascade.com>
Thu, 1 Sep 2005 05:50:51 +0000 (05:50 +0000)
src/CONVERTOR/VISU_Convertor_impl.cxx

index 04f0d3bf2e89fdc5edd9c8178b72afc8be9e0478..bfe9c21e089fb5aa4eaf465ee668fcbc91595802 100644 (file)
@@ -852,11 +852,9 @@ namespace
     aCellTypesArray->SetNumberOfComponents(1);
     aCellTypesArray->SetNumberOfTuples(aNbCells);
 
-    VISU::TID2ID& anElemObj2VTKID = theMeshOnEntity->myElemObj2VTKID;
     for(vtkIdType anID = 0; anID < aNbCells; anID++){
       PrintCells(anID,aConnectivity,anArray[anID]);
       aCellTypesArray->SetValue(anID,(unsigned char)theGeom);
-      anElemObj2VTKID[theSubMesh->GetElemObjID(anID)] = anID;
     }
 
     vtkIdType *pts = 0, npts = 0;
@@ -1489,9 +1487,12 @@ VISU_Convertor_impl
       
       const TGeom2SubMesh& aGeom2SubMesh = aMeshOnEntity->myGeom2SubMesh;
       TGeom2SubMesh::const_iterator anIter = aGeom2SubMesh.begin();
+
+      TID2ID& anElemObj2VTKID = aMeshOnEntity->myElemObj2VTKID;
       TSubMeshArr& aSubMeshArr = aMeshOnEntity->mySubMeshArr;
       aSubMeshArr.resize(aGeom2SubMesh.size());
-      for(vtkIdType anID = 0; anIter != aGeom2SubMesh.end(); anIter++, anID++){
+
+      for(vtkIdType anID = 0, aCellID = 0; anIter != aGeom2SubMesh.end(); anIter++, anID++){
        const vtkIdType& aGeom = anIter->first;
        PSubMeshImpl aSubMesh = anIter->second;
        const TVTKSource& aSource = aSubMesh->GetSource();
@@ -1499,6 +1500,10 @@ VISU_Convertor_impl
        GetCellsOnSubMesh(aSource,aMeshOnEntity,aSubMesh,aGeom);
        anAppendFilter->AddInput(aSource.GetPointer());
 
+       vtkIdType aNbCells = aSource->GetNumberOfCells();
+       for(vtkIdType aCell = 0; aCell < aNbCells; aCell++, aCellID++){
+         anElemObj2VTKID[aSubMesh->GetElemObjID(aCell)] = aCellID;
+       }
        aSubMeshArr[anID] = aSubMesh;
       }
       aMeshOnEntity->myNamedPointCoords = aMesh->myNamedPointCoords;