FreeMat

- Main Page
- Related Pages

vtkXMLShader

Section: Visualization Toolkit IO Classes

# Usage

vtkXMLShader encapsulates the XML description for a Shader. It provides convenient access to various attributes/properties of a shader. .SECTION Thanks Shader support in VTK includes key contributions by Gary Templet at Sandia National Labs.

To create an instance of class vtkXMLShader, simply invoke its constructor as follows

      obj = vtkXMLShader

# Methods

The class vtkXMLShader has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, `obj` is an instance of the vtkXMLShader class.

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkXMLShader = obj.NewInstance ()`
- `vtkXMLShader = obj.SafeDownCast (vtkObject o)`
- `vtkXMLDataElement = obj.GetRootElement ()` - Get/Set the XML root element that describes this shader.
- `obj.SetRootElement (vtkXMLDataElement )` - Get/Set the XML root element that describes this shader.
- `int = obj.GetLanguage ()` - Returns the shader's language as defined in the XML description.
- `int = obj.GetScope ()` - Returns the type of the shader as defined in the XML description.
- `int = obj.GetLocation ()` - Returns the location of the shader as defined in the XML description.
- `int = obj.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
- `string = obj.GetName ()` - Get the name of the Shader.
- `string = obj.GetEntry ()` - Get the entry point to the shader code as defined in the XML.
- `string = obj.GetCode ()` - Get the shader code.