From 5ba5026a7f64246ba48c781957d9b011bdf0175b Mon Sep 17 00:00:00 2001 From: apo Date: Fri, 11 May 2007 06:07:01 +0000 Subject: [PATCH] To restore previous version --- .../VISU_ScalarMapOnDeformedShapePL.cxx | 123 ++++-------------- .../VISU_ScalarMapOnDeformedShapePL.hxx | 22 +--- 2 files changed, 29 insertions(+), 116 deletions(-) diff --git a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx index 202d14cf..6a0be83a 100644 --- a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx +++ b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx @@ -34,13 +34,6 @@ #include "VTKViewer_TransformFilter.h" #include "VTKViewer_Transform.h" -#include "SALOME_ExtractGeometry.h" - -#include -#include -#include -#include - #include #include #include @@ -59,25 +52,20 @@ vtkStandardNewMacro(VISU_ScalarMapOnDeformedShapePL) * \li myScalars is vtk shared pointer to vtkUnstructuredGrid - scalars data */ VISU_ScalarMapOnDeformedShapePL -::VISU_ScalarMapOnDeformedShapePL(): - myScalarsExtractGeometry(SALOME_ExtractGeometry::New()) +::VISU_ScalarMapOnDeformedShapePL() { - myCellDataToPointData = VISU_CellDataToPointData::New(); - myWarpVector = vtkWarpVector::New(); - myScalarsExtractGeometry->SetInput(myMergeFilter->GetOutput()); - vtkImplicitBoolean* anImplicitBoolean = vtkImplicitBoolean::New(); - myScalarsExtractGeometry->SetImplicitFunction(anImplicitBoolean); - anImplicitBoolean->SetOperationTypeToIntersection(); - anImplicitBoolean->Delete(); + myScalarsMergeFilter = VISU_MergeFilter::New(); + myScalarsMergeFilter->SetMergingInputs(true); myScalarsExtractor = VISU_Extractor::New(); myScalarsFieldTransform = VISU_FieldTransform::New(); - myScalarsMergeFilter = VISU_MergeFilter::New(); - myScalarsMergeFilter->SetMergingInputs(true); + myCellDataToPointData = VISU_CellDataToPointData::New(); + + myScalars = myMergeFilter->GetOutput(); } /*! @@ -91,8 +79,6 @@ VISU_ScalarMapOnDeformedShapePL myScalarsMergeFilter->Delete(); - myScalarsExtractGeometry->Delete(); - myScalarsExtractor->Delete(); myScalarsFieldTransform->Delete(); @@ -100,77 +86,6 @@ VISU_ScalarMapOnDeformedShapePL myCellDataToPointData->Delete(); } -/*! - * Copy information about pipline. - * Copy scale and scalars. - */ -void -VISU_ScalarMapOnDeformedShapePL -::ShallowCopy(VISU_PipeLine *thePipeLine) -{ - VISU_ScalarMapOnDeformedShapePL *aPipeLine = dynamic_cast(thePipeLine); - if(aPipeLine){ - SetScale(aPipeLine->GetScale()); - SetScalars(aPipeLine->GetScalars()); - } - Superclass::ShallowCopy(thePipeLine); -} - -//======================================================================= -void -VISU_ScalarMapOnDeformedShapePL -::SetImplicitFunction(vtkImplicitFunction *theFunction) -{ - Superclass::SetImplicitFunction(theFunction); - - myScalarsExtractGeometry->SetImplicitFunction(theFunction); -} - - -void -VISU_ScalarMapOnDeformedShapePL -::RemoveAllClippingPlanes() -{ - Superclass::RemoveAllClippingPlanes(); - - if(vtkImplicitBoolean* aBoolean = myScalarsExtractGeometry->GetImplicitBoolean()){ - vtkImplicitFunctionCollection* aFunction = aBoolean->GetFunction(); - aFunction->RemoveAllItems(); - aBoolean->Modified(); // VTK bug - } -} - - -bool -VISU_ScalarMapOnDeformedShapePL -::AddClippingPlane(vtkPlane* thePlane) -{ - Superclass::AddClippingPlane(thePlane); - - if (thePlane) { - if (vtkImplicitBoolean* aBoolean = myScalarsExtractGeometry->GetImplicitBoolean()) { - vtkImplicitFunctionCollection* aFunction = aBoolean->GetFunction(); - aFunction->AddItem(thePlane); - - // Check, that at least one cell present after clipping. - // This check was introduced because of bug IPAL8849. - if (GetScalarsClippedInput()->GetNumberOfCells() < 1) - return false; - } - } - return true; -} - - -VISU_PipeLine::TInput* -VISU_ScalarMapOnDeformedShapePL -::GetScalarsClippedInput() -{ - if(myScalarsExtractGeometry->GetInput()) - myScalarsExtractGeometry->Update(); - return myScalarsExtractGeometry->GetOutput(); -} - //======================================================================= void VISU_ScalarMapOnDeformedShapePL @@ -254,29 +169,43 @@ VISU_ScalarMapOnDeformedShapePL SetScale(VISU_DeformedShapePL::GetDefaultScale(this)); } +/*! + * Copy information about pipline. + * Copy scale and scalars. + */ +void +VISU_ScalarMapOnDeformedShapePL +::ShallowCopy(VISU_PipeLine *thePipeLine) +{ + VISU_ScalarMapOnDeformedShapePL *aPipeLine = dynamic_cast(thePipeLine); + if(aPipeLine){ + SetScale(aPipeLine->GetScale()); + SetScalars(aPipeLine->GetScalars()); + } + Superclass::ShallowCopy(thePipeLine); +} + /*! * Set scalars. * Sets vtkDataSet with scalars values to VISU_Extractor filter for scalars extraction. */ void VISU_ScalarMapOnDeformedShapePL -::SetScalars(TInput *theScalars) +::SetScalars(vtkDataSet *theScalars) { - myScalarsExtractGeometry->SetInput(theScalars); + myScalars = theScalars; } /*! * Get pointer to input scalars. */ -VISU_PipeLine::TInput* +vtkPointSet* VISU_ScalarMapOnDeformedShapePL ::GetScalars() { - vtkDataSet* aDataSet = myScalarsExtractGeometry->GetInput(); - return dynamic_cast(aDataSet); + return myScalars.GetPointer(); } - /*! * Sets scale for deformed shape */ diff --git a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx index cd53b31f..e1f805f3 100644 --- a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx +++ b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx @@ -55,19 +55,6 @@ public: void ShallowCopy(VISU_PipeLine *thePipeLine); - // Clipping planes - virtual - void - RemoveAllClippingPlanes(); - - virtual - bool - AddClippingPlane(vtkPlane* thePlane); - - virtual - void - SetImplicitFunction(vtkImplicitFunction *theFunction); - virtual void SetScale(vtkFloatingPointType theScale); @@ -98,10 +85,10 @@ public: virtual void - SetScalars(TInput *theScalars); + SetScalars(vtkDataSet *theScalars); virtual - TInput* + vtkPointSet* GetScalars(); public: @@ -133,14 +120,11 @@ protected: TInsertCustomPL* InsertCustomPL(); - TInput* - GetScalarsClippedInput(); - vtkFloatingPointType myScaleFactor; vtkWarpVector *myWarpVector; VISU_MergeFilter *myScalarsMergeFilter; + vtkSmartPointer myScalars; VISU_CellDataToPointData* myCellDataToPointData; - SALOME_ExtractGeometry* myScalarsExtractGeometry; VISU_FieldTransform* myScalarsFieldTransform; VISU_Extractor* myScalarsExtractor; }; -- 2.39.2