From 9546e32b27125f16bb56e0a0da6a3b16eba2ed87 Mon Sep 17 00:00:00 2001 From: ouv Date: Thu, 21 Mar 2013 10:02:26 +0000 Subject: [PATCH] Issue 0051810: TC7.2.0: Impossible to build presentation on family --- src/CONVERTOR/VISU_ConvertorDef_impl.hxx | 2 ++ src/CONVERTOR/VISU_Structures_impl.cxx | 15 ++++++++++++++- src/CONVERTOR/VISU_Structures_impl.hxx | 5 +++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/CONVERTOR/VISU_ConvertorDef_impl.hxx b/src/CONVERTOR/VISU_ConvertorDef_impl.hxx index 061db3b2..5cbeb22f 100644 --- a/src/CONVERTOR/VISU_ConvertorDef_impl.hxx +++ b/src/CONVERTOR/VISU_ConvertorDef_impl.hxx @@ -48,12 +48,14 @@ class VISU_AppendFilter; class VISU_MergeFilter; class VISU_CommonCellsFilter; +class vtkPassThroughFilter; namespace VISU { //--------------------------------------------------------------- typedef vtkSmartPointer PMergeFilter; typedef vtkSmartPointer PCommonCellsFilter; + typedef vtkSmartPointer PPassThroughFilter; //--------------------------------------------------------------- typedef vtkSmartPointer PPolyData; diff --git a/src/CONVERTOR/VISU_Structures_impl.cxx b/src/CONVERTOR/VISU_Structures_impl.cxx index 96d596d1..a86a6e32 100644 --- a/src/CONVERTOR/VISU_Structures_impl.cxx +++ b/src/CONVERTOR/VISU_Structures_impl.cxx @@ -39,6 +39,7 @@ #include #include #include +#include namespace VISU { @@ -329,6 +330,18 @@ namespace VISU return mySource; } + const PPassThroughFilter& + TUnstructuredGridHolder + ::GetFilter() const + { + if(!myFilter.GetPointer()){ + myFilter = vtkPassThroughFilter::New(); + myFilter->Delete(); + myFilter->SetInputData( GetSource() ); + } + return myFilter; + } + vtkUnstructuredGrid* TUnstructuredGridHolder ::GetUnstructuredGridOutput() @@ -340,7 +353,7 @@ namespace VISU TUnstructuredGridHolder ::GetOutputPort() { - return NULL; + return GetFilter()->GetOutputPort(); } unsigned long int diff --git a/src/CONVERTOR/VISU_Structures_impl.hxx b/src/CONVERTOR/VISU_Structures_impl.hxx index 2598cd95..c7e4629c 100644 --- a/src/CONVERTOR/VISU_Structures_impl.hxx +++ b/src/CONVERTOR/VISU_Structures_impl.hxx @@ -86,6 +86,10 @@ namespace VISU const PUnstructuredGrid& GetSource() const; + //! This method allow to create corresponding VTK filter by demand (not at once) + const PPassThroughFilter& + GetFilter() const; + virtual vtkUnstructuredGrid* GetUnstructuredGridOutput(); @@ -101,6 +105,7 @@ namespace VISU protected: mutable PUnstructuredGrid mySource; + mutable PPassThroughFilter myFilter; }; -- 2.39.2