FreeMat
|
Section: Visualization Toolkit IO Classes
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.
To create an instance of class vtkParticleReader, simply invoke its constructor as follows
obj = vtkParticleReader
The class vtkParticleReader has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, obj
is an instance of the vtkParticleReader class.
string = obj.GetClassName ()
int = obj.IsA (string name)
vtkParticleReader = obj.NewInstance ()
vtkParticleReader = obj.SafeDownCast (vtkObject o)
obj.SetFileName (string )
- Specify file name. string = obj.GetFileName ()
- Specify file name. obj.SetDataByteOrderToBigEndian ()
- 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. obj.SetDataByteOrderToLittleEndian ()
- 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. int = obj.GetDataByteOrder ()
- 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. obj.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. string = obj.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. obj.SetSwapBytes (int )
- Set/Get the byte swapping to explicitly swap the bytes of a file. Not used when reading text files. int = obj.GetSwapBytes ()
- Set/Get the byte swapping to explicitly swap the bytes of a file. Not used when reading text files. obj.SwapBytesOn ()
- Set/Get the byte swapping to explicitly swap the bytes of a file. Not used when reading text files. obj.SwapBytesOff ()
- Set/Get the byte swapping to explicitly swap the bytes of a file. Not used when reading text files. obj.SetHasScalar (int )
- Default: 1. If 1 then each particle has a value associated with it. int = obj.GetHasScalar ()
- Default: 1. If 1 then each particle has a value associated with it. obj.HasScalarOn ()
- Default: 1. If 1 then each particle has a value associated with it. obj.HasScalarOff ()
- Default: 1. If 1 then each particle has a value associated with it. obj.SetFileType (int )
- Get/Set the file type. The options are:int = obj.GetFileTypeMinValue ()
- Get/Set the file type. The options are:int = obj.GetFileTypeMaxValue ()
- Get/Set the file type. The options are:int = obj.GetFileType ()
- Get/Set the file type. The options are:obj.SetFileTypeToUnknown ()
- Get/Set the file type. The options are:obj.SetFileTypeToText ()
- Get/Set the file type. The options are:obj.SetFileTypeToBinary ()
- Get/Set the data type. The options are:obj.SetDataType (int )
- Get/Set the data type. The options are:int = obj.GetDataTypeMinValue ()
- Get/Set the data type. The options are:int = obj.GetDataTypeMaxValue ()
- Get/Set the data type. The options are:int = obj.GetDataType ()
- Get/Set the data type. The options are:obj.SetDataTypeToFloat ()
- Get/Set the data type. The options are:obj.SetDataTypeToDouble ()