From 84a965025a81160caf2dc584f50981271fc0dbe5 Mon Sep 17 00:00:00 2001 From: ouv Date: Wed, 20 Mar 2013 12:36:24 +0000 Subject: [PATCH] Porting to VTK 6. Fixing bugs with SIGSEGV on creation of presentations. --- src/CONVERTOR/VISU_CommonCellsFilter.cxx | 16 ++++++---------- src/CONVERTOR/VISU_CommonCellsFilter.hxx | 4 ---- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/CONVERTOR/VISU_CommonCellsFilter.cxx b/src/CONVERTOR/VISU_CommonCellsFilter.cxx index 4473acb6..526c5bc1 100644 --- a/src/CONVERTOR/VISU_CommonCellsFilter.cxx +++ b/src/CONVERTOR/VISU_CommonCellsFilter.cxx @@ -209,10 +209,10 @@ namespace vtkStandardNewMacro(VISU_CommonCellsFilter); VISU_CommonCellsFilter -::VISU_CommonCellsFilter() : - myIsProfileSet( false ), - myIsCellsSet( false ) -{} +::VISU_CommonCellsFilter() +{ + this->SetNumberOfInputPorts(1); +} VISU_CommonCellsFilter ::~VISU_CommonCellsFilter() @@ -222,7 +222,6 @@ void VISU_CommonCellsFilter ::SetProfileUG(vtkAlgorithmOutput *input) { - myIsProfileSet = true; this->SetInputConnection(0, input); } @@ -230,7 +229,7 @@ void VISU_CommonCellsFilter ::SetCellsUG(vtkAlgorithmOutput *input) { - myIsCellsSet = true; + this->SetNumberOfInputPorts(2); this->SetInputConnection(1, input); } @@ -243,15 +242,12 @@ VISU_CommonCellsFilter { VISU::TTimerLog aTimerLog(MYDEBUG,"VISU_CommonCellsFilter::Execute"); - if( !myIsProfileSet ) - return 0; - vtkInformation *inInfo1 = inputVector[0]->GetInformationObject(0); vtkUnstructuredGrid *anInputProfileUG = vtkUnstructuredGrid::SafeDownCast( inInfo1->Get(vtkDataObject::DATA_OBJECT())); vtkUnstructuredGrid *anInputCellsUG = NULL; - if( myIsCellsSet ) + if( this->GetNumberOfInputPorts() > 1 ) { vtkInformation *inInfo2 = inputVector[1]->GetInformationObject(0); anInputCellsUG = vtkUnstructuredGrid::SafeDownCast( diff --git a/src/CONVERTOR/VISU_CommonCellsFilter.hxx b/src/CONVERTOR/VISU_CommonCellsFilter.hxx index 7074bfca..51f3ba3d 100644 --- a/src/CONVERTOR/VISU_CommonCellsFilter.hxx +++ b/src/CONVERTOR/VISU_CommonCellsFilter.hxx @@ -48,10 +48,6 @@ protected: virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); //generate output data -private: - bool myIsProfileSet; - bool myIsCellsSet; - private: VISU_CommonCellsFilter(const VISU_CommonCellsFilter&); // Lock copy void operator=(const VISU_CommonCellsFilter&); // Lock copy -- 2.39.2