From 3c512e4df79f85f5ea4bbc55f4ccc5b87f3fb59b Mon Sep 17 00:00:00 2001 From: apo Date: Wed, 2 May 2007 11:52:53 +0000 Subject: [PATCH] In context of [Bug NPAL15278] EDF 347 : ScalarMaponDeformedShape Restore selection functionality --- src/CONVERTOR/VISU_Convertor_impl.cxx | 30 +++++++++++++++--- src/OBJECT/VISU_Actor.cxx | 44 ++++++++++++++++----------- 2 files changed, 51 insertions(+), 23 deletions(-) diff --git a/src/CONVERTOR/VISU_Convertor_impl.cxx b/src/CONVERTOR/VISU_Convertor_impl.cxx index fa801675..e63d3b60 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.cxx +++ b/src/CONVERTOR/VISU_Convertor_impl.cxx @@ -656,16 +656,25 @@ namespace VISU 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 @@ -2010,6 +2019,10 @@ 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, aCellID = 0; anIter != aGeom2SubMesh.end(); anIter++, anID++){ EGeometry aEGeom = anIter->first; vtkIdType aVGeom = VISUGeom2VTK(aEGeom); @@ -2028,7 +2041,14 @@ VISU_Convertor_impl 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 diff --git a/src/OBJECT/VISU_Actor.cxx b/src/OBJECT/VISU_Actor.cxx index 06c487b3..c2f6a388 100644 --- a/src/OBJECT/VISU_Actor.cxx +++ b/src/OBJECT/VISU_Actor.cxx @@ -32,9 +32,6 @@ #include "VTKViewer_GeometryFilter.h" #include "VTKViewer_PassThroughFilter.h" -#include "VISU_ConvertorUtils.hxx" -#include "VISU_ConvertorDef.hxx" - #include #include @@ -411,16 +408,25 @@ vtkIdType VISU_Actor ::GetNodeObjId(vtkIdType theID) { - if(MYDEBUG) cout << "GetNodeObjId("<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("<GetInput(),theID); + if(myIsVTKMapping) + return theID; + + return GetCurrentPL()->GetNodeVTKID(theID); } vtkFloatingPointType* @@ -439,23 +445,25 @@ vtkIdType VISU_Actor ::GetElemObjId(vtkIdType theID) { - if(MYDEBUG) cout << "GetElemObjId("<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("<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* -- 2.39.2