GenOp Class Reference

#include <shaderOp.h>

Inheritance diagram for GenOp:

Inheritance graph
[legend]
List of all members.

Detailed Description

GenOp - General Operation - Very useful for combining several variables into one LangElement statement. It uses an elipses as a parameter, so it can take as many variables as you can throw at it. It takes a string and parses it for the '@' symbol which it replaces with passed in parameters. Similar to the C statement printf(). Here's an example:

   ( assuming three variables var1, var2, var3 exist and their assigned names
     are var1Name, var2Name, and var3Name )
   
   LangElement *statement = new GenOp( "  @ = @ * @.x + @.y;", var1, var1, var2, var3 );

The output in the shader file would be:

   var1Name = var1Name * var2Name.x + var3Name.y;


Public Member Functions

 GenOp (const char *statement,...)
virtual void print (Stream &stream)

Private Types

typedef ShaderOp Parent

Private Attributes

Vector< LangElement * > mElemList


Member Typedef Documentation

typedef ShaderOp GenOp::Parent [private]


Constructor & Destructor Documentation

GenOp::GenOp ( const char *  statement,
  ... 
)


Member Function Documentation

virtual void GenOp::print ( Stream stream  )  [virtual]

Reimplemented from LangElement.


Member Data Documentation