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

Parses VTK Material file. More...

#include <vtkXMLMaterialParser.h>

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

List of all members.

Public Types

typedef vtkXMLParser Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkXMLMaterialParserNewInstance () const
void PrintSelf (ostream &os, vtkIndent indent)
virtual vtkXMLMaterialGetMaterial ()
void SetMaterial (vtkXMLMaterial *)
virtual int Parse ()
virtual int Parse (const char *inputString)
virtual int Parse (const char *inputString, unsigned int length)

Static Public Member Functions

static vtkXMLMaterialParserNew ()
static int IsTypeOf (const char *type)
static vtkXMLMaterialParserSafeDownCast (vtkObjectBase *o)

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
virtual void StartElement (const char *name, const char **atts)
virtual void EndElement (const char *)
virtual void CharacterDataHandler (const char *data, int length)

Protected Attributes

vtkXMLMaterialMaterial
vtkXMLMaterialParserInternals * Internals
virtual int InitializeParser ()
 vtkXMLMaterialParser ()
 ~vtkXMLMaterialParser ()

Detailed Description

Parses VTK Material file.

vtkXMLMaterialParser parses a VTK Material file and provides that file's description of a number of vertex and fragment shaders along with data values specified for data members of vtkProperty. This material is to be applied to an actor through it's vtkProperty and augments VTK's concept of a vtkProperty to include explicitly include vertex and fragment shaders and parameter settings for those shaders. This effectively makes reflectance models and other shaders a material property. If no shaders are specified VTK should default to standard rendering.

Design:
vtkXMLMaterialParser provides access to 3 distinct types of first-level vtkXMLDataElements that describe a VTK material. These elements are as follows:
Design:
vtkProperty - describe values for vtkProperty data members
Design:
vtkVertexShader - a vertex shader and enough information to install it into the hardware rendering pipeline including values for specific shader parameters and structures.
Design:
vtkFragmentShader - a fragment shader and enough information to install it into the hardware rendering pipeline including values for specific shader parameters and structures.
Design:
The design of the material file closely follows that of vtk's xml descriptions of it's data sets. This allows use of the very handy vtkXMLDataElement which provides easy access to an xml element's attribute values. Inlined data is currently not handled.
Design:
Ideally this class would be a Facade to a DOM parser, but VTK only provides access to expat, a SAX parser. Other vtk classes that parse xml files are tuned to read vtkDataSets and don't provide the functionality to handle generic xml data. As such they are of little use here.
Design:
This class may be extended for better data handling or may become a Facade to a DOM parser should on become part of the VTK code base.
Thanks:
Shader support in VTK includes key contributions by Gary Templet at Sandia National Labs.

Definition at line 85 of file vtkXMLMaterialParser.h.


Member Typedef Documentation

Reimplemented from vtkXMLParser.

Definition at line 89 of file vtkXMLMaterialParser.h.


Constructor & Destructor Documentation

Overridden to clean up internal structures before the chunk-parsing begins.

Overridden to clean up internal structures before the chunk-parsing begins.


Member Function Documentation

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

Reimplemented from vtkXMLParser.

static int vtkXMLMaterialParser::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 vtkXMLParser.

virtual int vtkXMLMaterialParser::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 vtkXMLParser.

Reimplemented from vtkXMLParser.

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

Reimplemented from vtkXMLParser.

Reimplemented from vtkXMLParser.

void vtkXMLMaterialParser::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 vtkXMLParser.

Set/Get the vtkXMLMaterial representation of the parsed material.

Set/Get the vtkXMLMaterial representation of the parsed material.

virtual int vtkXMLMaterialParser::Parse ( ) [virtual]

Overridden to initialize the internal structures before the parsing begins.

Reimplemented from vtkXMLParser.

virtual int vtkXMLMaterialParser::Parse ( const char *  inputString) [virtual]

Overridden to initialize the internal structures before the parsing begins.

Reimplemented from vtkXMLParser.

virtual int vtkXMLMaterialParser::Parse ( const char *  inputString,
unsigned int  length 
) [virtual]

Overridden to initialize the internal structures before the parsing begins.

Reimplemented from vtkXMLParser.

Overridden to clean up internal structures before the chunk-parsing begins.

Reimplemented from vtkXMLParser.

virtual void vtkXMLMaterialParser::StartElement ( const char *  name,
const char **  atts 
) [protected, virtual]

Event for handling the start of an element

Reimplemented from vtkXMLParser.

virtual void vtkXMLMaterialParser::EndElement ( const char *  ) [protected, virtual]

Event for handling the end of an element

Reimplemented from vtkXMLParser.

virtual void vtkXMLMaterialParser::CharacterDataHandler ( const char *  data,
int  length 
) [protected, virtual]

Handle character data, not yet implemented

Reimplemented from vtkXMLParser.


Member Data Documentation

Definition at line 124 of file vtkXMLMaterialParser.h.

vtkXMLMaterialParserInternals* vtkXMLMaterialParser::Internals [protected]

Definition at line 125 of file vtkXMLMaterialParser.h.


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