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

#include <vtkShaderProgram.h>

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

List of all members.

Public Types

typedef vtkObject Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkShaderProgramNewInstance () const
void PrintSelf (ostream &os, vtkIndent indent)
virtual vtkXMLMaterialGetMaterial ()
virtual void SetMaterial (vtkXMLMaterial *)
int AddShader (vtkShader *shader)
void RemoveShader (int index)
void RemoveShader (vtkShader *shader)
vtkCollectionIteratorNewShaderIterator ()
int GetNumberOfShaders ()
virtual void ReadMaterial ()
virtual void Render (vtkActor *, vtkRenderer *)=0
virtual void PostRender (vtkActor *, vtkRenderer *)
virtual void ReleaseGraphicsResources (vtkWindow *)
virtual void AddShaderVariable (const char *name, int numVars, int *x)
virtual void AddShaderVariable (const char *name, int numVars, float *x)
virtual void AddShaderVariable (const char *name, int numVars, double *x)
virtual vtkShaderDeviceAdapterGetShaderDeviceAdapter ()

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkShaderProgramSafeDownCast (vtkObjectBase *o)
static vtkShaderProgramCreateShaderProgram (int type)

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 vtkShaderProgram ()
 ~vtkShaderProgram ()
virtual void SetGLExtensionsLoaded (int)
virtual int GetGLExtensionsLoaded ()
virtual void LoadExtensions (vtkRenderWindow *)
void SetShaderDeviceAdapter (vtkShaderDeviceAdapter *)

Protected Attributes

vtkXMLMaterialMaterial
vtkCollectionShaderCollection
vtkCollectionIteratorShaderCollectionIterator
int GLExtensionsLoaded
virtual vtkShaderNewShader ()=0

Detailed Description

vtkShaderProgram is a superclass for managing Hardware Shaders defined in the XML Material file and interfacing VTK to those shaders. It's concrete descendants are responsible for installing vertex and fragment programs to the graphics hardware.

Shader Operations are shader library operations that are performed:
on individual shaders, that is, without consideration of the partner shader.
Program Operations are shader library operations that treat the:
vertex and fragment shader as a single unit.
Design:
This class is a Strategy pattern for 'Program' operations, which treat vertex/fragment shader pairs as a single 'Program', as required by some shader libraries (GLSL). Typically, 'Shader' operations are delegated to instances of vtkShader (managed by descendants of this class) while 'Program' operations are handled by descendants of this class, vtkCgShaderProgram, vtkGLSLShaderProgram.
See also:
vtkCgShaderProgram, vtkGLSLShaderProgram
Thanks:
Shader support in VTK includes key contributions by Gary Templet at Sandia National Labs.

Definition at line 70 of file vtkShaderProgram.h.


Member Typedef Documentation

Reimplemented from vtkObject.

Reimplemented in vtkGLSLShaderProgram.

Definition at line 73 of file vtkShaderProgram.h.


Constructor & Destructor Documentation


Member Function Documentation

static int vtkShaderProgram::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 vtkObject.

Reimplemented in vtkGLSLShaderProgram.

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

Reimplemented in vtkGLSLShaderProgram.

Reimplemented from vtkObject.

Reimplemented in vtkGLSLShaderProgram.

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

Reimplemented from vtkObject.

Reimplemented in vtkGLSLShaderProgram.

Reimplemented from vtkObject.

Reimplemented in vtkGLSLShaderProgram.

void vtkShaderProgram::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.

Reimplemented in vtkGLSLShaderProgram.

virtual void vtkShaderProgram::SetMaterial ( vtkXMLMaterial ) [virtual]

Remove a shader at the given index.

Removes the given shader.

Returns a new iterator to iterate over the shaders.

Returns the number of shaders available in this shader program.

virtual void vtkShaderProgram::ReadMaterial ( ) [virtual]
virtual void vtkShaderProgram::Render ( vtkActor ,
vtkRenderer  
) [pure virtual]

Implemented in vtkGLSLShaderProgram.

virtual void vtkShaderProgram::AddShaderVariable ( const char *  name,
int  numVars,
int x 
) [virtual]

Provide values to initialize shader variables. This is a conduit to initialize shader variables that change over time, useful for animation, gui widget inputs, etc. name - hardware name of the uniform variable numVars - number of variables being set x - values

virtual void vtkShaderProgram::AddShaderVariable ( const char *  name,
int  numVars,
float x 
) [virtual]

Provide values to initialize shader variables. This is a conduit to initialize shader variables that change over time, useful for animation, gui widget inputs, etc. name - hardware name of the uniform variable numVars - number of variables being set x - values

virtual void vtkShaderProgram::AddShaderVariable ( const char *  name,
int  numVars,
double x 
) [virtual]

Provide values to initialize shader variables. This is a conduit to initialize shader variables that change over time, useful for animation, gui widget inputs, etc. name - hardware name of the uniform variable numVars - number of variables being set x - values

virtual void vtkShaderProgram::PostRender ( vtkActor ,
vtkRenderer  
) [virtual]

Called to unload the shaders after the actor has been rendered.

Reimplemented in vtkGLSLShaderProgram.

virtual void vtkShaderProgram::ReleaseGraphicsResources ( vtkWindow ) [virtual]

Release any graphics resources that are being consumed by this actor. The parameter window could be used to determine which graphic resources to release.

Reimplemented in vtkGLSLShaderProgram.

Get the vtkShaderDeviceAdapter which can be used to execute this shader program.

virtual void vtkShaderProgram::SetGLExtensionsLoaded ( int  ) [protected, virtual]
virtual int vtkShaderProgram::GetGLExtensionsLoaded ( ) [protected, virtual]
virtual void vtkShaderProgram::LoadExtensions ( vtkRenderWindow ) [inline, protected, virtual]

Reimplemented in vtkGLSLShaderProgram.

Definition at line 148 of file vtkShaderProgram.h.

virtual vtkShader* vtkShaderProgram::NewShader ( ) [protected, pure virtual]

Must be overloaded by subclasses to create the shader of appropriate type.

Implemented in vtkGLSLShaderProgram.


Member Data Documentation

Definition at line 141 of file vtkShaderProgram.h.

Definition at line 142 of file vtkShaderProgram.h.

Definition at line 143 of file vtkShaderProgram.h.

Definition at line 146 of file vtkShaderProgram.h.


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