proj home

Files   Classes   Functions   Hierarchy  

test01obj< P, PD > Class Template Reference

#include <test01obj.h>

Inheritance diagram for test01obj< P, PD >:
Collaboration diagram for test01obj< P, PD >:

List of all members.

Public Member Functions

 test01obj (pftessinit tessinit, P *cp, int &argc, char **&argv, uintc mode, uintc x, uintc y, string const &title)
void keyboard (unsigned char key, int x, int y)
 Derived classes define keyboard.
void display ()
 Derived classes define display.
void eval ()
 Generally responsible for graphics initialization.

Public Attributes

zpr zz
menu01< test01obj< P, PD > > menu
gobjContainer xGraphics
d3tessmesh
d3tessdrawmeshdraw
d3clippingclip
d2partitiondraw< PD > * hdraw


Detailed Description

template<typename P, typename PD>
class test01obj< P, PD >

Definition at line 12 of file test01obj.h.


Constructor & Destructor Documentation

template<typename P, typename PD>
test01obj< P, PD >::test01obj ( pftessinit  tessinit,
P *  cp,
int &  argc,
char **&  argv,
uintc  mode,
uintc  x,
uintc  y,
string const &  title 
) [inline]

Definition at line 29 of file test01obj.h.

References test01obj< P, PD >::clip, d3tessdraw::graphicsDeffered, test01obj< P, PD >::hdraw, test01obj< P, PD >::menu, test01obj< P, PD >::mesh, menu01< T >::meshAoffset, test01obj< P, PD >::meshdraw, d3tessdraw::meshupdate(), d3tessdraw::multicolor, d3tessdraw::points, gobjContainer::set(), d3tessdraw::simplexes, test01obj< P, PD >::xGraphics, and d3clipping::zero.

00039     : myglutgui(argc,argv,mode,x,y,title), menu(*this)
00040   {
00041     set();
00042 
00043     xGraphics.set();
00044 
00045     unsigned int N(1000);
00046     mesh = new d3tess(N);
00047     assert(tessinit!=0);
00048     (*tessinit)(*mesh);
00049 
00050     meshdraw = new d3tessdraw(*mesh);
00051     meshdraw->graphicsDeffered.v[d3tessdraw::multicolor]->isdrawn = true;
00052     meshdraw->graphicsDeffered.v[d3tessdraw::points]->isdrawn = true;
00053     meshdraw->graphicsDeffered.v[d3tessdraw::simplexes]->isdrawn = true;
00054     meshdraw->meshupdate();
00055 
00056     xGraphics.push_back(new gobjglPushMatrix());
00057     xGraphics.push_back(& menu.meshAoffset);
00058 
00059     xGraphics.push_back(meshdraw);
00060 
00061     xGraphics.push_back(new gobjglPopMatrix());
00062 
00063     clip = new d3clipping(*mesh,*cp);
00064     clip->zero = 1.0e-10;
00065 
00066     hdraw = new d2partitiondraw<PD>(*new PD(*cp));
00067     xGraphics.push_back(hdraw);
00068 //cout << SHOW(xGraphics.vg.size()) << endl;
00069   }


Member Function Documentation

template<typename P, typename PD>
void test01obj< P, PD >::display (  )  [inline, virtual]

Derived classes define display.

Implements myglutgui.

Definition at line 74 of file test01obj.h.

References gobjContainer::draw(), menu01< T >::draw(), glerrordisplay(), test01obj< P, PD >::menu, and test01obj< P, PD >::xGraphics.

00075   {
00076     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
00077 
00078     menu.draw();
00079 
00080     xGraphics.draw();
00081 
00082     glerrordisplay();
00083     glutSwapBuffers();
00084   }

template<typename P, typename PD>
void test01obj< P, PD >::eval (  )  [inline, virtual]

Generally responsible for graphics initialization.

Not useful for classes with multiple initializations and hence this function is not abstract.

Reimplemented from myglutgui.

Definition at line 86 of file test01obj.h.

References gobjContainer::set(), zpr::update(), test01obj< P, PD >::xGraphics, and test01obj< P, PD >::zz.

Referenced by main().

00087   {
00088     OpenGLinitialisation();
00089   
00090     glEnable(GL_DEPTH_TEST);
00091     glEnable(GL_CULL_FACE);
00092 
00093     xGraphics.set();
00094 
00095     glMatrixMode(GL_MODELVIEW);
00096     glLoadIdentity();
00097     gluLookAt
00098     (
00099       3.0,0.0,6.0,  // Eye
00100       3.0,0.0,0.0,  // Center
00101       0.0,1.0,0.0   // Up
00102     );
00103 
00104     zz.update();
00105 
00106 
00107     glutPostRedisplay();
00108   }

template<typename P, typename PD>
void test01obj< P, PD >::keyboard ( unsigned char  key,
int  x,
int  y 
) [inline, virtual]

Derived classes define keyboard.

Reimplemented from myglutgui.

Definition at line 71 of file test01obj.h.

References test01obj< P, PD >::menu, and menusystem::read().

00072     { menu.read(key); }


Member Data Documentation

template<typename P, typename PD>
d3clipping* test01obj< P, PD >::clip

Definition at line 24 of file test01obj.h.

Referenced by test01obj< P, PD >::test01obj().

template<typename P, typename PD>
d2partitiondraw< PD >* test01obj< P, PD >::hdraw

Definition at line 26 of file test01obj.h.

Referenced by test01obj< P, PD >::test01obj().

template<typename P, typename PD>
menu01< test01obj<P,PD> > test01obj< P, PD >::menu

template<typename P, typename PD>
d3tess* test01obj< P, PD >::mesh

Definition at line 22 of file test01obj.h.

Referenced by test01obj< P, PD >::test01obj().

template<typename P, typename PD>
d3tessdraw* test01obj< P, PD >::meshdraw

Definition at line 23 of file test01obj.h.

Referenced by test01obj< P, PD >::test01obj().

template<typename P, typename PD>
gobjContainer test01obj< P, PD >::xGraphics

template<typename P, typename PD>
zpr test01obj< P, PD >::zz

Definition at line 16 of file test01obj.h.

Referenced by test01obj< P, PD >::eval().


The documentation for this class was generated from the following file:

Generated on Fri Mar 4 00:50:19 2011 for Chelton Evans Source by  doxygen 1.5.8