34 #ifndef vtkXMLReader_h
35 #define vtkXMLReader_h
38 #include "vtkIOXMLModule.h"
43 VTK_ABI_NAMESPACE_BEGIN
98 this->SetBinaryInputString(input.c_str(),
static_cast<int>(input.length()));
166 vtkGetStringMacro(ActiveTimeDataArrayName);
167 vtkSetStringMacro(ActiveTimeDataArrayName);
201 vtkSetMacro(TimeStep,
int);
202 vtkGetMacro(TimeStep,
int);
205 vtkGetMacro(NumberOfTimeSteps,
int);
210 vtkGetVector2Macro(TimeStepRange,
int);
211 vtkSetVector2Macro(TimeStepRange,
int);
343 vtkGetMacro(FileMajorVersion,
int);
348 vtkGetMacro(FileMinorVersion,
int);
408 vtkObject* caller,
unsigned long eid,
void* clientdata,
void* calldata);
483 float ProgressRange[2];
513 int TimeStepRange[2];
541 std::istringstream* StringStream;
542 int TimeStepWasReadOnce;
544 int FileMajorVersion;
545 int FileMinorVersion;
557 VTK_ABI_NAMESPACE_END
Abstract superclass for all arrays.
Superclass for all sources, filters, and sinks in VTK.
supports function callbacks
dynamic, self-adjusting array of char
superclass for callback/observer methods
Store on/off settings for data arrays, etc.
abstract superclass for arrays of numeric data
general representation of visualization data
represent and manipulate attribute data in a dataset
abstract class to specify dataset behavior
a simple class to control print indentation
abstract base class for most VTK objects
a vtkAbstractArray subclass for strings
record modification and/or execution time
Represents an XML element and those nested inside.
Used by vtkXMLReader to parse VTK XML files.
Superclass for VTK's XML format readers.
vtkCharArray * InputArray
virtual int ReadArrayTuples(vtkXMLDataElement *da, vtkIdType arrayTupleIndex, vtkAbstractArray *array, vtkIdType startTupleIndex, vtkIdType numTuples, FieldType type=OTHER)
Read an Array values starting at the given tuple index and up to numTuples taking into account the nu...
vtkXMLDataElement * FieldDataElement
vtkCallbackCommand * SelectionObserver
virtual void SetProgressRange(const float range[2], int curStep, int numSteps)
virtual void ConvertGhostLevelsToGhostType(FieldType, vtkAbstractArray *, vtkIdType, vtkIdType)
int GetColumnArrayStatus(const char *name)
Get/Set whether the point, cell, column or time array with the given name is to be read.
virtual int CanReadFileVersion(int major, int minor)
Test if the reader can read a file with the given version number.
void SetInputString(const std::string &input)
Enable reading from an InputString instead of the default, a file.
virtual void GetProgressRange(float *range)
virtual void DestroyXMLParser()
Internal utility methods.
int CellDataArrayIsEnabled(vtkXMLDataElement *eCDA)
Check whether the given array element is an enabled array.
void SetColumnArrayStatus(const char *name, int status)
Get/Set whether the point, cell, column or time array with the given name is to be read.
virtual int ReadArrayValues(vtkXMLDataElement *da, vtkIdType arrayIndex, vtkAbstractArray *array, vtkIdType startIndex, vtkIdType numValues, FieldType type=OTHER)
Read an Array values starting at the given index and up to numValues.
vtkDataSet * GetOutputAsDataSet(int index)
Get the output as a vtkDataSet pointer.
void SetReaderErrorObserver(vtkCommand *)
Set/get the ErrorObserver for the internal reader This is useful for applications that want to catch ...
vtkXMLDataParser * GetXMLParser()
Returns the internal XML parser.
vtkDataArraySelection * CellDataArraySelection
virtual void SetupOutputData()
Setup the output's data with allocation.
void ComputeCellIncrements(int *extent, vtkIdType *increments)
Utility methods for subclasses.
int CreateInformationKey(vtkXMLDataElement *eInfoKey, vtkInformation *info)
Create a vtkInformationKey from its corresponding XML representation.
void SetDataArraySelections(vtkXMLDataElement *eDSA, vtkDataArraySelection *sel)
Setup the data array selections for the input's set of arrays.
void SetParserErrorObserver(vtkCommand *)
Set/get the ErrorObserver for the internal xml parser This is useful for applications that want to ca...
virtual void SetupEmptyOutput()=0
Setup the output with no data available.
int GetNumberOfTimeDataArrays() const
Getters for time data array candidates.
virtual void SqueezeOutputArrays(vtkDataObject *)
Give concrete classes an option to squeeze any output arrays at the end of RequestData.
vtkDataSet * GetOutputAsDataSet()
Get the output as a vtkDataSet pointer.
int GetNumberOfPointArrays()
Get the number of point, cell or column arrays available in the input.
int Max(int a, int b)
Utility methods for subclasses.
virtual void CreateXMLParser()
Internal utility methods.
vtkSmartPointer< vtkDataArray > TimeDataArray
Populated in ReadXMLInformation from the field data for the array chosen using ActiveTimeDataArrayNam...
vtkAbstractArray * CreateArray(vtkXMLDataElement *da)
Create a vtkAbstractArray from its corresponding XML representation.
virtual void CloseStream()
Internal utility methods.
int CanReadFileVersionString(const char *version)
Internal utility methods.
virtual void SetupOutputInformation(vtkInformation *vtkNotUsed(outInfo))
Setup the output's information.
vtkIdType GetStartTuple(int *extent, vtkIdType *increments, int i, int j, int k)
Utility methods for subclasses.
virtual const char * GetDataSetName()=0
Get the name of the data set being read.
vtkTypeBool ReadFromInputString
void SetupCompressor(const char *type)
Internal utility methods.
vtkDataArraySelection * ColumnArraySelection
vtkXMLDataParser * XMLParser
virtual void SetInputArray(vtkCharArray *)
Specify the vtkCharArray to be used when reading from a string.
void ComputePointIncrements(int *extent, vtkIdType *increments)
Utility methods for subclasses.
virtual int ReadXMLInformation()
Pipeline execution methods to be defined by subclass.
int GetNumberOfColumnArrays()
Get the number of point, cell or column arrays available in the input.
void SetInputString(const char *in, int len)
Enable reading from an InputString instead of the default, a file.
void ReadAttributeIndices(vtkXMLDataElement *eDSA, vtkDataSetAttributes *dsa)
Utility methods for subclasses.
int PointDataArrayIsEnabled(vtkXMLDataElement *ePDA)
Check whether the given array element is an enabled array.
virtual void CloseVTKFile()
Internal utility methods.
virtual int OpenVTKFile()
Internal utility methods.
void SetInputString(const char *in)
Specify the InputString for use when reading from a character array.
void ComputeCellDimensions(int *extent, int *dimensions)
Utility methods for subclasses.
virtual int CanReadFile(VTK_FILEPATH const char *name)
Test whether the file (type) with the given name can be read by this reader.
void SetNumberOfTimeSteps(int num)
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
static void SelectionModifiedCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)
Callback registered with the SelectionObserver.
static int IsTimeStepInArray(int timestep, int *timesteps, int length)
char ** CreateStringArray(int numStrings)
Utility methods for subclasses.
virtual int RequestDataObject(vtkInformation *vtkNotUsed(request), vtkInformationVector **vtkNotUsed(inputVector), vtkInformationVector *vtkNotUsed(outputVector))
void ComputePointDimensions(int *extent, int *dimensions)
Utility methods for subclasses.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int GetNumberOfCellArrays()
Get the number of point, cell or column arrays available in the input.
void MarkIdTypeArrays(vtkXMLDataElement *da)
XML files have not consistently saved out adequate meta-data in past to correctly create vtkIdTypeArr...
virtual int CanReadFileWithDataType(const char *dsname)
This method is used by CanReadFile() to check if the reader can read an XML with the primary element ...
const char * GetCellArrayName(int index)
Get the name of the point, cell, column or time array with the given index in the input.
int IntersectExtents(int *extent1, int *extent2, int *result)
Utility methods for subclasses.
char * ActiveTimeDataArrayName
Name of the field-data array used to determine the time for the dataset being read.
virtual int ReadVTKFile(vtkXMLDataElement *eVTKFile)
Read the top-level element from the file.
virtual int OpenVTKString()
Internal utility methods.
virtual int ReadPrimaryElement(vtkXMLDataElement *ePrimary)
Read the primary element from the file.
void SetBinaryInputString(const char *, int len)
Enable reading from an InputString instead of the default, a file.
vtkGetFilePathMacro(FileName)
Get/Set the name of the input file.
const char * GetPointArrayName(int index)
Get the name of the point, cell, column or time array with the given index in the input.
const char * GetTimeDataArray(int idx) const
Getters for time data array candidates.
int GetLocalDataType(vtkXMLDataElement *da, int datatype)
If the IdType argument is present in the provided XMLDataElement and the provided dataType has the sa...
bool ReadInformation(vtkXMLDataElement *infoRoot, vtkInformation *info)
Populates the info object with the InformationKey children in infoRoot.
vtkInformation * GetCurrentOutputInformation()
vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
int GetCellArrayStatus(const char *name)
Get/Set whether the point, cell, column or time array with the given name is to be read.
vtkSetFilePathMacro(FileName)
Get/Set the name of the input file.
int GetPointArrayStatus(const char *name)
Get/Set whether the point, cell, column or time array with the given name is to be read.
const char * GetColumnArrayName(int index)
Get the name of the point, cell, column or time array with the given index in the input.
virtual void UpdateProgressDiscrete(float progress)
vtkDataObject * GetCurrentOutput()
virtual void ReadXMLData()
Pipeline execution methods to be defined by subclass.
virtual int OpenStream()
Internal utility methods.
vtkStringArray * TimeDataStringArray
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
virtual void SetProgressRange(const float range[2], int curStep, const float *fractions)
void DestroyStringArray(int numStrings, char **strings)
Utility methods for subclasses.
void SetCellArrayStatus(const char *name, int status)
Get/Set whether the point, cell, column or time array with the given name is to be read.
virtual void CloseVTKString()
Internal utility methods.
void SetPointArrayStatus(const char *name, int status)
Get/Set whether the point, cell, column or time array with the given name is to be read.
vtkDataArraySelection * PointDataArraySelection
virtual void CopyOutputInformation(vtkInformation *vtkNotUsed(outInfo), int vtkNotUsed(port))
int SetFieldDataInfo(vtkXMLDataElement *eDSA, int association, vtkIdType numTuples, vtkInformationVector *(&infoVector))
int Min(int a, int b)
Utility methods for subclasses.