From 2b16333a40bd3cbcaf8f0bc9fc4cc0808fc0603a Mon Sep 17 00:00:00 2001 From: pkv Date: Tue, 30 Aug 2005 11:55:12 +0000 Subject: [PATCH] adds IDs mapping --- src/CONVERTOR/VISU_Convertor.hxx | 14 +++++++++++++- src/OBJECT/VISU_Actor.cxx | 21 ++++++++++++++++----- src/OBJECT/VISU_Actor.h | 5 ++++- src/PIPELINE/VISU_PipeLine.cxx | 11 +++++++++++ src/PIPELINE/VISU_PipeLine.hxx | 8 +++++++- src/PIPELINE/VISU_ScalarMapPL.cxx | 11 +++++++++++ src/PIPELINE/VISU_ScalarMapPL.hxx | 9 +++++++-- 7 files changed, 69 insertions(+), 10 deletions(-) diff --git a/src/CONVERTOR/VISU_Convertor.hxx b/src/CONVERTOR/VISU_Convertor.hxx index a08fef2b..f788a3e5 100644 --- a/src/CONVERTOR/VISU_Convertor.hxx +++ b/src/CONVERTOR/VISU_Convertor.hxx @@ -40,7 +40,9 @@ #include "MED_Vector.hxx" #include - +//pkv f +class vtkCell; +//pkv t class vtkUnstructuredGrid; namespace VISU @@ -142,6 +144,16 @@ namespace VISU virtual vtkIdType GetElemObjID(int theVtkI) const = 0; + + //pkv f + virtual + vtkCell* + GetElemCell(int theObjID) = 0; + + virtual + float* + GetNodeCoord(int theObjID) = 0; + //pkv t }; diff --git a/src/OBJECT/VISU_Actor.cxx b/src/OBJECT/VISU_Actor.cxx index 072cd704..263500f0 100644 --- a/src/OBJECT/VISU_Actor.cxx +++ b/src/OBJECT/VISU_Actor.cxx @@ -216,9 +216,9 @@ void VISU_Actor::ShallowCopy(vtkProp *prop){ int VISU_Actor::GetNodeObjId(int theVtkID){ vtkIdType aID; // - aID=theVtkID; + aID=myGeomFilter->GetNodeObjId(theVtkID); if (myIsShrunk) { - aID= myShrinkFilter->GetNodeObjId(theVtkID); + aID= myShrinkFilter->GetNodeObjId(aID); } if (myPipeLine) { aID=myPipeLine->GetNodeObjID(aID); @@ -230,13 +230,24 @@ int VISU_Actor::GetNodeObjId(int theVtkID){ int VISU_Actor::GetElemObjId(int theVtkID){ vtkIdType aID; // - aID=theVtkID; - + aID=myGeomFilter->GetElemObjId(theVtkID); if (myIsShrunk) { - aID= myShrinkFilter->GetElemObjId(theVtkID); + aID= myShrinkFilter->GetElemObjId(aID); } if (myPipeLine) { aID=myPipeLine->GetElemObjID(aID); } return aID; } +//modified by NIZNHY-PKV Tue Aug 30 12:46:15 2005f +//---------------------------------------------------------------------------- +vtkCell* VISU_Actor::GetElemCell(int theObjID) +{ + return myPipeLine->GetElemCell(theObjID); +} +//---------------------------------------------------------------------------- +float* VISU_Actor::GetNodeCoord(int theObjID) +{ + return myPipeLine->GetNodeCoord(theObjID); +} +//modified by NIZNHY-PKV Tue Aug 30 12:46:19 2005t diff --git a/src/OBJECT/VISU_Actor.h b/src/OBJECT/VISU_Actor.h index 01cf5c67..e750b174 100644 --- a/src/OBJECT/VISU_Actor.h +++ b/src/OBJECT/VISU_Actor.h @@ -90,7 +90,10 @@ class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor { virtual int GetNodeObjId(int theVtkID); virtual int GetElemObjId(int theVtkID); - + //pkv f + virtual vtkCell* GetElemCell(int theObjID); + virtual float* GetNodeCoord(int theObjID); + //pkv t protected: VISU_Actor(); diff --git a/src/PIPELINE/VISU_PipeLine.cxx b/src/PIPELINE/VISU_PipeLine.cxx index 0baaae33..68812380 100644 --- a/src/PIPELINE/VISU_PipeLine.cxx +++ b/src/PIPELINE/VISU_PipeLine.cxx @@ -322,3 +322,14 @@ vtkIdType VISU_PipeLine::GetElemObjID(vtkIdType theVtkID) { return myExtractGeometry->GetElemObjId(theVtkID); } +//modified by NIZNHY-PKV Tue Aug 30 12:53:58 2005f +vtkCell* VISU_PipeLine::GetElemCell(int ) +{ + return NULL; +} + +float* VISU_PipeLine::GetNodeCoord(int ) +{ + return NULL; +} +//modified by NIZNHY-PKV Tue Aug 30 12:54:01 2005t diff --git a/src/PIPELINE/VISU_PipeLine.hxx b/src/PIPELINE/VISU_PipeLine.hxx index c2d6a25f..396925b8 100644 --- a/src/PIPELINE/VISU_PipeLine.hxx +++ b/src/PIPELINE/VISU_PipeLine.hxx @@ -32,6 +32,9 @@ #include +//pkv f +class vtkCell; +//pkv t template class TVTKSmartPtr: public vtkSmartPointer { @@ -104,7 +107,10 @@ public: virtual vtkIdType GetNodeObjID(vtkIdType theVtkID); virtual vtkIdType GetElemObjID(vtkIdType theVtkID); - + //pkv f + virtual vtkCell* GetElemCell(int theObjID); + virtual float* GetNodeCoord(int theObjID); + //pkv t protected: VISU_PipeLine(); VISU_PipeLine(const VISU_PipeLine&); diff --git a/src/PIPELINE/VISU_ScalarMapPL.cxx b/src/PIPELINE/VISU_ScalarMapPL.cxx index 5cc88197..56af5b44 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.cxx +++ b/src/PIPELINE/VISU_ScalarMapPL.cxx @@ -165,6 +165,17 @@ vtkIdType VISU_ScalarMapPL::GetElemObjID(vtkIdType theVtkID) aIDx=myProfile->GetElemObjID(aIDx); return aIDx; } +//modified by NIZNHY-PKV Tue Aug 30 12:13:53 2005f +vtkCell* VISU_ScalarMapPL::GetElemCell(int theObjID) +{ + return GetProfile()->GetElemCell(theObjID); +} +float* VISU_ScalarMapPL::GetNodeCoord(int theObjID) +{ + return GetProfile()->GetNodeCoord(theObjID); +} +//modified by NIZNHY-PKV Tue Aug 30 12:13:55 2005t + void VISU_ScalarMapPL::Build() { myExtractor->SetInput(GetInput2()); diff --git a/src/PIPELINE/VISU_ScalarMapPL.hxx b/src/PIPELINE/VISU_ScalarMapPL.hxx index bfdffb22..7f6e379c 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.hxx +++ b/src/PIPELINE/VISU_ScalarMapPL.hxx @@ -34,7 +34,9 @@ #include class vtkDataSet; - +//pkv f +class vtkCell; +//pkv t class VISU_Extractor; class VISU_FieldTransform; @@ -81,7 +83,10 @@ public: void SetProfile(const VISU::PProfile& theProfile); const VISU::PProfile& GetProfile()const; - + //pkv f + vtkCell* GetElemCell(int theObjID); + float* GetNodeCoord(int theObjID); + //pkv t protected: typedef vtkDataSet THook; virtual THook* DoHook(); -- 2.39.2