Commit 70cfffcc authored by Ken Martin's avatar Ken Martin

ENH: converted to the new pipeline

parent 08d52bad
......@@ -17,6 +17,7 @@
#include "vtkCallbackCommand.h"
#include "vtkDataSet.h"
#include "vtkImageData.h"
#include "vtkInformation.h"
#include "vtkObjectFactory.h"
#include "vtkPolyData.h"
#include "vtkRectilinearGrid.h"
......@@ -28,7 +29,7 @@
#include "vtkXMLStructuredGridWriter.h"
#include "vtkXMLUnstructuredGridWriter.h"
vtkCxxRevisionMacro(vtkXMLDataSetWriter, "1.8");
vtkCxxRevisionMacro(vtkXMLDataSetWriter, "1.9");
vtkStandardNewMacro(vtkXMLDataSetWriter);
//----------------------------------------------------------------------------
......@@ -52,27 +53,16 @@ void vtkXMLDataSetWriter::PrintSelf(ostream& os, vtkIndent indent)
this->Superclass::PrintSelf(os, indent);
}
//----------------------------------------------------------------------------
void vtkXMLDataSetWriter::SetInput(vtkDataSet* input)
{
this->vtkProcessObject::SetNthInput(0, input);
}
//----------------------------------------------------------------------------
vtkDataSet* vtkXMLDataSetWriter::GetInput()
{
if(this->NumberOfInputs < 1)
{
return 0;
}
return static_cast<vtkDataSet*>(this->Inputs[0]);
return static_cast<vtkDataSet*>(this->Superclass::GetInput());
}
//----------------------------------------------------------------------------
int vtkXMLDataSetWriter::WriteInternal()
{
vtkDataSet* input = this->GetInput();
vtkDataSet* input = vtkDataSet::SafeDownCast(this->GetInput());
vtkXMLWriter* writer = 0;
// Create a writer based on the data set type.
......@@ -161,7 +151,7 @@ void vtkXMLDataSetWriter::ProgressCallbackFunction(vtkObject* caller,
unsigned long,
void* clientdata, void*)
{
vtkProcessObject* w = vtkProcessObject::SafeDownCast(caller);
vtkAlgorithm* w = vtkAlgorithm::SafeDownCast(caller);
if(w)
{
reinterpret_cast<vtkXMLDataSetWriter*>(clientdata)->ProgressCallback(w);
......@@ -169,7 +159,7 @@ void vtkXMLDataSetWriter::ProgressCallbackFunction(vtkObject* caller,
}
//----------------------------------------------------------------------------
void vtkXMLDataSetWriter::ProgressCallback(vtkProcessObject* w)
void vtkXMLDataSetWriter::ProgressCallback(vtkAlgorithm* w)
{
float width = this->ProgressRange[1]-this->ProgressRange[0];
float internalProgress = w->GetProgress();
......@@ -180,3 +170,10 @@ void vtkXMLDataSetWriter::ProgressCallback(vtkProcessObject* w)
w->SetAbortExecute(1);
}
}
int vtkXMLDataSetWriter::FillInputPortInformation(
int vtkNotUsed(port), vtkInformation* info)
{
info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkDataSet");
return 1;
}
......@@ -37,15 +37,19 @@ public:
void PrintSelf(ostream& os, vtkIndent indent);
static vtkXMLDataSetWriter* New();
//BTX
// Description:
// Get/Set the writer's input.
void SetInput(vtkDataSet* input);
vtkDataSet* GetInput();
//ETX
protected:
vtkXMLDataSetWriter();
~vtkXMLDataSetWriter();
// see algorithm for more info
virtual int FillInputPortInformation(int port, vtkInformation* info);
// Override writing method from superclass.
virtual int WriteInternal();
......@@ -58,7 +62,7 @@ protected:
static void ProgressCallbackFunction(vtkObject*, unsigned long, void*,
void*);
// Progress callback from internal writer.
virtual void ProgressCallback(vtkProcessObject* w);
virtual void ProgressCallback(vtkAlgorithm* w);
// The observer to report progress from the internal writer.
vtkCallbackCommand* ProgressObserver;
......
......@@ -15,8 +15,9 @@
#include "vtkXMLImageDataWriter.h"
#include "vtkObjectFactory.h"
#include "vtkImageData.h"
#include "vtkInformation.h"
vtkCxxRevisionMacro(vtkXMLImageDataWriter, "1.4");
vtkCxxRevisionMacro(vtkXMLImageDataWriter, "1.5");
vtkStandardNewMacro(vtkXMLImageDataWriter);
//----------------------------------------------------------------------------
......@@ -35,21 +36,10 @@ void vtkXMLImageDataWriter::PrintSelf(ostream& os, vtkIndent indent)
this->Superclass::PrintSelf(os,indent);
}
//----------------------------------------------------------------------------
void vtkXMLImageDataWriter::SetInput(vtkImageData* input)
{
this->vtkProcessObject::SetNthInput(0, input);
}
//----------------------------------------------------------------------------
vtkImageData* vtkXMLImageDataWriter::GetInput()
{
if(this->NumberOfInputs < 1)
{
return 0;
}
return static_cast<vtkImageData*>(this->Inputs[0]);
return static_cast<vtkImageData*>(this->Superclass::GetInput());
}
//----------------------------------------------------------------------------
......@@ -78,3 +68,10 @@ void vtkXMLImageDataWriter::WritePrimaryElementAttributes()
this->WriteVectorAttribute("Origin", 3, input->GetOrigin());
this->WriteVectorAttribute("Spacing", 3, input->GetSpacing());
}
int vtkXMLImageDataWriter::FillInputPortInformation(
int vtkNotUsed(port), vtkInformation* info)
{
info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkImageData");
return 1;
}
......@@ -37,10 +37,11 @@ public:
vtkTypeRevisionMacro(vtkXMLImageDataWriter,vtkXMLStructuredDataWriter);
void PrintSelf(ostream& os, vtkIndent indent);
//BTX
// Description:
// Get/Set the writer's input.
void SetInput(vtkImageData* input);
vtkImageData* GetInput();
//ETX
// Description:
// Get the default file extension for files written by this writer.
......@@ -50,6 +51,9 @@ protected:
vtkXMLImageDataWriter();
~vtkXMLImageDataWriter();
// see algorithm for more info
virtual int FillInputPortInformation(int port, vtkInformation* info);
void WritePrimaryElementAttributes();
void GetInputExtent(int* extent);
const char* GetDataSetName();
......
......@@ -28,7 +28,7 @@
#include "vtkXMLPStructuredGridWriter.h"
#include "vtkXMLPUnstructuredGridWriter.h"
vtkCxxRevisionMacro(vtkXMLPDataSetWriter, "1.8");
vtkCxxRevisionMacro(vtkXMLPDataSetWriter, "1.9");
vtkStandardNewMacro(vtkXMLPDataSetWriter);
//----------------------------------------------------------------------------
......@@ -47,21 +47,10 @@ void vtkXMLPDataSetWriter::PrintSelf(ostream& os, vtkIndent indent)
this->Superclass::PrintSelf(os, indent);
}
//----------------------------------------------------------------------------
void vtkXMLPDataSetWriter::SetInput(vtkDataSet* input)
{
this->vtkProcessObject::SetNthInput(0, input);
}
//----------------------------------------------------------------------------
vtkDataSet* vtkXMLPDataSetWriter::GetInput()
{
if(this->NumberOfInputs < 1)
{
return 0;
}
return static_cast<vtkDataSet*>(this->Inputs[0]);
return static_cast<vtkDataSet*>(this->Superclass::GetInput());
}
//----------------------------------------------------------------------------
......
......@@ -35,10 +35,11 @@ public:
void PrintSelf(ostream& os, vtkIndent indent);
static vtkXMLPDataSetWriter* New();
//BTX
// Description:
// Get/Set the writer's input.
void SetInput(vtkDataSet* input);
vtkDataSet* GetInput();
//ETX
protected:
vtkXMLPDataSetWriter();
......
......@@ -18,7 +18,7 @@
#include "vtkDataSet.h"
#include "vtkErrorCode.h"
vtkCxxRevisionMacro(vtkXMLPDataWriter, "1.12");
vtkCxxRevisionMacro(vtkXMLPDataWriter, "1.13");
//----------------------------------------------------------------------------
vtkXMLPDataWriter::vtkXMLPDataWriter()
......@@ -348,7 +348,7 @@ void vtkXMLPDataWriter::ProgressCallbackFunction(vtkObject* caller,
unsigned long,
void* clientdata, void*)
{
vtkProcessObject* w = vtkProcessObject::SafeDownCast(caller);
vtkAlgorithm* w = vtkAlgorithm::SafeDownCast(caller);
if(w)
{
reinterpret_cast<vtkXMLPDataWriter*>(clientdata)->ProgressCallback(w);
......@@ -356,7 +356,7 @@ void vtkXMLPDataWriter::ProgressCallbackFunction(vtkObject* caller,
}
//----------------------------------------------------------------------------
void vtkXMLPDataWriter::ProgressCallback(vtkProcessObject* w)
void vtkXMLPDataWriter::ProgressCallback(vtkAlgorithm* w)
{
float width = this->ProgressRange[1]-this->ProgressRange[0];
float internalProgress = w->GetProgress();
......
......@@ -81,7 +81,7 @@ protected:
static void ProgressCallbackFunction(vtkObject*, unsigned long, void*,
void*);
// Progress callback from internal writer.
virtual void ProgressCallback(vtkProcessObject* w);
virtual void ProgressCallback(vtkAlgorithm* w);
int StartPiece;
int EndPiece;
......
......@@ -13,12 +13,14 @@
=========================================================================*/
#include "vtkXMLPImageDataWriter.h"
#include "vtkObjectFactory.h"
#include "vtkXMLImageDataWriter.h"
#include "vtkErrorCode.h"
#include "vtkImageData.h"
#include "vtkInformation.h"
#include "vtkObjectFactory.h"
#include "vtkXMLImageDataWriter.h"
vtkCxxRevisionMacro(vtkXMLPImageDataWriter, "1.5");
vtkCxxRevisionMacro(vtkXMLPImageDataWriter, "1.6");
vtkStandardNewMacro(vtkXMLPImageDataWriter);
//----------------------------------------------------------------------------
......@@ -37,21 +39,10 @@ void vtkXMLPImageDataWriter::PrintSelf(ostream& os, vtkIndent indent)
this->Superclass::PrintSelf(os,indent);
}
//----------------------------------------------------------------------------
void vtkXMLPImageDataWriter::SetInput(vtkImageData* input)
{
this->vtkProcessObject::SetNthInput(0, input);
}
//----------------------------------------------------------------------------
vtkImageData* vtkXMLPImageDataWriter::GetInput()
{
if(this->NumberOfInputs < 1)
{
return 0;
}
return static_cast<vtkImageData*>(this->Inputs[0]);
return static_cast<vtkImageData*>(this->Superclass::GetInput());
}
//----------------------------------------------------------------------------
......@@ -94,3 +85,10 @@ vtkXMLPImageDataWriter::CreateStructuredPieceWriter()
pWriter->SetInput(this->GetInput());
return pWriter;
}
int vtkXMLPImageDataWriter::FillInputPortInformation(
int vtkNotUsed(port), vtkInformation* info)
{
info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkImageData");
return 1;
}
......@@ -36,11 +36,12 @@ public:
static vtkXMLPImageDataWriter* New();
vtkTypeRevisionMacro(vtkXMLPImageDataWriter,vtkXMLPStructuredDataWriter);
void PrintSelf(ostream& os, vtkIndent indent);
//BTX
// Description:
// Get/Set the writer's input.
void SetInput(vtkImageData* input);
vtkImageData* GetInput();
//ETX
// Description:
// Get the default file extension for files written by this writer.
......@@ -54,6 +55,9 @@ protected:
void WritePrimaryElementAttributes();
vtkXMLStructuredDataWriter* CreateStructuredPieceWriter();
// see algorithm for more info
virtual int FillInputPortInformation(int port, vtkInformation* info);
private:
vtkXMLPImageDataWriter(const vtkXMLPImageDataWriter&); // Not implemented.
void operator=(const vtkXMLPImageDataWriter&); // Not implemented.
......
......@@ -13,11 +13,13 @@
=========================================================================*/
#include "vtkXMLPPolyDataWriter.h"
#include "vtkObjectFactory.h"
#include "vtkXMLPolyDataWriter.h"
#include "vtkPolyData.h"
#include "vtkInformation.h"
vtkCxxRevisionMacro(vtkXMLPPolyDataWriter, "1.4");
vtkCxxRevisionMacro(vtkXMLPPolyDataWriter, "1.5");
vtkStandardNewMacro(vtkXMLPPolyDataWriter);
//----------------------------------------------------------------------------
......@@ -36,21 +38,10 @@ void vtkXMLPPolyDataWriter::PrintSelf(ostream& os, vtkIndent indent)
this->Superclass::PrintSelf(os,indent);
}
//----------------------------------------------------------------------------
void vtkXMLPPolyDataWriter::SetInput(vtkPolyData* input)
{
this->vtkProcessObject::SetNthInput(0, input);
}
//----------------------------------------------------------------------------
vtkPolyData* vtkXMLPPolyDataWriter::GetInput()
{
if(this->NumberOfInputs < 1)
{
return 0;
}
return static_cast<vtkPolyData*>(this->Inputs[0]);
return static_cast<vtkPolyData*>(this->Superclass::GetInput());
}
//----------------------------------------------------------------------------
......@@ -74,3 +65,10 @@ vtkXMLPPolyDataWriter::CreateUnstructuredPieceWriter()
pWriter->SetInput(this->GetInput());
return pWriter;
}
int vtkXMLPPolyDataWriter::FillInputPortInformation(
int vtkNotUsed(port), vtkInformation* info)
{
info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkPolyData");
return 1;
}
......@@ -36,11 +36,12 @@ public:
static vtkXMLPPolyDataWriter* New();
vtkTypeRevisionMacro(vtkXMLPPolyDataWriter,vtkXMLPUnstructuredDataWriter);
void PrintSelf(ostream& os, vtkIndent indent);
//BTX
// Description:
// Get/Set the writer's input.
void SetInput(vtkPolyData* input);
vtkPolyData* GetInput();
//ETX
// Description:
// Get the default file extension for files written by this writer.
......@@ -50,6 +51,9 @@ protected:
vtkXMLPPolyDataWriter();
~vtkXMLPPolyDataWriter();
// see algorithm for more info
virtual int FillInputPortInformation(int port, vtkInformation* info);
const char* GetDataSetName();
vtkXMLUnstructuredDataWriter* CreateUnstructuredPieceWriter();
......
......@@ -13,12 +13,14 @@
=========================================================================*/
#include "vtkXMLPRectilinearGridWriter.h"
#include "vtkObjectFactory.h"
#include "vtkXMLRectilinearGridWriter.h"
#include "vtkErrorCode.h"
#include "vtkInformation.h"
#include "vtkObjectFactory.h"
#include "vtkRectilinearGrid.h"
#include "vtkXMLRectilinearGridWriter.h"
vtkCxxRevisionMacro(vtkXMLPRectilinearGridWriter, "1.6");
vtkCxxRevisionMacro(vtkXMLPRectilinearGridWriter, "1.7");
vtkStandardNewMacro(vtkXMLPRectilinearGridWriter);
//----------------------------------------------------------------------------
......@@ -37,21 +39,10 @@ void vtkXMLPRectilinearGridWriter::PrintSelf(ostream& os, vtkIndent indent)
this->Superclass::PrintSelf(os,indent);
}
//----------------------------------------------------------------------------
void vtkXMLPRectilinearGridWriter::SetInput(vtkRectilinearGrid* input)
{
this->vtkProcessObject::SetNthInput(0, input);
}
//----------------------------------------------------------------------------
vtkRectilinearGrid* vtkXMLPRectilinearGridWriter::GetInput()
{
if(this->NumberOfInputs < 1)
{
return 0;
}
return static_cast<vtkRectilinearGrid*>(this->Inputs[0]);
return static_cast<vtkRectilinearGrid*>(this->Superclass::GetInput());
}
//----------------------------------------------------------------------------
......@@ -89,3 +80,10 @@ void vtkXMLPRectilinearGridWriter::WritePData(vtkIndent indent)
this->WritePCoordinates(input->GetXCoordinates(), input->GetYCoordinates(),
input->GetZCoordinates(), indent);
}
int vtkXMLPRectilinearGridWriter::FillInputPortInformation(
int vtkNotUsed(port), vtkInformation* info)
{
info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkRectilinearGrid");
return 1;
}
......@@ -37,11 +37,12 @@ public:
static vtkXMLPRectilinearGridWriter* New();
vtkTypeRevisionMacro(vtkXMLPRectilinearGridWriter,vtkXMLPStructuredDataWriter);
void PrintSelf(ostream& os, vtkIndent indent);
//BTX
// Description:
// Get/Set the writer's input.
void SetInput(vtkRectilinearGrid* input);
vtkRectilinearGrid* GetInput();
//ETX
// Description:
// Get the default file extension for files written by this writer.
......@@ -51,6 +52,9 @@ protected:
vtkXMLPRectilinearGridWriter();
~vtkXMLPRectilinearGridWriter();
// see algorithm for more info
virtual int FillInputPortInformation(int port, vtkInformation* info);
const char* GetDataSetName();
vtkXMLStructuredDataWriter* CreateStructuredPieceWriter();
void WritePData(vtkIndent indent);
......
......@@ -13,12 +13,14 @@
=========================================================================*/
#include "vtkXMLPStructuredGridWriter.h"
#include "vtkObjectFactory.h"
#include "vtkXMLStructuredGridWriter.h"
#include "vtkErrorCode.h"
#include "vtkInformation.h"
#include "vtkObjectFactory.h"
#include "vtkStructuredGrid.h"
#include "vtkXMLStructuredGridWriter.h"
vtkCxxRevisionMacro(vtkXMLPStructuredGridWriter, "1.6");
vtkCxxRevisionMacro(vtkXMLPStructuredGridWriter, "1.7");
vtkStandardNewMacro(vtkXMLPStructuredGridWriter);
//----------------------------------------------------------------------------
......@@ -37,21 +39,11 @@ void vtkXMLPStructuredGridWriter::PrintSelf(ostream& os, vtkIndent indent)
this->Superclass::PrintSelf(os,indent);
}
//----------------------------------------------------------------------------
void vtkXMLPStructuredGridWriter::SetInput(vtkStructuredGrid* input)
{
this->vtkProcessObject::SetNthInput(0, input);
}
//----------------------------------------------------------------------------
vtkStructuredGrid* vtkXMLPStructuredGridWriter::GetInput()
{
if(this->NumberOfInputs < 1)
{
return 0;
}
return static_cast<vtkStructuredGrid*>(this->Inputs[0]);
return static_cast<vtkStructuredGrid*>(this->Superclass::GetInput());
}
//----------------------------------------------------------------------------
......@@ -87,3 +79,10 @@ void vtkXMLPStructuredGridWriter::WritePData(vtkIndent indent)
vtkStructuredGrid* input = this->GetInput();
this->WritePPoints(input->GetPoints(), indent);
}
int vtkXMLPStructuredGridWriter::FillInputPortInformation(
int vtkNotUsed(port), vtkInformation* info)
{
info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkStructuredGrid");
return 1;
}
......@@ -38,15 +38,19 @@ public:
vtkTypeRevisionMacro(vtkXMLPStructuredGridWriter,vtkXMLPStructuredDataWriter);
void PrintSelf(ostream& os, vtkIndent indent);
//BTX
// Description:
// Get/Set the writer's input.
void SetInput(vtkStructuredGrid* input);
vtkStructuredGrid* GetInput();
//ETX
protected:
vtkXMLPStructuredGridWriter();
~vtkXMLPStructuredGridWriter();
// see algorithm for more info
virtual int FillInputPortInformation(int port, vtkInformation* info);
const char* GetDataSetName();
const char* GetDefaultFileExtension();
vtkXMLStructuredDataWriter* CreateStructuredPieceWriter();
......
......@@ -17,7 +17,7 @@
#include "vtkErrorCode.h"
#include "vtkPointSet.h"
vtkCxxRevisionMacro(vtkXMLPUnstructuredDataWriter, "1.5");
vtkCxxRevisionMacro(vtkXMLPUnstructuredDataWriter, "1.6");
//----------------------------------------------------------------------------
vtkXMLPUnstructuredDataWriter::vtkXMLPUnstructuredDataWriter()
......@@ -38,12 +38,7 @@ void vtkXMLPUnstructuredDataWriter::PrintSelf(ostream& os, vtkIndent indent)
//----------------------------------------------------------------------------
vtkPointSet* vtkXMLPUnstructuredDataWriter::GetInputAsPointSet()
{
if(this->NumberOfInputs < 1)
{
return 0;
}
return static_cast<vtkPointSet*>(this->Inputs[0]);
return static_cast<vtkPointSet*>(this->GetInput());
}
//----------------------------------------------------------------------------
......
......@@ -13,11 +13,13 @@
=========================================================================*/
#include "vtkXMLPUnstructuredGridWriter.h"
#include "vtkInformation.h"
#include "vtkObjectFactory.h"
#include "vtkXMLUnstructuredGridWriter.h"
#include "vtkUnstructuredGrid.h"
#include "vtkXMLUnstructuredGridWriter.h"
vtkCxxRevisionMacro(vtkXMLPUnstructuredGridWriter, "1.4");
vtkCxxRevisionMacro(vtkXMLPUnstructuredGridWriter, "1.5");
vtkStandardNewMacro(vtkXMLPUnstructuredGridWriter);
//----------------------------------------------------------------------------
......@@ -36,21 +38,10 @@ void vtkXMLPUnstructuredGridWriter::PrintSelf(ostream& os, vtkIndent indent)
this->Superclass::PrintSelf(os,indent);
}
//----------------------------------------------------------------------------
void vtkXMLPUnstructuredGridWriter::SetInput(vtkUnstructuredGrid* input)
{
this->vtkProcessObject::SetNthInput(0, input);
}
//----------------------------------------------------------------------------
vtkUnstructuredGrid* vtkXMLPUnstructuredGridWriter::GetInput()
{
if(this->NumberOfInputs < 1)
{
return 0;
}
return static_cast<vtkUnstructuredGrid*>(this->Inputs[0]);
return static_cast<vtkUnstructuredGrid*>(this->Superclass::GetInput());
}
//----------------------------------------------------------------------------
......@@ -74,3 +65,10 @@ vtkXMLPUnstructuredGridWriter::CreateUnstructuredPieceWriter()
pWriter->SetInput(this->GetInput());
return pWriter;
}
int vtkXMLPUnstructuredGridWriter::FillInputPortInformation(
int vtkNotUsed(port), vtkInformation* info)
{
info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkUnstructuredGrid");
return 1;
}
......@@ -37,11 +37,12 @@ public:
static vtkXMLPUnstructuredGridWriter* New();
vtkTypeRevisionMacro(vtkXMLPUnstructuredGridWriter,vtkXMLPUnstructuredDataWriter);
void PrintSelf(ostream& os, vtkIndent indent);
//BTX
// Description:
// Get/Set the writer's input.
void SetInput(vtkUnstructuredGrid* input);
vtkUnstructuredGrid* GetInput();
//ETX
// Description:
// Get the default file extension for files written by this writer.
......@@ -51,6 +52,9 @@ protected:
vtkXMLPUnstructuredGridWriter();
~vtkXMLPUnstructuredGridWriter();
// see algorithm for more info
virtual int FillInputPortInformation(int port, vtkInformation* info);
const char* GetDataSetName();
vtkXMLUnstructuredDataWriter* CreateUnstructuredPieceWriter();
......
......@@ -17,11 +17,12 @@
#include "vtkCellArray.h"
#include "vtkCellData.h"
#include "vtkErrorCode.h"
#include "vtkInformation.h"
#include "vtkObjectFactory.h"
#include "vtkPointData.h"
#include "vtkPolyData.h"
vtkCxxRevisionMacro(vtkXMLPolyDataWriter, "1.7");
vtkCxxRevisionMacro(vtkXMLPolyDataWriter, "1.8");
vtkStandardNewMacro(vtkXMLPolyDataWriter);
//----------------------------------------------------------------------------
......@@ -40,23 +41,13 @@ void vtkXMLPolyDataWriter::PrintSelf(ostream& os, vtkIndent indent)
this->Superclass::PrintSelf(os,indent);
}
//----------------------------------------------------------------------------
void vtkXMLPolyDataWriter::SetInput(vtkPolyData* input)
{
this->vtkProcessObject::SetNthInput(0, input);
}
//----------------------------------------------------------------------------
vtkPolyData* vtkXMLPolyDataWriter::GetInput()
{
if(this->NumberOfInputs < 1)
{
return 0;
}
return static_cast<vtkPolyData*>(this->Inputs[0]);
return static_cast<vtkPolyData*>(this->Superclass::GetInput());
}
//----------------------------------------------------------------------------
const char* vtkXMLPolyDataWriter::GetDataSetName()
{
......@@ -403,3 +394,10 @@ void vtkXMLPolyDataWriter::CalculateSuperclassFraction(float* fractions)
fractions[i+1] = fractions[i+1] / fractions[5];
}
}
int vtkXMLPolyDataWriter::FillInputPortInformation(
int vtkNotUsed(port), vtkInformation* info)
{
info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkPolyData");
return 1;
}
......@@ -37,11 +37,12 @@ public:
vtkTypeRevisionMacro(vtkXMLPolyDataWriter,vtkXMLUnstructuredDataWriter);
void PrintSelf(ostream& os, vtkIndent indent);
static vtkXMLPolyDataWriter* New();
//BTX
// Description:
// Get/Set the writer's input.
void SetInput(vtkPolyData* input);
vtkPolyData* GetInput();
//ETX
// Description:
// Get the default file extension for files written by this writer.
......@@ -51,6 +52,9 @@ protected:
vtkXMLPolyDataWriter();
~vtkXMLPolyDataWriter();
// see algorithm for more info
virtual int FillInputPortInformation(int port, vtkInformation* info);
const char* GetDataSetName();
void SetInputUpdateExtent(int piece, int numPieces, int ghostLevel);
......
......@@ -18,11 +18,12 @@
#include "vtkErrorCode.h"
#include "vtkExtentTranslator.h"
#include "vtkFloatArray.h"
#include "vtkInformation.h"
#include "vtkObjectFactory.h"
#include "vtkPointData.h"
#include "vtkRectilinearGrid.h"
vtkCxxRevisionMacro(vtkXMLRectilinearGridWriter, "1.8");
vtkCxxRevisionMacro(vtkXMLRectilinearGridWriter, "1.9");
vtkStandardNewMacro(vtkXMLRectilinearGridWriter);
//----------------------------------------------------------------------------
......@@ -41,21 +42,10 @@ void vtkXMLRectilinearGridWriter::PrintSelf(ostream& os, vtkIndent indent)
this->Superclass::PrintSelf(os,indent);