ParaView
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkCSVExporter Class Reference

exporter used by certain views to export data as a CSV file. More...

#include <vtkCSVExporter.h>

Inherits vtkObject.

Public Types

enum  ExporterModes { STREAM_ROWS, STREAM_COLUMNS }
 
typedef vtkObject Superclass
 

Public Member Functions

virtual const char * GetClassName ()
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent)
 
bool Open (ExporterModes mode=STREAM_ROWS)
 Open the file and set mode in which the exporter is operating. More...
 
void Close ()
 Closes the file cleanly. More...
 
void Abort ()
 Same as Close except deletes the file, if created. More...
 
void AddColumn (vtkAbstractArray *yarray, const char *yarrayname=NULL, vtkDataArray *xarray=NULL)
 In STREAM_COLUMNS mode, use this method to add a column (yarray). More...
 
virtual void SetFileName (const char *)
 Get/Set the filename for the file. More...
 
virtual char * GetFileName ()
 Get/Set the filename for the file. More...
 
virtual void SetFieldDelimiter (const char *)
 Get/Set the delimiter use to separate fields ("," by default.) More...
 
virtual char * GetFieldDelimiter ()
 Get/Set the delimiter use to separate fields ("," by default.) More...
 
virtual void SetFilterColumnsByVisibility (bool)
 Get/Set to filter by column or not. More...
 
virtual bool GetFilterColumnsByVisibility ()
 Get/Set to filter by column or not. More...
 
void WriteHeader (vtkFieldData *)
 In STREAM_ROWS mode, use these methods to write column headers once using WriteHeader and then use WriteData as many times as needed to write out rows. More...
 
void WriteData (vtkFieldData *)
 In STREAM_ROWS mode, use these methods to write column headers once using WriteHeader and then use WriteData as many times as needed to write out rows. More...
 

Static Public Member Functions

static vtkCSVExporterNew ()
 
static int IsTypeOf (const char *type)
 
static vtkCSVExporterSafeDownCast (vtkObject *o)
 

Protected Member Functions

 vtkCSVExporter ()
 
 ~vtkCSVExporter ()
 

Protected Attributes

char * FileName
 
char * FieldDelimiter
 
bool FilterColumnsByVisibility
 
ofstream * FileStream
 
ExporterModes Mode
 

Detailed Description

exporter used by certain views to export data as a CSV file.

This is used by vtkSMCSVExporterProxy to export the data shown in the spreadsheet view or chart views as a CSV. The reason this class simply doesn't use a vtkCSVWriter is that vtkCSVWriter is designed to write out a single vtkTable as CSV. For exporting data from views, generating this single vtkTable that can be exported is often time consuming or memory consuming or both. Having a special exporter helps us with that. It provides two sets of APIs:

One has to pick which mode the exporter is operating in during the OpenFile() call.

Definition at line 49 of file vtkCSVExporter.h.

Member Typedef Documentation

§ Superclass

typedef vtkObject vtkCSVExporter::Superclass

Definition at line 53 of file vtkCSVExporter.h.

Member Enumeration Documentation

§ ExporterModes

Enumerator
STREAM_ROWS 
STREAM_COLUMNS 

Definition at line 80 of file vtkCSVExporter.h.

Constructor & Destructor Documentation

§ vtkCSVExporter()

vtkCSVExporter::vtkCSVExporter ( )
protected

§ ~vtkCSVExporter()

vtkCSVExporter::~vtkCSVExporter ( )
protected

Member Function Documentation

§ New()

static vtkCSVExporter* vtkCSVExporter::New ( )
static

§ GetClassName()

virtual const char* vtkCSVExporter::GetClassName ( )
virtual

§ IsTypeOf()

static int vtkCSVExporter::IsTypeOf ( const char *  type)
static

§ IsA()

virtual int vtkCSVExporter::IsA ( const char *  type)
virtual

§ SafeDownCast()

static vtkCSVExporter* vtkCSVExporter::SafeDownCast ( vtkObject *  o)
static

§ PrintSelf()

void vtkCSVExporter::PrintSelf ( ostream &  os,
vtkIndent  indent 
)

§ SetFileName()

virtual void vtkCSVExporter::SetFileName ( const char *  )
virtual

Get/Set the filename for the file.

§ GetFileName()

virtual char* vtkCSVExporter::GetFileName ( )
virtual

Get/Set the filename for the file.

§ SetFieldDelimiter()

virtual void vtkCSVExporter::SetFieldDelimiter ( const char *  )
virtual

Get/Set the delimiter use to separate fields ("," by default.)

§ GetFieldDelimiter()

virtual char* vtkCSVExporter::GetFieldDelimiter ( )
virtual

Get/Set the delimiter use to separate fields ("," by default.)

§ SetFilterColumnsByVisibility()

virtual void vtkCSVExporter::SetFilterColumnsByVisibility ( bool  )
virtual

Get/Set to filter by column or not.

§ GetFilterColumnsByVisibility()

virtual bool vtkCSVExporter::GetFilterColumnsByVisibility ( )
virtual

Get/Set to filter by column or not.

§ Open()

bool vtkCSVExporter::Open ( ExporterModes  mode = STREAM_ROWS)

Open the file and set mode in which the exporter is operating.

§ Close()

void vtkCSVExporter::Close ( )

Closes the file cleanly.

Call this at the end to close the file and dump out any cached data.

§ Abort()

void vtkCSVExporter::Abort ( )

Same as Close except deletes the file, if created.

This is useful to interrupt the exporting on failure.

§ WriteHeader()

void vtkCSVExporter::WriteHeader ( vtkFieldData *  )

In STREAM_ROWS mode, use these methods to write column headers once using WriteHeader and then use WriteData as many times as needed to write out rows.

§ WriteData()

void vtkCSVExporter::WriteData ( vtkFieldData *  )

In STREAM_ROWS mode, use these methods to write column headers once using WriteHeader and then use WriteData as many times as needed to write out rows.

§ AddColumn()

void vtkCSVExporter::AddColumn ( vtkAbstractArray *  yarray,
const char *  yarrayname = NULL,
vtkDataArray *  xarray = NULL 
)

In STREAM_COLUMNS mode, use this method to add a column (yarray).

One can assign it a name different the the name of the array using yarrayname. If xarray is not NULL, then is used as the row-id. This makes it possible to add multiple columns with varying number of samples. The final output will have empty cells for missing values.

Member Data Documentation

§ FileName

char* vtkCSVExporter::FileName
protected

Definition at line 127 of file vtkCSVExporter.h.

§ FieldDelimiter

char* vtkCSVExporter::FieldDelimiter
protected

Definition at line 128 of file vtkCSVExporter.h.

§ FilterColumnsByVisibility

bool vtkCSVExporter::FilterColumnsByVisibility
protected

Definition at line 129 of file vtkCSVExporter.h.

§ FileStream

ofstream* vtkCSVExporter::FileStream
protected

Definition at line 130 of file vtkCSVExporter.h.

§ Mode

ExporterModes vtkCSVExporter::Mode
protected

Definition at line 131 of file vtkCSVExporter.h.


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