VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkXMLShader Class Reference

encapsulates a Shader XML description. More...

#include <vtkXMLShader.h>

Inheritance diagram for vtkXMLShader:
[legend]
Collaboration diagram for vtkXMLShader:
[legend]

Public Types

enum  LanguageCodes { LANGUAGE_NONE =0, LANGUAGE_MIXED, LANGUAGE_CG, LANGUAGE_GLSL }
 
enum  ScopeCodes { SCOPE_NONE =0, SCOPE_MIXED, SCOPE_VERTEX, SCOPE_FRAGMENT }
 
enum  LocationCodes { LOCATION_NONE =0, LOCATION_INLINE, LOCATION_FILE, LOCATION_LIBRARY }
 
typedef vtkObject Superclass
 
- Public Types inherited from vtkObject
typedef vtkObjectBase Superclass
 

Public Member Functions

virtual const char * GetClassName ()
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent)
 
int GetLanguage ()
 
int GetScope ()
 
int GetLocation ()
 
int GetStyle ()
 
const char * GetName ()
 
const char * GetEntry ()
 
const char * GetCode ()
 
const char ** GetArgs ()
 
virtual vtkXMLDataElementGetRootElement ()
 
void SetRootElement (vtkXMLDataElement *)
 
- Public Member Functions inherited from vtkObject
virtual void DebugOn ()
 
virtual void DebugOff ()
 
unsigned char GetDebug ()
 
void SetDebug (unsigned char debugFlag)
 
virtual void Modified ()
 
virtual unsigned long GetMTime ()
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
void SetReferenceCount (int)
 
void PrintRevisions (ostream &os)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 

Static Public Member Functions

static vtkXMLShaderNew ()
 
static int IsTypeOf (const char *type)
 
static vtkXMLShaderSafeDownCast (vtkObject *o)
 
static char * LocateFile (const char *filename)
 
- Static Public Member Functions inherited from vtkObject
static int IsTypeOf (const char *type)
 
static vtkObjectSafeDownCast (vtkObject *o)
 
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static int IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 

Protected Member Functions

 vtkXMLShader ()
 
 ~vtkXMLShader ()
 
void ReadCodeFromFile (const char *fullpath)
 
virtual void SetCode (const char *)
 
void SetSourceLibraryElement (vtkXMLDataElement *)
 
void CleanupArgs ()
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
virtual ~vtkObject ()
 
virtual void RegisterInternal (vtkObjectBase *, int check)
 
virtual void UnRegisterInternal (vtkObjectBase *, int check)
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &os)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

char * Code
 
vtkXMLDataElementRootElement
 
vtkXMLDataElementSourceLibraryElement
 
char ** Args
 
- Protected Attributes inherited from vtkObject
unsigned char Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
int ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

encapsulates a Shader XML description.

vtkXMLShader encapsulates the XML description for a Shader. It provides convenient access to various attributes/properties of a shader.

Thanks:
Shader support in VTK includes key contributions by Gary Templet at Sandia National Labs.

Definition at line 33 of file vtkXMLShader.h.

Member Typedef Documentation

Definition at line 37 of file vtkXMLShader.h.

Member Enumeration Documentation

Enumerator:
LANGUAGE_NONE 
LANGUAGE_MIXED 
LANGUAGE_CG 
LANGUAGE_GLSL 

Definition at line 83 of file vtkXMLShader.h.

Enumerator:
SCOPE_NONE 
SCOPE_MIXED 
SCOPE_VERTEX 
SCOPE_FRAGMENT 

Definition at line 91 of file vtkXMLShader.h.

Enumerator:
LOCATION_NONE 
LOCATION_INLINE 
LOCATION_FILE 
LOCATION_LIBRARY 

Definition at line 99 of file vtkXMLShader.h.

Constructor & Destructor Documentation

vtkXMLShader::vtkXMLShader ( )
protected
vtkXMLShader::~vtkXMLShader ( )
protected

Member Function Documentation

static vtkXMLShader* vtkXMLShader::New ( )
static
virtual const char* vtkXMLShader::GetClassName ( )
virtual

Reimplemented from vtkObject.

static int vtkXMLShader::IsTypeOf ( const char *  type)
static
virtual int vtkXMLShader::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 vtkObject.

static vtkXMLShader* vtkXMLShader::SafeDownCast ( vtkObject o)
static
void vtkXMLShader::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 vtkObject.

virtual vtkXMLDataElement* vtkXMLShader::GetRootElement ( )
virtual

Get/Set the XML root element that describes this shader.

void vtkXMLShader::SetRootElement ( vtkXMLDataElement )

Get/Set the XML root element that describes this shader.

int vtkXMLShader::GetLanguage ( )

Returns the shader's language as defined in the XML description.

int vtkXMLShader::GetScope ( )

Returns the type of the shader as defined in the XML description.

int vtkXMLShader::GetLocation ( )

Returns the location of the shader as defined in the XML description.

int vtkXMLShader::GetStyle ( )

Returns the style of the shader as optionaly defined in the XML description. If not present, default style is 1. "style=2" means it is a shader without a main(). In style 2, the "main" function for the vertex shader part is void propFuncVS(void), the main function for the fragment shader part is void propFuncFS(). This is useful when combining a shader at the actor level and a shader defines at the renderer level, like the depth peeling pass.

Postcondition
valid_result: result==1 || result==2
const char* vtkXMLShader::GetName ( )

Get the name of the Shader.

const char* vtkXMLShader::GetEntry ( )

Get the entry point to the shader code as defined in the XML.

const char* vtkXMLShader::GetCode ( )

Get the shader code.

const char** vtkXMLShader::GetArgs ( )

Returns an null terminate array of the pointers to space sepatared Args defined in the XML description.

static char* vtkXMLShader::LocateFile ( const char *  filename)
static

Searches the file in the VTK_MATERIALS_DIRS. Note that this allocates new memory for the string. The caller must delete it.

void vtkXMLShader::ReadCodeFromFile ( const char *  fullpath)
protected
virtual void vtkXMLShader::SetCode ( const char *  )
protectedvirtual
void vtkXMLShader::SetSourceLibraryElement ( vtkXMLDataElement )
protected
void vtkXMLShader::CleanupArgs ( )
protected

Member Data Documentation

char* vtkXMLShader::Code
protected

Definition at line 114 of file vtkXMLShader.h.

vtkXMLDataElement* vtkXMLShader::RootElement
protected

Definition at line 115 of file vtkXMLShader.h.

vtkXMLDataElement* vtkXMLShader::SourceLibraryElement
protected

Definition at line 118 of file vtkXMLShader.h.

char** vtkXMLShader::Args
protected

Definition at line 121 of file vtkXMLShader.h.


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