vtk
Class vtkDataReader

java.lang.Object
  extended byvtk.vtkObjectBase
      extended byvtk.vtkObject
          extended byvtk.vtkProcessObject
              extended byvtk.vtkSource
                  extended byvtk.vtkDataReader
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
vtkDataObjectReader, vtkDataSetReader, vtkPolyDataReader, vtkRectilinearGridReader, vtkStructuredGridReader, vtkStructuredPointsReader, vtkUnstructuredGridReader

public class vtkDataReader
extends vtkSource
implements java.io.Serializable

vtkDataReader - helper superclass for objects that read vtk data files. vtkDataReader is a helper superclass that reads the vtk data file header, dataset type, and attribute data (point and cell attributes such as scalars, vectors, normals, etc.) from a vtk data file. See text for the format of the various vtk file types. JavaBean wrapper for vtkDataReader object.

Author:
vtk2jbean Automatic JavaBean wrapper for VTK.
See Also:
vtkPolyDataReader, vtkStructuredPointsReader, vtkStructuredGridReader, vtkUnsutructuredGridReader, Serialized Form

Field Summary
protected  java.beans.PropertyChangeSupport changes
           
 
Fields inherited from class vtk.vtkObjectBase
vtkId
 
Constructor Summary
  vtkDataReader()
           
protected vtkDataReader(int dmy)
           
 
Method Summary
 void closeVTKFile()
          Close the vtk file.
 java.lang.String getClassName()
          Return the class name as a string.
 java.lang.String getFieldDataName()
          Set the name of the field data to extract.
 java.lang.String getFieldDataNameInFile(int id0)
          What is the name of the ith attribute of a certain type in this file?
 java.lang.String getFileName()
          Specify file name of vtk data file to read.
 int getFileType()
          Get the type of file (ASCII or BINARY).
 java.lang.String getHeader()
          Get the header from the vtk data file.
 vtkCharArray getInputArray()
          Specify the vtkCharArray to be used when reading from a string.
 java.lang.String getInputString()
          Specify the InputString for use when reading from a character array.
 int getInputStringLength()
          Specify the InputString for use when reading from a character array.
 java.lang.String getLookupTableName()
          Set the name of the lookup table data to extract.
 java.lang.String getNormalsName()
          Set the name of the normal data to extract.
 java.lang.String getNormalsNameInFile(int id0)
          What is the name of the ith attribute of a certain type in this file?
 int getNumberOfFieldDataInFile()
          What is the name of the ith attribute of a certain type in this file?
 int getNumberOfNormalsInFile()
          How many attributes of various types are in this file?
 int getNumberOfScalarsInFile()
          How many attributes of various types are in this file?
 int getNumberOfTCoordsInFile()
          How many attributes of various types are in this file?
 int getNumberOfTensorsInFile()
          How many attributes of various types are in this file?
 int getNumberOfVectorsInFile()
          How many attributes of various types are in this file?
 int getReadFromInputString()
          Enable reading from an InputString or InputArray instead of the default, a file.
 java.lang.String getScalarsName()
          Set the name of the scalar data to extract.
 java.lang.String getScalarsNameInFile(int id0)
          What is the name of the ith attribute of a certain type in this file?
 java.lang.String getTCoordsName()
          Set the name of the texture coordinate data to extract.
 java.lang.String getTCoordsNameInFile(int id0)
          What is the name of the ith attribute of a certain type in this file?
 java.lang.String getTensorsName()
          Set the name of the tensor data to extract.
 java.lang.String getTensorsNameInFile(int id0)
          What is the name of the ith attribute of a certain type in this file?
 vtkDataReader getThisDataReader()
           
 java.lang.String getVectorsName()
          Set the name of the vector data to extract.
 java.lang.String getVectorsNameInFile(int id0)
          What is the name of the ith attribute of a certain type in this file?
 int isA(java.lang.String id0)
          Return 1 if this class is the same type of (or a subclass of) the named class.
 int isFilePolyData()
          Is the file a valid vtk file of the passed dataset type ?
 int isFileRectilinearGrid()
          Is the file a valid vtk file of the passed dataset type ?
 int isFileStructuredGrid()
          Is the file a valid vtk file of the passed dataset type ?
 int isFileStructuredPoints()
          Is the file a valid vtk file of the passed dataset type ?
 int isFileUnstructuredGrid()
          Is the file a valid vtk file of the passed dataset type ?
 int isFileValid(java.lang.String id0)
          Is the file a valid vtk file of the passed dataset type ?
 int openVTKFile()
          Open a vtk data file.
 int read(java.lang.String id0)
          Internal function to read in a value.
 vtkDataArray readArray(java.lang.String id0, int id1, int id2)
          Helper functions for reading data.
 int readCellData(vtkDataSet id0, int id1)
          Read the cell data of a vtk data file.
 int readCoordinates(vtkRectilinearGrid id0, int id1, int id2)
          Read the coordinates for a rectilinear grid.
 vtkFieldData readFieldData()
          Helper functions for reading data.
 void readFromInputStringOff()
          Enable reading from an InputString or InputArray instead of the default, a file.
 void readFromInputStringOn()
          Enable reading from an InputString or InputArray instead of the default, a file.
 int readHeader()
          Read the header of a vtk data file.
 int readPointData(vtkDataSet id0, int id1)
          Read the point data of a vtk data file.
 int readPoints(vtkPointSet id0, int id1)
          Read point coordinates.
 void SetBinaryInputString(byte[] id0, int id1)
           
 void setFieldDataName(java.lang.String id0)
          Set the name of the field data to extract.
 void setFileName(java.lang.String id0)
          Specify file name of vtk data file to read.
 void setInputArray(vtkCharArray id0)
          Specify the vtkCharArray to be used when reading from a string.
 void setInputString(java.lang.String id0)
          Specify the InputString for use when reading from a character array.
 void setInputString(java.lang.String id0, int id1)
          Specify the InputString for use when reading from a character array.
 void setLookupTableName(java.lang.String id0)
          Set the name of the lookup table data to extract.
 void setNormalsName(java.lang.String id0)
          Set the name of the normal data to extract.
 void setReadFromInputString(int id0)
          Enable reading from an InputString or InputArray instead of the default, a file.
 void setScalarsName(java.lang.String id0)
          Set the name of the scalar data to extract.
 void setTCoordsName(java.lang.String id0)
          Set the name of the texture coordinate data to extract.
 void setTensorsName(java.lang.String id0)
          Set the name of the tensor data to extract.
 void setVectorsName(java.lang.String id0)
          Set the name of the vector data to extract.
