# Ogre::CompositorScriptCompiler2 Class Reference

This class uses the new ScriptCompiler to compile compositor scripts. More...

`#include <OgreCompositorScriptCompiler2.h>`

Inheritance diagram for Ogre::CompositorScriptCompiler2:

[legend]

List of all members.

## Public Types

enum

{
ID_COMPOSITOR, ID_TECHNIQUE, ID_TARGET, ID_TARGET_OUTPUT,
ID_PASS, ID_TEXTURE, ID_INPUT, ID_NONE,
ID_PREVIOUS, ID_TARGET_WIDTH, ID_TARGET_HEIGHT, ID_ONLY_INITIAL,
ID_VISIBILITY_MASK, ID_LOD_BIAS, ID_MATERIAL_SCHEME, ID_CLEAR,
ID_STENCIL, ID_RENDER_SCENE, ID_RENDER_QUAD, ID_MATERIAL,
ID_IDENTIFIER, ID_FIRST_RENDER_QUEUE, ID_LAST_RENDER_QUEUE, ID_BUFFERS,
ID_COLOUR, ID_DEPTH, ID_COLOUR_VALUE, ID_DEPTH_VALUE,
ID_STENCIL_VALUE, ID_CHECK, ID_COMP_FUNC, ID_ALWAYS_FAIL,
ID_ALWAYS_PASS, ID_LESS_EQUAL, ID_LESS, ID_EQUAL,
ID_NOT_EQUAL, ID_GREATER_EQUAL, ID_GREATER, ID_REF_VALUE,
ID_MASK, ID_FAIL_OP, ID_KEEP, ID_ZERO,
ID_REPLACE, ID_INCREMENT, ID_DECREMENT, ID_INCREMENT_WRAP,
ID_DECREMENT_WRAP, ID_INVERT, ID_DEPTH_FAIL_OP, ID_PASS_OP,
ID_TWO_SIDED
}

enum | { CE_STRINGEXPECTED, CE_NUMBEREXPECTED, CE_FEWERPARAMETERSEXPECTED, CE_VARIABLEEXPECTED, CE_UNDEFINEDVARIABLE, CE_OBJECTNAMEEXPECTED, CE_OBJECTALLOCATIONERROR, CE_INVALIDPARAMETERS, CE_DUPLICATEOVERRIDE, CE_UNEXPECTEDTOKEN, CE_OBJECTBASENOTFOUND, CE_UNSUPPORTEDBYRENDERSYSTEM, CE_REFERENCETOANONEXISTINGOBJECT }
enum | { ID_ON = 1, ID_OFF = 2, ID_TRUE = 1, ID_FALSE = 2, ID_YES = 1, ID_NO = 2 }
typedef std::map< String, uint32 > | IdMap
typedef SharedPtr< Error > | ErrorPtr
typedef std::list< ErrorPtr > | ErrorList

## Public Member Functions

| CompositorScriptCompiler2 ()
void | setListener (CompositorScriptCompilerListener *listener)
| Sets the listener used for overriding compiler functions.
bool | compile (const String &str, const String &source, const String &group)
| Takes in a string of script code and compiles it into resources.
bool | compile (const ConcreteNodeListPtr &nodes, const String &group)
| Compiles resources from the given concrete node list.
bool | _compile (AbstractNodeListPtr nodes, const String &group)
| Compiles the given abstract syntax tree.
void | addError (uint32 code, const String &file, int line, const String &msg="")
| Adds the given error to the compiler's list of errors.
void | setListener (ScriptCompilerListener *listener)
| Sets the listener used by the compiler.
ScriptCompilerListener * | getListener ()
| Returns the currently set listener.
const String & | getResourceGroup () const
| Returns the resource group currently set for this compiler.
void | addNameExclusion (const String &type)
| Adds a name exclusion to the map.
void | removeNameExclusion (const String &type)
| Removes a name exclusion.
bool | _fireEvent (const String &name, const std::vector< Any > &args, Any *retval)
| Internal method for firing the handleEvent method.
Any | _fireCreateObject (const String &type, const std::vector< Any > &args)
| Internal method for firing the createObject event.
void * | operator new (size_t sz, const char *file, int line, const char *func)
| operator new, with debug line info
void * | operator new (size_t sz)
void * | operator new (size_t sz, void *ptr)
| placement operator new
void * | operator new[] (size_t sz, const char *file, int line, const char *func)
| array operator new, with debug line info
void * | operator new[] (size_t sz)
void | operator delete (void *ptr)
void | operator delete (void *ptr, void *)
void | operator delete (void *ptr, const char *, int, const char *)
void | operator delete[] (void *ptr)
void | operator delete[] (void *ptr, const char *, int, const char *)

