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

ENH: Added support for GetData(). This method makes it easy to get input/output in algorithms

parent ffe99867
...@@ -21,11 +21,12 @@ ...@@ -21,11 +21,12 @@
#include "vtkInformationIdTypeKey.h" #include "vtkInformationIdTypeKey.h"
#include "vtkInformationIntegerVectorKey.h" #include "vtkInformationIntegerVectorKey.h"
#include "vtkInformationKey.h" #include "vtkInformationKey.h"
#include "vtkInformationVector.h"
#include "vtkObjectFactory.h" #include "vtkObjectFactory.h"
#include "vtkUniformGrid.h" #include "vtkUniformGrid.h"
#include "vtkUnsignedCharArray.h" #include "vtkUnsignedCharArray.h"
vtkCxxRevisionMacro(vtkHierarchicalBoxDataSet, "1.14"); vtkCxxRevisionMacro(vtkHierarchicalBoxDataSet, "1.15");
vtkStandardNewMacro(vtkHierarchicalBoxDataSet); vtkStandardNewMacro(vtkHierarchicalBoxDataSet);
vtkInformationKeyMacro(vtkHierarchicalBoxDataSet,BOX,IntegerVector); vtkInformationKeyMacro(vtkHierarchicalBoxDataSet,BOX,IntegerVector);
...@@ -370,3 +371,17 @@ void vtkHierarchicalBoxDataSet::PrintSelf(ostream& os, vtkIndent indent) ...@@ -370,3 +371,17 @@ void vtkHierarchicalBoxDataSet::PrintSelf(ostream& os, vtkIndent indent)
} }
} }
//----------------------------------------------------------------------------
vtkHierarchicalBoxDataSet* vtkHierarchicalBoxDataSet::GetData(
vtkInformation* info)
{
return
info?vtkHierarchicalBoxDataSet::SafeDownCast(info->Get(DATA_OBJECT())) : 0;
}
//----------------------------------------------------------------------------
vtkHierarchicalBoxDataSet* vtkHierarchicalBoxDataSet::GetData(
vtkInformationVector* v, int i)
{
return vtkHierarchicalBoxDataSet::GetData(v->GetInformationObject(i));
}
...@@ -109,6 +109,13 @@ public: ...@@ -109,6 +109,13 @@ public:
// points. // points.
virtual vtkIdType GetNumberOfPoints(); virtual vtkIdType GetNumberOfPoints();
//BTX
// Description:
// Retrieve an instance of this class from an information object.
static vtkHierarchicalBoxDataSet* GetData(vtkInformation* info);
static vtkHierarchicalBoxDataSet* GetData(vtkInformationVector* v, int i=0);
//ETX
protected: protected:
vtkHierarchicalBoxDataSet(); vtkHierarchicalBoxDataSet();
~vtkHierarchicalBoxDataSet(); ~vtkHierarchicalBoxDataSet();
......
...@@ -17,10 +17,11 @@ ...@@ -17,10 +17,11 @@
#include "vtkDataSet.h" #include "vtkDataSet.h"
#include "vtkInformation.h" #include "vtkInformation.h"
#include "vtkInformationIntegerKey.h" #include "vtkInformationIntegerKey.h"
#include "vtkInformationVector.h"
#include "vtkObjectFactory.h" #include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtkMultiBlockDataSet, "1.6"); vtkCxxRevisionMacro(vtkMultiBlockDataSet, "1.7");
vtkStandardNewMacro(vtkMultiBlockDataSet); vtkStandardNewMacro(vtkMultiBlockDataSet);
vtkInformationKeyMacro(vtkMultiBlockDataSet,BLOCK,Integer); vtkInformationKeyMacro(vtkMultiBlockDataSet,BLOCK,Integer);
...@@ -64,3 +65,16 @@ void vtkMultiBlockDataSet::PrintSelf(ostream& os, vtkIndent indent) ...@@ -64,3 +65,16 @@ void vtkMultiBlockDataSet::PrintSelf(ostream& os, vtkIndent indent)
this->Superclass::PrintSelf(os,indent); this->Superclass::PrintSelf(os,indent);
} }
//----------------------------------------------------------------------------
vtkMultiBlockDataSet* vtkMultiBlockDataSet::GetData(vtkInformation* info)
{
return
info? vtkMultiBlockDataSet::SafeDownCast(info->Get(DATA_OBJECT())) : 0;
}
//----------------------------------------------------------------------------
vtkMultiBlockDataSet* vtkMultiBlockDataSet::GetData(vtkInformationVector* v,
int i)
{
return vtkMultiBlockDataSet::GetData(v->GetInformationObject(i));
}
...@@ -87,6 +87,13 @@ public: ...@@ -87,6 +87,13 @@ public:
static vtkInformationIntegerKey* BLOCK(); static vtkInformationIntegerKey* BLOCK();
//BTX
// Description:
// Retrieve an instance of this class from an information object.
static vtkMultiBlockDataSet* GetData(vtkInformation* info);
static vtkMultiBlockDataSet* GetData(vtkInformationVector* v, int i=0);
//ETX
protected: protected:
vtkMultiBlockDataSet(); vtkMultiBlockDataSet();
~vtkMultiBlockDataSet(); ~vtkMultiBlockDataSet();
......
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