00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef __TRANSTREE_H__
00013 #define __TRANSTREE_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 "floatparam.h"
00027 #include "doubleparam.h"
00028
00029
00030
00035 class TransTree : public CmdTreeNode
00036 {
00037 public:
00038 TransTree()
00039 : CmdTreeNode( "Transformations", new QPtrList<CmdTreeNode> )
00040 {
00041
00042
00043
00044
00045 mySubTree->append( new CmdTreeNode( "glRotated", NULL, cmd_glRotated,
00046 new SuperPtrList<CmdParam>( 4,
00047 new DoubleParam( "angle", "45", "GLdouble" ),
00048 new DoubleParam( "x", "0", "GLdouble" ),
00049 new DoubleParam( "y", "0", "GLdouble" ),
00050 new DoubleParam( "z", "1", "GLdouble" ) ) ) );
00051 mySubTree->append( new CmdTreeNode( "glRotatef", NULL, cmd_glRotatef,
00052 new SuperPtrList<CmdParam>( 4,
00053 new FloatParam( "angle", "45", "GLfloat" ),
00054 new FloatParam( "x", "0", "GLfloat" ),
00055 new FloatParam( "y", "0", "GLfloat" ),
00056 new FloatParam( "z", "1", "GLfloat" ) ) ) );
00057 mySubTree->append( new CmdTreeNode( "glScaled", NULL, cmd_glScaled,
00058 new SuperPtrList<CmdParam>( 3,
00059 new DoubleParam( "x", "1", "GLdouble" ),
00060 new DoubleParam( "y", "1", "GLdouble" ),
00061 new DoubleParam( "z", "1", "GLdouble" ) ) ) );
00062 mySubTree->append( new CmdTreeNode( "glScalef", NULL, cmd_glScalef,
00063 new SuperPtrList<CmdParam>( 3,
00064 new FloatParam( "x", "1", "GLfloat" ),
00065 new FloatParam( "y", "1", "GLfloat" ),
00066 new FloatParam( "z", "1", "GLfloat" ) ) ) );
00067 mySubTree->append( new CmdTreeNode( "glTranslated", NULL, cmd_glTranslated,
00068 new SuperPtrList<CmdParam>( 3,
00069 new DoubleParam( "x", "0", "GLdouble" ),
00070 new DoubleParam( "y", "0", "GLdouble" ),
00071 new DoubleParam( "z", "0", "GLdouble" ) ) ) );
00072 mySubTree->append( new CmdTreeNode( "glTranslatef", NULL, cmd_glTranslatef,
00073 new SuperPtrList<CmdParam>( 3,
00074 new FloatParam( "x", "0", "GLfloat" ),
00075 new FloatParam( "y", "0", "GLfloat" ),
00076 new FloatParam( "z", "0", "GLfloat" ) ) ) );
00077 }
00078
00079
00080
00081
00082
00083 static void cmd_glRotated( const QStringList& p ) {
00084 glRotated( p[0].toDouble(), p[1].toDouble(), p[2].toDouble(), p[3].toDouble() );
00085 }
00086 static void cmd_glRotatef( const QStringList& p ) {
00087 glRotatef( p[0].toFloat(), p[1].toFloat(), p[2].toFloat(), p[3].toFloat() );
00088 }
00089 static void cmd_glScaled( const QStringList& p ) {
00090 glScaled( p[0].toDouble(), p[1].toDouble(), p[2].toDouble() );
00091 }
00092 static void cmd_glScalef( const QStringList& p ) {
00093 glScalef( p[0].toFloat(), p[1].toFloat(), p[2].toFloat() );
00094 }
00095 static void cmd_glTranslated( const QStringList& p ) {
00096 glTranslated( p[0].toDouble(), p[1].toDouble(), p[2].toDouble() );
00097 }
00098 static void cmd_glTranslatef( const QStringList& p ) {
00099 glTranslatef( p[0].toFloat(), p[1].toFloat(), p[2].toFloat() );
00100 }
00101
00102 private:
00103
00104 };
00105
00106
00107 #endif // __TRANSTREE_H__