#include <vtkQtXMLProcessor.h>
which is then processed using either XQuery or XSLT. vtkQtXMLProcessor provides multiple "domains" which control how data is mapped to XML:
"ROW_DOMAIN" treats an input vtkFieldData object as a "table" made-up of columns, rows, and cells/fields. This table is mapped (using shallow-copy semantics) into XML, and each "row" in the "table" is passed to an XQuery or XSLT expression, producing one output result for each "row".
"DATA_OBJECT_DOMAIN" maps vtkFieldData to a "table" in the same way, but passes the entire table to an XQuery or XSLT expression, producing a single output result for the entire data obect.
Following is an example of how a field data containing two arrays named "foo" and "bar" are mapped into XML:
Note how the array names are mapped to elements in the resulting XML. Because there are strict rules on the naming of XML elements, array names will be automatically "mangled" to produce conforming element names. Users may optionally supply their own mappings from array names to element names.
"VALUE_DOMAIN" is used when when a data object already contains XML data that can be passed to an XQuery or XSLT expression directly, producing one output result for each value in an attribute array. Use SetInputArrayToProcess(0, ...) to specify the attribute array that contains XML for processing.
Parameters: FieldType: Controls which field data should be extracted from the input for processing.
InputDomain: Controls whether XML processing will be applied to individual rows (the default), the entire input field data, or an attribute array containing XML.
QueryType: Controls whether to use XQuery or XSLT for processing.
Query: The XQuery or XSLT template to be used for processing.
OutputArray: The name of the output array that will store the processed results.
Inputs: Input port 0: A vtkDataObject containing arbitrary field data.
Outputs: Output port 0: A shallow-copy of the input vtkDataObject. If InputDomain is set to "ROW_DOMAIN" (the default), or "VALUE_DOMAIN", the data object's field data will contain an additional string array containing the results of running XQuery / XSLT on each individual row / value in the input.
If InputDomain is set to "DATA_OBJECT_DOMAIN", the data object will be identical to the input.
Output port 1: A vtkTable. If InputDomain is set to "ROW_DOMAIN" (the default) or "VALUE_DOMAIN", the table will be completely empty. If InputDomain is set to "DATA_OBJECT_DOMAIN", the table will contain a single string array with a single value containing the results of running XQuery / XSLT on the entire contents of the input field data.
Definition at line 117 of file vtkQtXMLProcessor.h.
Public Types | |
enum | { ROW_DOMAIN = 0, DATA_OBJECT_DOMAIN = 1, VALUE_DOMAIN = 2 } |
enum | { XQUERY = 0, XSLT = 1 } |
typedef vtkPassInputTypeAlgorithm | Superclass |
Public Member Functions | |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
virtual int | GetFieldType () |
virtual void | SetFieldType (int) |
virtual int | GetInputDomain () |
virtual void | SetInputDomain (int) |
virtual int | GetQueryType () |
virtual void | SetQueryType (int) |
virtual void | SetQuery (const char *) |
virtual char * | GetQuery () |
virtual void | SetOutputArray (const char *) |
virtual char * | GetOutputArray () |
void | MapArrayName (const vtkStdString &from, const vtkStdString &to) |
void | ClearArrayNameMap () |
Static Public Member Functions | |
static vtkQtXMLProcessor * | New () |
static int | IsTypeOf (const char *type) |
static vtkQtXMLProcessor * | SafeDownCast (vtkObject *o) |
Protected Member Functions | |
vtkQtXMLProcessor () | |
~vtkQtXMLProcessor () | |
int | FillOutputPortInformation (int port, vtkInformation *info) |
int | RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *) |
anonymous enum |
Definition at line 126 of file vtkQtXMLProcessor.h.
anonymous enum |
vtkQtXMLProcessor::vtkQtXMLProcessor | ( | ) | [protected] |
vtkQtXMLProcessor::~vtkQtXMLProcessor | ( | ) | [protected] |
static vtkQtXMLProcessor* vtkQtXMLProcessor::New | ( | ) | [static] |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkPassInputTypeAlgorithm.
virtual const char* vtkQtXMLProcessor::GetClassName | ( | ) | [virtual] |
Reimplemented from vtkPassInputTypeAlgorithm.
static int vtkQtXMLProcessor::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 vtkPassInputTypeAlgorithm.
virtual int vtkQtXMLProcessor::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 vtkPassInputTypeAlgorithm.
static vtkQtXMLProcessor* vtkQtXMLProcessor::SafeDownCast | ( | vtkObject * | o | ) | [static] |
Reimplemented from vtkPassInputTypeAlgorithm.
void vtkQtXMLProcessor::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 vtkPassInputTypeAlgorithm.
virtual int vtkQtXMLProcessor::GetFieldType | ( | ) | [virtual] |
Specifies the field data to process when InputDomain is set to "ROW_DOMAIN" or "DATA_OBJECT_DOMAIN".
virtual void vtkQtXMLProcessor::SetFieldType | ( | int | ) | [virtual] |
Specifies the field data to process when InputDomain is set to "ROW_DOMAIN" or "DATA_OBJECT_DOMAIN".
virtual int vtkQtXMLProcessor::GetInputDomain | ( | ) | [virtual] |
Specifies how input data should be mapped to XML for processing.
virtual void vtkQtXMLProcessor::SetInputDomain | ( | int | ) | [virtual] |
Specifies how input data should be mapped to XML for processing.
virtual int vtkQtXMLProcessor::GetQueryType | ( | ) | [virtual] |
Specifies Whether the query uses XQuery or XSLT syntax.
virtual void vtkQtXMLProcessor::SetQueryType | ( | int | ) | [virtual] |
Specifies Whether the query uses XQuery or XSLT syntax.
virtual void vtkQtXMLProcessor::SetQuery | ( | const char * | ) | [virtual] |
Specifies the XQuery or XSLT query to apply to input data.
virtual char* vtkQtXMLProcessor::GetQuery | ( | ) | [virtual] |
Specifies the XQuery or XSLT query to apply to input data.
virtual void vtkQtXMLProcessor::SetOutputArray | ( | const char * | ) | [virtual] |
Specifies the name of the array where output results will be stored.
virtual char* vtkQtXMLProcessor::GetOutputArray | ( | ) | [virtual] |
Specifies the name of the array where output results will be stored.
void vtkQtXMLProcessor::MapArrayName | ( | const vtkStdString & | from, | |
const vtkStdString & | to | |||
) |
Used to provide explicit mappings from VTK array names to XML element names.
void vtkQtXMLProcessor::ClearArrayNameMap | ( | ) |
Used to provide explicit mappings from VTK array names to XML element names.
int vtkQtXMLProcessor::FillOutputPortInformation | ( | int | port, | |
vtkInformation * | info | |||
) | [protected, virtual] |
Fill the output port information objects for this algorithm. This is invoked by the first call to GetOutputPortInformation for each port so subclasses can specify what they can handle.
Reimplemented from vtkPassInputTypeAlgorithm.
int vtkQtXMLProcessor::RequestData | ( | vtkInformation * | , | |
vtkInformationVector ** | , | |||
vtkInformationVector * | ||||
) | [protected, virtual] |
This is called within ProcessRequest when a request asks the algorithm to do its work. This is the method you should override to do whatever the algorithm is designed to do. This happens during the fourth pass in the pipeline execution process.
Reimplemented from vtkPassInputTypeAlgorithm.