vtkXMLMaterialParser Class Reference

#include <vtkXMLMaterialParser.h>

Inheritance diagram for vtkXMLMaterialParser:

Inheritance graph
[legend]
Collaboration diagram for vtkXMLMaterialParser:

Collaboration graph
[legend]

List of all members.


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 84 of file vtkXMLMaterialParser.h.


Public Types

typedef vtkXMLParser Superclass

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
virtual int InitializeParser ()
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 (vtkObject *o)

Protected Member Functions

 vtkXMLMaterialParser ()
 ~vtkXMLMaterialParser ()
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

Member Typedef Documentation

Reimplemented from vtkXMLParser.

Definition at line 88 of file vtkXMLMaterialParser.h.


Constructor & Destructor Documentation

vtkXMLMaterialParser::vtkXMLMaterialParser (  )  [protected]

vtkXMLMaterialParser::~vtkXMLMaterialParser (  )  [protected]


Member Function Documentation

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

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

Reimplemented from vtkXMLParser.

virtual const char* vtkXMLMaterialParser::GetClassName (  )  [virtual]

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 vtkTypeRevisionMacro 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 vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkXMLParser.

static vtkXMLMaterialParser* vtkXMLMaterialParser::SafeDownCast ( vtkObject o  )  [static]

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.

virtual vtkXMLMaterial* vtkXMLMaterialParser::GetMaterial (  )  [virtual]

Set/Get the vtkXMLMaterial representation of the parsed material.

void vtkXMLMaterialParser::SetMaterial ( vtkXMLMaterial  ) 

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.

virtual int vtkXMLMaterialParser::InitializeParser (  )  [virtual]

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 121 of file vtkXMLMaterialParser.h.

vtkXMLMaterialParserInternals* vtkXMLMaterialParser::Internals [protected]

Definition at line 122 of file vtkXMLMaterialParser.h.


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

Generated on Wed Jun 3 19:47:46 2009 for VTK by  doxygen 1.5.6