VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
vtkArrayWriter Class Reference

Serialize sparse and dense arrays to a file or stream. More...

#include <vtkArrayWriter.h>

Inheritance diagram for vtkArrayWriter:
Inheritance graph
[legend]
Collaboration diagram for vtkArrayWriter:
Collaboration graph
[legend]

List of all members.

Public Types

typedef vtkWriter Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkArrayWriterNewInstance () const
void PrintSelf (ostream &os, vtkIndent indent)
virtual int Write ()
bool Write (const vtkStdString &FileName, bool WriteBinary=false)
bool Write (ostream &stream, bool WriteBinary=false)
vtkStdString Write (bool WriteBinary)
virtual void SetFileName (const char *)
virtual char * GetFileName ()
virtual void SetBinary (int)
virtual int GetBinary ()
virtual void BinaryOn ()
virtual void BinaryOff ()
virtual vtkStdString GetOutputString ()
virtual void SetWriteToOutputString (bool)
virtual bool GetWriteToOutputString ()
virtual void WriteToOutputStringOn ()
virtual void WriteToOutputStringOff ()

Static Public Member Functions

static vtkArrayWriterNew ()
static int IsTypeOf (const char *type)
static vtkArrayWriterSafeDownCast (vtkObjectBase *o)
static bool Write (vtkArray *array, const vtkStdString &file_name, bool WriteBinary=false)
static vtkStdString Write (vtkArray *array, bool WriteBinary=false)
static bool Write (vtkArray *array, ostream &stream, bool WriteBinary=false)

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 vtkArrayWriter ()
 ~vtkArrayWriter ()
virtual int FillInputPortInformation (int port, vtkInformation *info)
virtual void WriteData ()

Protected Attributes

char * FileName
int Binary
bool WriteToOutputString
vtkStdString OutputString

Detailed Description

Serialize sparse and dense arrays to a file or stream.

vtkArrayWriter serializes sparse and dense array data using a text-based format that is human-readable and easily parsed (default option). The WriteBinary array option can be used to serialize the sparse and dense array data using a binary format that is optimized for rapid throughput.

vtkArrayWriter can be used in two distinct ways: first, it can be used as a normal pipeline filter, which writes its inputs to a file. Alternatively, static methods are provided for writing vtkArray instances to files or arbitrary c++ streams.

Inputs: Input port 0: (required) vtkArrayData object containing a single sparse or dense array.

Output Format: See http://www.kitware.com/InfovisWiki/index.php/N-Way_Array_File_Formats for details on how vtkArrayWriter encodes data.

See also:
vtkArrayReader
Thanks:
Developed by Timothy M. Shead (tshea.nosp@m.d@sa.nosp@m.ndia..nosp@m.gov) at Sandia National Laboratories.
Tests:
vtkArrayWriter (Tests)

Definition at line 63 of file vtkArrayWriter.h.


Member Typedef Documentation

Reimplemented from vtkWriter.

Definition at line 68 of file vtkArrayWriter.h.


Constructor & Destructor Documentation


Member Function Documentation

static vtkArrayWriter* vtkArrayWriter::New ( ) [static]

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkAlgorithm.

static int vtkArrayWriter::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 vtkWriter.

virtual int vtkArrayWriter::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 vtkWriter.

Reimplemented from vtkWriter.

virtual vtkObjectBase* vtkArrayWriter::NewInstanceInternal ( ) const [protected, virtual]

Reimplemented from vtkWriter.

Reimplemented from vtkWriter.

void vtkArrayWriter::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 vtkWriter.

virtual void vtkArrayWriter::SetFileName ( const char *  ) [virtual]

Get / set the filename where data will be stored (when used as a filter).

virtual char* vtkArrayWriter::GetFileName ( ) [virtual]

Get / set the filename where data will be stored (when used as a filter).

virtual void vtkArrayWriter::SetBinary ( int  ) [virtual]

Get / set whether data will be written in binary format (when used as a filter).

virtual int vtkArrayWriter::GetBinary ( ) [virtual]

Get / set whether data will be written in binary format (when used as a filter).

virtual void vtkArrayWriter::BinaryOn ( ) [virtual]

Get / set whether data will be written in binary format (when used as a filter).

virtual void vtkArrayWriter::BinaryOff ( ) [virtual]

Get / set whether data will be written in binary format (when used as a filter).

virtual vtkStdString vtkArrayWriter::GetOutputString ( ) [inline, virtual]

The output string. This is only set when WriteToOutputString is set.

Definition at line 88 of file vtkArrayWriter.h.

virtual void vtkArrayWriter::SetWriteToOutputString ( bool  ) [virtual]

Whether to output to a string instead of to a file, which is the default.

virtual bool vtkArrayWriter::GetWriteToOutputString ( ) [virtual]

Whether to output to a string instead of to a file, which is the default.

virtual void vtkArrayWriter::WriteToOutputStringOn ( ) [virtual]

Whether to output to a string instead of to a file, which is the default.

virtual void vtkArrayWriter::WriteToOutputStringOff ( ) [virtual]

Whether to output to a string instead of to a file, which is the default.

virtual int vtkArrayWriter::Write ( ) [virtual]

Write data to output. Method executes subclasses WriteData() method, as well as StartMethod() and EndMethod() methods. Returns 1 on success and 0 on failure.

Reimplemented from vtkWriter.

bool vtkArrayWriter::Write ( const vtkStdString FileName,
bool  WriteBinary = false 
)

Writes input port 0 data to a file, using an arbitrary filename and binary flag.

static bool vtkArrayWriter::Write ( vtkArray array,
const vtkStdString file_name,
bool  WriteBinary = false 
) [static]

Write an arbitrary array to a file, without using the pipeline.

bool vtkArrayWriter::Write ( ostream &  stream,
bool  WriteBinary = false 
)

Write input port 0 data to an arbitrary stream. Note: streams should always be opened in binary mode, to prevent problems reading files on Windows.

static bool vtkArrayWriter::Write ( vtkArray array,
ostream &  stream,
bool  WriteBinary = false 
) [static]

Write arbitrary data to a stream without using the pipeline. Note: streams should always be opened in binary mode, to prevent problems reading files on Windows.

vtkStdString vtkArrayWriter::Write ( bool  WriteBinary)

Write input port 0 data to a string. Note that the WriteBinary argument is not optional in order to not clash with the inherited Write() method.

static vtkStdString vtkArrayWriter::Write ( vtkArray array,
bool  WriteBinary = false 
) [static]

Write arbitrary data to a string without using the pipeline.

virtual int vtkArrayWriter::FillInputPortInformation ( int  port,
vtkInformation info 
) [protected, virtual]

Fill the input port information objects for this algorithm. This is invoked by the first call to GetInputPortInformation for each port so subclasses can specify what they can handle.

Reimplemented from vtkAlgorithm.

virtual void vtkArrayWriter::WriteData ( ) [protected, virtual]

Implements vtkWriter.


Member Data Documentation

char* vtkArrayWriter::FileName [protected]

Definition at line 138 of file vtkArrayWriter.h.

Definition at line 139 of file vtkArrayWriter.h.

Definition at line 140 of file vtkArrayWriter.h.

Definition at line 141 of file vtkArrayWriter.h.


The documentation for this class was generated from the following file: