}
+ //---------------------------------------------------------------
+ vtkCell*
+ TFamilyImpl
+ ::GetElemCell(int theObjID)
+ {
+ vtkIdType aVtkID = GetElemVTKID(theObjID);
+ return GetSource()->GetCell(aVtkID);
+ }
+
+ vtkIdType
+ TFamilyImpl
+ ::GetElemVTKID(vtkIdType theID) const
+ {
+ if(myElemObj2VTKID.empty())
+ return theID;
+ else{
+ TID2ID::const_iterator anIter = myElemObj2VTKID.find(theID);
+ if(anIter != myElemObj2VTKID.end())
+ return anIter->second;
+ }
+ return -1;
+ }
+
+ vtkIdType
+ TFamilyImpl
+ ::GetElemObjID(vtkIdType theID) const
+ {
+ return myMeshID[theID];
+ }
+
+
//---------------------------------------------------------------
TNbASizeCells
TGroupImpl
aCellTypesArray->SetNumberOfComponents(1);
aCellTypesArray->SetNumberOfTuples(aNbCells);
+ TSubMeshID& aMeshID = theFamily->myMeshID;
+ aMeshID.resize(aNbCells);
+
+ VISU::TID2ID& anElemObj2VTKID = theFamily->myElemObj2VTKID;
+
const VISU::TGeom2SubMesh& aGeom2SubMesh = theMeshOnEntity->myGeom2SubMesh;
VISU::TGeom2SubMesh::const_iterator anIter = aGeom2SubMesh.begin();
for(vtkIdType i = 0, j = 0; anIter != aGeom2SubMesh.end(); anIter++){
VISU::TSubMeshID::const_iterator aSubMeshIDIter = aSubMeshID.begin();
for(; aSubMeshIDIter != aSubMeshID.end(); aSubMeshIDIter++, i++){
- PrintCells(i,aConnectivity,anArray[*aSubMeshIDIter]);
+ vtkIdType anID = *aSubMeshIDIter;
+ PrintCells(i,aConnectivity,anArray[anID]);
aCellTypesArray->SetValue(j++,(unsigned char)aGeom);
+
+ anElemObj2VTKID[anID] = i;
+ aMeshID[i] = anID;
}
}
vtkIdType *pts = 0, npts = 0;
struct TFamilyImpl: virtual TFamily, virtual TSource
{
+ virtual
+ vtkCell*
+ GetElemCell(int theObjID);
+
+ virtual
+ vtkIdType
+ GetElemVTKID(vtkIdType theID) const;
+
+ virtual
+ vtkIdType
+ GetElemObjID(vtkIdType theID) const;
+
+ TID2ID myElemObj2VTKID;
+ TSubMeshID myMeshID;
+
TGeom2SubMeshID myGeom2SubMeshID;
};
typedef SharedPtr<TFamilyImpl> PFamilyImpl;