proj home

Files   Classes   Functions   Hierarchy  

tessD2draw02circles< TESS, PT, INDX > Class Template Reference

Circle through three points of triangle. More...

#include <tessD2draw02.h>

Inheritance diagram for tessD2draw02circles< TESS, PT, INDX >:
Collaboration diagram for tessD2draw02circles< TESS, PT, INDX >:

List of all members.

Public Member Functions

 tessD2draw02circles (TESS &tess_, bool &isdrawn_)
 Constructor.
void draw ()
 Draw to the global graphics stream.

Public Attributes

boolisdrawn
 Toggle the display.
double blend
 The alpha component.


Detailed Description

template<typename TESS, typename PT, typename INDX>
class tessD2draw02circles< TESS, PT, INDX >

Circle through three points of triangle.

Definition at line 125 of file tessD2draw02.h.


Constructor & Destructor Documentation

template<typename TESS, typename PT, typename INDX>
tessD2draw02circles< TESS, PT, INDX >::tessD2draw02circles ( TESS &  tess_,
bool isdrawn_ 
) [inline]

Constructor.

Definition at line 137 of file tessD2draw02.h.

00138     : tess(tess_), isdrawn(isdrawn_), blend(0.5) {}


Member Function Documentation

template<typename TESS , typename PT , typename INDX >
void tessD2draw02circles< TESS, PT, INDX >::draw (  )  [inline, virtual]

Draw to the global graphics stream.

Implements gobj.

Definition at line 163 of file tessD2draw02.h.

References tessD2draw02circles< TESS, PT, INDX >::blend, gobjpush, tessD2draw02circles< TESS, PT, INDX >::isdrawn, triangle< PT, PD >::outercircle(), gobjContainer::push(), and r.

00164 {
00165   gobjContainer & y = * new gobjContainer(true);
00166 
00167   y.push( new gobjglPushAttrib(GL_CURRENT_BIT));
00168   y.push( new gobjglPushAttrib(GL_LIGHTING_BIT));
00169 
00170   y.push(new gobjglDisable(GL_LIGHTING));
00171   y.push( new gobjglEnable(GL_BLEND));
00172   y.push( new gobjglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA));
00173 
00174   gobjMyCircle * cir = new gobjMyCircle();
00175   y.push(cir);
00176 
00177   triangle<pt2,double> t;
00178   pt2 p0;
00179   double radius;
00180   typedef point3<double> pt3;
00181 
00182   random11<double> r;
00183 
00184   INDX const imax = tess.vi.size();
00185   for (INDX i=1; i<imax; ++i)
00186   {
00187     if (tess.vi[i].isnull())
00188       continue;
00189 
00190     y.push(new gobjglColor4f(r(),r(),r(),blend));
00191 
00192     get(t,tess.pts,tess.vi[i]);
00193 
00194     t.outercircle(radius,p0);
00195 
00196 //cout << SHOW(radius) << " " << SHOW(p0) << endl;
00197 
00198     y.push( new gobjMyCircleDraw(radius, pt3(p0), *cir) );
00199   }
00200 
00201   //y.push( new gobjglEnd());
00202 
00203   y.push( new gobjglPopAttrib());
00204   y.push( new gobjglPopAttrib());
00205 
00206 //cout << SHOW(y.vg.size()) << endl;
00207 //cout << SHOW(isdrawn) << endl;
00208 
00209   gobjSwitch<bool&> * s = 
00210     new gobjSwitch<bool&>(&y,isdrawn);
00211 
00212   gobjpush(s);
00213 }


Member Data Documentation

template<typename TESS, typename PT, typename INDX>
double tessD2draw02circles< TESS, PT, INDX >::blend

The alpha component.

Definition at line 134 of file tessD2draw02.h.

Referenced by tessD2draw02circles< TESS, PT, INDX >::draw().

template<typename TESS, typename PT, typename INDX>
bool& tessD2draw02circles< TESS, PT, INDX >::isdrawn

Toggle the display.

Definition at line 131 of file tessD2draw02.h.

Referenced by tessD2draw02circles< TESS, PT, INDX >::draw().


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