Commit 47f8853d authored by Mathieu Malaterre's avatar Mathieu Malaterre

ENH: First pass at adding timesupport in XML file. Getting toward solving issue #1739

parent 10c02c39
/*=========================================================================
Program: Visualization Toolkit
Module: vtkOffsetsManagerArray.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME OffsetsManager - Helper class due to PIMPL excess
// .SECTION Description
// This class is deisgned to work within vtkXMLWriter. It store a position
// in a file (unsigned long) and associate a offset in the file. This is
// usefull when writting TimeStep XML file when you want to forward the
// same offset from the AppendData section on every entry in let say
// <Points> definition
// Example:
// <Points>
// <DataArray type="Float32" TimeStep="0" format="appended" offset="268" />
// <DataArray type="Float32" TimeStep="1" format="appended" offset="268" />
// ...
// </Points>
// Therefore data is only stored once in the XML file. At read time the
// offset value is stored to determine whenever we need to read data
// (ie when offset different from previously stored offset)
// .SECTION See Also
// vtkXMLWriter
// .SECTION Warning
// Do not include this file in a header file, it will break PIMPL convention
#ifndef __vtkOffsetsManagerArray_h
#define __vtkOffsetsManagerArray_h
#include "vtkSystemIncludes.h"
#include <vtkstd/vector>
#include <assert.h>
//----------------------------------------------------------------------------
class OffsetsManager
{
public:
// Construct with default (unsigned long)-1 MTime
OffsetsManager()
{
this->LastMTime = (unsigned long)-1; //almost invalid state
}
~OffsetsManager()
{
}
void Allocate(int numTimeStep)
{
assert( numTimeStep > 0);
this->Positions.resize(numTimeStep);
this->OffsetValues.resize(numTimeStep);
}
unsigned long &GetPosition(unsigned int t)
{
assert( t < this->Positions.size());
return this->Positions[t];
}
unsigned long &GetOffsetValue(unsigned int t)
{
assert( t < this->OffsetValues.size());
return this->OffsetValues[t];
}
unsigned long &GetLastMTime()
{
return this->LastMTime;
}
private:
unsigned long LastMTime; // Previously written dataarray mtime
vtkstd::vector<unsigned long> Positions; // Position in the stream to write the offset
vtkstd::vector<unsigned long> OffsetValues; // Value of offset
};
//----------------------------------------------------------------------------
class OffsetsManagerGroup
{
public:
// This is kind of a hack since we need to consider both the case of Points with
// only one array over time and PointData with possibly multiple array over time
// therefore we need to use a OffsetsManagerGroup for representing offset from
// Points but OffsetsManagerArray for PointData. In both case the toplevel structure
// is a container of Pieces...
OffsetsManager &GetPiece(unsigned int index)
{
assert( index < this->Internals.size());
OffsetsManager &e = this->Internals[index];
return e;
}
// GetElement should be used when manipulating a OffsetsManagerArray
OffsetsManager &GetElement(unsigned int index)
{
assert( index < this->Internals.size());
OffsetsManager &e = this->Internals[index];
return e;
}
unsigned int GetNumberOfElements()
{
return this->Internals.size();
}
void Allocate(int numElements)
{
assert(numElements >= 0); //allow 0 for empty FieldData
this->Internals.resize(numElements);
}
void Allocate(int numElements, int numTimeSteps)
{
assert(numElements > 0);
assert(numTimeSteps > 0);
this->Internals.resize(numElements);
for(int i=0; i<numElements; i++)
{
this->Internals[i].Allocate(numTimeSteps);
}
}
private:
vtkstd::vector<OffsetsManager> Internals;
};
//----------------------------------------------------------------------------
class OffsetsManagerArray
{
public:
OffsetsManagerGroup &GetPiece(unsigned int index)
{
assert( index < this->Internals.size());
return this->Internals[index];
}
void Allocate(int numPieces)
{
assert(numPieces > 0);
this->Internals.resize(numPieces);
}
void Allocate(int numPieces, int numElements, int numTimeSteps)
{
assert(numPieces > 0);
assert(numElements > 0);
assert(numTimeSteps > 0);
this->Internals.resize(numPieces);
for(int i=0; i<numPieces; i++)
{
this->Internals[i].Allocate(numElements, numTimeSteps);
}
}
private:
vtkstd::vector<OffsetsManagerGroup> Internals;
};
#endif
......@@ -20,7 +20,7 @@
#include <ctype.h>
vtkCxxRevisionMacro(vtkXMLDataElement, "1.22");
vtkCxxRevisionMacro(vtkXMLDataElement, "1.23");
vtkStandardNewMacro(vtkXMLDataElement);
//----------------------------------------------------------------------------
......@@ -482,91 +482,88 @@ vtkXMLDataElement* vtkXMLDataElement::LookupElementUpScope(const char* id)
//----------------------------------------------------------------------------
int vtkXMLDataElement::GetScalarAttribute(const char* name, int& value)
{
return this->GetVectorAttribute(name, 1, &value);
return this->GetVectorAttribute(name, &value);
}
//----------------------------------------------------------------------------
int vtkXMLDataElement::GetScalarAttribute(const char* name, float& value)
{
return this->GetVectorAttribute(name, 1, &value);
return this->GetVectorAttribute(name, &value);
}
//----------------------------------------------------------------------------
int vtkXMLDataElement::GetScalarAttribute(const char* name, double& value)
{
return this->GetVectorAttribute(name, 1, &value);
return this->GetVectorAttribute(name, &value);
}
//----------------------------------------------------------------------------
int vtkXMLDataElement::GetScalarAttribute(const char* name,
unsigned long& value)
{
return this->GetVectorAttribute(name, 1, &value);
return this->GetVectorAttribute(name, &value);
}
//----------------------------------------------------------------------------
#ifdef VTK_USE_64BIT_IDS
int vtkXMLDataElement::GetScalarAttribute(const char* name, vtkIdType& value)
{
return this->GetVectorAttribute(name, 1, &value);
return this->GetVectorAttribute(name, &value);
}
#endif
//----------------------------------------------------------------------------
template <class T>
int vtkXMLDataElementVectorAttributeParse(const char* str, int length, T* data)
int vtkXMLDataElementVectorAttributeParse(const char* str, T* data)
{
if(!str || !length || !data) { return 0; }
if(!str || !data)
{
return 0;
}
strstream vstr;
vstr << str << ends;
int i;
for(i=0;i < length;++i)
int i=0;
while(vstr >> data[i])
{
vstr >> data[i];
if(!vstr) { return i; }
++i;
}
return length;
return i;
}
//----------------------------------------------------------------------------
int vtkXMLDataElement::GetVectorAttribute(const char* name, int length,
int* data)
int vtkXMLDataElement::GetVectorAttribute(const char* name, int* data)
{
return vtkXMLDataElementVectorAttributeParse(this->GetAttribute(name),
length, data);
data);
}
//----------------------------------------------------------------------------
int vtkXMLDataElement::GetVectorAttribute(const char* name, int length,
float* data)
int vtkXMLDataElement::GetVectorAttribute(const char* name, float* data)
{
return vtkXMLDataElementVectorAttributeParse(this->GetAttribute(name),
length, data);
data);
}
//----------------------------------------------------------------------------
int vtkXMLDataElement::GetVectorAttribute(const char* name, int length,
double* data)
int vtkXMLDataElement::GetVectorAttribute(const char* name, double* data)
{
return vtkXMLDataElementVectorAttributeParse(this->GetAttribute(name),
length, data);
data);
}
//----------------------------------------------------------------------------
int vtkXMLDataElement::GetVectorAttribute(const char* name, int length,
unsigned long* data)
int vtkXMLDataElement::GetVectorAttribute(const char* name, unsigned long* data)
{
return vtkXMLDataElementVectorAttributeParse(this->GetAttribute(name),
length, data);
data);
}
//----------------------------------------------------------------------------
#ifdef VTK_USE_64BIT_IDS
int vtkXMLDataElement::GetVectorAttribute(const char* name, int length,
vtkIdType* data)
int vtkXMLDataElement::GetVectorAttribute(const char* name, vtkIdType* data)
{
return vtkXMLDataElementVectorAttributeParse(this->GetAttribute(name),
length, data);
data);
}
#endif
......
......@@ -77,10 +77,10 @@ public:
// Description:
// Get the attribute with the given name and converted to a scalar
// value. Returns length of vector read.
int GetVectorAttribute(const char* name, int length, int* value);
int GetVectorAttribute(const char* name, int length, float* value);
int GetVectorAttribute(const char* name, int length, double* value);
int GetVectorAttribute(const char* name, int length, unsigned long* value);
int GetVectorAttribute(const char* name, int* value);
int GetVectorAttribute(const char* name, float* value);
int GetVectorAttribute(const char* name, double* value);
int GetVectorAttribute(const char* name, unsigned long* value);
// Description:
// Set the attribute with the given name.
......@@ -93,7 +93,7 @@ public:
//BTX
int GetScalarAttribute(const char* name, vtkIdType& value);
void SetIdTypeAttribute(const char* name, vtkIdType value);
int GetVectorAttribute(const char* name, int length, vtkIdType* value);
int GetVectorAttribute(const char* name, vtkIdType* value);
void SetVectorAttribute(const char* name, int length, const vtkIdType* value);
//ETX
#endif
......
......@@ -22,7 +22,7 @@
#include "vtkObjectFactory.h"
#include "vtkXMLDataElement.h"
vtkCxxRevisionMacro(vtkXMLDataParser, "1.28");
vtkCxxRevisionMacro(vtkXMLDataParser, "1.29");
vtkStandardNewMacro(vtkXMLDataParser);
vtkCxxSetObjectMacro(vtkXMLDataParser, Compressor, vtkDataCompressor);
......
This diff is collapsed.
......@@ -107,7 +107,18 @@ protected:
// The observer to report progress from reading data from XMLParser.
vtkCallbackCommand* DataProgressObserver;
// Specify the last time step read, usefull to know if we need to rearead data
// //PointData
int *PointDataTimeStep;
unsigned long *PointDataOffset;
int PointDataNeedToReadTimeStep(vtkXMLDataElement *eNested);
//CellData
int *CellDataTimeStep;
unsigned long *CellDataOffset;
int CellDataNeedToReadTimeStep(vtkXMLDataElement *eNested);
private:
vtkXMLDataReader(const vtkXMLDataReader&); // Not implemented.
void operator=(const vtkXMLDataReader&); // Not implemented.
......
......@@ -29,7 +29,7 @@
#include "vtkXMLStructuredGridWriter.h"
#include "vtkXMLUnstructuredGridWriter.h"
vtkCxxRevisionMacro(vtkXMLDataSetWriter, "1.10");
vtkCxxRevisionMacro(vtkXMLDataSetWriter, "1.11");
vtkStandardNewMacro(vtkXMLDataSetWriter);
//----------------------------------------------------------------------------
......
......@@ -15,7 +15,7 @@
#include "vtkXMLFileReadTester.h"
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtkXMLFileReadTester, "1.2");
vtkCxxRevisionMacro(vtkXMLFileReadTester, "1.3");
vtkStandardNewMacro(vtkXMLFileReadTester);
//----------------------------------------------------------------------------
......
......@@ -22,7 +22,7 @@
#include "vtkInformation.h"
#include "vtkStreamingDemandDrivenPipeline.h"
vtkCxxRevisionMacro(vtkXMLImageDataReader, "1.8");
vtkCxxRevisionMacro(vtkXMLImageDataReader, "1.9");
vtkStandardNewMacro(vtkXMLImageDataReader);
//----------------------------------------------------------------------------
......@@ -84,7 +84,7 @@ int vtkXMLImageDataReader::ReadPrimaryElement(vtkXMLDataElement* ePrimary)
if(!this->Superclass::ReadPrimaryElement(ePrimary)) { return 0; }
// Get the image's origin.
if(ePrimary->GetVectorAttribute("Origin", 3, this->Origin) != 3)
if(ePrimary->GetVectorAttribute("Origin", this->Origin) != 3)
{
this->Origin[0] = 0;
this->Origin[1] = 0;
......@@ -92,7 +92,7 @@ int vtkXMLImageDataReader::ReadPrimaryElement(vtkXMLDataElement* ePrimary)
}
// Get the image's spacing.
if(ePrimary->GetVectorAttribute("Spacing", 3, this->Spacing) != 3)
if(ePrimary->GetVectorAttribute("Spacing", this->Spacing) != 3)
{
this->Spacing[0] = 1;
this->Spacing[1] = 1;
......
......@@ -17,7 +17,7 @@
#include "vtkImageData.h"
#include "vtkInformation.h"
vtkCxxRevisionMacro(vtkXMLImageDataWriter, "1.6");
vtkCxxRevisionMacro(vtkXMLImageDataWriter, "1.7");
vtkStandardNewMacro(vtkXMLImageDataWriter);
//----------------------------------------------------------------------------
......@@ -61,9 +61,9 @@ const char* vtkXMLImageDataWriter::GetDefaultFileExtension()
}
//----------------------------------------------------------------------------
void vtkXMLImageDataWriter::WritePrimaryElementAttributes()
void vtkXMLImageDataWriter::WritePrimaryElementAttributes(ostream &os, vtkIndent indent)
{
this->Superclass::WritePrimaryElementAttributes();
this->Superclass::WritePrimaryElementAttributes(os, indent);
vtkImageData* input = this->GetInput();
this->WriteVectorAttribute("Origin", 3, input->GetOrigin());
this->WriteVectorAttribute("Spacing", 3, input->GetSpacing());
......
......@@ -54,7 +54,7 @@ protected:
// see algorithm for more info
virtual int FillInputPortInformation(int port, vtkInformation* info);
void WritePrimaryElementAttributes();
void WritePrimaryElementAttributes(ostream &os, vtkIndent indent);
void GetInputExtent(int* extent);
const char* GetDataSetName();
......
......@@ -26,7 +26,7 @@
#include "vtkInformation.h"
#include "vtkStreamingDemandDrivenPipeline.h"
vtkCxxRevisionMacro(vtkXMLPDataReader, "1.16");
vtkCxxRevisionMacro(vtkXMLPDataReader, "1.17");
//----------------------------------------------------------------------------
vtkXMLPDataReader::vtkXMLPDataReader()
......@@ -51,8 +51,14 @@ vtkXMLPDataReader::vtkXMLPDataReader()
//----------------------------------------------------------------------------
vtkXMLPDataReader::~vtkXMLPDataReader()
{
if(this->NumberOfPieces) { this->DestroyPieces(); }
if(this->PathName) { delete [] this->PathName; }
if(this->NumberOfPieces)
{
this->DestroyPieces();
}
if(this->PathName)
{
delete [] this->PathName;
}
this->PieceProgressObserver->Delete();
}
......@@ -67,8 +73,14 @@ void vtkXMLPDataReader::PrintSelf(ostream& os, vtkIndent indent)
vtkDataSet* vtkXMLPDataReader::GetPieceInputAsDataSet(int piece)
{
vtkXMLDataReader* reader = this->PieceReaders[piece];
if(!reader) { return 0; }
if(reader->GetNumberOfOutputPorts() < 1) { return 0; }
if(!reader)
{
return 0;
}
if(reader->GetNumberOfOutputPorts() < 1)
{
return 0;
}
return static_cast<vtkDataSet*>(reader->GetExecutive()->GetOutputData(0));
}
......@@ -214,7 +226,10 @@ void vtkXMLPDataReader::CopyOutputInformation(vtkInformation *outInfo, int port)
//----------------------------------------------------------------------------
int vtkXMLPDataReader::ReadPrimaryElement(vtkXMLDataElement* ePrimary)
{
if(!this->Superclass::ReadPrimaryElement(ePrimary)) { return 0; }
if(!this->Superclass::ReadPrimaryElement(ePrimary))
{
return 0;
}
// Read information about the data.
if(!ePrimary->GetScalarAttribute("GhostLevel", this->GhostLevel))
{
......@@ -230,7 +245,10 @@ int vtkXMLPDataReader::ReadPrimaryElement(vtkXMLDataElement* ePrimary)
for(i=0;i < numNested; ++i)
{
vtkXMLDataElement* eNested = ePrimary->GetNestedElement(i);
if(strcmp(eNested->GetName(), "Piece") == 0) { ++numPieces; }
if(strcmp(eNested->GetName(), "Piece") == 0)
{
++numPieces;
}
else if(strcmp(eNested->GetName(), "PPointData") == 0)
{
this->PPointDataElement = eNested;
......@@ -247,7 +265,10 @@ int vtkXMLPDataReader::ReadPrimaryElement(vtkXMLDataElement* ePrimary)
vtkXMLDataElement* eNested = ePrimary->GetNestedElement(i);
if(strcmp(eNested->GetName(), "Piece") == 0)
{
if(!this->ReadPiece(eNested, piece++)) { return 0; }
if(!this->ReadPiece(eNested, piece++))
{
return 0;
}
}
}
......@@ -257,7 +278,10 @@ int vtkXMLPDataReader::ReadPrimaryElement(vtkXMLDataElement* ePrimary)
//----------------------------------------------------------------------------
void vtkXMLPDataReader::SetupPieces(int numPieces)
{
if(this->NumberOfPieces) { this->DestroyPieces(); }
if(this->NumberOfPieces)
{
this->DestroyPieces();
}
this->NumberOfPieces = numPieces;
this->PieceElements = new vtkXMLDataElement*[this->NumberOfPieces];
this->PieceReaders = new vtkXMLDataReader*[this->NumberOfPieces];
......@@ -409,7 +433,10 @@ int vtkXMLPDataReader::CanReadPiece(int index)
char* vtkXMLPDataReader::CreatePieceFileName(const char* fileName)
{
ostrstream fn_with_warning_C4701;
if(this->PathName) { fn_with_warning_C4701 << this->PathName; }
if(this->PathName)
{
fn_with_warning_C4701 << this->PathName;
}
fn_with_warning_C4701 << fileName << ends;
return fn_with_warning_C4701.str();
}
......
......@@ -29,7 +29,7 @@
#include "vtkXMLPStructuredGridWriter.h"
#include "vtkXMLPUnstructuredGridWriter.h"
vtkCxxRevisionMacro(vtkXMLPDataSetWriter, "1.10");
vtkCxxRevisionMacro(vtkXMLPDataSetWriter, "1.11");
vtkStandardNewMacro(vtkXMLPDataSetWriter);
//----------------------------------------------------------------------------
......
......@@ -18,7 +18,7 @@
#include "vtkDataSet.h"
#include "vtkErrorCode.h"
vtkCxxRevisionMacro(vtkXMLPDataWriter, "1.14");
vtkCxxRevisionMacro(vtkXMLPDataWriter, "1.15");
//----------------------------------------------------------------------------
vtkXMLPDataWriter::vtkXMLPDataWriter()
......@@ -121,7 +121,7 @@ int vtkXMLPDataWriter::WriteInternal()
}
//----------------------------------------------------------------------------
void vtkXMLPDataWriter::WritePrimaryElementAttributes()
void vtkXMLPDataWriter::WritePrimaryElementAttributes(ostream &, vtkIndent)
{
this->WriteScalarAttribute("GhostLevel", this->GhostLevel);
}
......@@ -141,7 +141,7 @@ int vtkXMLPDataWriter::WriteData()
}
os << indent << "<" << this->GetDataSetName();
this->WritePrimaryElementAttributes();
this->WritePrimaryElementAttributes(os, indent);
if (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError)
{
return 0;
......
......@@ -66,7 +66,7 @@ protected:
virtual vtkXMLWriter* CreatePieceWriter(int index)=0;
virtual void WritePrimaryElementAttributes();
virtual void WritePrimaryElementAttributes(ostream &os, vtkIndent indent);
int WriteData();
virtual void WritePData(vtkIndent indent);
virtual void WritePPieceAttributes(int index);
......
......@@ -23,7 +23,7 @@
#include "vtkInformation.h"
#include "vtkStreamingDemandDrivenPipeline.h"
vtkCxxRevisionMacro(vtkXMLPImageDataReader, "1.8");
vtkCxxRevisionMacro(vtkXMLPImageDataReader, "1.9");
vtkStandardNewMacro(vtkXMLPImageDataReader);
//----------------------------------------------------------------------------
......@@ -98,7 +98,7 @@ int vtkXMLPImageDataReader::ReadPrimaryElement(vtkXMLDataElement* ePrimary)
if(!this->Superclass::ReadPrimaryElement(ePrimary)) { return 0; }
// Get the image's origin.
if(ePrimary->GetVectorAttribute("Origin", 3, this->Origin) != 3)
if(ePrimary->GetVectorAttribute("Origin", this->Origin) != 3)
{
this->Origin[0] = 0;
this->Origin[1] = 0;
......@@ -106,7 +106,7 @@ int vtkXMLPImageDataReader::ReadPrimaryElement(vtkXMLDataElement* ePrimary)
}
// Get the image's spacing.
if(ePrimary->GetVectorAttribute("Spacing", 3, this->Spacing) != 3)
if(ePrimary->GetVectorAttribute("Spacing", this->Spacing) != 3)
{
this->Spacing[0] = 1;
this->Spacing[1] = 1;
......
......@@ -20,7 +20,7 @@
#include "vtkObjectFactory.h"
#include "vtkXMLImageDataWriter.h"
vtkCxxRevisionMacro(vtkXMLPImageDataWriter, "1.7");
vtkCxxRevisionMacro(vtkXMLPImageDataWriter, "1.8");
vtkStandardNewMacro(vtkXMLPImageDataWriter);
//----------------------------------------------------------------------------
......@@ -58,9 +58,9 @@ const char* vtkXMLPImageDataWriter::GetDefaultFileExtension()
}
//----------------------------------------------------------------------------
void vtkXMLPImageDataWriter::WritePrimaryElementAttributes()
void vtkXMLPImageDataWriter::WritePrimaryElementAttributes(ostream &os, vtkIndent indent)
{
this->Superclass::WritePrimaryElementAttributes();
this->Superclass::WritePrimaryElementAttributes(os, indent);
if (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError)
{
return;
......
......@@ -52,7 +52,7 @@ protected:
~vtkXMLPImageDataWriter();
const char* GetDataSetName();
void WritePrimaryElementAttributes();
void WritePrimaryElementAttributes(ostream &os, vtkIndent indent);
vtkXMLStructuredDataWriter* CreateStructuredPieceWriter();
// see algorithm for more info
......
......@@ -22,7 +22,7 @@
#include "vtkInformation.h"
#include "vtkStreamingDemandDrivenPipeline.h"
vtkCxxRevisionMacro(vtkXMLPPolyDataReader, "1.6");
vtkCxxRevisionMacro(vtkXMLPPolyDataReader, "1.7");
vtkStandardNewMacro(vtkXMLPPolyDataReader);
//----------------------------------------------------------------------------
......
......@@ -19,7 +19,7 @@
#include "vtkPolyData.h"
#include "vtkInformation.h"
vtkCxxRevisionMacro(vtkXMLPPolyDataWriter, "1.6");
vtkCxxRevisionMacro(vtkXMLPPolyDataWriter, "1.7");
vtkStandardNewMacro(vtkXMLPPolyDataWriter);
//----------------------------------------------------------------------------
......
......@@ -22,7 +22,7 @@
#include "vtkInformation.h"
#include "vtkStreamingDemandDrivenPipeline.h"
vtkCxxRevisionMacro(vtkXMLPRectilinearGridReader, "1.10");
vtkCxxRevisionMacro(vtkXMLPRectilinearGridReader, "1.11");
vtkStandardNewMacro(vtkXMLPRectilinearGridReader);
//----------------------------------------------------------------------------
......
......@@ -20,7 +20,7 @@
#include "vtkRectilinearGrid.h"
#include "vtkXMLRectilinearGridWriter.h"
vtkCxxRevisionMacro(vtkXMLPRectilinearGridWriter, "1.7");
vtkCxxRevisionMacro(vtkXMLPRectilinearGridWriter, "1.8");
vtkStandardNewMacro(vtkXMLPRectilinearGridWriter);
//----------------------------------------------------------------------------
......
......@@ -21,7 +21,7 @@
#include "vtkXMLDataElement.h"
#include "vtkXMLStructuredDataReader.h"
vtkCxxRevisionMacro(vtkXMLPStructuredDataReader, "1.18");
vtkCxxRevisionMacro(vtkXMLPStructuredDataReader, "1.19");
//----------------------------------------------------------------------------
vtkXMLPStructuredDataReader::vtkXMLPStructuredDataReader()
......@@ -169,7 +169,7 @@ vtkXMLPStructuredDataReader::ReadPrimaryElement(vtkXMLDataElement* ePrimary)
// Read information about the structured data.
int extent[6];
if(ePrimary->GetVectorAttribute("WholeExtent", 6, extent) < 6)
if(ePrimary->GetVectorAttribute("WholeExtent", extent) < 6)
{
vtkErrorMacro(<< this->GetDataSetName()
<< " element has no WholeExtent.");
......@@ -231,7 +231,7 @@ int vtkXMLPStructuredDataReader::ReadPiece(vtkXMLDataElement* ePiece)
// Get the extent of the piece.
int* pieceExtent = this->PieceExtents+this->Piece*6;
if(ePiece->GetVectorAttribute("Extent", 6, pieceExtent) < 6)
if(ePiece->GetVectorAttribute("Extent", pieceExtent) < 6)
{
vtkErrorMacro("Piece " << this->Piece << " has invalid Extent.");
return 0;
......
......@@ -18,7 +18,7 @@
#include "vtkErrorCode.h"
#include "vtkDataSet.h"
vtkCxxRevisionMacro(vtkXMLPStructuredDataWriter, "1.3");
vtkCxxRevisionMacro(vtkXMLPStructuredDataWriter, "1.4");
vtkCxxSetObjectMacro(vtkXMLPStructuredDataWriter, ExtentTranslator,
vtkExtentTranslator);
......@@ -49,11 +49,11 @@ void vtkXMLPStructuredDataWriter::PrintSelf(ostream& os, vtkIndent indent)
}
//----------------------------------------------------------------------------
void vtkXMLPStructuredDataWriter::WritePrimaryElementAttributes()
void vtkXMLPStructuredDataWriter::WritePrimaryElementAttributes(ostream &os, vtkIndent indent)
{
vtkDataSet* input = this->GetInputAsDataSet();
this->WriteVectorAttribute("WholeExtent", 6, input->GetWholeExtent());
this->Superclass::WritePrimaryElementAttributes();
this->Superclass::WritePrimaryElementAttributes(os, indent);
}
//----------------------------------------------------------------------------
......