00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef __GLUTTREE_H__
00013 #define __GLUTTREE_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 "doubleparam.h"
00028
00029 #include "3rdparty/glut_subset/glut.h"
00030
00031
00036 class GlutTree : public CmdTreeNode
00037 {
00038 public:
00039 GlutTree()
00040 : CmdTreeNode( "GLUT", new QPtrList<CmdTreeNode> )
00041 {
00042
00043
00044
00045
00046 mySubTree->append( new CmdTreeNode( "glutWireSphere", NULL, cmd_glutWireSphere,
00047 new SuperPtrList<CmdParam>( 3,
00048 new DoubleParam( "radius", "1", "GLdouble" ),
00049 new IntParam( "slices", "12", "GLint" ),
00050 new IntParam( "stacks", "12", "GLint" ) ) ) );
00051 mySubTree->append( new CmdTreeNode( "glutSolidSphere", NULL, cmd_glutSolidSphere,
00052 new SuperPtrList<CmdParam>( 3,
00053 new DoubleParam( "radius", "1", "GLdouble" ),
00054 new IntParam( "slices", "12", "GLint" ),
00055 new IntParam( "stacks", "12", "GLint" ) ) ) );
00056 mySubTree->append( new CmdTreeNode( "glutWireTorus", NULL, cmd_glutWireTorus,
00057 new SuperPtrList<CmdParam>( 4,
00058 new DoubleParam( "innerRadius", "0.4", "GLdouble" ),
00059 new DoubleParam( "outerRadius", "1", "GLdouble" ),
00060 new IntParam( "sides", "12", "GLint" ),
00061 new IntParam( "rings", "12", "GLint" ) ) ) );
00062 mySubTree->append( new CmdTreeNode( "glutSolidTorus", NULL, cmd_glutSolidTorus,
00063 new SuperPtrList<CmdParam>( 4,
00064 new DoubleParam( "innerRadius", "0.4", "GLdouble" ),
00065 new DoubleParam( "outerRadius", "1", "GLdouble" ),
00066 new IntParam( "sides", "12", "GLint" ),
00067 new IntParam( "rings", "12", "GLint" ) ) ) );
00068 mySubTree->append( new CmdTreeNode( "glutWireDodecahedron", NULL, cmd_glutWireDodecahedron, NULL ) );
00069 mySubTree->append( new CmdTreeNode( "glutSolidDodecahedron", NULL, cmd_glutSolidDodecahedron, NULL ) );
00070 mySubTree->append( new CmdTreeNode( "glutWireTeapot", NULL, cmd_glutWireTeapot,
00071 new SuperPtrList<CmdParam>( 1,
00072 new DoubleParam( "size", "1", "GLdouble" ) ) ) );
00073 mySubTree->append( new CmdTreeNode( "glutSolidTeapot", NULL, cmd_glutSolidTeapot,
00074 new SuperPtrList<CmdParam>( 1,
00075 new DoubleParam( "size", "1", "GLdouble" ) ) ) );
00076 mySubTree->append( new CmdTreeNode( "glutWireOctahedron", NULL, cmd_glutWireOctahedron, NULL ) );
00077 mySubTree->append( new CmdTreeNode( "glutSolidOctahedron", NULL, cmd_glutSolidOctahedron, NULL ) );
00078 mySubTree->append( new CmdTreeNode( "glutWireTetrahedron", NULL, cmd_glutWireTetrahedron, NULL ) );
00079 mySubTree->append( new CmdTreeNode( "glutSolidTetrahedron", NULL, cmd_glutSolidTetrahedron, NULL ) );
00080 mySubTree->append( new CmdTreeNode( "glutWireIcosahedron", NULL, cmd_glutWireIcosahedron, NULL ) );
00081 mySubTree->append( new CmdTreeNode( "glutSolidIcosahedron", NULL, cmd_glutSolidIcosahedron, NULL ) );
00082 }
00083
00084
00085
00086
00087
00088 static void cmd_glutWireSphere( const QStringList& p ) {
00089 glutWireSphere( p[0].toDouble(), p[1].toInt(), p[2].toInt() );
00090 }
00091 static void cmd_glutSolidSphere( const QStringList& p ) {
00092 glutSolidSphere( p[0].toDouble(), p[1].toInt(), p[2].toInt() );
00093 }
00094 static void cmd_glutWireTorus( const QStringList& p ) {
00095 glutWireTorus( p[0].toDouble(), p[1].toDouble(), p[2].toInt(), p[3].toInt() );
00096 }
00097 static void cmd_glutSolidTorus( const QStringList& p ) {
00098 glutSolidTorus( p[0].toDouble(), p[1].toDouble(), p[2].toInt(), p[3].toInt() );
00099 } static void cmd_glutWireDodecahedron( const QStringList& ) {
00100 glutWireDodecahedron();
00101 }
00102 static void cmd_glutSolidDodecahedron( const QStringList& ) {
00103 glutSolidDodecahedron();
00104 }
00105
00106 static void cmd_glutWireTeapot( const QStringList& p ) {
00107 glutWireTeapot( p[0].toDouble() );
00108 }
00109 static void cmd_glutSolidTeapot( const QStringList& p ) {
00110 glutSolidTeapot( p[0].toDouble() );
00111 } static void cmd_glutWireOctahedron( const QStringList& ) {
00112 glutWireOctahedron();
00113 }
00114 static void cmd_glutSolidOctahedron( const QStringList& ) {
00115 glutSolidOctahedron();
00116 }
00117 static void cmd_glutWireTetrahedron( const QStringList& ) {
00118 glutWireTetrahedron();
00119 }
00120 static void cmd_glutSolidTetrahedron( const QStringList& ) {
00121 glutSolidTetrahedron();
00122 }
00123 static void cmd_glutWireIcosahedron( const QStringList& ) {
00124 glutWireIcosahedron();
00125 }
00126 static void cmd_glutSolidIcosahedron( const QStringList& ) {
00127 glutSolidIcosahedron();
00128 }
00129
00130
00131 private:
00132
00133 };
00134
00135
00136 #endif // __GLUTTREE_H__