Main Page | Namespace List | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

materialtree.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002 *
00003 * Title:     MaterialTree
00004 * Filename:  src/materialtree.h
00005 * Generated: February 26, 2004 @ 21:00:38
00006 *        by: GENTREE - Generates C++ command tree header files for GLITCH.
00007 *
00008 * WARNING! All changes made in this file will be lost!
00009 *
00010 *******************************************************************************/
00011 
00012 #ifndef __MATERIALTREE_H__
00013 #define __MATERIALTREE_H__
00014 
00015 
00016 #include <qgl.h>
00017 #include <qptrlist.h>
00018 #include <qstring.h>
00019 #include <qstringlist.h>
00020 
00021 #include "cmdtreenode.h"
00022 #include "cmdparam.h"
00023 #include "superptrlist.h"
00024 #include "supervaluelist.h"
00025 
00026 #include "intparam.h"
00027 #include "enumparam.h"
00028 #include "arrayparam.h"
00029 #include "floatparam.h"
00030 
00031 
00032 
00037 class MaterialTree : public CmdTreeNode
00038 {
00039 public:
00040     MaterialTree()
00041         : CmdTreeNode( "Material", new QPtrList<CmdTreeNode> )
00042     {
00043 
00044         // Trees
00045 
00046         // Commands
00047         mySubTree->append( new CmdTreeNode( "glMaterialf", NULL, cmd_glMaterialf, 
00048                             new SuperPtrList<CmdParam>( 3,
00049                                 new EnumParam( "face", "1032", 
00050                                     SuperValueList<char*>( 3,
00051                                         "GL_FRONT",
00052                                         "GL_BACK",
00053                                         "GL_FRONT_AND_BACK" ),
00054                                     SuperValueList<int>( 3,
00055                                         GL_FRONT,
00056                                         GL_BACK,
00057                                         GL_FRONT_AND_BACK ),
00058                                     "GLenum" ), 
00059                                 new EnumParam( "pname", "5633", 
00060                                     SuperValueList<char*>( 1,
00061                                         "GL_SHININESS" ),
00062                                     SuperValueList<int>( 1,
00063                                         GL_SHININESS ),
00064                                     "GLenum" ), 
00065                                 new FloatParam( "param", "0", "GLfloat" ) ) ) );
00066         mySubTree->append( new CmdTreeNode( "glMateriali", NULL, cmd_glMateriali, 
00067                             new SuperPtrList<CmdParam>( 3,
00068                                 new EnumParam( "face", "1032", 
00069                                     SuperValueList<char*>( 3,
00070                                         "GL_FRONT",
00071                                         "GL_BACK",
00072                                         "GL_FRONT_AND_BACK" ),
00073                                     SuperValueList<int>( 3,
00074                                         GL_FRONT,
00075                                         GL_BACK,
00076                                         GL_FRONT_AND_BACK ),
00077                                     "GLenum" ), 
00078                                 new EnumParam( "pname", "5633", 
00079                                     SuperValueList<char*>( 1,
00080                                         "GL_SHININESS" ),
00081                                     SuperValueList<int>( 1,
00082                                         GL_SHININESS ),
00083                                     "GLenum" ), 
00084                                 new IntParam( "param", "0", "GLint" ) ) ) );
00085         mySubTree->append( new CmdTreeNode( "glMaterialfv", NULL, cmd_glMaterialfv, 
00086                             new SuperPtrList<CmdParam>( 3,
00087                                 new EnumParam( "face", "1032", 
00088                                     SuperValueList<char*>( 3,
00089                                         "GL_FRONT",
00090                                         "GL_BACK",
00091                                         "GL_FRONT_AND_BACK" ),
00092                                     SuperValueList<int>( 3,
00093                                         GL_FRONT,
00094                                         GL_BACK,
00095                                         GL_FRONT_AND_BACK ),
00096                                     "GLenum" ), 
00097                                 new EnumParam( "pname", "4608", 
00098                                     SuperValueList<char*>( 4,
00099                                         "GL_AMBIENT",
00100                                         "GL_DIFFUSE",
00101                                         "GL_EMISSION",
00102                                         "GL_SPECULAR" ),
00103                                     SuperValueList<int>( 4,
00104                                         GL_AMBIENT,
00105                                         GL_DIFFUSE,
00106                                         GL_EMISSION,
00107                                         GL_SPECULAR ),
00108                                     "GLenum" ), 
00109                                 new ArrayParam( "params", "material",
00110                                     new SuperPtrList<CmdParam>( 4,
00111                                         new FloatParam( "0", "0.5" ),
00112                                         new FloatParam( "1", "0.5" ),
00113                                         new FloatParam( "2", "0.5" ),
00114                                         new FloatParam( "3", "1" ) ),
00115                                     "GLfloat*" ) ) ) );
00116         mySubTree->append( new CmdTreeNode( "glMaterialiv", NULL, cmd_glMaterialiv, 
00117                             new SuperPtrList<CmdParam>( 3,
00118                                 new EnumParam( "face", "1032", 
00119                                     SuperValueList<char*>( 3,
00120                                         "GL_FRONT",
00121                                         "GL_BACK",
00122                                         "GL_FRONT_AND_BACK" ),
00123                                     SuperValueList<int>( 3,
00124                                         GL_FRONT,
00125                                         GL_BACK,
00126                                         GL_FRONT_AND_BACK ),
00127                                     "GLenum" ), 
00128                                 new EnumParam( "pname", "4608", 
00129                                     SuperValueList<char*>( 4,
00130                                         "GL_AMBIENT",
00131                                         "GL_DIFFUSE",
00132                                         "GL_EMISSION",
00133                                         "GL_SPECULAR" ),
00134                                     SuperValueList<int>( 4,
00135                                         GL_AMBIENT,
00136                                         GL_DIFFUSE,
00137                                         GL_EMISSION,
00138                                         GL_SPECULAR ),
00139                                     "GLenum" ), 
00140                                 new ArrayParam( "params", "material",
00141                                     new SuperPtrList<CmdParam>( 4,
00142                                         new IntParam( "0", "0" ),
00143                                         new IntParam( "1", "0" ),
00144                                         new IntParam( "2", "0" ),
00145                                         new IntParam( "3", "1" ) ),
00146                                     "GLint*" ) ) ) );
00147         mySubTree->append( new CmdTreeNode( "glColorMaterial", NULL, cmd_glColorMaterial, 
00148                             new SuperPtrList<CmdParam>( 2,
00149                                 new EnumParam( "face", "1032", 
00150                                     SuperValueList<char*>( 3,
00151                                         "GL_FRONT",
00152                                         "GL_BACK",
00153                                         "GL_FRONT_AND_BACK" ),
00154                                     SuperValueList<int>( 3,
00155                                         GL_FRONT,
00156                                         GL_BACK,
00157                                         GL_FRONT_AND_BACK ),
00158                                     "GLenum" ), 
00159                                 new EnumParam( "mode", "5634", 
00160                                     SuperValueList<char*>( 5,
00161                                         "GL_EMISSION",
00162                                         "GL_AMBIENT",
00163                                         "GL_DIFFUSE",
00164                                         "GL_SPECULAR",
00165                                         "GL_AMBIENT_AND_DIFFUSE" ),
00166                                     SuperValueList<int>( 5,
00167                                         GL_EMISSION,
00168                                         GL_AMBIENT,
00169                                         GL_DIFFUSE,
00170                                         GL_SPECULAR,
00171                                         GL_AMBIENT_AND_DIFFUSE ),
00172                                     "GLenum" ) ) ) );
00173     }
00174 
00175     // Note: In the unlikely (but serious) event that too few elements exist in
00176     //       the list of strings that is passed, the QStringList class will
00177     //       catch and handle the case as appropiate.
00178 
00179     static void cmd_glMaterialf( const QStringList& p ) {
00180         glMaterialf( p[0].toInt(), p[1].toInt(), p[2].toFloat() );
00181     }
00182     static void cmd_glMateriali( const QStringList& p ) {
00183         glMateriali( p[0].toInt(), p[1].toInt(), p[2].toInt() );
00184     }
00185     static void cmd_glMaterialfv( const QStringList& p ) {
00186         GLfloat params[4] = { p[2].toFloat(), p[3].toFloat(), p[4].toFloat(), p[5].toFloat() };
00187         glMaterialfv( p[0].toInt(), p[1].toInt(), params );
00188     }
00189     static void cmd_glMaterialiv( const QStringList& p ) {
00190         GLint params[4] = { p[2].toInt(), p[3].toInt(), p[4].toInt(), p[5].toInt() };
00191         glMaterialiv( p[0].toInt(), p[1].toInt(), params );
00192     }
00193     static void cmd_glColorMaterial( const QStringList& p ) {
00194         glColorMaterial( p[0].toInt(), p[1].toInt() );
00195     }
00196 
00197 private:
00198 
00199 };
00200 
00201 
00202 #endif // __MATERIALTREE_H__

Generated on Fri Feb 27 12:01:39 2004 for Glitch by doxygen 1.3.2