From 2e89fb2eba465f1d6a7df633da33e649dfc409c2 Mon Sep 17 00:00:00 2001 From: pkv Date: Thu, 1 Sep 2005 13:20:26 +0000 Subject: [PATCH] provides ID mapping for entities --- src/PIPELINE/VISU_PipeLine.cxx | 45 ++++++++++++---------- src/PIPELINE/VISU_ScalarMapPL.cxx | 62 ------------------------------- src/PIPELINE/VISU_ScalarMapPL.hxx | 24 +----------- src/VISU_I/VISU_Mesh_i.cc | 4 ++ 4 files changed, 30 insertions(+), 105 deletions(-) diff --git a/src/PIPELINE/VISU_PipeLine.cxx b/src/PIPELINE/VISU_PipeLine.cxx index 05ae01be..c00f14c7 100644 --- a/src/PIPELINE/VISU_PipeLine.cxx +++ b/src/PIPELINE/VISU_PipeLine.cxx @@ -317,44 +317,49 @@ vtkIdType VISU_PipeLine ::GetNodeObjID(vtkIdType theID) { - return myExtractGeometry->GetNodeObjId(theID); + vtkIdType anID=myExtractGeometry->GetNodeObjId(theID); + return myIDMapper->GetNodeObjID(anID); } vtkIdType VISU_PipeLine ::GetNodeVTKID(vtkIdType theID) { - return -1; + return myIDMapper->GetNodeVTKID(theID); } float* VISU_PipeLine -::GetNodeCoord(int ) +::GetNodeCoord(int theObjID) { - return NULL; + return myIDMapper->GetNodeCoord(theObjID); } - -vtkIdType -VISU_PipeLine -::GetElemObjID(vtkIdType theID) +//modified by NIZNHY-PKV Thu Sep 1 18:15:13 2005f +//======================================================================= +//function : VISU_PipeLine::GetElemObjID +//purpose : +//======================================================================= +vtkIdType VISU_PipeLine::GetElemObjID(vtkIdType theID) { - return myExtractGeometry->GetElemObjId(theID); + vtkIdType anID=myExtractGeometry->GetElemObjId(theID); + return myIDMapper->GetElemObjID(anID); } - -vtkIdType -VISU_PipeLine -::GetElemVTKID(vtkIdType theID) +//======================================================================= +//function : VISU_PipeLine::GetElemVTKID +//purpose : +//======================================================================= +vtkIdType VISU_PipeLine::GetElemVTKID(vtkIdType theID) { - return -1; + return myIDMapper->GetElemVTKID(theID); } - -vtkCell* -VISU_PipeLine -::GetElemCell(int ) +//======================================================================= +//function : VISU_PipeLine::GetElemCell +//purpose : +//======================================================================= +vtkCell* VISU_PipeLine::GetElemCell(vtkIdType theObjID) { - return NULL; + return myIDMapper->GetElemCell(theObjID); } -//modified by NIZNHY-PKV Thu Sep 1 16:16:05 2005f //======================================================================= //function : VISU_PipeLine::SetIdMapper //purpose : diff --git a/src/PIPELINE/VISU_ScalarMapPL.cxx b/src/PIPELINE/VISU_ScalarMapPL.cxx index 86235fa8..c105447d 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.cxx +++ b/src/PIPELINE/VISU_ScalarMapPL.cxx @@ -149,68 +149,6 @@ VISU_ScalarMapPL } */ //modified by NIZNHY-PKV Thu Sep 1 16:25:30 2005t -vtkIdType -VISU_ScalarMapPL -::GetNodeObjID(vtkIdType theID) -{ - vtkIdType anID = VISU_PipeLine::GetNodeObjID(theID); - //modified by NIZNHY-PKV Thu Sep 1 16:26:06 2005f - //return myProfile->GetNodeObjID(anID); - return myIDMapper->GetNodeObjID(anID); - //modified by NIZNHY-PKV Thu Sep 1 16:26:09 2005t -} - -vtkIdType -VISU_ScalarMapPL -::GetNodeVTKID(vtkIdType theID) -{ - //modified by NIZNHY-PKV Thu Sep 1 16:26:32 2005f - //return myProfile->GetNodeVTKID(theID); - return myIDMapper->GetNodeVTKID(theID); - //modified by NIZNHY-PKV Thu Sep 1 16:26:34 2005t -} - -float* -VISU_ScalarMapPL -::GetNodeCoord(int theObjID) -{ - //modified by NIZNHY-PKV Thu Sep 1 16:27:21 2005f - //return GetProfile()->GetNodeCoord(theObjID); - return myIDMapper->GetNodeCoord(theObjID); - //modified by NIZNHY-PKV Thu Sep 1 16:27:24 2005t -} - -vtkIdType -VISU_ScalarMapPL -::GetElemObjID(vtkIdType theID) -{ - vtkIdType anID = VISU_PipeLine::GetElemObjID(theID); - //modified by NIZNHY-PKV Thu Sep 1 16:27:52 2005f - //return myProfile->GetElemObjID(anID); - return myIDMapper->GetElemObjID(anID);return myIDMapper->GetElemObjID(anID); - //modified by NIZNHY-PKV Thu Sep 1 16:27:54 2005t -} - -vtkIdType -VISU_ScalarMapPL -::GetElemVTKID(vtkIdType theID) -{ - //modified by NIZNHY-PKV Thu Sep 1 16:28:32 2005f - // return myProfile->GetElemVTKID(theID); - return myIDMapper->GetElemVTKID(theID); - //modified by NIZNHY-PKV Thu Sep 1 16:28:35 2005t -} - -vtkCell* -VISU_ScalarMapPL:: -GetElemCell(vtkIdType theObjID) -{ - //modified by NIZNHY-PKV Thu Sep 1 16:28:53 2005f - // return GetProfile()->GetElemCell(theObjID); - return myIDMapper->GetElemCell(theObjID); - //modified by NIZNHY-PKV Thu Sep 1 16:28:59 2005t -} - void VISU_ScalarMapPL::Build() { myExtractor->SetInput(GetInput2()); diff --git a/src/PIPELINE/VISU_ScalarMapPL.hxx b/src/PIPELINE/VISU_ScalarMapPL.hxx index 68a33af1..483ec5a5 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.hxx +++ b/src/PIPELINE/VISU_ScalarMapPL.hxx @@ -86,29 +86,7 @@ public: GetProfile()const; */ //pkv t - virtual - vtkIdType - GetNodeObjID(vtkIdType theID); - - virtual - vtkIdType - GetNodeVTKID(vtkIdType theID); - - virtual - float* - GetNodeCoord(vtkIdType theObjID); - - virtual - vtkIdType - GetElemObjID(vtkIdType theID); - - virtual - vtkIdType - GetElemVTKID(vtkIdType theID); - - virtual - vtkCell* - GetElemCell(vtkIdType theObjID); + protected: typedef vtkDataSet THook; diff --git a/src/VISU_I/VISU_Mesh_i.cc b/src/VISU_I/VISU_Mesh_i.cc index 10462c6a..2a2f1684 100644 --- a/src/VISU_I/VISU_Mesh_i.cc +++ b/src/VISU_I/VISU_Mesh_i.cc @@ -247,6 +247,10 @@ VISU::Storable* VISU::Mesh_i::Build (int theRestoring) } if(anOutput == NULL) throw std::runtime_error("Mesh_i::Build - anOutput == NULL !!!"); myMeshPL->SetInput(anOutput); + //pkv f + myMeshPL->SetIDMapper(myResult->GetInput()-> // i.e. the VISU_Convertor + GetMeshOnEntityIDMapper(myMeshName,(VISU::TEntity)myEntity)); + //pkv t myMeshPL->Build(); if(!theRestoring) { //Setting IOR on the label myMeshPL->Init(); -- 2.39.2