Commit d7db1414 authored by Berk Geveci's avatar Berk Geveci

BUG: Fixed problems left over from the old pipeline code.

The readers were accessing their output information and through the executive.
This creates problems when what is passed to ProcessRequest() is different.
parent 449d8983
......@@ -39,7 +39,7 @@
#include <vtkstd/vector>
#include <vtksys/SystemTools.hxx>
vtkCxxRevisionMacro(vtkXMLCompositeDataReader, "1.2");
vtkCxxRevisionMacro(vtkXMLCompositeDataReader, "1.3");
struct vtkXMLCompositeDataReaderEntry
{
......@@ -89,18 +89,7 @@ const char* vtkXMLCompositeDataReader::GetDataSetName()
//----------------------------------------------------------------------------
void vtkXMLCompositeDataReader::SetupEmptyOutput()
{
vtkExecutive* exec = this->GetExecutive();
vtkInformation* info = exec->GetOutputInformation(0);
vtkDataObject* doOutput =
info->Get(vtkDataObject::DATA_OBJECT());
vtkCompositeDataSet* composite =
vtkCompositeDataSet::SafeDownCast(doOutput);
if (!composite)
{
return;
}
composite->Initialize();
this->GetCurrentOutput()->Initialize();
}
//----------------------------------------------------------------------------
......@@ -224,8 +213,7 @@ unsigned int vtkXMLCompositeDataReader::CountLeaves(vtkXMLDataElement* elem)
//----------------------------------------------------------------------------
void vtkXMLCompositeDataReader::ReadXMLData()
{
vtkExecutive* exec = this->GetExecutive();
vtkInformation* info = exec->GetOutputInformation(0);
vtkInformation* info = this->GetCurrentOutputInformation();
unsigned int updatePiece = static_cast<unsigned int>(
info->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER()));
......
......@@ -29,7 +29,7 @@
#include "assert.h"
vtkCxxRevisionMacro(vtkXMLDataReader, "1.35");
vtkCxxRevisionMacro(vtkXMLDataReader, "1.36");
//----------------------------------------------------------------------------
vtkXMLDataReader::vtkXMLDataReader()
......@@ -206,8 +206,7 @@ int vtkXMLDataReader::SetUpdateExtentInfo(vtkXMLDataElement *eDSA,
//----------------------------------------------------------------------------
void vtkXMLDataReader::CopyOutputInformation(vtkInformation *outInfo, int port)
{
vtkInformation *localInfo =
this->GetExecutive()->GetOutputInformation( port );
vtkInformation *localInfo = this->GetCurrentOutputInformation();
if ( localInfo->Has(vtkDataObject::POINT_DATA_VECTOR()) )
{
outInfo->CopyEntry( localInfo, vtkDataObject::POINT_DATA_VECTOR() );
......@@ -306,8 +305,9 @@ void vtkXMLDataReader::SetupOutputData()
{
this->Superclass::SetupOutputData();
vtkPointData* pointData = this->GetOutputAsDataSet(0)->GetPointData();
vtkCellData* cellData = this->GetOutputAsDataSet(0)->GetCellData();
vtkDataSet* output = vtkDataSet::SafeDownCast(this->GetCurrentOutput());
vtkPointData* pointData = output->GetPointData();
vtkCellData* cellData = output->GetCellData();
// Get the size of the output arrays.
unsigned long pointTuples = this->GetNumberOfPoints();
......@@ -451,8 +451,10 @@ int vtkXMLDataReader::ReadPieceData(int piece)
//----------------------------------------------------------------------------
int vtkXMLDataReader::ReadPieceData()
{
vtkPointData* pointData = this->GetOutputAsDataSet(0)->GetPointData();
vtkCellData* cellData = this->GetOutputAsDataSet(0)->GetCellData();
vtkDataSet* output = vtkDataSet::SafeDownCast(this->GetCurrentOutput());
vtkPointData* pointData = output->GetPointData();
vtkCellData* cellData = output->GetCellData();
vtkXMLDataElement* ePointData = this->PointDataElements[this->Piece];
vtkXMLDataElement* eCellData = this->CellDataElements[this->Piece];
......@@ -554,7 +556,7 @@ void vtkXMLDataReader::ReadXMLData()
if (this->FieldDataElement) // read the field data information
{
int i, numTuples;
vtkFieldData *fieldData = this->GetOutputDataObject(0)->GetFieldData();
vtkFieldData *fieldData = this->GetCurrentOutput()->GetFieldData();
for(i=0; i < this->FieldDataElement->GetNumberOfNestedElements() &&
!this->AbortExecute; i++)
{
......
......@@ -30,19 +30,12 @@
#include "vtkIntArray.h"
#include "vtkFieldData.h"
vtkCxxRevisionMacro(vtkXMLHyperOctreeReader, "1.4");
vtkCxxRevisionMacro(vtkXMLHyperOctreeReader, "1.5");
vtkStandardNewMacro(vtkXMLHyperOctreeReader);
//----------------------------------------------------------------------------
vtkXMLHyperOctreeReader::vtkXMLHyperOctreeReader()
{
// Copied from vtkHyperOctreeReader constructor:
vtkHyperOctree *output = vtkHyperOctree::New();
this->SetOutput(output);
// Releasing data for pipeline parallism.
// Filters will know it is empty.
output->ReleaseData();
output->Delete();
}
//----------------------------------------------------------------------------
......@@ -56,12 +49,6 @@ void vtkXMLHyperOctreeReader::PrintSelf(ostream& os, vtkIndent indent)
this->Superclass::PrintSelf(os, indent);
}
//----------------------------------------------------------------------------
void vtkXMLHyperOctreeReader::SetOutput(vtkHyperOctree *output)
{
this->GetExecutive()->SetOutputData(0, output);
}
//----------------------------------------------------------------------------
vtkHyperOctree* vtkXMLHyperOctreeReader::GetOutput()
{
......@@ -83,7 +70,7 @@ const char* vtkXMLHyperOctreeReader::GetDataSetName()
//----------------------------------------------------------------------------
void vtkXMLHyperOctreeReader::SetupEmptyOutput()
{
this->GetOutputAsDataSet(0)->SetUpdateExtent(0, 0);
this->GetCurrentOutput()->Initialize();
}
//----------------------------------------------------------------------------
......@@ -96,13 +83,13 @@ int vtkXMLHyperOctreeReader::FillOutputPortInformation(int, vtkInformation *info
//----------------------------------------------------------------------------
vtkIdType vtkXMLHyperOctreeReader::GetNumberOfPoints()
{
return this->GetOutput()->GetNumberOfPoints();
return vtkDataSet::SafeDownCast(this->GetCurrentOutput())->GetNumberOfPoints();
}
//----------------------------------------------------------------------------
vtkIdType vtkXMLHyperOctreeReader::GetNumberOfCells()
{
return this->GetOutput()->GetNumberOfCells();
return vtkDataSet::SafeDownCast(this->GetCurrentOutput())->GetNumberOfCells();
}
//----------------------------------------------------------------------------
......@@ -162,7 +149,8 @@ void vtkXMLHyperOctreeReader::ReadXMLData()
Origin[2] = 0;
}
vtkHyperOctree *output = this->GetOutput();
vtkHyperOctree *output = vtkHyperOctree::SafeDownCast(
this->GetCurrentOutput());
output->SetDimension(Dimension);
output->SetSize(Size);
output->SetOrigin(Origin);
......@@ -252,7 +240,8 @@ void vtkXMLHyperOctreeReader::ReadTopology(vtkXMLDataElement *elem)
this->SetProgressRange(progressRange, 1, fractions);
//Restore the topology from the vtkIntArray. Do it recursively, cell by cell.
vtkHyperOctreeCursor *cursor=this->GetOutput()->NewCellCursor();
vtkHyperOctreeCursor *cursor=vtkHyperOctree::SafeDownCast(
this->GetCurrentOutput())->NewCellCursor();
cursor->ToRoot();
//Where in the array we need to read from next.
this->ArrayIndex = 0;
......@@ -286,14 +275,14 @@ int vtkXMLHyperOctreeReader::BuildNextCell(
{
//terminal node
//subdivide but stop there
this->GetOutput()->SubdivideLeaf(cursor);
vtkHyperOctree::SafeDownCast(this->GetCurrentOutput())->SubdivideLeaf(cursor);
}
*/
else
{
//internal node
//subdivide
this->GetOutput()->SubdivideLeaf(cursor);
vtkHyperOctree::SafeDownCast(this->GetCurrentOutput())->SubdivideLeaf(cursor);
//then keep going down
int i=0;
while(i<nchildren)
......
......@@ -40,8 +40,7 @@ public:
static vtkXMLHyperOctreeReader *New();
// Description:
// Get/Set the reader's output.
void SetOutput(vtkHyperOctree *output);
// Get the reader's output.
vtkHyperOctree *GetOutput();
vtkHyperOctree *GetOutput(int idx);
......
......@@ -22,18 +22,12 @@
#include "vtkInformation.h"
#include "vtkStreamingDemandDrivenPipeline.h"
vtkCxxRevisionMacro(vtkXMLImageDataReader, "1.11");
vtkCxxRevisionMacro(vtkXMLImageDataReader, "1.12");
vtkStandardNewMacro(vtkXMLImageDataReader);
//----------------------------------------------------------------------------
vtkXMLImageDataReader::vtkXMLImageDataReader()
{
vtkImageData *output = vtkImageData::New();
this->SetOutput(output);
// Releasing data for pipeline parallism.
// Filters will know it is empty.
output->ReleaseData();
output->Delete();
}
//----------------------------------------------------------------------------
......@@ -47,12 +41,6 @@ void vtkXMLImageDataReader::PrintSelf(ostream& os, vtkIndent indent)
this->Superclass::PrintSelf(os, indent);
}
//----------------------------------------------------------------------------
void vtkXMLImageDataReader::SetOutput(vtkImageData *output)
{
this->GetExecutive()->SetOutputData(0, output);
}
//----------------------------------------------------------------------------
vtkImageData* vtkXMLImageDataReader::GetOutput()
{
......@@ -75,7 +63,7 @@ const char* vtkXMLImageDataReader::GetDataSetName()
//----------------------------------------------------------------------------
void vtkXMLImageDataReader::SetOutputExtent(int* extent)
{
this->GetOutput()->SetExtent(extent);
vtkImageData::SafeDownCast(this->GetCurrentOutput())->SetExtent(extent);
}
//----------------------------------------------------------------------------
......@@ -118,7 +106,7 @@ void vtkXMLImageDataReader::SetupOutputInformation(vtkInformation *outInfo)
void vtkXMLImageDataReader::CopyOutputInformation(vtkInformation *outInfo, int port)
{
this->Superclass::CopyOutputInformation(outInfo, port);
vtkInformation *localInfo = this->GetExecutive()->GetOutputInformation( port );
vtkInformation *localInfo = this->GetCurrentOutputInformation();
if ( localInfo->Has(vtkDataObject::ORIGIN()) )
{
......
......@@ -38,8 +38,7 @@ public:
static vtkXMLImageDataReader *New();
// Description:
// Get/Set the reader's output.
void SetOutput(vtkImageData *output);
// Get the reader's output.
vtkImageData *GetOutput();
vtkImageData *GetOutput(int idx);
......
......@@ -28,7 +28,7 @@
#include <vtksys/ios/sstream>
vtkCxxRevisionMacro(vtkXMLPDataReader, "1.19");
vtkCxxRevisionMacro(vtkXMLPDataReader, "1.20");
//----------------------------------------------------------------------------
vtkXMLPDataReader::vtkXMLPDataReader()
......@@ -83,7 +83,7 @@ vtkDataSet* vtkXMLPDataReader::GetPieceInputAsDataSet(int piece)
{
return 0;
}
return static_cast<vtkDataSet*>(reader->GetExecutive()->GetOutputData(0));
return static_cast<vtkDataSet*>(reader->GetOutputDataObject(0));
}
......@@ -95,8 +95,9 @@ void vtkXMLPDataReader::SetupOutputData()
// Setup the output arrays.
vtkXMLDataElement* ePointData = this->PPointDataElement;
vtkXMLDataElement* eCellData = this->PCellDataElement;
vtkPointData* pointData = this->GetOutputAsDataSet(0)->GetPointData();
vtkCellData* cellData = this->GetOutputAsDataSet(0)->GetCellData();
vtkDataSet* output = vtkDataSet::SafeDownCast(this->GetCurrentOutput());
vtkPointData* pointData = output->GetPointData();
vtkCellData* cellData = output->GetCellData();
// Get the size of the output arrays.
unsigned long pointTuples = this->GetNumberOfPoints();
......@@ -213,7 +214,7 @@ void vtkXMLPDataReader::SetupOutputInformation(vtkInformation *outInfo)
//----------------------------------------------------------------------------
void vtkXMLPDataReader::CopyOutputInformation(vtkInformation *outInfo, int port)
{
vtkInformation *localInfo = this->GetExecutive()->GetOutputInformation( port );
vtkInformation *localInfo = this->GetCurrentOutputInformation();
if ( localInfo->Has(vtkDataObject::POINT_DATA_VECTOR()) )
{
outInfo->CopyEntry( localInfo, vtkDataObject::POINT_DATA_VECTOR() );
......@@ -378,7 +379,7 @@ int vtkXMLPDataReader::ReadPieceData(int index)
int vtkXMLPDataReader::ReadPieceData()
{
vtkDataSet* input = this->GetPieceInputAsDataSet(this->Piece);
vtkDataSet* output = this->GetOutputAsDataSet(0);
vtkDataSet* output = vtkDataSet::SafeDownCast(this->GetCurrentOutput());
// copy any field data
if (input->GetFieldData())
......
......@@ -23,18 +23,12 @@
#include "vtkInformation.h"
#include "vtkStreamingDemandDrivenPipeline.h"
vtkCxxRevisionMacro(vtkXMLPImageDataReader, "1.10");
vtkCxxRevisionMacro(vtkXMLPImageDataReader, "1.11");
vtkStandardNewMacro(vtkXMLPImageDataReader);
//----------------------------------------------------------------------------
vtkXMLPImageDataReader::vtkXMLPImageDataReader()
{
vtkImageData *output = vtkImageData::New();
this->SetOutput(output);
// Releasing data for pipeline parallism.
// Filters will know it is empty.
output->ReleaseData();
output->Delete();
}
//----------------------------------------------------------------------------
......@@ -48,12 +42,6 @@ void vtkXMLPImageDataReader::PrintSelf(ostream& os, vtkIndent indent)
this->Superclass::PrintSelf(os, indent);
}
//----------------------------------------------------------------------------
void vtkXMLPImageDataReader::SetOutput(vtkImageData *output)
{
this->GetExecutive()->SetOutputData(0, output);
}
//----------------------------------------------------------------------------
vtkImageData* vtkXMLPImageDataReader::GetOutput()
{
......@@ -80,10 +68,16 @@ const char* vtkXMLPImageDataReader::GetDataSetName()
return "PImageData";
}
//----------------------------------------------------------------------------
void vtkXMLPImageDataReader::SetupEmptyOutput()
{
this->GetCurrentOutput()->Initialize();
}
//----------------------------------------------------------------------------
void vtkXMLPImageDataReader::SetOutputExtent(int* extent)
{
this->GetOutput()->SetExtent(extent);
vtkImageData::SafeDownCast(this->GetCurrentOutput())->SetExtent(extent);
}
//----------------------------------------------------------------------------
......@@ -132,7 +126,7 @@ void vtkXMLPImageDataReader::SetupOutputInformation(vtkInformation *outInfo)
void vtkXMLPImageDataReader::CopyOutputInformation(vtkInformation *outInfo, int port)
{
this->Superclass::CopyOutputInformation(outInfo, port);
vtkInformation *localInfo = this->GetExecutive()->GetOutputInformation( port );
vtkInformation *localInfo = this->GetCurrentOutputInformation();
if ( localInfo->Has(vtkDataObject::ORIGIN()) )
{
......
......@@ -38,8 +38,7 @@ public:
static vtkXMLPImageDataReader *New();
// Description:
// Get/Set the reader's output.
void SetOutput(vtkImageData *output);
// Get the reader's output.
vtkImageData *GetOutput();
vtkImageData *GetOutput(int idx);
......@@ -55,7 +54,8 @@ protected:
double Spacing[3];
vtkImageData* GetPieceInput(int index);
void SetupEmptyOutput();
const char* GetDataSetName();
void SetOutputExtent(int* extent);
void GetPieceInputExtent(int index, int* extent);
......
......@@ -22,19 +22,12 @@
#include "vtkInformation.h"
#include "vtkStreamingDemandDrivenPipeline.h"
vtkCxxRevisionMacro(vtkXMLPPolyDataReader, "1.7");
vtkCxxRevisionMacro(vtkXMLPPolyDataReader, "1.8");
vtkStandardNewMacro(vtkXMLPPolyDataReader);
//----------------------------------------------------------------------------
vtkXMLPPolyDataReader::vtkXMLPPolyDataReader()
{
// Copied from vtkPolyDataReader constructor:
vtkPolyData *output = vtkPolyData::New();
this->SetOutput(output);
// Releasing data for pipeline parallism.
// Filters will know it is empty.
output->ReleaseData();
output->Delete();
}
//----------------------------------------------------------------------------
......@@ -48,12 +41,6 @@ void vtkXMLPPolyDataReader::PrintSelf(ostream& os, vtkIndent indent)
this->Superclass::PrintSelf(os, indent);
}
//----------------------------------------------------------------------------
void vtkXMLPPolyDataReader::SetOutput(vtkPolyData *output)
{
this->GetExecutive()->SetOutputData(0, output);
}
//----------------------------------------------------------------------------
vtkPolyData* vtkXMLPPolyDataReader::GetOutput()
{
......@@ -77,7 +64,13 @@ void vtkXMLPPolyDataReader::GetOutputUpdateExtent(int& piece,
int& numberOfPieces,
int& ghostLevel)
{
this->GetOutput()->GetUpdateExtent(piece, numberOfPieces, ghostLevel);
vtkInformation* outInfo = this->GetCurrentOutputInformation();
piece = outInfo->Get(
vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER());
numberOfPieces= outInfo->Get(
vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES());
ghostLevel = outInfo->Get(
vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS());
}
//----------------------------------------------------------------------------
......@@ -170,7 +163,7 @@ void vtkXMLPPolyDataReader::SetupOutputData()
{
this->Superclass::SetupOutputData();
vtkPolyData* output = this->GetOutput();
vtkPolyData* output = vtkPolyData::SafeDownCast(this->GetCurrentOutput());
// Setup the output's cell arrays.
vtkCellArray* outVerts = vtkCellArray::New();
......@@ -206,7 +199,7 @@ int vtkXMLPPolyDataReader::ReadPieceData()
vtkPointSet* ips = this->GetPieceInputAsPointSet(this->Piece);
vtkPolyData* input = static_cast<vtkPolyData*>(ips);
vtkPolyData* output = this->GetOutput();
vtkPolyData* output = vtkPolyData::SafeDownCast(this->GetCurrentOutput());
// Copy the Verts.
this->CopyCellArray(this->TotalNumberOfVerts, input->GetVerts(),
......
......@@ -38,8 +38,7 @@ public:
static vtkXMLPPolyDataReader *New();
// Description:
// Get/Set the reader's output.
void SetOutput(vtkPolyData *output);
// Get the reader's output.
vtkPolyData *GetOutput();
vtkPolyData *GetOutput(int idx);
......
......@@ -22,19 +22,12 @@
#include "vtkInformation.h"
#include "vtkStreamingDemandDrivenPipeline.h"
vtkCxxRevisionMacro(vtkXMLPRectilinearGridReader, "1.12");
vtkCxxRevisionMacro(vtkXMLPRectilinearGridReader, "1.13");
vtkStandardNewMacro(vtkXMLPRectilinearGridReader);
//----------------------------------------------------------------------------
vtkXMLPRectilinearGridReader::vtkXMLPRectilinearGridReader()
{
// Copied from vtkRectilinearGridReader constructor:
vtkRectilinearGrid *output = vtkRectilinearGrid::New();
this->SetOutput(output);
// Releasing data for pipeline parallism.
// Filters will know it is empty.
output->ReleaseData();
output->Delete();
}
//----------------------------------------------------------------------------
......@@ -49,9 +42,9 @@ void vtkXMLPRectilinearGridReader::PrintSelf(ostream& os, vtkIndent indent)
}
//----------------------------------------------------------------------------
void vtkXMLPRectilinearGridReader::SetOutput(vtkRectilinearGrid *output)
void vtkXMLPRectilinearGridReader::SetupEmptyOutput()
{
this->GetExecutive()->SetOutputData(0, output);
this->GetCurrentOutput()->Initialize();
}
//----------------------------------------------------------------------------
......@@ -83,7 +76,7 @@ const char* vtkXMLPRectilinearGridReader::GetDataSetName()
//----------------------------------------------------------------------------
void vtkXMLPRectilinearGridReader::SetOutputExtent(int* extent)
{
this->GetOutput()->SetExtent(extent);
vtkRectilinearGrid::SafeDownCast(this->GetCurrentOutput())->SetExtent(extent);
}
//----------------------------------------------------------------------------
......@@ -116,7 +109,7 @@ vtkXMLPRectilinearGridReader::ReadPrimaryElement(vtkXMLDataElement* ePrimary)
if(!this->PCoordinatesElement)
{
int extent[6];
this->GetOutput()->GetWholeExtent(extent);
vtkRectilinearGrid::SafeDownCast(this->GetCurrentOutput())->GetWholeExtent(extent);
if((extent[0] <= extent[1]) && (extent[2] <= extent[3]) &&
(extent[4] <= extent[5]))
{
......@@ -141,7 +134,8 @@ void vtkXMLPRectilinearGridReader::SetupOutputData()
}
// Allocate the coordinate arrays.
vtkRectilinearGrid* output = this->GetOutput();
vtkRectilinearGrid* output = vtkRectilinearGrid::SafeDownCast(
this->GetCurrentOutput());
vtkXMLDataElement* xc = this->PCoordinatesElement->GetNestedElement(0);
vtkXMLDataElement* yc = this->PCoordinatesElement->GetNestedElement(1);
......@@ -183,7 +177,8 @@ int vtkXMLPRectilinearGridReader::ReadPieceData()
// Copy the coordinates arrays from the input piece.
vtkRectilinearGrid* input = this->GetPieceInput(this->Piece);
vtkRectilinearGrid* output = this->GetOutput();
vtkRectilinearGrid* output = vtkRectilinearGrid::SafeDownCast(
this->GetCurrentOutput());
this->CopySubCoordinates(this->SubPieceExtent, this->UpdateExtent,
this->SubExtent, input->GetXCoordinates(),
output->GetXCoordinates());
......
......@@ -38,8 +38,7 @@ public:
static vtkXMLPRectilinearGridReader *New();
// Description:
// Get/Set the reader's output.
void SetOutput(vtkRectilinearGrid *output);
// Get the reader's output.
vtkRectilinearGrid *GetOutput();
vtkRectilinearGrid *GetOutput(int idx);
......@@ -48,7 +47,8 @@ protected:
~vtkXMLPRectilinearGridReader();
vtkRectilinearGrid* GetPieceInput(int index);
void SetupEmptyOutput();
const char* GetDataSetName();
void SetOutputExtent(int* extent);
void GetPieceInputExtent(int index, int* extent);
......
......@@ -18,6 +18,7 @@
#include "vtkDataSet.h"
#include "vtkExtentSplitter.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkStreamingDemandDrivenPipeline.h"
#include "vtkTableExtentTranslator.h"
#include "vtkXMLDataElement.h"
......@@ -25,7 +26,7 @@
#include <vtksys/ios/sstream>
vtkCxxRevisionMacro(vtkXMLPStructuredDataReader, "1.23");
vtkCxxRevisionMacro(vtkXMLPStructuredDataReader, "1.24");
//----------------------------------------------------------------------------
vtkXMLPStructuredDataReader::vtkXMLPStructuredDataReader()
......@@ -75,7 +76,9 @@ vtkIdType vtkXMLPStructuredDataReader::GetNumberOfCells()
void vtkXMLPStructuredDataReader::ReadXMLData()
{
// Get the requested Update Extent.
this->GetOutputAsDataSet(0)->GetUpdateExtent(this->UpdateExtent);
vtkInformation* outInfo = this->GetCurrentOutputInformation();
outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(),
this->UpdateExtent);
vtkDebugMacro("Updating extent "
<< this->UpdateExtent[0] << " " << this->UpdateExtent[1] << " "
......@@ -164,19 +167,37 @@ void vtkXMLPStructuredDataReader::ReadXMLData()
this->SetOutputExtent(this->UpdateExtent);
}
//----------------------------------------------------------------------------
int vtkXMLPStructuredDataReader::RequestInformation(vtkInformation *request,
vtkInformationVector **inputVector,
vtkInformationVector *outputVector)
{
// Tell the output to use the table extent translator to provide the
// correct piece breakdown for the file layout.
outputVector->GetInformationObject(0)->Set(
vtkStreamingDemandDrivenPipeline::EXTENT_TRANSLATOR(),
this->ExtentTranslator);
return this->Superclass::RequestInformation(
request, inputVector, outputVector);
}
//----------------------------------------------------------------------------
int
vtkXMLPStructuredDataReader::ReadPrimaryElement(vtkXMLDataElement* ePrimary)
{
if(!this->Superclass::ReadPrimaryElement(ePrimary)) { return 0; }
vtkDataSet* output = this->GetOutputAsDataSet(0);
vtkDataSet* output = vtkDataSet::SafeDownCast(this->GetCurrentOutput());
// Get the whole extent attribute.
int extent[6];
if(ePrimary->GetVectorAttribute("WholeExtent", 6, extent) == 6)
{
// Set the output's whole extent.
output->SetWholeExtent(extent);
vtkInformation* outInfo = this->GetCurrentOutputInformation();
outInfo->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(),
extent, 6);
// Check each axis to see if it has cells.