Commit aab86574 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

ENH: Redesigned the composite dataset and subclasses. The details of this

redesign can be found at http://www.vtk.org/Wiki/VTK/Composite_Data_Redesign.
parent bd79e472
......@@ -81,6 +81,7 @@
#define VTK_SELECTION 22
#define VTK_DIRECTED_GRAPH 23
#define VTK_UNDIRECTED_GRAPH 24
#define VTK_MULTIPIECE_DATA_SET 25
/*--------------------------------------------------------------------------*/
/* Define a casting macro for use by the constants below. */
......
......@@ -25,7 +25,7 @@
#include "vtkCompositeDataPipeline.h"
#include "vtkContourFilter.h"
#include "vtkDebugLeaks.h"
#include "vtkHierarchicalDataExtractLevel.h"
#include "vtkExtractLevel.h"
#include "vtkHierarchicalDataSetGeometryFilter.h"
#include "vtkOutlineCornerFilter.h"
#include "vtkHierarchicalPolyDataMapper.h"
......@@ -79,6 +79,9 @@ int main(int argc, char* argv[])
// corner outline
vtkOutlineCornerFilter* ocf = vtkOutlineCornerFilter::New();
vtkCompositeDataPipeline* pipeline = vtkCompositeDataPipeline::New();
ocf->SetExecutive(pipeline);
pipeline->Delete();
ocf->SetInputConnection(0, reader->GetOutputPort(0));
// Rendering objects
......@@ -92,14 +95,20 @@ int main(int argc, char* argv[])
ren->AddActor(ocActor);
// cell 2 point and contour
vtkHierarchicalDataExtractLevel* el = vtkHierarchicalDataExtractLevel::New();
vtkExtractLevel* el = vtkExtractLevel::New();
el->SetInputConnection(0, reader->GetOutputPort(0));
el->SetLevelRange(2,2);
el->AddLevel(2);
vtkCellDataToPointData* c2p = vtkCellDataToPointData::New();
pipeline = vtkCompositeDataPipeline::New();
c2p->SetExecutive(pipeline);
pipeline->Delete();
c2p->SetInputConnection(0, el->GetOutputPort(0));
vtkContourFilter* contour = vtkContourFilter::New();
pipeline = vtkCompositeDataPipeline::New();
contour->SetExecutive(pipeline);
pipeline->Delete();
contour->SetInputConnection(0, c2p->GetOutputPort(0));
contour->SetValue(0, -0.013);
contour->SetInputArrayToProcess(
......
......@@ -13,7 +13,7 @@
=========================================================================*/
// This example demonstrates how multi-block datasets can be processed
// using the new vtkHierarchicalDataSet class.
// using the new vtkMultiBlockDataSet class.
//
// The command line arguments are:
// -D <path> => path to the data (VTKData); the data should be in <path>/Data/
......@@ -22,8 +22,8 @@
#include "vtkCellDataToPointData.h"
#include "vtkContourFilter.h"
#include "vtkDebugLeaks.h"
#include "vtkHierarchicalDataSet.h"
#include "vtkHierarchicalDataSetGeometryFilter.h"
#include "vtkMultiBlockDataSet.h"
#include "vtkCompositeDataGeometryFilter.h"
#include "vtkOutlineCornerFilter.h"
#include "vtkPolyData.h"
#include "vtkPolyDataMapper.h"
......@@ -55,7 +55,7 @@ int main(int argc, char* argv[])
// vtkMultiBlockDataSet respresents multi-block datasets. See
// the class documentation for more information.
vtkHierarchicalDataSet* mb = vtkHierarchicalDataSet::New();
vtkMultiBlockDataSet* mb = vtkMultiBlockDataSet::New();
for (i=0; i<3; i++)
{
......@@ -79,14 +79,14 @@ int main(int argc, char* argv[])
sg->ShallowCopy(reader->GetOutput());
// Add the structured grid to the multi-block dataset
mb->SetDataSet(0, i, sg);
mb->SetBlock(i, sg);
sg->Delete();
}
reader->Delete();
// Multi-block can be processed with regular VTK filters in two ways:
// 1. Pass through a multi-block aware consumer. Since a multi-block
// aware mapper is not yet available, vtkHierarchicalDataSetGeometryFilter
// aware mapper is not yet available, vtkCompositeDataGeometryFilter
// can be used
// 2. Assign the composite executive (vtkCompositeDataPipeline) to
// all "simple" (that work only on simple, non-composite datasets) filters
......@@ -99,8 +99,8 @@ int main(int argc, char* argv[])
// This filter is multi-block aware and will request blocks from the
// input. These blocks will be processed by simple processes as if they
// are the whole dataset
vtkHierarchicalDataSetGeometryFilter* geom1 =
vtkHierarchicalDataSetGeometryFilter::New();
vtkCompositeDataGeometryFilter* geom1 =
vtkCompositeDataGeometryFilter::New();
geom1->SetInputConnection(0, of->GetOutputPort(0));
// Rendering objects
......@@ -121,8 +121,8 @@ int main(int argc, char* argv[])
contour->SetValue(0, 0.45);
// geometry filter
vtkHierarchicalDataSetGeometryFilter* geom2 =
vtkHierarchicalDataSetGeometryFilter::New();
vtkCompositeDataGeometryFilter* geom2 =
vtkCompositeDataGeometryFilter::New();
geom2->SetInputConnection(0, contour->GetOutputPort(0));
// Rendering objects
......
......@@ -7,20 +7,21 @@ SET(KIT_LIBS vtkCommon)
SET( Kit_SRCS
vtkAbstractMapper.cxx
vtkActor2D.cxx
vtkActor2DCollection.cxx
vtkActor2D.cxx
vtkAdjacentVertexIterator.cxx
vtkAlgorithm.cxx
vtkAlgorithmOutput.cxx
vtkAttributesErrorMetric.cxx
vtkBiQuadraticQuad.cxx
vtkBiQuadraticQuadraticHexahedron.cxx
vtkBiQuadraticQuadraticWedge.cxx
vtkCachedStreamingDemandDrivenPipeline.cxx
vtkCardinalSpline.cxx
vtkCastToConcrete.cxx
vtkCell.cxx
vtkCell3D.cxx
vtkCellArray.cxx
vtkCell.cxx
vtkCellData.cxx
vtkCellLinks.cxx
vtkCellLocator.cxx
......@@ -28,20 +29,21 @@ vtkCellTypes.cxx
vtkColorTransferFunction.cxx
vtkCompositeDataIterator.cxx
vtkCompositeDataPipeline.cxx
vtkCompositeDataSetAlgorithm.cxx
vtkCompositeDataSet.cxx
vtkCone.cxx
vtkConvexPointSet.cxx
vtkCoordinate.cxx
vtkCylinder.cxx
vtkDataObject.cxx
vtkDataObjectAlgorithm.cxx
vtkDataObjectCollection.cxx
vtkDataObject.cxx
vtkDataObjectSource.cxx
vtkDataObjectTypes.cxx
vtkDataSet.cxx
vtkDataSetAlgorithm.cxx
vtkDataSetAttributes.cxx
vtkDataSetCollection.cxx
vtkDataSet.cxx
vtkDataSetSource.cxx
vtkDataSetToDataSetFilter.cxx
vtkDataSetToImageFilter.cxx
......@@ -50,8 +52,8 @@ vtkDataSetToStructuredGridFilter.cxx
vtkDataSetToStructuredPointsFilter.cxx
vtkDataSetToUnstructuredGridFilter.cxx
vtkDemandDrivenPipeline.cxx
vtkDirectedGraph.cxx
vtkDirectedGraphAlgorithm.cxx
vtkDirectedGraph.cxx
vtkEdgeListIterator.cxx
vtkEmptyCell.cxx
vtkExecutive.cxx
......@@ -59,31 +61,28 @@ vtkExplicitCell.cxx
vtkFieldData.cxx
vtkFilteringInformationKeyManager.cxx
vtkGenericAdaptorCell.cxx
vtkGenericAttribute.cxx
vtkGenericAttributeCollection.cxx
vtkGenericAttribute.cxx
vtkGenericCell.cxx
vtkGenericCellIterator.cxx
vtkGenericCellTessellator.cxx
vtkGenericDataSet.cxx
vtkGenericDataSetAlgorithm.cxx
vtkGenericDataSet.cxx
vtkGenericEdgeTable.cxx
vtkGenericInterpolatedVelocityField.cxx
vtkGenericPointIterator.cxx
vtkGenericSubdivisionErrorMetric.cxx
vtkGeometricErrorMetric.cxx
vtkGraphAlgorithm.cxx
vtkGraph.cxx
vtkGraphEdge.cxx
vtkGraphAlgorithm.cxx
vtkAttributesErrorMetric.cxx
vtkHexagonalPrism.cxx
vtkHexahedron.cxx
vtkHierarchicalDataInformation.cxx
vtkHierarchicalDataIterator.cxx
vtkHierarchicalBoxDataSetAlgorithm.cxx
vtkHierarchicalBoxDataSet.cxx
vtkHierarchicalDataSet.cxx
vtkHierarchicalDataSetAlgorithm.cxx
vtkHyperOctree.cxx
vtkHyperOctreeAlgorithm.cxx
vtkHyperOctreeCursor.cxx
vtkHyperOctree.cxx
vtkHyperOctreePointsGrabber.cxx
vtkImageAlgorithm.cxx
vtkImageData.cxx
......@@ -112,12 +111,9 @@ vtkLine.cxx
vtkLocator.cxx
vtkMapper2D.cxx
vtkMergePoints.cxx
vtkMultiBlockDataSet.cxx
vtkMultiBlockDataSetAlgorithm.cxx
vtkMultiGroupDataInformation.cxx
vtkMultiGroupDataIterator.cxx
vtkMultiGroupDataSet.cxx
vtkMultiGroupDataSetAlgorithm.cxx
vtkMultiBlockDataSet.cxx
vtkMultiPieceDataSet.cxx
vtkMutableDirectedGraph.cxx
vtkMutableUndirectedGraph.cxx
vtkNonLinearCell.cxx
......@@ -127,92 +123,91 @@ vtkParametricSpline.cxx
vtkPassInputTypeAlgorithm.cxx
vtkPentagonalPrism.cxx
vtkPerlinNoise.cxx
vtkPiecewiseFunction.cxx
vtkPiecewiseFunctionAlgorithm.cxx
vtkPiecewiseFunction.cxx
vtkPiecewiseFunctionShiftScale.cxx
vtkPixel.cxx
vtkPointData.cxx
vtkPointLocator.cxx
vtkPointSet.cxx
vtkPointSetAlgorithm.cxx
vtkPointSet.cxx
vtkPointSetSource.cxx
vtkPointSetToPointSetFilter.cxx
vtkPolyData.cxx
vtkPolyDataAlgorithm.cxx
vtkPolyDataCollection.cxx
vtkPolyData.cxx
vtkPolyDataSource.cxx
vtkPolyDataToPolyDataFilter.cxx
vtkPolygon.cxx
vtkPolyLine.cxx
vtkPolyVertex.cxx
vtkPolygon.cxx
vtkProcessObject.cxx
vtkPropAssembly.cxx
vtkPyramid.cxx
vtkQuad.cxx
vtkQuadraticEdge.cxx
vtkQuadraticHexahedron.cxx
vtkQuadraticPyramid.cxx
vtkQuadraticLinearQuad.cxx
vtkQuadraticLinearWedge.cxx
vtkQuadraticPyramid.cxx
vtkQuadraticQuad.cxx
vtkQuadraticTetra.cxx
vtkQuadraticTriangle.cxx
vtkQuadraticLinearWedge.cxx
vtkQuadraticWedge.cxx
vtkRectilinearGrid.cxx
vtkRectilinearGridAlgorithm.cxx
vtkRectilinearGrid.cxx
vtkRectilinearGridSource.cxx
vtkRectilinearGridToPolyDataFilter.cxx
vtkScalarTree.cxx
vtkSelection.cxx
vtkSelectionAlgorithm.cxx
vtkSelection.cxx
vtkSimpleCellTessellator.cxx
vtkSimpleImageToImageFilter.cxx
vtkSimpleScalarTree.cxx
vtkSmoothErrorMetric.cxx
vtkSphere.cxx
vtkSource.cxx
vtkSphere.cxx
vtkSpline.cxx
vtkStreamingDemandDrivenPipeline.cxx
vtkStructuredGrid.cxx
vtkStructuredGridAlgorithm.cxx
vtkStructuredGrid.cxx
vtkStructuredGridSource.cxx
vtkStructuredGridToPolyDataFilter.cxx
vtkStructuredGridToStructuredGridFilter.cxx
vtkStructuredPoints.cxx
vtkStructuredPointsCollection.cxx
vtkStructuredPoints.cxx
vtkStructuredPointsSource.cxx
vtkStructuredPointsToPolyDataFilter.cxx
vtkStructuredPointsToStructuredPointsFilter.cxx
vtkStructuredPointsToUnstructuredGridFilter.cxx
vtkSuperquadric.cxx
vtkTable.cxx
vtkTableAlgorithm.cxx
vtkTemporalDataSet.cxx
vtkTable.cxx
vtkTemporalDataSetAlgorithm.cxx
vtkTemporalDataSet.cxx
vtkTetra.cxx
vtkThreadedImageAlgorithm.cxx
vtkTree.cxx
vtkTreeAlgorithm.cxx
vtkTree.cxx
vtkTreeDFSIterator.cxx
vtkTriangle.cxx
vtkTriangleStrip.cxx
vtkTriQuadraticHexahedron.cxx
vtkTrivialProducer.cxx
vtkUndirectedGraph.cxx
vtkUndirectedGraphAlgorithm.cxx
vtkUndirectedGraph.cxx
vtkUniformGrid.cxx
vtkUnstructuredGrid.cxx
vtkUnstructuredGridAlgorithm.cxx
vtkUnstructuredGrid.cxx
vtkUnstructuredGridSource.cxx
vtkUnstructuredGridToPolyDataFilter.cxx
vtkUnstructuredGridToUnstructuredGridFilter.cxx
vtkVertex.cxx
vtkVertexListIterator.cxx
vtkViewDependentErrorMetric.cxx
vtkViewport.cxx
vtkVoxel.cxx
vtkWedge.cxx
vtkVertexListIterator.cxx
vtkViewport.cxx
vtkGenericInterpolatedVelocityField.cxx
)
SET_SOURCE_FILES_PROPERTIES(
......@@ -242,7 +237,6 @@ vtkGenericDataSetAlgorithm
vtkGenericPointIterator
vtkGenericSubdivisionErrorMetric
vtkGraph
vtkHierarchicalDataSetAlgorithm
vtkHyperOctreeAlgorithm
vtkHyperOctreeCursor
vtkHyperOctreePointsGrabber
......@@ -259,7 +253,6 @@ vtkInformationExecutivePortKey
vtkInformationExecutivePortVectorKey
vtkLocator
vtkMapper2D
vtkMultiGroupDataSetAlgorithm
vtkNonLinearCell
vtkPointSet
vtkPointSetSource
......@@ -290,7 +283,6 @@ vtkViewport
SET_SOURCE_FILES_PROPERTIES(
vtkFilteringInformationKeyManager.cxx
vtkHierarchicalDataIterator.cxx
vtkImageIterator.cxx
vtkInformation.cxx
vtkImageProgressIterator.cxx
......
......@@ -17,16 +17,14 @@ IF(PYTHON_EXECUTABLE)
vtkAMRBox.h
vtkApplyFilterCommandInternal.h
vtkCellType.h
vtkCompositeDataSetInternals.h
vtkDataObjectCollection.h
vtkDataSetCollection.h
vtkFilteringInformationKeyManager.h
vtkImageIterator.h
vtkImageProgressIterator.h
vtkMarchingCubesCases.h
vtkMarchingSquaresCases.h
vtkMultiBlockDataSetInternal.h
vtkMultiGroupDataSetInternal.h
vtkDataObjectCollection.h
vtkHierarchicalBoxDataSetInternal.h
vtkStructuredPoints.h
)
ENDIF(PYTHON_EXECUTABLE)
This diff is collapsed.
......@@ -12,52 +12,68 @@
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkCompositeDataIterator - abstract superclass for composite data iterators
// .NAME vtkCompositeDataIterator - superclass for composite data iterators
// .SECTION Description
// vtkCompositeDataIterator provides an interface for accessing datasets
// in a collection (vtkCompositeDataIterator). Sub-classes provide the
// actual implementation.
// in a collection (vtkCompositeDataIterator).
#ifndef __vtkCompositeDataIterator_h
#define __vtkCompositeDataIterator_h
#include "vtkObject.h"
class vtkCompositeDataSet;
class vtkCompositeDataSetIndex;
class vtkDataObject;
class vtkInformation;
class VTK_FILTERING_EXPORT vtkCompositeDataIterator : public vtkObject
{
public:
vtkTypeRevisionMacro(vtkCompositeDataIterator,vtkObject);
static vtkCompositeDataIterator* New();
vtkTypeRevisionMacro(vtkCompositeDataIterator, vtkObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Move the iterator to the beginning of the collection.
void InitTraversal() { this->GoToFirstItem(); }
// Set the composite dataset this iterator is iterating over.
// Must be set before traversal begins.
virtual void SetDataSet(vtkCompositeDataSet* ds);
vtkGetObjectMacro(DataSet, vtkCompositeDataSet);
// Description:
// Begin iterating over the composite dataset structure.
virtual void InitTraversal();
// Description:
// Begin iterating over the composite dataset structure in reverse order.
virtual void InitReverseTraversal();
// Description:
// Move the iterator to the beginning of the collection.
virtual void GoToFirstItem() = 0;
virtual void GoToFirstItem();
// Description:
// Move the iterator to the next item in the collection.
virtual void GoToNextItem() = 0;
virtual void GoToNextItem();
// Description:
// Test whether the iterator is currently pointing to a valid
// item. Returns 1 for yes, 0 for no.
virtual int IsDoneWithTraversal() = 0;
// Test whether the iterator is currently pointing to a valid item. Returns 1
// for yes, and 0 for no.
virtual int IsDoneWithTraversal();
// Description:
// Get the information object associated with the current
// data object.
virtual vtkInformation* GetCurrentInformationObject() = 0;
// Returns the current item. Valid only when IsDoneWithTraversal() returns 0.
virtual vtkDataObject* GetCurrentDataObject();
// Description:
// Get the current item. Valid only when IsDoneWithTraversal()
// returns 1.
virtual vtkDataObject* GetCurrentDataObject() = 0;
// Returns the meta-data associated with the current item. This will allocate
// a new vtkInformation object is none is already present. Use
// HasCurrentMetaData to avoid unnecessary creation of vtkInformation objects.
virtual vtkInformation* GetCurrentMetaData();
// Description:
// Returns if the a meta-data information object is present for the current
// item. Return 1 on success, 0 otherwise.
virtual int HasCurrentMetaData();
// Description:
// If VisitOnlyLeaves is true, the iterator will only visit nodes
......@@ -72,15 +88,71 @@ public:
vtkGetMacro(VisitOnlyLeaves, int);
vtkBooleanMacro(VisitOnlyLeaves, int);
// Description:
// If TraverseSubTree is set to true, the iterator will visit the entire tree
// structure, otherwise it only visits the first level children. Set to 1 by
// default.
vtkSetMacro(TraverseSubTree, int);
vtkGetMacro(TraverseSubTree, int);
vtkBooleanMacro(TraverseSubTree, int);
// Description:
// If SkipEmptyNodes is true, then NULL datasets will be skipped. Default is
// true.
vtkSetMacro(SkipEmptyNodes, int);
vtkGetMacro(SkipEmptyNodes, int);
vtkBooleanMacro(SkipEmptyNodes, int);
// Description:
// Flat index is an index obtained by traversing the tree in preorder.
// This can be used to uniquely identify nodes in the tree.
// Not valid if IsDoneWithTraversal() returns true.
vtkGetMacro(CurrentFlatIndex, unsigned int);
// Description:
// Returns if the iteration is in reverse order.
vtkGetMacro(Reverse, int);
//BTX
protected:
vtkCompositeDataIterator();
virtual ~vtkCompositeDataIterator();
vtkCompositeDataIterator();
virtual ~vtkCompositeDataIterator();
// Takes the current location to the next dataset. This traverses the tree in
// preorder fashion.
// If the current location is a composite dataset, next is its 1st child dataset.
// If the current is not a composite dataset, then next is the next dataset.
// This method gives no guarantees whether the current dataset will be
// non-null or leaf.
void NextInternal();
// Description:
// Returns the index for the current data object.
vtkCompositeDataSetIndex GetCurrentIndex();
// Needs access to GetCurrentIndex().
friend class vtkCompositeDataSet;
unsigned int CurrentFlatIndex;
int SkipEmptyNodes;
int TraverseSubTree;
int Reverse;
int VisitOnlyLeaves;
vtkCompositeDataSet* DataSet;
private:
vtkCompositeDataIterator(const vtkCompositeDataIterator&); // Not implemented.
void operator=(const vtkCompositeDataIterator&); // Not implemented.
vtkCompositeDataIterator(const vtkCompositeDataIterator&); // Not implemented.
void operator=(const vtkCompositeDataIterator&); // Not implemented.
class vtkInternals;
vtkInternals* Internals;
// Cannot be called when this->IsDoneWithTraversal() return 1.
void UpdateLocation();
//ETX
};
#endif
This diff is collapsed.
......@@ -22,10 +22,8 @@
// execution can be summarized as follows:
//
// * REQUEST_INFORMATION: The producers have to provide information about
// the contents of the composite dataset in this pass. This is accomplished
// by creating and populating a vtkMultiGroupDataInformation and setting
// it using the COMPOSITE_DATA_INFORMATION() key in the output information
// vector. Sources that can produce more than one piece (note that a piece is
// the contents of the composite dataset in this pass.
// Sources that can produce more than one piece (note that a piece is
// different than a block; each piece consistes of 0 or more blocks) should
// set MAXIMUM_NUMBER_OF_PIECES to -1.
//
......@@ -36,9 +34,9 @@
// vtkCompositeDataPipeline is assigned to a simple filter,
// it will invoke the vtkStreamingDemandDrivenPipeline passes in a loop,
// passing a different block each time and will collect the results in a
// composite dataset (vtkMultiGroupDataSet).
// composite dataset.
// .SECTION See also
// vtkMultiGroupDataInformation vtkCompositeDataSet vtkMultiGroupDataSet
// vtkCompositeDataSet
#ifndef __vtkCompositeDataPipeline_h
#define __vtkCompositeDataPipeline_h
......@@ -46,7 +44,6 @@
#include "vtkStreamingDemandDrivenPipeline.h"
class vtkCompositeDataSet;
class vtkMultiGroupDataSet;
class vtkInformationDoubleKey;
class vtkInformationIntegerVectorKey;
class vtkInformationObjectBaseKey;
......@@ -81,8 +78,6 @@ public:
// Description:
// vtkCompositeDataPipeline specific keys
static vtkInformationObjectBaseKey* COMPOSITE_DATA_INFORMATION();
static vtkInformationObjectBaseKey* UPDATE_BLOCKS();
static vtkInformationIntegerKey* REQUIRES_TIME_DOWNSTREAM();
protected:
......@@ -171,6 +166,18 @@ protected:
virtual void ResetPipelineInformation(int port, vtkInformation*);
// Description:
// Tries to create the best possible composite data output for the given input
// and non-composite algorithm output. Returns a new instance on success.
// Don't use this method for creating vtkTemporalDataSet. It's main purpose is
// to determine if vtkHierarchicalBoxDataSet can be propagated as
// vtkHierarchicalBoxDataSet in the output (if the algorithm can produce
// vtkUniformGrid given vtkUniformGrid inputs) or if it should be downgraded
// to a vtkMultiBlockDataSet.
vtkCompositeDataSet* CreateOutputCompositeDataSet(
vtkCompositeDataSet* input, int compositePort);
private:
vtkCompositeDataPipeline(const vtkCompositeDataPipeline&); // Not implemented.
void operator=(const vtkCompositeDataPipeline&); // Not implemented.
......
This diff is collapsed.
......@@ -12,12 +12,16 @@
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkCompositeDataSet - abstact superclass for composite (multi-block or AMR) datasets
// .NAME vtkCompositeDataSet - abstact superclass for composite
// (multi-block or AMR) datasets
// .SECTION Description
// vtkCompositeDataSet is an abstract class that represents a collection
// of datasets (including other composite datasets). This superclass
// does not implement an actual method for storing datasets. It
// only provides an interface to access the datasets through iterators.
// of datasets (including other composite datasets). It
// provides an interface to access the datasets through iterators.
// vtkCompositeDataSet provides methods are used by subclasses to store the datasets.
// vtkCompositeDataSet provides the datastructure for a full tree
// representation. Subclasses provide the semantics for it and control how
// this tree is buit.
// .SECTION See Also
// vtkCompositeDataIterator
......@@ -28,19 +32,18 @@
#include "vtkDataObject.h"
class vtkCompositeDataIterator;
class vtkCompositeDataSetInternals;
class vtkInformation;
class vtkInformationDataObjectKey;
class VTK_FILTERING_EXPORT vtkCompositeDataSet : public vtkDataObject
{
public:
vtkTypeRevisionMacro(vtkCompositeDataSet,vtkDataObject);
vtkTypeRevisionMacro(vtkCompositeDataSet, vtkDataObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Return a new (forward) iterator
// (the iterator has to be deleted by user)
virtual vtkCompositeDataIterator* NewIterator() = 0;
// Return a new iterator (the iterator has to be deleted by user).
virtual vtkCompositeDataIterator* NewIterator();
// Description:
// Return class name of data type (see vtkType.h for
......@@ -48,25 +51,44 @@ public:
virtual int GetDataObjectType() {return VTK_COMPOSITE_DATA_SET;}
// Description:
// Restore data object to initial state,
virtual void Initialize();
// Get the port currently producing this object.
virtual vtkAlgorithmOutput* GetProducerPort();
// Description:
// Adds dobj to the composite dataset. Where the dataset goes is determined
// by appropriate keys in the index information object. Which keys are used
// depends on the actual subclass.
virtual void AddDataSet(vtkInformation* index, vtkDataObject* dobj) = 0;
// Copies the tree structure from the input. All pointers to non-composite
// data objects are intialized to NULL. This also shallow copies the meta data
// associated with all the nodes.
virtual void CopyStructure(vtkCompositeDataSet* input);
// Description:
// Returns a dataset pointed by appropriate keys in the index information
// object. Which keys are used depends on the actual subclass.
virtual vtkDataObject* GetDataSet(vtkInformation* index) = 0;
// Sets the data set at the location pointed by the iterator.
// The iterator does not need to be iterating over this dataset itself. It can
// be any composite datasite with similar structure (achieved by using
// CopyStructure).
virtual void SetDataSet(vtkCompositeDataIterator* iter, vtkDataObject* dataObj);
// Description:
// Get the port currently producing this object.
virtual vtkAlgorithmOutput* GetProducerPort();
// Returns the dataset located at the positiong pointed by the iterator.
// The iterator does not need to be iterating over this dataset itself. It can