## Static Public Member Functions

static String | formatErrorCode (uint32 code)

## Protected Member Functions

bool | compileImpl (ScriptNodeListPtr nodes)
| This is the implementation for compiling the compositor scripts.
bool | processNode (ScriptNodeList::iterator &i, ScriptNodeList::iterator &end)
| This allows for overriding processing of script nodes.
ScriptNodeListPtr | loadImportPath (const String &name)
| This is the override for loading imports.
void | preParse ()
| Allows a listener to override the word id map before parsing.
bool | errorRaised (const ScriptCompilerErrorPtr &error)
| Allows a listener to override error handling in the compiler.

## Private Member Functions

void | compileCompositor (const ScriptNodePtr &node)
void | compileTechnique (const ScriptNodePtr &node)
void | compileTarget (const ScriptNodePtr &node, CompositionTechnique *technique)
void | compileTargetOutput (const ScriptNodePtr &node, CompositionTechnique *technique)
void | compilePass (const ScriptNodePtr &node, CompositionTargetPass *target)
void | compileTargetOptions (ScriptNodeList::iterator &i, ScriptNodeList::iterator &end, CompositionTargetPass *target)
bool | getCompareFunction (const ScriptNodePtr &node, CompareFunction &func)
bool | getStencilOp (const ScriptNodePtr &node, StencilOperation &op)
bool | getColourValue (ScriptNodeList::iterator &i, ScriptNodeList::iterator &end, ColourValue &c)

## Private Attributes

CompositorScriptCompilerListener * | mListener
Compositor * | mCompositor

## Detailed Description

This class uses the new ScriptCompiler to compile compositor scripts.

It uses a word id map, and allows a listener to override resource acquisitions and allocations.

Definition at line 60 of file OgreCompositorScriptCompiler2.h.

## Member Typedef Documentation

typedef std::map<String,uint32> Ogre::ScriptCompiler::IdMap `[inherited]`

Definition at line 183 of file OgreScriptCompiler.h.

typedef SharedPtr<Error> Ogre::ScriptCompiler::ErrorPtr `[inherited]`

Definition at line 192 of file OgreScriptCompiler.h.

typedef std::list<ErrorPtr> Ogre::ScriptCompiler::ErrorList `[inherited]`

Definition at line 193 of file OgreScriptCompiler.h.

## Member Enumeration Documentation

anonymous enum

Enumerator:

  ID_COMPOSITOR |
  ID_TECHNIQUE |
  ID_TARGET |
  ID_TARGET_OUTPUT |
  ID_PASS |
  ID_TEXTURE |
  ID_INPUT |
  ID_NONE |
  ID_PREVIOUS |
  ID_TARGET_WIDTH |
  ID_TARGET_HEIGHT |
  ID_ONLY_INITIAL |
  ID_VISIBILITY_MASK |
  ID_LOD_BIAS |
  ID_MATERIAL_SCHEME |
  ID_CLEAR |
  ID_STENCIL |
  ID_RENDER_SCENE |
  ID_RENDER_QUAD |
  ID_MATERIAL |
  ID_IDENTIFIER |
  ID_FIRST_RENDER_QUEUE |
  ID_LAST_RENDER_QUEUE |
  ID_BUFFERS |
  ID_COLOUR |
  ID_DEPTH |
  ID_COLOUR_VALUE |
  ID_DEPTH_VALUE |
  ID_STENCIL_VALUE |
  ID_CHECK |
  ID_COMP_FUNC |
  ID_ALWAYS_FAIL |
  ID_ALWAYS_PASS |
  ID_LESS_EQUAL |
  ID_LESS |
  ID_EQUAL |
  ID_NOT_EQUAL |
  ID_GREATER_EQUAL |
  ID_GREATER |
  ID_REF_VALUE |
  ID_MASK |
  ID_FAIL_OP |
  ID_KEEP |
  ID_ZERO |
  ID_REPLACE |
  ID_INCREMENT |
  ID_DECREMENT |
  ID_INCREMENT_WRAP |
  ID_DECREMENT_WRAP |
  ID_INVERT |
  ID_DEPTH_FAIL_OP |
  ID_PASS_OP |
  ID_TWO_SIDED |