protected  void VTKCastInit()
           
 void VTKInit()
           
 
Methods inherited from class vtk.vtkSource
computeInputUpdateExtents, getNumberOfOutputs, getOutputIndex, getReleaseDataFlag, getThisSource, inRegisterLoop, propagateUpdateExtent, releaseDataFlagOff, releaseDataFlagOn, setReleaseDataFlag, triggerAsynchronousUpdate, unRegister, unRegisterAllOutputs, update, updateData, updateInformation, updateWholeExtent
 
Methods inherited from class vtk.vtkProcessObject
abortExecuteOff, abortExecuteOn, getAbortExecute, getErrorCode, getNumberOfInputs, getProgress, getProgressMaxValue, getProgressMinValue, getProgressText, getThisProcessObject, removeAllInputs, setAbortExecute, setProgress, setProgressText, squeezeInputArray, updateProgress
 
Methods inherited from class vtk.vtkObject
AddObserver, breakOnError, debugOff, debugOn, getDebug, getGlobalWarningDisplay, getMTime, getThisObject, globalWarningDisplayOff, globalWarningDisplayOn, hasObserver, hasObserver, invokeEvent, invokeEvent, modified, Print, PrintRevisions, register, removeObserver, removeObservers, removeObservers, setDebug, setGlobalWarningDisplay
 
Methods inherited from class vtk.vtkObjectBase
addPropertyChangeListener, finalize, getReferenceCount, getThisObjectBase, isTypeOf, removePropertyChangeListener, setReferenceCount, VTKDelete
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

changes

protected java.beans.PropertyChangeSupport changes
Constructor Detail

vtkDataReader

public vtkDataReader()

vtkDataReader

protected vtkDataReader(int dmy)
Method Detail

getThisDataReader

public vtkDataReader getThisDataReader()

getClassName

public java.lang.String getClassName()
Description copied from class: vtkObjectBase
Return the class name as a string. This method is defined in all subclasses of vtkObjectBase with the vtkTypeRevisionMacro found in vtkSetGet.h.

Overrides:
getClassName in class vtkSource

isA

public int isA(java.lang.String id0)
Description copied from class: vtkObjectBase
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 vtkTypeRevisionMacro found in vtkSetGet.h.

Overrides:
isA in class vtkSource

setFileName

public void setFileName(java.lang.String id0)
Specify file name of vtk data file to read.


getFileName

public java.lang.String getFileName()
Specify file name of vtk data file to read.


isFileValid

public int isFileValid(java.lang.String id0)
Is the file a valid vtk file of the passed dataset type ? The dataset type is passed as a lower case string.


isFileStructuredPoints

public int isFileStructuredPoints()
Is the file a valid vtk file of the passed dataset type ? The dataset type is passed as a lower case string.


isFilePolyData

public int isFilePolyData()
Is the file a valid vtk file of the passed dataset type ? The dataset type is passed as a lower case string.


isFileStructuredGrid

public int isFileStructuredGrid()
Is the file a valid vtk file of the passed dataset type ? The dataset type is passed as a lower case string.


isFileUnstructuredGrid

public int isFileUnstructuredGrid()
Is the file a valid vtk file of the passed dataset type ? The dataset type is passed as a lower case string.


isFileRectilinearGrid

public int isFileRectilinearGrid()
Is the file a valid vtk file of the passed dataset type ? The dataset type is passed as a lower case string.


setInputString

public void setInputString(java.lang.String id0)
Specify the InputString for use when reading from a character array. Optionally include the length for binary strings. Note that a copy of the string is made and stored. If this causes exceedingly large memory consumption, consider using InputArray instead.


getInputString

public java.lang.String getInputString()
Specify the InputString for use when reading from a character array. Optionally include the length for binary strings. Note that a copy of the string is made and stored. If this causes exceedingly large memory consumption, consider using InputArray instead.


setInputString

public void setInputString(java.lang.String id0,
                           int id1)
Specify the InputString for use when reading from a character array. Optionally include the length for binary strings. Note that a copy of the string is made and stored. If this causes exceedingly large memory consumption, consider using InputArray instead.


getInputStringLength

public int getInputStringLength()
Specify the InputString for use when reading from a character array. Optionally include the length for binary strings. Note that a copy of the string is made and stored. If this causes exceedingly large memory consumption, consider using InputArray instead.


SetBinaryInputString

public void SetBinaryInputString(byte[] id0,
                                 int id1)

setInputArray

public void setInputArray(vtkCharArray id0)
Specify the vtkCharArray to be used when reading from a string. If set, this array has precendence over InputString. Use this instead of InputString to avoid the extra memory copy. It should be noted that if the underlying char* is owned by the user ( vtkCharArray::SetArray(array, 1); ) and is deleted before the reader, bad things will happen during a pipeline update.


getInputArray

public vtkCharArray getInputArray()
Specify the vtkCharArray to be used when reading from a string. If set, this array has precendence over InputString. Use this instead of InputString to avoid the extra memory copy. It should be noted that if the underlying char* is owned by the user ( vtkCharArray::SetArray(array, 1); ) and is deleted before the reader, bad things will happen during a pipeline update.


getHeader

public java.lang.String getHeader()
Get the header from the vtk data file.


setReadFromInputString

public void setReadFromInputString(int id0)
Enable reading from an InputString or InputArray instead of the default, a file.


getReadFromInputString

public int getReadFromInputString()
Enable reading from an InputString or InputArray instead of the default, a file.


readFromInputStringOn

public void readFromInputStringOn()
Enable reading from an InputString or InputArray instead of the default, a file.


readFromInputStringOff

public void readFromInputStringOff()
Enable reading from an InputString or InputArray instead of the default, a file.


getFileType

public int getFileType()
Get the type of file (ASCII or BINARY). Returned value only valid after file has been read.


getNumberOfScalarsInFile

public int getNumberOfScalarsInFile()
How many attributes of various types are in this file? This requires reading the file, so the filename must be set prior to invoking this operation. (Note: file characteristics are cached, so only a single read is necessary to return file characteristics.)


getNumberOfVectorsInFile

public int getNumberOfVectorsInFile()
How many attributes of various types are in this file? This requires reading the file, so the filename must be set prior to invoking this operation. (Note: file characteristics are cached, so only a single read is necessary to return file characteristics.)


getNumberOfTensorsInFile

public int getNumberOfTensorsInFile()
How many attributes of various types are in this file? This requires reading the file, so the filename must be set prior to invoking this operation. (Note: file characteristics are cached, so only a single read is necessary to return file characteristics.)


getNumberOfNormalsInFile

public int getNumberOfNormalsInFile()
How many attributes of various types are in this file? This requires reading the file, so the filename must be set prior to invoking this operation. (Note: file characteristics are cached, so only a single read is necessary to return file characteristics.)


getNumberOfTCoordsInFile

public int getNumberOfTCoordsInFile()
How many attributes of various types are in this file? This requires reading the file, so the filename must be set prior to invoking this operation. (Note: file characteristics are cached, so only a single read is necessary to return file characteristics.)


getNumberOfFieldDataInFile

public int getNumberOfFieldDataInFile()
What is the name of the ith attribute of a certain type in this file? This requires reading the file, so the filename must be set prior to invoking this operation.


getScalarsNameInFile

public java.lang.String getScalarsNameInFile(int id0)
What is the name of the ith attribute of a certain type in this file? This requires reading the file, so the filename must be set prior to invoking this operation.


