TMeshOnEntityImpl
::GetElemVTKID(vtkIdType theID) const
{
- VISU::TVTKOutput* anOutput = GetFilter()->GetOutput();
- return VISU::GetElemVTKID(anOutput, theID, (int)myEntity);
+ if(myElemObj2VTKID.empty())
+ return theID;
+ else{
+ TID2ID::const_iterator anIter = myElemObj2VTKID.find(theID);
+ if(anIter != myElemObj2VTKID.end())
+ return anIter->second;
+ }
+ return -1;
}
vtkIdType
TMeshOnEntityImpl
::GetElemObjID(vtkIdType theID) const
{
- VISU::TVTKOutput* anOutput = GetFilter()->GetOutput();
- return VISU::GetElemObjID(anOutput, theID);
+ vtkIdType anInputID, aStartId, anInputDataSetID;
+ const TVTKAppendFilter& anAppendFilter = GetFilter();
+ anAppendFilter->GetCellInputID(theID,anInputID,aStartId,anInputDataSetID);
+ const PSubMeshImpl& aSubMesh = mySubMeshArr[anInputDataSetID];
+ return aSubMesh->GetElemObjID(anInputID);
}
std::string
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, aCellID = 0; anIter != aGeom2SubMesh.end(); anIter++, anID++){
EGeometry aEGeom = anIter->first;
vtkIdType aVGeom = VISUGeom2VTK(aEGeom);
aSubMesh->myStartID = aCellID;
GetCellsOnSubMesh(aSource, aMeshOnEntity, aSubMesh, aVGeom);
anAppendFilter->AddInput(aSource.GetPointer());
- aCellID += aSource->GetNumberOfCells();
+
+ vtkIdType aNbCells = aSource->GetNumberOfCells();
+ for(vtkIdType aCell = 0; aCell < aNbCells; aCell++, aCellID++){
+ vtkIdType anObjID = aSubMesh->GetElemObjID(aCell);
+ anElemObj2VTKID[anObjID] = aCellID;
+ }
+
+ aSubMeshArr[anID] = aSubMesh;
}
aMeshOnEntity->myNamedPointCoords = aMesh->myNamedPointCoords;
//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
#include "VTKViewer_GeometryFilter.h"
#include "VTKViewer_PassThroughFilter.h"
-#include "VISU_ConvertorUtils.hxx"
-#include "VISU_ConvertorDef.hxx"
-
#include <stdexcept>
#include <sstream>
VISU_Actor
::GetNodeObjId(vtkIdType theID)
{
- if(MYDEBUG) cout << "GetNodeObjId("<<theID<<")"<<endl;
- return VISU::GetNodeObjID(this->GetInput(),theID);
+ if(myIsVTKMapping)
+ return Superclass::GetNodeObjId(theID);
+
+ vtkIdType anID = myGeomFilter->GetNodeObjId(theID);
+
+ if(myIsShrunk)
+ anID = myShrinkFilter->GetNodeObjId(anID);
+
+ return GetCurrentPL()->GetNodeObjID(anID);
}
vtkIdType
VISU_Actor
::GetNodeVTKID(vtkIdType theID)
{
- if(MYDEBUG) cout << "GetNodeVTKID("<<theID<<")"<<endl;
- return VISU::GetNodeVTKID(this->GetInput(),theID);
+ if(myIsVTKMapping)
+ return theID;
+
+ return GetCurrentPL()->GetNodeVTKID(theID);
}
vtkFloatingPointType*
VISU_Actor
::GetElemObjId(vtkIdType theID)
{
- if(MYDEBUG) cout << "GetElemObjId("<<theID<<")"<<endl;
- return VISU::GetElemObjID(this->GetInput(),theID);
+ if(myIsVTKMapping)
+ return Superclass::GetElemObjId(theID);
+
+ vtkIdType anID = myGeomFilter->GetElemObjId(theID);
+
+ if(myIsShrunk)
+ anID = myShrinkFilter->GetElemObjId(anID);
+
+ return GetCurrentPL()->GetElemObjID(anID);
}
vtkIdType
VISU_Actor
::GetElemVTKID(vtkIdType theID)
{
- if(MYDEBUG) cout << "GetElemVTKID("<<theID<<")"<<endl;
- vtkIdType theId = VISU::GetElemVTKID(this->GetInput(),theID,VISU::CELL_ENTITY);
- if(theId > -1)
- return theId;
- theId = VISU::GetElemVTKID(this->GetInput(),theID,VISU::FACE_ENTITY);
- if(theId > -1)
- return theId;
- theId = VISU::GetElemVTKID(this->GetInput(),theID,VISU::EDGE_ENTITY);
- return theId;
+ if(myIsVTKMapping)
+ return theID;
+
+ return GetCurrentPL()->GetElemVTKID(theID);
}
vtkCell*