Definition at line 63 of file OgreCompositorScriptCompiler2.h.

anonymous enum`[inherited]`

Enumerator:

  CE_STRINGEXPECTED |
  CE_NUMBEREXPECTED |
  CE_FEWERPARAMETERSEXPECTED |
  CE_VARIABLEEXPECTED |
  CE_UNDEFINEDVARIABLE |
  CE_OBJECTNAMEEXPECTED |
  CE_OBJECTALLOCATIONERROR |
  CE_INVALIDPARAMETERS |
  CE_DUPLICATEOVERRIDE |
  CE_UNEXPECTEDTOKEN |
  CE_OBJECTBASENOTFOUND |
  CE_UNSUPPORTEDBYRENDERSYSTEM |
  CE_REFERENCETOANONEXISTINGOBJECT |

Definition at line 196 of file OgreScriptCompiler.h.

anonymous enum`[inherited]`

Enumerator:

  ID_ON |
  ID_OFF |
  ID_TRUE |
  ID_FALSE |
  ID_YES |
  ID_NO |

Definition at line 304 of file OgreScriptCompiler.h.

## Constructor & Destructor Documentation

Ogre::CompositorScriptCompiler2::CompositorScriptCompiler2 | ( |  | ) |

## Member Function Documentation

void Ogre::CompositorScriptCompiler2::setListener | ( | CompositorScriptCompilerListener * | listener | ) |

Sets the listener used for overriding compiler functions.

bool Ogre::CompositorScriptCompiler2::compileImpl | ( | ScriptNodeListPtr | nodes | ) | `[protected]`

This is the implementation for compiling the compositor scripts.

bool Ogre::CompositorScriptCompiler2::processNode | ( | ScriptNodeList::iterator & | i,
|  | ScriptNodeList::iterator & | end |
| ) |  |  | `[protected]`

This allows for overriding processing of script nodes.

ScriptNodeListPtr Ogre::CompositorScriptCompiler2::loadImportPath | ( | const String & | name | ) | `[protected]`

This is the override for loading imports.

Reimplemented from Ogre::ScriptCompiler.

void Ogre::CompositorScriptCompiler2::preParse | ( |  | ) | `[protected]`

Allows a listener to override the word id map before parsing.

bool Ogre::CompositorScriptCompiler2::errorRaised | ( | const ScriptCompilerErrorPtr & | error | ) | `[protected]`

Allows a listener to override error handling in the compiler.

void Ogre::CompositorScriptCompiler2::compileCompositor | ( | const ScriptNodePtr & | node | ) | `[private]`

void Ogre::CompositorScriptCompiler2::compileTechnique | ( | const ScriptNodePtr & | node | ) | `[private]`

void Ogre::CompositorScriptCompiler2::compileTarget | ( | const ScriptNodePtr & | node,
|  | CompositionTechnique * | technique |
| ) |  |  | `[private]`

void Ogre::CompositorScriptCompiler2::compileTargetOutput | ( | const ScriptNodePtr & | node,
|  | CompositionTechnique * | technique |
| ) |  |  | `[private]`

void Ogre::CompositorScriptCompiler2::compilePass | ( | const ScriptNodePtr & | node,
|  | CompositionTargetPass * | target |
| ) |  |  | `[private]`

void Ogre::CompositorScriptCompiler2::compileTargetOptions | ( | ScriptNodeList::iterator & | i,
|  | ScriptNodeList::iterator & | end,
|  | CompositionTargetPass * | target |
| ) |  |  | `[private]`

bool Ogre::CompositorScriptCompiler2::getCompareFunction | ( | const ScriptNodePtr & | node,
|  | CompareFunction & | func |
| ) |  |  | `[private]`

