]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Porting to VTK 6.
authorouv <ouv@opencascade.com>
Wed, 20 Mar 2013 12:36:24 +0000 (12:36 +0000)
committerouv <ouv@opencascade.com>
Wed, 20 Mar 2013 12:36:24 +0000 (12:36 +0000)
Fixing bugs with SIGSEGV on creation of presentations.

src/CONVERTOR/VISU_CommonCellsFilter.cxx
src/CONVERTOR/VISU_CommonCellsFilter.hxx

index 4473acb63efc0fc1f7d04a09c9434d69045be3d4..526c5bc11c5e2a8ffa01cd30b000c38ce0823b0a 100644 (file)
@@ -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(
index 7074bfca3852c6d7ae2ffecc00dbee7dd508ff61..51f3ba3d1e9b60a940e8fa9779b1dbbf36a66cb3 100644 (file)
@@ -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