Commit bbe652a6 authored by Berk Geveci's avatar Berk Geveci
Browse files

Removed vtkSource, vtkProcessObject and subclasses.

First step in the removal of VTK 4 compatibility layer. I removed
vtkSource, vtkProcessObject and all of their subclasses. All algorithms
should be subclasses of vtkAlgorithm now.

Also removed vtkPLOT3DReader. This reader was using legacy API. Use
vtkMultiBlockPLOT3DReader instead

Made changes vtkSpatialRepresentationFilter that are not backwards
compatible. This filter now produces a multi-block output and which
levels are computed is controlled using the AddLevel method.
parent fa144819
......@@ -51,19 +51,11 @@ vtkCylinder.cxx
vtkDataObjectAlgorithm.cxx
vtkDataObjectCollection.cxx
vtkDataObject.cxx
vtkDataObjectSource.cxx
vtkDataObjectTypes.cxx
vtkDataSetAlgorithm.cxx
vtkDataSetAttributes.cxx
vtkDataSetCollection.cxx
vtkDataSet.cxx
vtkDataSetSource.cxx
vtkDataSetToDataSetFilter.cxx
vtkDataSetToImageFilter.cxx
vtkDataSetToPolyDataFilter.cxx
vtkDataSetToStructuredGridFilter.cxx
vtkDataSetToStructuredPointsFilter.cxx
vtkDataSetToUnstructuredGridFilter.cxx
vtkDemandDrivenPipeline.cxx
vtkDirectedAcyclicGraph.cxx
vtkDirectedGraphAlgorithm.cxx
......@@ -109,13 +101,8 @@ vtkImageAlgorithm.cxx
vtkImageData.cxx
vtkImageInPlaceFilter.cxx
vtkImageIterator.cxx
vtkImageMultipleInputFilter.cxx
vtkImageMultipleInputOutputFilter.cxx
vtkImageProgressIterator.cxx
vtkImageSource.cxx
vtkImageToImageFilter.cxx
vtkImageToStructuredPoints.cxx
vtkImageTwoInputFilter.cxx
vtkImplicitBoolean.cxx
vtkImplicitDataSet.cxx
vtkImplicitHalo.cxx
......@@ -164,20 +151,15 @@ vtkPointData.cxx
vtkPointLocator.cxx
vtkPointSetAlgorithm.cxx
vtkPointSet.cxx
vtkPointSetSource.cxx
vtkPointSetToPointSetFilter.cxx
vtkPointsProjectedHull.cxx
vtkPolyDataAlgorithm.cxx
vtkPolyDataCollection.cxx
vtkPolyData.cxx
vtkPolyDataSource.cxx
vtkPolyDataToPolyDataFilter.cxx
vtkPolygon.cxx
vtkPolyhedron.cxx
vtkPolyLine.cxx
vtkPolyPlane.cxx
vtkPolyVertex.cxx
vtkProcessObject.cxx
vtkPropAssembly.cxx
vtkPyramid.cxx
vtkQuad.cxx
......@@ -192,8 +174,6 @@ vtkQuadraticTriangle.cxx
vtkQuadraticWedge.cxx
vtkRectilinearGridAlgorithm.cxx
vtkRectilinearGrid.cxx
vtkRectilinearGridSource.cxx
vtkRectilinearGridToPolyDataFilter.cxx
vtkReebGraph.cxx
vtkReebGraphSimplificationMetric.cxx
vtkScalarTree.cxx
......@@ -204,21 +184,13 @@ vtkSimpleCellTessellator.cxx
vtkSimpleImageToImageFilter.cxx
vtkSimpleScalarTree.cxx
vtkSmoothErrorMetric.cxx
vtkSource.cxx
vtkSphere.cxx
vtkSpline.cxx
vtkStreamingDemandDrivenPipeline.cxx
vtkStructuredGridAlgorithm.cxx
vtkStructuredGrid.cxx
vtkStructuredGridSource.cxx
vtkStructuredGridToPolyDataFilter.cxx
vtkStructuredGridToStructuredGridFilter.cxx
vtkStructuredPointsCollection.cxx
vtkStructuredPoints.cxx
vtkStructuredPointsSource.cxx
vtkStructuredPointsToPolyDataFilter.cxx
vtkStructuredPointsToStructuredPointsFilter.cxx
vtkStructuredPointsToUnstructuredGridFilter.cxx
vtkSuperquadric.cxx
vtkTableAlgorithm.cxx
vtkTable.cxx
......@@ -240,9 +212,6 @@ vtkUndirectedGraph.cxx
vtkUniformGrid.cxx
vtkUnstructuredGridAlgorithm.cxx
vtkUnstructuredGrid.cxx
vtkUnstructuredGridSource.cxx
vtkUnstructuredGridToPolyDataFilter.cxx
vtkUnstructuredGridToUnstructuredGridFilter.cxx
vtkVertex.cxx
vtkVertexListIterator.cxx
vtkViewDependentErrorMetric.cxx
......@@ -260,15 +229,7 @@ vtkCell
vtkCell3D
vtkCompositeDataIterator
vtkCompositeDataSet
vtkDataObjectSource
vtkDataSet
vtkDataSetSource
vtkDataSetToDataSetFilter
vtkDataSetToImageFilter
vtkDataSetToPolyDataFilter
vtkDataSetToStructuredGridFilter
vtkDataSetToStructuredPointsFilter
vtkDataSetToUnstructuredGridFilter
vtkDistributedGraphHelper
vtkExecutive
vtkExplicitCell
......@@ -288,12 +249,7 @@ vtkHyperOctreePointsGrabber
vtkImageAlgorithm
vtkImageInPlaceFilter
vtkImageIterator
vtkImageMultipleInputFilter
vtkImageMultipleInputOutputFilter
vtkImageProgressIterator
vtkImageSource
vtkImageToImageFilter
vtkImageTwoInputFilter
vtkIncrementalPointLocator
vtkInformationExecutivePortKey
vtkInformationExecutivePortVectorKey
......@@ -301,28 +257,10 @@ vtkLocator
vtkMapper2D
vtkNonLinearCell
vtkPointSet
vtkPointSetSource
vtkPointSetToPointSetFilter
vtkPolyDataSource
vtkPolyDataToPolyDataFilter
vtkProcessObject
vtkRectilinearGridSource
vtkRectilinearGridToPolyDataFilter
vtkScalarTree
vtkSimpleImageToImageFilter
vtkSource
vtkSpline
vtkStructuredGridSource
vtkStructuredGridToPolyDataFilter
vtkStructuredGridToStructuredGridFilter
vtkStructuredPointsSource
vtkStructuredPointsToPolyDataFilter
vtkStructuredPointsToStructuredPointsFilter
vtkStructuredPointsToUnstructuredGridFilter
vtkThreadedImageAlgorithm
vtkUnstructuredGridSource
vtkUnstructuredGridToPolyDataFilter
vtkUnstructuredGridToUnstructuredGridFilter
vtkViewport
ABSTRACT
)
......
......@@ -21,7 +21,6 @@ PURPOSE. See the above copyright notice for more information.
#include "vtkGarbageCollector.h"
#include "vtkInformation.h"
#include "vtkObjectFactory.h"
#include "vtkSource.h"
#include "vtkTrivialProducer.h"
#include "vtkStreamingDemandDrivenPipeline.h"
#include "vtkInformationDataObjectKey.h"
......@@ -72,33 +71,6 @@ vtkInformationKeyRestrictedMacro(vtkDataObject, SPACING, DoubleVector, 3);
vtkInformationKeyMacro(vtkDataObject, DATA_GEOMETRY_UNMODIFIED, Integer);
vtkInformationKeyMacro(vtkDataObject, SIL, DataObject);
class vtkDataObjectToSourceFriendship
{
public:
static void SetOutput(vtkSource* source, int i, vtkDataObject* newData)
{
if(source)
{
// Make sure there is room in the source for this output.
if(i >= source->NumberOfOutputs)
{
source->SetNumberOfOutputs(i+1);
}
// Update the source's Outputs array.
vtkDataObject* oldData = source->Outputs[i];
if(newData)
{
newData->Register(source);
}
source->Outputs[i] = newData;
if(oldData)
{
oldData->UnRegister(source);
}
}
}
};
// Initialize static member that controls global data release
// after use by filter
......@@ -119,7 +91,6 @@ const char vtkDataObject
//----------------------------------------------------------------------------
vtkDataObject::vtkDataObject()
{
this->Source = NULL;
this->PipelineInformation = 0;
this->Information = vtkInformation::New();
......@@ -147,15 +118,6 @@ void vtkDataObject::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
if ( this->Source )
{
os << indent << "Source: " << this->Source << "\n";
}
else
{
os << indent << "Source: (none)\n";
}
if ( this->Information )
{
os << indent << "Information: " << this->Information << "\n";
......@@ -286,9 +248,6 @@ void vtkDataObject::SetPipelineInformation(vtkInformation* newInfo)
vtkInformation* oldInfo = this->PipelineInformation;
if(newInfo != oldInfo)
{
// Remove any existing compatibility link to a source.
this->Source = 0;
if(newInfo)
{
// Reference the new information.
......@@ -304,20 +263,6 @@ void vtkDataObject::SetPipelineInformation(vtkInformation* newInfo)
// Tell the new information about this object.
newInfo->Set(vtkDataObject::DATA_OBJECT(), this);
// If the new producer is a vtkSource then setup the backward
// compatibility link.
vtkExecutive* newExec = vtkExecutive::PRODUCER()->GetExecutive(newInfo);
int newPort = vtkExecutive::PRODUCER()->GetPort(newInfo);
if(newExec)
{
vtkSource* newSource = vtkSource::SafeDownCast(newExec->GetAlgorithm());
if(newSource)
{
vtkDataObjectToSourceFriendship::SetOutput(newSource, newPort, this);
this->Source = newSource;
}
}
}
// Save the pointer to the new information.
......@@ -325,19 +270,6 @@ void vtkDataObject::SetPipelineInformation(vtkInformation* newInfo)
if(oldInfo)
{
// If the old producer was a vtkSource then remove the backward
// compatibility link.
vtkExecutive* oldExec = vtkExecutive::PRODUCER()->GetExecutive(oldInfo);
int oldPort = vtkExecutive::PRODUCER()->GetPort(oldInfo);
if(oldExec)
{
vtkSource* oldSource = vtkSource::SafeDownCast(oldExec->GetAlgorithm());
if(oldSource)
{
vtkDataObjectToSourceFriendship::SetOutput(oldSource, oldPort, 0);
}
}
// Remove the old information's reference to us.
oldInfo->Set(vtkDataObject::DATA_OBJECT(), 0);
......@@ -793,32 +725,6 @@ int vtkDataObject::ShouldIReleaseData()
return vtkDataObjectGlobalReleaseDataFlag || this->GetReleaseDataFlag();
}
//----------------------------------------------------------------------------
void vtkDataObject::SetSource(vtkSource* newSource)
{
vtkDebugMacro( << this->GetClassName() << " ("
<< this << "): setting Source to " << newSource );
if(newSource)
{
// Find the output index on the source producing this data object.
int index = newSource->GetOutputIndex(this);
if(index >= 0)
{
newSource->GetExecutive()->SetOutputData(index, this);
}
else
{
vtkErrorMacro("SetSource cannot find the output index of this "
"data object from the source.");
this->SetPipelineInformation(0);
}
}
else
{
this->SetPipelineInformation(0);
}
}
//----------------------------------------------------------------------------
void vtkDataObject::Register(vtkObjectBase* o)
{
......
......@@ -41,7 +41,6 @@ class vtkExecutive;
class vtkFieldData;
class vtkInformation;
class vtkProcessObject;
class vtkSource;
class vtkStreamingDemandDrivenPipelineToDataObjectFriendship;
class vtkExtentTranslator;
class vtkInformationDataObjectKey;
......@@ -67,11 +66,6 @@ public:
vtkTypeMacro(vtkDataObject,vtkObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Set/Get the source object creating this data object.
vtkGetObjectMacro(Source,vtkSource);
void SetSource(vtkSource *s);
// Description:
// Set/Get the information object associated with this data object.
vtkGetObjectMacro(Information, vtkInformation);
......@@ -547,9 +541,6 @@ protected:
// General field data associated with data object
vtkFieldData *FieldData;
// Who generated this data as output?
vtkSource *Source;
// Keep track of data release during network execution
int DataReleased;
......
/*=========================================================================
Program: Visualization Toolkit
Module: vtkDataObjectSource.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkDataObjectSource.h"
#include "vtkDataObject.h"
#include "vtkInformation.h"
#include "vtkObjectFactory.h"
vtkDataObjectSource::vtkDataObjectSource()
{
// A source has no inputs by default.
this->SetNumberOfInputPorts(0);
this->SetOutput(vtkDataObject::New());
// Releasing data for pipeline parallism.
// Filters will know it is empty.
this->Outputs[0]->ReleaseData();
this->Outputs[0]->Delete();
}
//----------------------------------------------------------------------------
vtkDataObject *vtkDataObjectSource::GetOutput()
{
if (this->NumberOfOutputs < 1)
{
return NULL;
}
return this->Outputs[0];
}
//----------------------------------------------------------------------------
void vtkDataObjectSource::SetOutput(vtkDataObject *output)
{
this->vtkSource::SetNthOutput(0, output);
}
//----------------------------------------------------------------------------
int vtkDataObjectSource::FillOutputPortInformation(int port,
vtkInformation* info)
{
if(!this->Superclass::FillOutputPortInformation(port, info))
{
return 0;
}
info->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkDataObject");
return 1;
}
//----------------------------------------------------------------------------
void vtkDataObjectSource::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
}
/*=========================================================================
Program: Visualization Toolkit
Module: vtkDataObjectSource.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkDataObjectSource - abstract class specifies interface for
// field source (or objects that generate field output)
// .SECTION Description
// vtkDataObjectSource is an abstract object that specifies behavior and
// interface of field source objects. Field source objects are source objects
// that create vtkFieldData (field data) on output.
//
// Concrete subclasses of vtkDataObjectSource must define Update() and
// Execute() methods. The public method Update() invokes network execution
// and will bring the network up-to-date. The protected Execute() method
// actually does the work of data creation/generation. The difference between
// the two methods is that Update() implements input consistency checks and
// modified time comparisons and then invokes the Execute() which is an
// implementation of a particular algorithm.
//
// vtkDataObjectSource provides a mechanism for invoking the methods
// StartMethod() and EndMethod() before and after object execution (via
// Execute()). These are convenience methods you can use for any purpose
// (e.g., debugging info, highlighting/notifying user interface, etc.) These
// methods accept a single void* pointer that can be used to send data to the
// methods. It is also possible to specify a function to delete the argument
// via StartMethodArgDelete and EndMethodArgDelete.
//
// Another method, ProgressMethod() can be specified. Some filters invoke this
// method periodically during their execution. The use is similar to that of
// StartMethod() and EndMethod().
//
// An important feature of subclasses of vtkDataObjectSource is that it is
// possible to control the memory-management model (i.e., retain output
// versus delete output data). If enabled the ReleaseDataFlag enables the
// deletion of the output data once the downstream process object finishes
// processing the data (please see text).
// .SECTION See Also
// vtkSource vtkFilter vtkFieldDataFilter
#ifndef __vtkDataObjectSource_h
#define __vtkDataObjectSource_h
#include "vtkSource.h"
class vtkDataObject;
class VTK_FILTERING_EXPORT vtkDataObjectSource : public vtkSource
{
public:
vtkTypeMacro(vtkDataObjectSource,vtkSource);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Get the output field of this source.
vtkDataObject *GetOutput();
vtkDataObject *GetOutput(int idx)
{
return this->vtkSource::GetOutput(idx);
}
void SetOutput(vtkDataObject *);
protected:
vtkDataObjectSource();
~vtkDataObjectSource() {};
virtual int FillOutputPortInformation(int, vtkInformation*);
private:
vtkDataObjectSource(const vtkDataObjectSource&); // Not implemented.
void operator=(const vtkDataObjectSource&); // Not implemented.
};
#endif
......@@ -24,7 +24,6 @@
#include "vtkInformationVector.h"
#include "vtkMath.h"
#include "vtkPointData.h"
#include "vtkSource.h"
#include <math.h>
......
......@@ -45,7 +45,6 @@ class vtkCellTypes;
class vtkGenericCell;
class vtkIdList;
class vtkPointData;
class vtkSourceToDataSetFriendship;
class VTK_FILTERING_EXPORT vtkDataSet : public vtkDataObject
{
......@@ -366,7 +365,6 @@ protected:
private:
void InternalDataSetCopy(vtkDataSet *src);
//BTX
friend class vtkSourceToDataSetFriendship;
friend class vtkImageAlgorithmToDataSetFriendship;
//ETX
private:
......
/*=========================================================================
Program: Visualization Toolkit
Module: vtkDataSetSource.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkDataSetSource.h"
#include "vtkInformation.h"
#include "vtkObjectFactory.h"
#include "vtkDataSet.h"
vtkDataSetSource::vtkDataSetSource()
{
// A source has no inputs by default.
this->SetNumberOfInputPorts(0);
this->SetNumberOfOutputPorts(1);
}
//----------------------------------------------------------------------------
vtkDataSet *vtkDataSetSource::GetOutput()
{
if (this->NumberOfOutputs < 1)
{
return NULL;
}
return static_cast<vtkDataSet *>(this->Outputs[0]);
}
//----------------------------------------------------------------------------
void vtkDataSetSource::SetOutput(vtkDataSet *output)
{
this->vtkSource::SetNthOutput(0, output);
}
//----------------------------------------------------------------------------
vtkDataSet *vtkDataSetSource::GetOutput(int idx)
{
return static_cast<vtkDataSet *>( this->vtkSource::GetOutput(idx) );
}
//----------------------------------------------------------------------------
int vtkDataSetSource::FillOutputPortInformation(int port, vtkInformation* info)
{
if(!this->Superclass::FillOutputPortInformation(port, info))
{
return 0;
}
info->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkDataSet");
return 1;
}
//----------------------------------------------------------------------------
void vtkDataSetSource::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
}
/*=========================================================================
Program: Visualization Toolkit
Module: vtkDataSetSource.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkDataSetSource - abstract class whose subclasses generate datasets
// .SECTION Description
// vtkDataSetSource is an abstract class whose subclasses generate datasets.
#ifndef __vtkDataSetSource_h
#define __vtkDataSetSource_h
#include "vtkSource.h"
class vtkDataSet;
class VTK_FILTERING_EXPORT vtkDataSetSource : public vtkSource
{
public:
vtkTypeMacro(vtkDataSetSource,vtkSource);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Get the output of this source.
vtkDataSet *GetOutput();
vtkDataSet *GetOutput(int idx);
void SetOutput(vtkDataSet *);
protected:
vtkDataSetSource();
~vtkDataSetSource() {};
virtual int FillOutputPortInformation(int, vtkInformation*);
private:
vtkDataSetSource(const vtkDataSetSource&); // Not implemented.
void operator=(const vtkDataSetSource&); // Not implemented.
};
#endif
/*=========================================================================
Program: Visualization Toolkit
Module: vtkDataSetToDataSetFilter.cxx