bool Ogre::CompositorScriptCompiler2::getStencilOp | ( | const ScriptNodePtr & | node,
|  | StencilOperation & | op |
| ) |  |  | `[private]`

bool Ogre::CompositorScriptCompiler2::getColourValue | ( | ScriptNodeList::iterator & | i,
|  | ScriptNodeList::iterator & | end,
|  | ColourValue & | c |
| ) |  |  | `[private]`

static String Ogre::ScriptCompiler::formatErrorCode | ( | uint32 | code | ) | `[static, inherited]`

bool Ogre::ScriptCompiler::compile | ( | const String & | str,
|  | const String & | source,
|  | const String & | group |
| ) |  |  | `[inherited]`

Takes in a string of script code and compiles it into resources.

Parameters:

  | str | The script code
  | source | The source of the script code (e.g. a script file)
  | group | The resource group to place the compiled resources into

bool Ogre::ScriptCompiler::compile | ( | const ConcreteNodeListPtr & | nodes,
|  | const String & | group |
| ) |  |  | `[inherited]`

Compiles resources from the given concrete node list.

bool Ogre::ScriptCompiler::_compile | ( | AbstractNodeListPtr | nodes,
|  | const String & | group |
| ) |  |  | `[inherited]`

Compiles the given abstract syntax tree.

void Ogre::ScriptCompiler::addError | ( | uint32 | code,
|  | const String & | file,
|  | int | line,
|  | const String & | msg = `""` |
| ) |  |  | `[inherited]`

Adds the given error to the compiler's list of errors.

void Ogre::ScriptCompiler::setListener | ( | ScriptCompilerListener * | listener | ) | `[inherited]`

Sets the listener used by the compiler.

ScriptCompilerListener* Ogre::ScriptCompiler::getListener | ( |  | ) | `[inherited]`

Returns the currently set listener.

const String& Ogre::ScriptCompiler::getResourceGroup | ( |  | ) | const`[inherited]`

Returns the resource group currently set for this compiler.

void Ogre::ScriptCompiler::addNameExclusion | ( | const String & | type | ) | `[inherited]`

Adds a name exclusion to the map.

Name exclusions identify object types which cannot accept names. This means that excluded types will always have empty names. All values in the object header are stored as object values.

void Ogre::ScriptCompiler::removeNameExclusion | ( | const String & | type | ) | `[inherited]`

Removes a name exclusion.

bool Ogre::ScriptCompiler::_fireEvent | ( | const String & | name,
|  | const std::vector< Any > & | args,
|  | Any * | retval |
| ) |  |  | `[inherited]`

Internal method for firing the handleEvent method.

Any Ogre::ScriptCompiler::_fireCreateObject | ( | const String & | type,
|  | const std::vector< Any > & | args |
| ) |  |  | `[inherited]`

Internal method for firing the createObject event.

template<class Alloc>

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func |
| ) |  |  | `[inherited]`

operator new, with debug line info

Definition at line 62 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) | `[inherited]`

Definition at line 67 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | void * | ptr |
| ) |  |  | `[inherited]`

placement operator new

Definition at line 73 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func |
| ) |  |  | `[inherited]`

array operator new, with debug line info

Definition at line 79 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) | `[inherited]`

Definition at line 84 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) | `[inherited]`

Definition at line 89 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | void * |  |
| ) |  |  | `[inherited]`

Definition at line 95 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |  |
| ) |  |  | `[inherited]`

Definition at line 101 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) | `[inherited]`

Definition at line 106 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |  |
| ) |  |  | `[inherited]`

Definition at line 112 of file OgreMemoryAllocatedObject.h.

## Member Data Documentation

CompositorScriptCompilerListener* Ogre::CompositorScriptCompiler2::mListener `[private]`

Reimplemented from Ogre::ScriptCompiler.

Definition at line 151 of file OgreCompositorScriptCompiler2.h.

Compositor* Ogre::CompositorScriptCompiler2::mCompositor `[private]`

Definition at line 153 of file OgreCompositorScriptCompiler2.h.

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

- OgreCompositorScriptCompiler2.h

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Jul 26 11:33:02 2009