#include <vtkBoostSplitTableField.h>
Assume the following table:
Author Year Title Brian; Jeff; Tim 2007 Foo Tim 2003 Bar
If we produce a graph relating authors to the year in which they publish, the string "Brian; Jeff; Tim" will be treated (incorrectly) as a single author associated with the year 2007. vtkBoostSplitTableField addresses this by splitting one-or-more fields into "subvalues" using a configurable delimiter and placing each subvalue on its own row (the other fields in the original row are copied). Using the above example, splitting the "Author" field with a ";" (semicolon) delimiter produces:
Author Year Title Brian 2007 Foo Jeff 2007 Foo Tim 2007 Foo Tim 2003 Bar
When this table is converted to a graph, each author (correctly) becomes a separate node.
Usage:
Use AddField() to specify the field(s) to be split. If no fields have been specified, vtkBoostSplitTableField will act as a passthrough. By default, no fields are specified.
The second argument to AddField() is a string containing zero-to-many single character delimiters (multi-character delimiters are not supported).
If the input table is missing a field specified by AddField(), it is an error. If no fields are specified, no splitting is performed. If the delimiter for a field is an empty string, no splitting is performed on that field.
Definition at line 66 of file vtkBoostSplitTableField.h.
Public Types | |
typedef vtkTableAlgorithm | Superclass |
Public Member Functions | |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
void | ClearFields () |
void | AddField (const char *field, const char *delimiters) |
Static Public Member Functions | |
static vtkBoostSplitTableField * | New () |
static int | IsTypeOf (const char *type) |
static vtkBoostSplitTableField * | SafeDownCast (vtkObject *o) |
Protected Member Functions | |
vtkBoostSplitTableField () | |
~vtkBoostSplitTableField () | |
int | RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *) |
Protected Attributes | |
vtkStringArray * | Fields |
vtkStringArray * | Delimiters |
vtkBoostSplitTableField::vtkBoostSplitTableField | ( | ) | [protected] |
vtkBoostSplitTableField::~vtkBoostSplitTableField | ( | ) | [protected] |
static vtkBoostSplitTableField* vtkBoostSplitTableField::New | ( | ) | [static] |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkTableAlgorithm.
virtual const char* vtkBoostSplitTableField::GetClassName | ( | ) | [virtual] |
Reimplemented from vtkTableAlgorithm.
static int vtkBoostSplitTableField::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 vtkTypeRevisionMacro found in vtkSetGet.h.
Reimplemented from vtkTableAlgorithm.
virtual int vtkBoostSplitTableField::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 vtkTypeRevisionMacro found in vtkSetGet.h.
Reimplemented from vtkTableAlgorithm.
static vtkBoostSplitTableField* vtkBoostSplitTableField::SafeDownCast | ( | vtkObject * | o | ) | [static] |
Reimplemented from vtkTableAlgorithm.
void vtkBoostSplitTableField::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 vtkTableAlgorithm.
void vtkBoostSplitTableField::ClearFields | ( | ) |
void vtkBoostSplitTableField::AddField | ( | const char * | field, | |
const char * | delimiters | |||
) |
int vtkBoostSplitTableField::RequestData | ( | vtkInformation * | request, | |
vtkInformationVector ** | inputVector, | |||
vtkInformationVector * | outputVector | |||
) | [protected, virtual] |
This is called by the superclass. This is the method you should override.
Reimplemented from vtkTableAlgorithm.
vtkStringArray* vtkBoostSplitTableField::Fields [protected] |
Definition at line 85 of file vtkBoostSplitTableField.h.
vtkStringArray* vtkBoostSplitTableField::Delimiters [protected] |
Definition at line 86 of file vtkBoostSplitTableField.h.