//---------------------------------------------------------------
+ float*
+ TMeshOnEntityImpl
+ ::GetNodeCoord(vtkIdType theObjID)
+ {
+ vtkIdType aVtkID = GetNodeVTKID(theObjID);
+ return GetFilter()->GetOutput()->GetPoint(aVtkID);
+ }
+
+ vtkIdType
+ TMeshOnEntityImpl
+ ::GetNodeVTKID(vtkIdType theID) const
+ {
+ return myNamedPointCoords->GetVTKID(theID);
+ }
+
+ vtkIdType
+ TMeshOnEntityImpl
+ ::GetNodeObjID(vtkIdType theID) const
+ {
+ return myNamedPointCoords->GetObjID(theID);
+ }
+
vtkCell*
TMeshOnEntityImpl
::GetElemCell(int theObjID)
return make_pair(aNbCells,aCellsSize);
}
+ vtkCell*
+ TGroupImpl
+ ::GetElemCell(int theObjID)
+ {
+ vtkIdType aVtkID = GetElemVTKID(theObjID);
+ return GetFilter()->GetOutput()->GetCell(aVtkID);
+ }
+
+ vtkIdType
+ TGroupImpl
+ ::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
+ TGroupImpl
+ ::GetElemObjID(vtkIdType theID) const
+ {
+ vtkIdType anInputID;
+ const TVTKAppendFilter& anAppendFilter = GetFilter();
+ vtkIdType anID = anAppendFilter->GetCellInputID(theID,anInputID);
+ const PFamilyImpl& aFamily = myFamilyArr[anInputID];
+ return aFamily->GetElemObjID(anID);
+ }
+
//---------------------------------------------------------------
void
aSource->SetPoints(GetPoints(aMesh));
GetCellsOnFamily(aSource,aMeshOnEntity,aFamily);
+ aFamily->myNamedPointCoords = aMesh->myNamedPointCoords;
+
aFamily->myIsVTKDone = true;
if(MYDEBUGWITHFILES){
const VISU::TFamilySet& aFamilySet = aGroup->myFamilySet;
LoadMeshOnGroup(aMesh,aFamilySet);
- TFamilySet::const_iterator aFamilyIter = aFamilySet.begin();
- for(; aFamilyIter != aFamilySet.end(); aFamilyIter++){
- PFamilyImpl aFamily = *aFamilyIter;
+ TFamilySet::const_iterator anIter = aFamilySet.begin();
+
+ TID2ID& anElemObj2VTKID = aGroup->myElemObj2VTKID;
+ TFamilyArr& aFamilyArr = aGroup->myFamilyArr;
+ aFamilyArr.resize(aFamilySet.size());
+
+ for(vtkIdType anID = 0; anIter != aFamilySet.end(); anIter++){
+ PFamilyImpl aFamily = *anIter;
const std::string& aFamilyName = aFamily->myName;
const VISU::TEntity& anEntity = aFamily->myEntity;
TOutput* anOutput = GetFamilyOnEntity(theMeshName,anEntity,aFamilyName);
anAppendFilter->AddInput(anOutput);
+
+ vtkIdType aNbCells = anOutput->GetNumberOfCells();
+ for(vtkIdType aCellID = 0; aCellID < aNbCells; aCellID++){
+ anElemObj2VTKID[aFamily->GetElemObjID(aCellID)] = aCellID;
+ }
+ aFamilyArr[anID] = aFamily;
}
+ aGroup->myNamedPointCoords = aMesh->myNamedPointCoords;
aGroup->myIsVTKDone = true;
struct TMeshOnEntityImpl: virtual TMeshOnEntity, virtual TAppendFilter, virtual TSizeCounter
{
+ virtual
+ float*
+ GetNodeCoord(vtkIdType theObjID);
+
+ virtual
+ vtkIdType
+ GetNodeVTKID(vtkIdType theID) const;
+
+ virtual
+ vtkIdType
+ GetNodeObjID(vtkIdType theID) const;
+
virtual
vtkCell*
- GetElemCell(int theObjID);
+ GetElemCell(vtkIdType theID);
virtual
vtkIdType
vtkIdType
GetElemObjID(vtkIdType theID) const;
+ PNamedPointCoords myNamedPointCoords;
TID2ID myElemObj2VTKID;
TSubMeshID myMeshID;
//---------------------------------------------------------------
typedef std::pair<vtkIdType,vtkIdType> TNbASizeCells;
+ typedef TVector<PFamilyImpl> TFamilyArr;
struct TGroupImpl: virtual TGroup, virtual TAppendFilter
{
TNbASizeCells
GetNbASizeCells() const;
+
+ virtual
+ vtkCell*
+ GetElemCell(int theObjID);
+
+ virtual
+ vtkIdType
+ GetElemVTKID(vtkIdType theID) const;
+
+ virtual
+ vtkIdType
+ GetElemObjID(vtkIdType theID) const;
+
+ TID2ID myElemObj2VTKID;
+ TFamilyArr myFamilyArr;
+ PNamedPointCoords myNamedPointCoords;
};
typedef SharedPtr<TGroupImpl> PGroupImpl;