getVectorsNameInFile

public java.lang.String getVectorsNameInFile(int id0)
What is the name of the ith attribute of a certain type in this file? This requires reading the file, so the filename must be set prior to invoking this operation.


getTensorsNameInFile

public java.lang.String getTensorsNameInFile(int id0)
What is the name of the ith attribute of a certain type in this file? This requires reading the file, so the filename must be set prior to invoking this operation.


getNormalsNameInFile

public java.lang.String getNormalsNameInFile(int id0)
What is the name of the ith attribute of a certain type in this file? This requires reading the file, so the filename must be set prior to invoking this operation.


getTCoordsNameInFile

public java.lang.String getTCoordsNameInFile(int id0)
What is the name of the ith attribute of a certain type in this file? This requires reading the file, so the filename must be set prior to invoking this operation.


getFieldDataNameInFile

public java.lang.String getFieldDataNameInFile(int id0)
What is the name of the ith attribute of a certain type in this file? This requires reading the file, so the filename must be set prior to invoking this operation.


setScalarsName

public void setScalarsName(java.lang.String id0)
Set the name of the scalar data to extract. If not specified, first scalar data encountered is extracted.


getScalarsName

public java.lang.String getScalarsName()
Set the name of the scalar data to extract. If not specified, first scalar data encountered is extracted.


setVectorsName

public void setVectorsName(java.lang.String id0)
Set the name of the vector data to extract. If not specified, first vector data encountered is extracted.


getVectorsName

public java.lang.String getVectorsName()
Set the name of the vector data to extract. If not specified, first vector data encountered is extracted.


setTensorsName

public void setTensorsName(java.lang.String id0)
Set the name of the tensor data to extract. If not specified, first tensor data encountered is extracted.


getTensorsName

public java.lang.String getTensorsName()
Set the name of the tensor data to extract. If not specified, first tensor data encountered is extracted.


setNormalsName

public void setNormalsName(java.lang.String id0)
Set the name of the normal data to extract. If not specified, first normal data encountered is extracted.


getNormalsName

public java.lang.String getNormalsName()
Set the name of the normal data to extract. If not specified, first normal data encountered is extracted.


setTCoordsName

public void setTCoordsName(java.lang.String id0)
Set the name of the texture coordinate data to extract. If not specified, first texture coordinate data encountered is extracted.


getTCoordsName

public java.lang.String getTCoordsName()
Set the name of the texture coordinate data to extract. If not specified, first texture coordinate data encountered is extracted.


setLookupTableName

public void setLookupTableName(java.lang.String id0)
Set the name of the lookup table data to extract. If not specified, uses lookup table named by scalar. Otherwise, this specification supersedes.


getLookupTableName

public java.lang.String getLookupTableName()
Set the name of the lookup table data to extract. If not specified, uses lookup table named by scalar. Otherwise, this specification supersedes.


setFieldDataName

public void setFieldDataName(java.lang.String id0)
Set the name of the field data to extract. If not specified, uses first field data encountered in file.


getFieldDataName

public java.lang.String getFieldDataName()
Set the name of the field data to extract. If not specified, uses first field data encountered in file.


openVTKFile

public int openVTKFile()
Open a vtk data file. Returns zero if error.


readHeader

public int readHeader()
Read the header of a vtk data file. Returns 0 if error.


readCellData

public int readCellData(vtkDataSet id0,
                        int id1)
Read the cell data of a vtk data file. The number of cells (from the dataset) must match the number of cells defined in cell attributes (unless no geometry was defined).


readPointData

public int readPointData(vtkDataSet id0,
                         int id1)
Read the point data of a vtk data file. The number of points (from the dataset) must match the number of points defined in point attributes (unless no geometry was defined).


readPoints

public int readPoints(vtkPointSet id0,
                      int id1)
Read point coordinates. Return 0 if error.


readCoordinates

public int readCoordinates(vtkRectilinearGrid id0,
                           int id1,
                           int id2)
Read the coordinates for a rectilinear grid. The axes parameter specifies which coordinate axes (0,1,2) is being read.


readArray

public vtkDataArray readArray(java.lang.String id0,
                              int id1,
                              int id2)
Helper functions for reading data.


readFieldData

public vtkFieldData readFieldData()
Helper functions for reading data.


read

public int read(java.lang.String id0)
Internal function to read in a value. Returns zero if there was an error.


closeVTKFile

public void closeVTKFile()
Close the vtk file.


VTKInit

public void VTKInit()
Overrides:
VTKInit in class vtkObject

VTKCastInit

protected void VTKCastInit()
Overrides:
VTKCastInit in class vtkSource


Copyright © 2004 Sydney ViSLAB. All Rights Reserved.