00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef __ATTRIBSTREE_H__
00013 #define __ATTRIBSTREE_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 "enumparam.h"
00027 #include "floatparam.h"
00028
00029
00030
00035 class AttribsTree : public CmdTreeNode
00036 {
00037 public:
00038 AttribsTree()
00039 : CmdTreeNode( "Attributes", new QPtrList<CmdTreeNode> )
00040 {
00041
00042
00043
00044
00045 mySubTree->append( new CmdTreeNode( "glPointSize", NULL, cmd_glPointSize,
00046 new SuperPtrList<CmdParam>( 1,
00047 new FloatParam( "size", "1", "GLfloat" ) ) ) );
00048 mySubTree->append( new CmdTreeNode( "glLineWidth", NULL, cmd_glLineWidth,
00049 new SuperPtrList<CmdParam>( 1,
00050 new FloatParam( "width", "1", "GLfloat" ) ) ) );
00051 mySubTree->append( new CmdTreeNode( "glPushAttrib", NULL, cmd_glPushAttrib,
00052 new SuperPtrList<CmdParam>( 1,
00053 new EnumParam( "mask", "1048575",
00054 SuperValueList<char*>( 21,
00055 "GL_ALL_ATTRIB_BITS",
00056 "GL_ACCUM_BUFFER_BIT",
00057 "GL_COLOR_BUFFER_BIT",
00058 "GL_CURRENT_BIT",
00059 "GL_DEPTH_BUFFER_BIT",
00060 "GL_ENABLE_BIT",
00061 "GL_EVAL_BIT",
00062 "GL_FOG_BIT",
00063 "GL_HINT_BIT",
00064 "GL_LIGHTING_BIT",
00065 "GL_LINE_BIT",
00066 "GL_LIST_BIT",
00067 "GL_PIXEL_MODE_BIT",
00068 "GL_POINT_BIT",
00069 "GL_POLYGON_BIT",
00070 "GL_POLYGON_STIPPLE_BIT",
00071 "GL_SCISSOR_BIT",
00072 "GL_STENCIL_BUFFER_BIT",
00073 "GL_TEXTURE_BIT",
00074 "GL_TRANSFORM_BIT",
00075 "GL_VIEWPORT_BIT" ),
00076 SuperValueList<int>( 21,
00077 GL_ALL_ATTRIB_BITS,
00078 GL_ACCUM_BUFFER_BIT,
00079 GL_COLOR_BUFFER_BIT,
00080 GL_CURRENT_BIT,
00081 GL_DEPTH_BUFFER_BIT,
00082 GL_ENABLE_BIT,
00083 GL_EVAL_BIT,
00084 GL_FOG_BIT,
00085 GL_HINT_BIT,
00086 GL_LIGHTING_BIT,
00087 GL_LINE_BIT,
00088 GL_LIST_BIT,
00089 GL_PIXEL_MODE_BIT,
00090 GL_POINT_BIT,
00091 GL_POLYGON_BIT,
00092 GL_POLYGON_STIPPLE_BIT,
00093 GL_SCISSOR_BIT,
00094 GL_STENCIL_BUFFER_BIT,
00095 GL_TEXTURE_BIT,
00096 GL_TRANSFORM_BIT,
00097 GL_VIEWPORT_BIT ),
00098 "GLbitfield" ) ) ) );
00099 mySubTree->append( new CmdTreeNode( "glPopAttrib", NULL, cmd_glPopAttrib, NULL ) );
00100 }
00101
00102
00103
00104
00105
00106 static void cmd_glPointSize( const QStringList& p ) {
00107 glPointSize( p[0].toFloat() );
00108 }
00109 static void cmd_glLineWidth( const QStringList& p ) {
00110 glLineWidth( p[0].toFloat() );
00111 }
00112 static void cmd_glPushAttrib( const QStringList& p ) {
00113 glPushAttrib( p[0].toInt() );
00114 } static void cmd_glPopAttrib( const QStringList& ) {
00115 glPopAttrib();
00116 }
00117
00118
00119 private:
00120
00121 };
00122
00123
00124 #endif // __ATTRIBSTREE_H__