Commit 468485c3 authored by Andrew Bauer's avatar Andrew Bauer Committed by Kitware Robot
Browse files

Merge topic 'structureddatawriter-extents'

2db839d7 Properly setting the number of pieces and whole extent.
parents 4527ed94 2db839d7
......@@ -21,37 +21,20 @@
#include "vtkInformation.h"
#include "vtkStreamingDemandDrivenPipeline.h"
vtkCxxSetObjectMacro(vtkXMLPStructuredDataWriter, ExtentTranslator,
vtkExtentTranslator);
//----------------------------------------------------------------------------
vtkXMLPStructuredDataWriter::vtkXMLPStructuredDataWriter()
{
this->ExtentTranslator = vtkExtentTranslator::New();
}
//----------------------------------------------------------------------------
vtkXMLPStructuredDataWriter::~vtkXMLPStructuredDataWriter()
{
if (this->ExtentTranslator)
{
this->ExtentTranslator->Delete();
this->ExtentTranslator = 0;
}
}
//----------------------------------------------------------------------------
void vtkXMLPStructuredDataWriter::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
if(this->ExtentTranslator)
{
os << indent << "ExtentTranslator: " << this->ExtentTranslator << "\n";
}
else
{
os << indent << "ExtentTranslator: (none)\n";
}
}
//----------------------------------------------------------------------------
......@@ -69,11 +52,14 @@ void vtkXMLPStructuredDataWriter::WritePPieceAttributes(int index)
vtkInformation* inInfo = this->GetExecutive()->GetInputInformation(0, 0);
vtkExtentTranslator* et = vtkExtentTranslator::SafeDownCast(
inInfo->Get(vtkStreamingDemandDrivenPipeline::EXTENT_TRANSLATOR()));
et->SetNumberOfPieces(this->GetNumberOfPieces());
et->SetWholeExtent(inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT()));
et->SetPiece(index);
et->SetGhostLevel(0);
et->PieceToExtent();
et->GetExtent(extent);
this->WriteVectorAttribute("Extent", 6, extent);
if (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError)
{
......@@ -89,6 +75,9 @@ vtkXMLWriter* vtkXMLPStructuredDataWriter::CreatePieceWriter(int index)
vtkInformation* inInfo = this->GetExecutive()->GetInputInformation(0, 0);
vtkExtentTranslator* et = vtkExtentTranslator::SafeDownCast(
inInfo->Get(vtkStreamingDemandDrivenPipeline::EXTENT_TRANSLATOR()));
et->SetNumberOfPieces(this->GetNumberOfPieces());
et->SetWholeExtent(inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT()));
et->SetPiece(index);
et->SetGhostLevel(0);
et->PieceToExtent();
......
......@@ -23,7 +23,6 @@
#include "vtkXMLPDataWriter.h"
class vtkXMLStructuredDataWriter;
class vtkExtentTranslator;
class VTK_IO_EXPORT vtkXMLPStructuredDataWriter : public vtkXMLPDataWriter
{
......@@ -31,11 +30,6 @@ public:
vtkTypeMacro(vtkXMLPStructuredDataWriter,vtkXMLPDataWriter);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Get/Set the extent translator used for creating pieces.
virtual void SetExtentTranslator(vtkExtentTranslator*);
vtkGetObjectMacro(ExtentTranslator, vtkExtentTranslator);
protected:
vtkXMLPStructuredDataWriter();
~vtkXMLPStructuredDataWriter();
......@@ -45,8 +39,6 @@ protected:
void WritePPieceAttributes(int index);
vtkXMLWriter* CreatePieceWriter(int index);
vtkExtentTranslator* ExtentTranslator;
private:
vtkXMLPStructuredDataWriter(const vtkXMLPStructuredDataWriter&); // Not implemented.
void operator=(const vtkXMLPStructuredDataWriter&); // Not implemented.
......
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