Commit a3e0028d authored by Brad King's avatar Brad King
Browse files

ENH: Added GetData method to data object types to aid algorithm...

ENH: Added GetData method to data object types to aid algorithm implementations in getting input and output data objects from input and output pipeline information.
parent b5323222
......@@ -19,11 +19,12 @@
#include "vtkCompositeDataPipeline.h"
#include "vtkDataSet.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkInformationDataObjectKey.h"
#include "vtkInformationIntegerKey.h"
#include "vtkTrivialProducer.h"
vtkCxxRevisionMacro(vtkCompositeDataSet, "1.7");
vtkCxxRevisionMacro(vtkCompositeDataSet, "1.8");
vtkInformationKeyMacro(vtkCompositeDataSet,INDEX,Integer);
vtkInformationKeyMacro(vtkCompositeDataSet,COMPOSITE_DATA_SET,DataObject);
......@@ -104,6 +105,19 @@ vtkAlgorithmOutput* vtkCompositeDataSet::GetProducerPort()
return this->GetExecutive()->GetProducerPort(this);
}
//----------------------------------------------------------------------------
vtkCompositeDataSet* vtkCompositeDataSet::GetData(vtkInformation* info)
{
return info? vtkCompositeDataSet::SafeDownCast(info->Get(DATA_OBJECT())) : 0;
}
//----------------------------------------------------------------------------
vtkCompositeDataSet* vtkCompositeDataSet::GetData(vtkInformationVector* v,
int i)
{
return vtkCompositeDataSet::GetData(v->GetInformationObject(i));
}
//----------------------------------------------------------------------------
void vtkCompositeDataSet::PrintSelf(ostream& os, vtkIndent indent)
{
......
......@@ -74,6 +74,11 @@ public:
static vtkInformationIntegerKey* INDEX();
static vtkInformationDataObjectKey* COMPOSITE_DATA_SET();
// Description:
// Retrieve an instance of this class from an information object.
static vtkCompositeDataSet* GetData(vtkInformation* info);
static vtkCompositeDataSet* GetData(vtkInformationVector* v, int i=0);
protected:
vtkCompositeDataSet();
~vtkCompositeDataSet();
......
......@@ -34,7 +34,7 @@ PURPOSE. See the above copyright notice for more information.
#include "vtkInformationVector.h"
#include "vtkDataSetAttributes.h"
vtkCxxRevisionMacro(vtkDataObject, "1.28");
vtkCxxRevisionMacro(vtkDataObject, "1.29");
vtkStandardNewMacro(vtkDataObject);
vtkCxxSetObjectMacro(vtkDataObject,Information,vtkInformation);
......@@ -1365,3 +1365,15 @@ int vtkDataObject::GetRequestExactExtent()
}
return 0;
}
//----------------------------------------------------------------------------
vtkDataObject* vtkDataObject::GetData(vtkInformation* info)
{
return info? info->Get(DATA_OBJECT()) : 0;
}
//----------------------------------------------------------------------------
vtkDataObject* vtkDataObject::GetData(vtkInformationVector* v, int i)
{
return vtkDataObject::GetData(v->GetInformationObject(i));
}
......@@ -49,6 +49,7 @@ class vtkInformationIntegerKey;
class vtkInformationIntegerPointerKey;
class vtkInformationIntegerVectorKey;
class vtkInformationStringKey;
class vtkInformationVector;
class vtkStreamingDemandDrivenPipeline;
class vtkInformationInformationVectorKey;
......@@ -460,6 +461,11 @@ public:
static vtkInformationDoubleVectorKey* ORIGIN();
static vtkInformationDoubleVectorKey* SPACING();
// Description:
// Retrieve an instance of this class from an information object.
static vtkDataObject* GetData(vtkInformation* info);
static vtkDataObject* GetData(vtkInformationVector* v, int i=0);
protected:
vtkDataObject();
......
......@@ -21,13 +21,14 @@
#include "vtkGenericCell.h"
#include "vtkIdList.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkMath.h"
#include "vtkPointData.h"
#include "vtkSource.h"
#include <math.h>
vtkCxxRevisionMacro(vtkDataSet, "1.7");
vtkCxxRevisionMacro(vtkDataSet, "1.8");
//----------------------------------------------------------------------------
// Constructor with default bounds (0,1, 0,1, 0,1).
......@@ -625,6 +626,18 @@ void vtkDataSet::GenerateGhostLevelArray()
}
//----------------------------------------------------------------------------
vtkDataSet* vtkDataSet::GetData(vtkInformation* info)
{
return info? vtkDataSet::SafeDownCast(info->Get(DATA_OBJECT())) : 0;
}
//----------------------------------------------------------------------------
vtkDataSet* vtkDataSet::GetData(vtkInformationVector* v, int i)
{
return vtkDataSet::GetData(v->GetInformationObject(i));
}
//----------------------------------------------------------------------------
void vtkDataSet::PrintSelf(ostream& os, vtkIndent indent)
{
......
......@@ -317,6 +317,11 @@ public:
// computes the ghost arrays for a given dataset.
virtual void GenerateGhostLevelArray();
// Description:
// Retrieve an instance of this class from an information object.
static vtkDataSet* GetData(vtkInformation* info);
static vtkDataSet* GetData(vtkInformationVector* v, int i=0);
protected:
// Constructor with default bounds (0,1, 0,1, 0,1).
vtkDataSet();
......
......@@ -14,16 +14,18 @@
=========================================================================*/
#include "vtkGenericDataSet.h"
#include <assert.h>
#include "vtkGenericAttributeCollection.h"
#include "vtkMath.h"
#include "vtkCellTypes.h"
#include "vtkGenericCellIterator.h"
#include "vtkGenericAdaptorCell.h"
#include "vtkGenericAttributeCollection.h"
#include "vtkGenericCellIterator.h"
#include "vtkGenericCellTessellator.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkMath.h"
#include <assert.h>
vtkCxxRevisionMacro(vtkGenericDataSet, "1.6");
vtkCxxRevisionMacro(vtkGenericDataSet, "1.7");
vtkCxxSetObjectMacro(vtkGenericDataSet, Tessellator,vtkGenericCellTessellator);
//----------------------------------------------------------------------------
......@@ -204,3 +206,15 @@ int vtkGenericDataSet::GetDataObjectType()
{
return VTK_GENERIC_DATA_SET;
}
//----------------------------------------------------------------------------
vtkGenericDataSet* vtkGenericDataSet::GetData(vtkInformation* info)
{
return info? vtkGenericDataSet::SafeDownCast(info->Get(DATA_OBJECT())) : 0;
}
//----------------------------------------------------------------------------
vtkGenericDataSet* vtkGenericDataSet::GetData(vtkInformationVector* v, int i)
{
return vtkGenericDataSet::GetData(v->GetInformationObject(i));
}
......@@ -217,7 +217,12 @@ public:
// Description:
// Estimated size needed after tessellation (or special operation)
virtual vtkIdType GetEstimatedSize() = 0;
// Description:
// Retrieve an instance of this class from an information object.
static vtkGenericDataSet* GetData(vtkInformation* info);
static vtkGenericDataSet* GetData(vtkInformationVector* v, int i=0);
protected:
// Description:
// Constructor with uninitialized bounds (1,-1, 1,-1, 1,-1),
......
......@@ -17,11 +17,12 @@
#include "vtkDataSet.h"
#include "vtkHierarchicalDataInformation.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkInformationIntegerKey.h"
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtkHierarchicalDataSet, "1.8");
vtkCxxRevisionMacro(vtkHierarchicalDataSet, "1.9");
vtkStandardNewMacro(vtkHierarchicalDataSet);
vtkInformationKeyMacro(vtkHierarchicalDataSet,LEVEL,Integer);
......@@ -74,6 +75,20 @@ vtkDataObject* vtkHierarchicalDataSet::GetDataSet(vtkInformation* index)
return this->Superclass::GetDataSet(index);
}
//----------------------------------------------------------------------------
vtkHierarchicalDataSet* vtkHierarchicalDataSet::GetData(vtkInformation* info)
{
return
info? vtkHierarchicalDataSet::SafeDownCast(info->Get(DATA_OBJECT())) : 0;
}
//----------------------------------------------------------------------------
vtkHierarchicalDataSet*
vtkHierarchicalDataSet::GetData(vtkInformationVector* v, int i)
{
return vtkHierarchicalDataSet::GetData(v->GetInformationObject(i));
}
//----------------------------------------------------------------------------
void vtkHierarchicalDataSet::PrintSelf(ostream& os, vtkIndent indent)
{
......
......@@ -82,6 +82,11 @@ public:
static vtkInformationIntegerKey* LEVEL();
// Description:
// Retrieve an instance of this class from an information object.
static vtkHierarchicalDataSet* GetData(vtkInformation* info);
static vtkHierarchicalDataSet* GetData(vtkInformationVector* v, int i=0);
protected:
vtkHierarchicalDataSet();
~vtkHierarchicalDataSet();
......
......@@ -14,30 +14,33 @@
=========================================================================*/
#include "vtkHyperOctree.h"
#include "vtkHyperOctreeCursor.h"
#include <vtkstd/vector>
#include "vtkDataSetAttributes.h"
#include "vtkPointData.h"
#include "vtkCellData.h"
#include <assert.h>
#include "vtkObjectFactory.h"
#include "vtkCellLinks.h"
#include "vtkCellType.h"
#include <vtkstd/deque>
//#include <vtkstd/set>
#include "vtkOrderedTriangulator.h"
#include "vtkPolygon.h"
#include "vtkLine.h"
#include "vtkPixel.h"
#include "vtkVoxel.h"
#include "vtkDataSetAttributes.h"
#include "vtkGenericCell.h"
#include "vtkPoints.h"
#include "vtkHyperOctreeCursor.h"
#include "vtkHyperOctreePointsGrabber.h"
#include "vtkIdTypeArray.h"
#include "vtkCellLinks.h"
#include "vtkInformation.h"
#include "vtkInformationDoubleVectorKey.h"
#include "vtkInformationIntegerKey.h"
#include "vtkInformationVector.h"
#include "vtkLine.h"
#include "vtkObjectFactory.h"
#include "vtkOrderedTriangulator.h"
#include "vtkPixel.h"
#include "vtkPointData.h"
#include "vtkPoints.h"
#include "vtkPolygon.h"
#include "vtkTimerLog.h"
#include "vtkVoxel.h"
#include "vtkInformationIntegerKey.h"
#include "vtkInformationDoubleVectorKey.h"
#include <vtkstd/deque>
//#include <vtkstd/set>
#include <vtkstd/vector>
#include <assert.h>
vtkInformationKeyMacro(vtkHyperOctree, LEVELS, Integer);
vtkInformationKeyMacro(vtkHyperOctree, DIMENSION, Integer);
......@@ -111,7 +114,7 @@ void vtkHyperOctree::PrintSelf(ostream& os, vtkIndent indent)
}
vtkCxxRevisionMacro(vtkHyperOctreeInternal, "1.16");
vtkCxxRevisionMacro(vtkHyperOctreeInternal, "1.17");
template<unsigned int D> class vtkCompactHyperOctree;
template<unsigned int D> class vtkCompactHyperOctreeNode;
......@@ -514,13 +517,13 @@ private:
void operator=(const vtkCompactHyperOctreeCursor<D> &); // Not implemented.
};
// vtkCxxRevisionMacro(vtkCompactHyperOctreeCursor, "1.16");
// vtkCxxRevisionMacro(vtkCompactHyperOctreeCursor, "1.17");
template<unsigned int D>
void vtkCompactHyperOctreeCursor<D>::CollectRevisions(ostream& sos)
{
vtkOStreamWrapper os(sos);
this->Superclass::CollectRevisions(os);
os << "vtkCompactHyperOctreeCursor<" << D <<"> " << "1.16" << '\n';
os << "vtkCompactHyperOctreeCursor<" << D <<"> " << "1.17" << '\n';
}
......@@ -652,7 +655,7 @@ protected:
int Children[1<<D]; // indices
};
//vtkCxxRevisionMacro(vtkCompactHyperOctree, "1.16");
//vtkCxxRevisionMacro(vtkCompactHyperOctree, "1.17");
template<unsigned int D> class vtkCompactHyperOctree
: public vtkHyperOctreeInternal
......@@ -957,13 +960,13 @@ private:
void operator=(const vtkCompactHyperOctree<D> &); // Not implemented.
};
// vtkCxxRevisionMacro(vtkCompactHyperOctree, "1.16");
// vtkCxxRevisionMacro(vtkCompactHyperOctree, "1.17");
template<unsigned int D>
void vtkCompactHyperOctree<D>::CollectRevisions(ostream& sos)
{
vtkOStreamWrapper os(sos);
this->Superclass::CollectRevisions(os);
os << "vtkCompactHyperOctree<" << D <<"> " << "1.16" << '\n';
os << "vtkCompactHyperOctree<" << D <<"> " << "1.17" << '\n';
}
......@@ -971,7 +974,7 @@ void vtkCompactHyperOctree<D>::CollectRevisions(ostream& sos)
// quadtree: vtkHyperOctreeInternal<2>
// bittree: vtkHyperOctreeInternal<1>
vtkCxxRevisionMacro(vtkHyperOctree, "1.16");
vtkCxxRevisionMacro(vtkHyperOctree, "1.17");
vtkStandardNewMacro(vtkHyperOctree);
//-----------------------------------------------------------------------------
......@@ -3671,7 +3674,14 @@ void vtkHyperOctree::EvaluateDualCorner(
this->CornerLeafIds->InsertNextTupleValue(leaves);
}
//----------------------------------------------------------------------------
vtkHyperOctree* vtkHyperOctree::GetData(vtkInformation* info)
{
return info? vtkHyperOctree::SafeDownCast(info->Get(DATA_OBJECT())) : 0;
}
//----------------------------------------------------------------------------
vtkHyperOctree* vtkHyperOctree::GetData(vtkInformationVector* v, int i)
{
return vtkHyperOctree::GetData(v->GetInformationObject(i));
}
......@@ -469,7 +469,12 @@ public:
// arrays, etc. are not included in the return value). THIS METHOD
// IS THREAD SAFE.
unsigned long GetActualMemorySize();
// Description:
// Retrieve an instance of this class from an information object.
static vtkHyperOctree* GetData(vtkInformation* info);
static vtkHyperOctree* GetData(vtkInformationVector* v, int i=0);
protected:
// Constructor with default bounds (0,1, 0,1, 0,1).
vtkHyperOctree();
......
......@@ -20,6 +20,7 @@
#include "vtkGenericCell.h"
#include "vtkInformation.h"
#include "vtkInformationIntegerKey.h"
#include "vtkInformationVector.h"
#include "vtkLargeInteger.h"
#include "vtkLine.h"
#include "vtkMath.h"
......@@ -30,9 +31,8 @@
#include "vtkStreamingDemandDrivenPipeline.h"
#include "vtkVertex.h"
#include "vtkVoxel.h"
#include "vtkInformationVector.h"
vtkCxxRevisionMacro(vtkImageData, "1.18");
vtkCxxRevisionMacro(vtkImageData, "1.19");
vtkStandardNewMacro(vtkImageData);
//----------------------------------------------------------------------------
......@@ -2123,4 +2123,14 @@ void vtkImageData::ComputeInternalExtent(int *intExt, int *tgtExt, int *bnds)
}
}
//----------------------------------------------------------------------------
vtkImageData* vtkImageData::GetData(vtkInformation* info)
{
return info? vtkImageData::SafeDownCast(info->Get(DATA_OBJECT())) : 0;
}
//----------------------------------------------------------------------------
vtkImageData* vtkImageData::GetData(vtkInformationVector* v, int i)
{
return vtkImageData::GetData(v->GetInformationObject(i));
}
......@@ -341,6 +341,11 @@ public:
// The extent type is a 3D extent
virtual int GetExtentType() { return VTK_3D_EXTENT; };
// Description:
// Retrieve an instance of this class from an information object.
static vtkImageData* GetData(vtkInformation* info);
static vtkImageData* GetData(vtkInformationVector* v, int i=0);
protected:
vtkImageData();
~vtkImageData();
......
......@@ -19,11 +19,12 @@
#include "vtkMultiGroupDataIterator.h"
#include "vtkMultiGroupDataSetInternal.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkInformationIntegerKey.h"
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtkMultiGroupDataSet, "1.1");
vtkCxxRevisionMacro(vtkMultiGroupDataSet, "1.2");
vtkStandardNewMacro(vtkMultiGroupDataSet);
vtkCxxSetObjectMacro(vtkMultiGroupDataSet,MultiGroupDataInformation,vtkMultiGroupDataInformation);
......@@ -335,6 +336,20 @@ vtkIdType vtkMultiGroupDataSet::GetNumberOfPoints()
return numPts;
}
//----------------------------------------------------------------------------
vtkMultiGroupDataSet* vtkMultiGroupDataSet::GetData(vtkInformation* info)
{
return
info? vtkMultiGroupDataSet::SafeDownCast(info->Get(DATA_OBJECT())) : 0;
}
//----------------------------------------------------------------------------
vtkMultiGroupDataSet* vtkMultiGroupDataSet::GetData(vtkInformationVector* v,
int i)
{
return vtkMultiGroupDataSet::GetData(v->GetInformationObject(i));
}
//----------------------------------------------------------------------------
void vtkMultiGroupDataSet::PrintSelf(ostream& os, vtkIndent indent)
{
......
......@@ -161,6 +161,11 @@ public:
static vtkInformationIntegerKey* GROUP();
// Description:
// Retrieve an instance of this class from an information object.
static vtkMultiGroupDataSet* GetData(vtkInformation* info);
static vtkMultiGroupDataSet* GetData(vtkInformationVector* v, int i=0);
protected:
vtkMultiGroupDataSet();
~vtkMultiGroupDataSet();
......
......@@ -13,13 +13,17 @@
=========================================================================*/
#include "vtkPiecewiseFunction.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkObjectFactory.h"
#include <vtkstd/vector>
#include <vtkstd/set>
#include <vtkstd/algorithm>
#include <vtkstd/iterator>
vtkCxxRevisionMacro(vtkPiecewiseFunction, "1.46");
vtkCxxRevisionMacro(vtkPiecewiseFunction, "1.47");
vtkStandardNewMacro(vtkPiecewiseFunction);
// The Node structure
......@@ -884,6 +888,20 @@ void vtkPiecewiseFunction::FillFromDataPointer(int nb, double *ptr)
this->SortAndUpdateRange();
}
//----------------------------------------------------------------------------
vtkPiecewiseFunction* vtkPiecewiseFunction::GetData(vtkInformation* info)
{
return
info? vtkPiecewiseFunction::SafeDownCast(info->Get(DATA_OBJECT())) : 0;
}
//----------------------------------------------------------------------------
vtkPiecewiseFunction* vtkPiecewiseFunction::GetData(vtkInformationVector* v,
int i)
{
return vtkPiecewiseFunction::GetData(v->GetInformationObject(i));
}
// Print method for tkPiecewiseFunction
void vtkPiecewiseFunction::PrintSelf(ostream& os, vtkIndent indent)
{
......
......@@ -149,7 +149,12 @@ public:
// is alreay initialized, so there is no need to call this method which
// in turn simply calls RemoveAllPoints()
void Initialize();
// Description:
// Retrieve an instance of this class from an information object.
static vtkPiecewiseFunction* GetData(vtkInformation* info);
static vtkPiecewiseFunction* GetData(vtkInformationVector* v, int i=0);
protected:
vtkPiecewiseFunction();
~vtkPiecewiseFunction();
......
......@@ -17,10 +17,12 @@
#include "vtkCell.h"
#include "vtkGarbageCollector.h"
#include "vtkGenericCell.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkPointLocator.h"
#include "vtkSource.h"
vtkCxxRevisionMacro(vtkPointSet, "1.4");
vtkCxxRevisionMacro(vtkPointSet, "1.5");
vtkCxxSetObjectMacro(vtkPointSet,Points,vtkPoints);
......@@ -377,6 +379,18 @@ void vtkPointSet::DeepCopy(vtkDataObject *dataObject)
this->vtkDataSet::DeepCopy(dataObject);
}
//----------------------------------------------------------------------------
vtkPointSet* vtkPointSet::GetData(vtkInformation* info)
{
return info? vtkPointSet::SafeDownCast(info->Get(DATA_OBJECT())) : 0;
}
//----------------------------------------------------------------------------
vtkPointSet* vtkPointSet::GetData(vtkInformationVector* v, int i)
{
return vtkPointSet::GetData(v->GetInformationObject(i));
}
//----------------------------------------------------------------------------
void vtkPointSet::PrintSelf(ostream& os, vtkIndent indent)
{
......
......@@ -90,6 +90,11 @@ public:
void ShallowCopy(vtkDataObject *src);
void DeepCopy(vtkDataObject *src);
// Description:
// Retrieve an instance of this class from an information object.
static vtkPointSet* GetData(vtkInformation* info);
static vtkPointSet* GetData(vtkInformationVector* v, int i=0);
protected:
vtkPointSet();
~vtkPointSet();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment