From bbd0dfcd95c6cbe277ee2c58af50a0efba62f585 Mon Sep 17 00:00:00 2001 From: pkv Date: Mon, 29 Aug 2005 11:57:39 +0000 Subject: [PATCH] adds IDs mapping --- src/CONVERTOR/VISU_Convertor.hxx | 9 +++++++- src/CONVERTOR/VISU_Convertor_impl.cxx | 16 ++++++++++++++ src/CONVERTOR/VISU_Convertor_impl.hxx | 7 ++++++ src/OBJECT/VISU_Actor.cxx | 26 ++++++++++++++++++---- src/PIPELINE/VISU_PipeLine.cxx | 10 +++++++++ src/PIPELINE/VISU_PipeLine.hxx | 3 +++ src/PIPELINE/VISU_ScalarMapPL.cxx | 32 +++++++++++++++++++++++++++ src/PIPELINE/VISU_ScalarMapPL.hxx | 9 ++++++++ 8 files changed, 107 insertions(+), 5 deletions(-) diff --git a/src/CONVERTOR/VISU_Convertor.hxx b/src/CONVERTOR/VISU_Convertor.hxx index 718e18ff..a08fef2b 100644 --- a/src/CONVERTOR/VISU_Convertor.hxx +++ b/src/CONVERTOR/VISU_Convertor.hxx @@ -333,7 +333,14 @@ public: const VISU::TEntity& theEntity, const std::string& theFieldName, int theStampsNum) = 0; - + + virtual + VISU::PProfile + GetProfile(const std::string& theMeshName, + const VISU::TEntity& theEntity, + const std::string& theFieldName, + int theStampsNum) = 0; + virtual TOutput* GetTimeStampOnGaussPts(const std::string& theMeshName, diff --git a/src/CONVERTOR/VISU_Convertor_impl.cxx b/src/CONVERTOR/VISU_Convertor_impl.cxx index 5183abf4..c81d2827 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.cxx +++ b/src/CONVERTOR/VISU_Convertor_impl.cxx @@ -1467,6 +1467,22 @@ VISU_Convertor_impl return aSource.GetPointer(); } +//--------------------------------------------------------------- +VISU::PProfile +VISU_Convertor_impl::GetProfile(const std::string& theMeshName, + const VISU::TEntity& theEntity, + const std::string& theFieldName, + int theStampsNum) +{ + GetTimeStampOnMesh(theMeshName, theEntity, theFieldName, theStampsNum); + TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName, + theEntity, + theFieldName, + theStampsNum); + PValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp); + PProfileImpl aProfile = aValForTime->myProfile; + return aProfile; +} //--------------------------------------------------------------- VISU_Convertor::TOutput* diff --git a/src/CONVERTOR/VISU_Convertor_impl.hxx b/src/CONVERTOR/VISU_Convertor_impl.hxx index 64b33f0b..e57c7445 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.hxx +++ b/src/CONVERTOR/VISU_Convertor_impl.hxx @@ -431,6 +431,13 @@ public: const std::string& theFieldName, int theStampsNum); virtual + VISU::PProfile + GetProfile(const std::string& theMeshName, + const VISU::TEntity& theEntity, + const std::string& theFieldName, + int theStampsNum); + + virtual TOutput* GetTimeStampOnGaussPts(const std::string& theMeshName, const VISU::TEntity& theEntity, diff --git a/src/OBJECT/VISU_Actor.cxx b/src/OBJECT/VISU_Actor.cxx index ac8298d3..072cd704 100644 --- a/src/OBJECT/VISU_Actor.cxx +++ b/src/OBJECT/VISU_Actor.cxx @@ -214,11 +214,29 @@ void VISU_Actor::ShallowCopy(vtkProp *prop){ //---------------------------------------------------------------------------- int VISU_Actor::GetNodeObjId(int theVtkID){ - if ( myIsShrunk ) - return myShrinkFilter->GetNodeObjId(theVtkID); - return theVtkID; + vtkIdType aID; + // + aID=theVtkID; + if (myIsShrunk) { + aID= myShrinkFilter->GetNodeObjId(theVtkID); + } + if (myPipeLine) { + aID=myPipeLine->GetNodeObjID(aID); + } + return aID; } +//---------------------------------------------------------------------------- int VISU_Actor::GetElemObjId(int theVtkID){ - return myGeomFilter->GetElemObjId(theVtkID); + vtkIdType aID; + // + aID=theVtkID; + + if (myIsShrunk) { + aID= myShrinkFilter->GetElemObjId(theVtkID); + } + if (myPipeLine) { + aID=myPipeLine->GetElemObjID(aID); + } + return aID; } diff --git a/src/PIPELINE/VISU_PipeLine.cxx b/src/PIPELINE/VISU_PipeLine.cxx index d670a681..a13806cc 100644 --- a/src/PIPELINE/VISU_PipeLine.cxx +++ b/src/PIPELINE/VISU_PipeLine.cxx @@ -312,3 +312,13 @@ bool VISU_PipeLine::IsPlanarInput() const return false; } + +vtkIdType VISU_PipeLine::GetNodeObjID(vtkIdType theVtkID) +{ + return myExtractGeometry->GetNodeObjId(theVtkID); +} + +vtkIdType VISU_PipeLine::GetElemObjID(vtkIdType theVtkID) +{ + return myExtractGeometry->GetElemObjId(theVtkID); +} diff --git a/src/PIPELINE/VISU_PipeLine.hxx b/src/PIPELINE/VISU_PipeLine.hxx index 4dd6db6e..56b7dee4 100644 --- a/src/PIPELINE/VISU_PipeLine.hxx +++ b/src/PIPELINE/VISU_PipeLine.hxx @@ -101,6 +101,9 @@ public: bool IsShrinkable() { return myIsShrinkable; } + virtual vtkIdType GetNodeObjID(vtkIdType theVtkID); + virtual vtkIdType GetElemObjID(vtkIdType theVtkID); + protected: VISU_PipeLine(); VISU_PipeLine(const VISU_PipeLine&); diff --git a/src/PIPELINE/VISU_ScalarMapPL.cxx b/src/PIPELINE/VISU_ScalarMapPL.cxx index 473d2de8..5cc88197 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.cxx +++ b/src/PIPELINE/VISU_ScalarMapPL.cxx @@ -133,6 +133,38 @@ void VISU_ScalarMapPL::Init(){ //SetSourceRange(); } +void VISU_ScalarMapPL::SetProfile(const VISU::PProfile& theProfile) +{ + myProfile=theProfile; +} +const VISU::PProfile& VISU_ScalarMapPL::GetProfile()const +{ + return myProfile; +} + +vtkIdType VISU_ScalarMapPL::GetNodeObjID(vtkIdType theVtkID) +{ + vtkIdType aIDx=-1; + // + if (!myProfile){ + return aIDx; + } + aIDx=VISU_PipeLine::GetNodeObjID(theVtkID); + aIDx=myProfile->GetNodeObjID(aIDx); + return aIDx; +} + +vtkIdType VISU_ScalarMapPL::GetElemObjID(vtkIdType theVtkID) +{ + vtkIdType aIDx=-1; + // + if (!myProfile){ + return aIDx; + } + aIDx=VISU_PipeLine::GetElemObjID(theVtkID); + aIDx=myProfile->GetElemObjID(aIDx); + return aIDx; +} void VISU_ScalarMapPL::Build() { myExtractor->SetInput(GetInput2()); diff --git a/src/PIPELINE/VISU_ScalarMapPL.hxx b/src/PIPELINE/VISU_ScalarMapPL.hxx index b5358285..bfdffb22 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.hxx +++ b/src/PIPELINE/VISU_ScalarMapPL.hxx @@ -31,6 +31,8 @@ #include "VISU_PipeLine.hxx" #include "VISU_ScalarBarActor.hxx" +#include + class vtkDataSet; class VISU_Extractor; @@ -74,6 +76,12 @@ public: virtual void GetSourceRange(float theRange[2]); virtual void SetSourceRange(); + virtual vtkIdType GetNodeObjID(vtkIdType theVtkID); + virtual vtkIdType GetElemObjID(vtkIdType theVtkID); + + void SetProfile(const VISU::PProfile& theProfile); + const VISU::PProfile& GetProfile()const; + protected: typedef vtkDataSet THook; virtual THook* DoHook(); @@ -81,6 +89,7 @@ protected: VISU_LookupTable *myMapperTable, *myBarTable; VISU_FieldTransform *myFieldTransform; VISU_Extractor* myExtractor; + VISU::PProfile myProfile; }; #endif -- 2.39.2