VTK
|
Read ASCII or binary particle data and (optionally) one scalar value associated with each particle. More...
#include <vtkParticleReader.h>
Read ASCII or binary particle data and (optionally) one scalar value associated with each particle.
vtkParticleReader reads either a binary or a text file of particles. Each particle can have associated with it an optional scalar value. So the format is: x, y, z, scalar (all floats or doubles). The text file can consist of a comma delimited set of values. In most cases vtkParticleReader can automatically determine whether the file is text or binary. The data can be either float or double. Progress updates are provided. With respect to binary files, random access into the file to read pieces is supported.
Definition at line 49 of file vtkParticleReader.h.
Reimplemented from vtkPolyDataAlgorithm.
Definition at line 53 of file vtkParticleReader.h.
enum vtkParticleReader::FILE_TYPE [protected] |
Enumerate the supported file types.
- FILE_TYPE_IS_UNKNOWN, (default) the class will attempt to determine the file type. - FILE_TYPE_IS_TEXT, the file type is text. - FILE_TYPE_IS_BINARY, the file type is binary.
Definition at line 171 of file vtkParticleReader.h.
vtkParticleReader::vtkParticleReader | ( | ) | [protected] |
vtkParticleReader::~vtkParticleReader | ( | ) | [protected] |
static vtkParticleReader* vtkParticleReader::New | ( | ) | [static] |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkPolyDataAlgorithm.
static int vtkParticleReader::IsTypeOf | ( | const char * | name | ) | [static] |
Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkPolyDataAlgorithm.
virtual int vtkParticleReader::IsA | ( | const char * | name | ) | [virtual] |
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkPolyDataAlgorithm.
static vtkParticleReader* vtkParticleReader::SafeDownCast | ( | vtkObjectBase * | o | ) | [static] |
Reimplemented from vtkPolyDataAlgorithm.
virtual vtkObjectBase* vtkParticleReader::NewInstanceInternal | ( | ) | const [protected, virtual] |
Reimplemented from vtkPolyDataAlgorithm.
vtkParticleReader* vtkParticleReader::NewInstance | ( | ) | const |
Reimplemented from vtkPolyDataAlgorithm.
void vtkParticleReader::PrintSelf | ( | ostream & | os, |
vtkIndent | indent | ||
) | [virtual] |
Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkPolyDataAlgorithm.
virtual void vtkParticleReader::SetFileName | ( | const char * | ) | [virtual] |
Specify file name.
virtual char* vtkParticleReader::GetFileName | ( | ) | [virtual] |
Specify file name.
These methods should be used instead of the SwapBytes methods. They indicate the byte ordering of the file you are trying to read in. These methods will then either swap or not swap the bytes depending on the byte ordering of the machine it is being run on. For example, reading in a BigEndian file on a BigEndian machine will result in no swapping. Trying to read the same file on a LittleEndian machine will result in swapping. As a quick note most UNIX machines are BigEndian while PC's and VAX tend to be LittleEndian. So if the file you are reading in was generated on a VAX or PC, SetDataByteOrderToLittleEndian otherwise SetDataByteOrderToBigEndian. Not used when reading text files.
These methods should be used instead of the SwapBytes methods. They indicate the byte ordering of the file you are trying to read in. These methods will then either swap or not swap the bytes depending on the byte ordering of the machine it is being run on. For example, reading in a BigEndian file on a BigEndian machine will result in no swapping. Trying to read the same file on a LittleEndian machine will result in swapping. As a quick note most UNIX machines are BigEndian while PC's and VAX tend to be LittleEndian. So if the file you are reading in was generated on a VAX or PC, SetDataByteOrderToLittleEndian otherwise SetDataByteOrderToBigEndian. Not used when reading text files.
These methods should be used instead of the SwapBytes methods. They indicate the byte ordering of the file you are trying to read in. These methods will then either swap or not swap the bytes depending on the byte ordering of the machine it is being run on. For example, reading in a BigEndian file on a BigEndian machine will result in no swapping. Trying to read the same file on a LittleEndian machine will result in swapping. As a quick note most UNIX machines are BigEndian while PC's and VAX tend to be LittleEndian. So if the file you are reading in was generated on a VAX or PC, SetDataByteOrderToLittleEndian otherwise SetDataByteOrderToBigEndian. Not used when reading text files.
void vtkParticleReader::SetDataByteOrder | ( | int | ) |
These methods should be used instead of the SwapBytes methods. They indicate the byte ordering of the file you are trying to read in. These methods will then either swap or not swap the bytes depending on the byte ordering of the machine it is being run on. For example, reading in a BigEndian file on a BigEndian machine will result in no swapping. Trying to read the same file on a LittleEndian machine will result in swapping. As a quick note most UNIX machines are BigEndian while PC's and VAX tend to be LittleEndian. So if the file you are reading in was generated on a VAX or PC, SetDataByteOrderToLittleEndian otherwise SetDataByteOrderToBigEndian. Not used when reading text files.
const char* vtkParticleReader::GetDataByteOrderAsString | ( | ) |
These methods should be used instead of the SwapBytes methods. They indicate the byte ordering of the file you are trying to read in. These methods will then either swap or not swap the bytes depending on the byte ordering of the machine it is being run on. For example, reading in a BigEndian file on a BigEndian machine will result in no swapping. Trying to read the same file on a LittleEndian machine will result in swapping. As a quick note most UNIX machines are BigEndian while PC's and VAX tend to be LittleEndian. So if the file you are reading in was generated on a VAX or PC, SetDataByteOrderToLittleEndian otherwise SetDataByteOrderToBigEndian. Not used when reading text files.
virtual void vtkParticleReader::SetSwapBytes | ( | int | ) | [virtual] |
Set/Get the byte swapping to explicitly swap the bytes of a file. Not used when reading text files.
int vtkParticleReader::GetSwapBytes | ( | ) | [inline] |
Set/Get the byte swapping to explicitly swap the bytes of a file. Not used when reading text files.
Definition at line 85 of file vtkParticleReader.h.
virtual void vtkParticleReader::SwapBytesOn | ( | ) | [virtual] |
Set/Get the byte swapping to explicitly swap the bytes of a file. Not used when reading text files.
virtual void vtkParticleReader::SwapBytesOff | ( | ) | [virtual] |
Set/Get the byte swapping to explicitly swap the bytes of a file. Not used when reading text files.
virtual void vtkParticleReader::SetHasScalar | ( | int | ) | [virtual] |
Default: 1. If 1 then each particle has a value associated with it.
virtual int vtkParticleReader::GetHasScalar | ( | ) | [virtual] |
Default: 1. If 1 then each particle has a value associated with it.
virtual void vtkParticleReader::HasScalarOn | ( | ) | [virtual] |
Default: 1. If 1 then each particle has a value associated with it.
virtual void vtkParticleReader::HasScalarOff | ( | ) | [virtual] |
Default: 1. If 1 then each particle has a value associated with it.
virtual void vtkParticleReader::SetFileType | ( | int | ) | [virtual] |
Get/Set the file type. The options are: - FILE_TYPE_IS_UNKNOWN (default) the class will attempt to determine the file type. If this fails then you should set the file type yourself. - FILE_TYPE_IS_TEXT the file type is text. - FILE_TYPE_IS_BINARY the file type is binary.
virtual int vtkParticleReader::GetFileType | ( | ) | [virtual] |
Get/Set the file type. The options are: - FILE_TYPE_IS_UNKNOWN (default) the class will attempt to determine the file type. If this fails then you should set the file type yourself. - FILE_TYPE_IS_TEXT the file type is text. - FILE_TYPE_IS_BINARY the file type is binary.
void vtkParticleReader::SetFileTypeToUnknown | ( | ) | [inline] |
Get/Set the file type. The options are: - FILE_TYPE_IS_UNKNOWN (default) the class will attempt to determine the file type. If this fails then you should set the file type yourself. - FILE_TYPE_IS_TEXT the file type is text. - FILE_TYPE_IS_BINARY the file type is binary.
Definition at line 103 of file vtkParticleReader.h.
void vtkParticleReader::SetFileTypeToText | ( | ) | [inline] |
Get/Set the file type. The options are: - FILE_TYPE_IS_UNKNOWN (default) the class will attempt to determine the file type. If this fails then you should set the file type yourself. - FILE_TYPE_IS_TEXT the file type is text. - FILE_TYPE_IS_BINARY the file type is binary.
Definition at line 104 of file vtkParticleReader.h.
void vtkParticleReader::SetFileTypeToBinary | ( | ) | [inline] |
Get/Set the file type. The options are: - FILE_TYPE_IS_UNKNOWN (default) the class will attempt to determine the file type. If this fails then you should set the file type yourself. - FILE_TYPE_IS_TEXT the file type is text. - FILE_TYPE_IS_BINARY the file type is binary.
Definition at line 105 of file vtkParticleReader.h.
virtual void vtkParticleReader::SetDataType | ( | int | ) | [virtual] |
Get/Set the data type. The options are: - VTK_FLOAT (default) single precision floating point. - VTK_DOUBLE double precision floating point.
virtual int vtkParticleReader::GetDataType | ( | ) | [virtual] |
Get/Set the data type. The options are: - VTK_FLOAT (default) single precision floating point. - VTK_DOUBLE double precision floating point.
void vtkParticleReader::SetDataTypeToFloat | ( | ) | [inline] |
Get/Set the data type. The options are: - VTK_FLOAT (default) single precision floating point. - VTK_DOUBLE double precision floating point.
Definition at line 114 of file vtkParticleReader.h.
void vtkParticleReader::SetDataTypeToDouble | ( | ) | [inline] |
Get/Set the data type. The options are: - VTK_FLOAT (default) single precision floating point. - VTK_DOUBLE double precision floating point.
Definition at line 115 of file vtkParticleReader.h.
void vtkParticleReader::OpenFile | ( | ) | [protected] |
int vtkParticleReader::RequestInformation | ( | vtkInformation * | , |
vtkInformationVector ** | , | ||
vtkInformationVector * | |||
) | [protected, virtual] |
Reimplemented from vtkPolyDataAlgorithm.
int vtkParticleReader::RequestData | ( | vtkInformation * | request, |
vtkInformationVector ** | inputVector, | ||
vtkInformationVector * | outputVector | ||
) | [protected, virtual] |
This is called by the superclass. This is the method you should override.
Reimplemented from vtkPolyDataAlgorithm.
int vtkParticleReader::ProduceOutputFromTextFileDouble | ( | vtkInformationVector * | outputVector | ) | [protected] |
The format that will be read if the file is a text file is: x, y, z, s (where s is some scalar value associated with the particle). Each line corresponding to a particle is terminated with a line feed. If y, z, or s is missing, zero is substituted for them. Comment lines in the file are handled as follows: 1) Any line containing "\/\/" "\#" "\%" anywhere in the line is discarded. 2) Lines containing "\/*" are discarded until a "*\/" is found. The line following the "*\/" will be read.
int vtkParticleReader::ProduceOutputFromTextFileFloat | ( | vtkInformationVector * | outputVector | ) | [protected] |
The format that will be read if the file is a text file is: x, y, z, s (where s is some scalar value associated with the particle). Each line corresponding to a particle is terminated with a line feed. If y, z, or s is missing, zero is substituted for them. Comment lines in the file are handled as follows: 1) Any line containing "\/\/" "\#" "\%" anywhere in the line is discarded. 2) Lines containing "\/*" are discarded until a "*\/" is found. The line following the "*\/" will be read.
int vtkParticleReader::ProduceOutputFromBinaryFileDouble | ( | vtkInformationVector * | outputVector | ) | [protected] |
This reader assumes that the file is binary and consists of floating point values by default.
int vtkParticleReader::ProduceOutputFromBinaryFileFloat | ( | vtkInformationVector * | outputVector | ) | [protected] |
This reader assumes that the file is binary and consists of floating point values by default.
int vtkParticleReader::DetermineFileType | ( | ) | [protected] |
Determine the type of file based on an analysis of its contents. Up to 5000 bytes of the file are read and classified. The classification of a file as either binary or text is based on the proportions of bytes in various classifications. The classification of the file is not infallible but should work correctly most of the time. If it fails, use SetFileTypeToText() or SetFileTypeToBinary() to set the file type. This algorithm probably only identifies ASCII text correctly and will not work for UTF-8 UCS-2 (or UTF-16) or UCS-4 or EBCIDIC.
void vtkParticleReader::DoProgressUpdate | ( | size_t & | bytesRead, |
size_t & | fileLength | ||
) | [protected] |
Update of the progress.
char* vtkParticleReader::FileName [protected] |
Definition at line 125 of file vtkParticleReader.h.
ifstream* vtkParticleReader::File [protected] |
Definition at line 126 of file vtkParticleReader.h.
int vtkParticleReader::HasScalar [protected] |
Definition at line 176 of file vtkParticleReader.h.
int vtkParticleReader::FileType [protected] |
Used to decide which reader should be used.
Definition at line 178 of file vtkParticleReader.h.
int vtkParticleReader::DataType [protected] |
Used to specify the data type.
Definition at line 180 of file vtkParticleReader.h.
size_t vtkParticleReader::Alliquot [protected] |
Set an alliquot of bytes.
Definition at line 183 of file vtkParticleReader.h.
size_t vtkParticleReader::Count [protected] |
Count of the number of alliquots processed.
Definition at line 185 of file vtkParticleReader.h.
int vtkParticleReader::SwapBytes [protected] |
Definition at line 187 of file vtkParticleReader.h.
size_t vtkParticleReader::NumberOfPoints [protected] |
Definition at line 188 of file vtkParticleReader.h.