From: apo Date: Wed, 25 Apr 2007 11:24:01 +0000 (+0000) Subject: Merge with BR_Dev_For_4_0 (initial version) X-Git-Tag: mergeto_BR_Dev_For_4_0_21May07~37 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2d58eff7c10361dfe72e550e80167fca559e4535;p=modules%2Fvisu.git Merge with BR_Dev_For_4_0 (initial version) --- diff --git a/src/PIPELINE/VISU_ColoredPL.cxx b/src/PIPELINE/VISU_ColoredPL.cxx index f41c4a3f..c2cabcdf 100644 --- a/src/PIPELINE/VISU_ColoredPL.cxx +++ b/src/PIPELINE/VISU_ColoredPL.cxx @@ -211,7 +211,7 @@ VISU_ColoredPL myMapperTable->Build(); myBarTable->Build(); - VISU_PipeLine::Update(); + Superclass::Update(); } diff --git a/src/PIPELINE/VISU_ScalarMapPL.cxx b/src/PIPELINE/VISU_ScalarMapPL.cxx index 1153b5d3..44c0216d 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.cxx +++ b/src/PIPELINE/VISU_ScalarMapPL.cxx @@ -28,6 +28,13 @@ #include "VISU_ScalarMapPL.hxx" #include "VISU_DataSetMapperHolder.hxx" +#include "VISU_FieldTransform.hxx" + +#include "VISU_AppendFilter.hxx" +#include "VISU_MergeFilter.hxx" + +#include +#include #include #include @@ -40,8 +47,16 @@ vtkStandardNewMacro(VISU_ScalarMapPL); //---------------------------------------------------------------------------- VISU_ScalarMapPL ::VISU_ScalarMapPL(): - VISU_UnstructuredGridPL(this) -{} + VISU_UnstructuredGridPL(this), + myAppendFilter(VISU_AppendFilter::New()), + myMergeFilter(VISU_MergeFilter::New()) +{ + myAppendFilter->SetMergingInputs(true); + myAppendFilter->Delete(); + + myMergeFilter->SetMergingInputs(true); + myMergeFilter->Delete(); +} //---------------------------------------------------------------------------- @@ -70,4 +85,49 @@ VISU_ScalarMapPL } +//---------------------------------------------------------------------------- +void +VISU_ScalarMapPL +::AddGeometry(vtkDataSet* theGeometry) +{ + myAppendFilter->AddInput(theGeometry); +} + +//---------------------------------------------------------------------------- +int +VISU_ScalarMapPL +::GetNumberOfGeometry() +{ + return myAppendFilter->GetNumberOfInputConnections(0); +} + +//---------------------------------------------------------------------------- +void +VISU_ScalarMapPL +::ClearGeometry() +{ + myAppendFilter->RemoveAllInputs(); +} + +//---------------------------------------------------------------------------- +vtkDataSet* +VISU_ScalarMapPL +::InsertCustomPL() +{ + vtkDataSet* aDataSet = Superclass::InsertCustomPL(); + myMergeFilter->SetGeometry(myAppendFilter->GetOutput()); + myAppendFilter->SetSharedPointSet(GetFieldTransformFilter()->GetUnstructuredGridOutput()); + + myMergeFilter->SetScalars(aDataSet); + myMergeFilter->SetVectors(aDataSet); + + myMergeFilter->RemoveFields(); + myMergeFilter->AddField("VISU_FIELD", aDataSet); + myMergeFilter->AddField("VISU_CELLS_MAPPER", aDataSet); + myMergeFilter->AddField("VISU_POINTS_MAPPER", aDataSet); + + return myMergeFilter->GetOutput(); +} + + //---------------------------------------------------------------------------- diff --git a/src/PIPELINE/VISU_ScalarMapPL.hxx b/src/PIPELINE/VISU_ScalarMapPL.hxx index 0a6bd876..de035fba 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.hxx +++ b/src/PIPELINE/VISU_ScalarMapPL.hxx @@ -33,6 +33,8 @@ #include "VISU_UnstructuredGridPL.hxx" class VISU_DataSetMapperHolder; +class VISU_AppendFilter; +class VISU_MergeFilter; //---------------------------------------------------------------------------- @@ -46,6 +48,18 @@ public: VISU_ScalarMapPL* New(); + virtual + void + AddGeometry(vtkDataSet* theGeometry); + + virtual + int + GetNumberOfGeometry(); + + virtual + void + ClearGeometry(); + protected: //---------------------------------------------------------------------------- VISU_ScalarMapPL(); @@ -58,9 +72,17 @@ protected: void OnCreateMapperHolder(); + virtual + vtkDataSet* + InsertCustomPL(); + virtual void Build(); + +private: + vtkSmartPointer myAppendFilter; + vtkSmartPointer myMergeFilter; }; #endif