From 1129b93862b767bc6c494f125657c55e096c899c Mon Sep 17 00:00:00 2001 From: apo Date: Mon, 26 Sep 2005 14:23:57 +0000 Subject: [PATCH] To implement more careful pipeline shallow copy --- src/PIPELINE/VISU_GaussPointsPL.cxx | 19 +++++++++---------- src/PIPELINE/VISU_ImplicitFunctionWidget.cxx | 9 +++++++++ src/PIPELINE/VISU_ImplicitFunctionWidget.h | 3 +-- src/PIPELINE/VISU_PipeLine.cxx | 13 ++++++++++--- src/PIPELINE/VISU_ScalarMapPL.cxx | 2 +- 5 files changed, 30 insertions(+), 16 deletions(-) diff --git a/src/PIPELINE/VISU_GaussPointsPL.cxx b/src/PIPELINE/VISU_GaussPointsPL.cxx index d2071495..292babe5 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.cxx +++ b/src/PIPELINE/VISU_GaussPointsPL.cxx @@ -59,15 +59,14 @@ void VISU_GaussPointsPL ::ShallowCopy(VISU_PipeLine *thePipeLine) { - SetIDMapper(thePipeLine->GetIDMapper()); - myPSMapper->ShallowCopy(thePipeLine->GetMapper()); - Build(); - + Superclass::ShallowCopy(thePipeLine); if(VISU_GaussPointsPL *aPipeLine = dynamic_cast(thePipeLine)){ - SetScalarRange(aPipeLine->GetScalarRange()); - SetScalarMode(aPipeLine->GetScalarMode()); - SetNbColors(aPipeLine->GetNbColors()); - SetScaling(aPipeLine->GetScaling()); + SetGaussMesh(aPipeLine->GetGaussMesh()); + + vtkPolyData* aDatsSet = myPSMapper->GetInput(); + myPSMapper->ShallowCopy(aPipeLine->GetPSMapper()); + // To restore mapper input from pipeline + myPSMapper->SetInput(aDatsSet); SetGaussMesh(aPipeLine->GetGaussMesh()); SetClamp(aPipeLine->GetClamp()); @@ -123,8 +122,8 @@ VISU_GaussPointsPL //---------------------------------------------------------------------------- void -VISU_GaussPointsPL:: -Init() +VISU_GaussPointsPL +::Init() { VISU_ScalarMapPL::Init(); diff --git a/src/PIPELINE/VISU_ImplicitFunctionWidget.cxx b/src/PIPELINE/VISU_ImplicitFunctionWidget.cxx index 5d2130e5..236de553 100644 --- a/src/PIPELINE/VISU_ImplicitFunctionWidget.cxx +++ b/src/PIPELINE/VISU_ImplicitFunctionWidget.cxx @@ -417,6 +417,15 @@ void VISU_ImplicitFunctionWidget::SetEnabled(int enabling) this->Interactor->Render(); } + +int +VISU_ImplicitFunctionWidget +::IsEnabled() +{ + return this->Enabled; +} + + //================================================================== // function: ProcessEvents // purpose : diff --git a/src/PIPELINE/VISU_ImplicitFunctionWidget.h b/src/PIPELINE/VISU_ImplicitFunctionWidget.h index 5b59e1dc..1590f303 100644 --- a/src/PIPELINE/VISU_ImplicitFunctionWidget.h +++ b/src/PIPELINE/VISU_ImplicitFunctionWidget.h @@ -67,8 +67,7 @@ public: // Methods that satisfy the superclass' API. virtual void SetEnabled(int); virtual void PlaceWidget(float bounds[6]); - void PlaceWidget() - {this->Superclass::PlaceWidget();} + int IsEnabled(); // Description: // Get the origin of the plane. diff --git a/src/PIPELINE/VISU_PipeLine.cxx b/src/PIPELINE/VISU_PipeLine.cxx index 57f11890..be88e0b5 100644 --- a/src/PIPELINE/VISU_PipeLine.cxx +++ b/src/PIPELINE/VISU_PipeLine.cxx @@ -88,8 +88,15 @@ VISU_PipeLine ::ShallowCopy(VISU_PipeLine *thePipeLine) { SetIDMapper(thePipeLine->GetIDMapper()); - GetMapper()->ShallowCopy(thePipeLine->GetMapper()); + SetImplicitFunction(thePipeLine->GetImplicitFunction()); + + vtkDataSet* aDatsSet = myMapper->GetInput(); + GetMapper()->ShallowCopy(thePipeLine->GetMapper()); + + // To restore mapper input from pipeline + myMapper->SetInput(aDatsSet); + Build(); } @@ -325,7 +332,7 @@ vtkIdType VISU_PipeLine ::GetNodeObjID(vtkIdType theID) { - vtkIdType anID=myExtractGeometry->GetNodeObjId(theID); + vtkIdType anID = myExtractGeometry->GetNodeObjId(theID); return myIDMapper->GetNodeObjID(anID); } @@ -348,7 +355,7 @@ vtkIdType VISU_PipeLine ::GetElemObjID(vtkIdType theID) { - vtkIdType anID=myExtractGeometry->GetElemObjId(theID); + vtkIdType anID = myExtractGeometry->GetElemObjId(theID); return myIDMapper->GetElemObjID(anID); } diff --git a/src/PIPELINE/VISU_ScalarMapPL.cxx b/src/PIPELINE/VISU_ScalarMapPL.cxx index ac75caae..2b46d042 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.cxx +++ b/src/PIPELINE/VISU_ScalarMapPL.cxx @@ -67,7 +67,7 @@ void VISU_ScalarMapPL::ShallowCopy(VISU_PipeLine *thePipeLine){ SetScalarMode(aPipeLine->GetScalarMode()); SetNbColors(aPipeLine->GetNbColors()); SetScaling(aPipeLine->GetScaling()); - //Update(); + Update(); // apo-gauss } } -- 2.39.2