proj home

Files   Classes   Functions   Hierarchy  

writesimplicesobj Class Reference

#include <d3tessdraw.h>

Inheritance diagram for writesimplicesobj:
Collaboration diagram for writesimplicesobj:

List of all members.

Public Member Functions

 writesimplicesobj (d3tess const &tess_)
void draw ()
 Draw the object.
 writesimplicesobj (d4tess const &_tess)
void draw () const


Detailed Description

Definition at line 113 of file d3tessdraw.h.


Constructor & Destructor Documentation

writesimplicesobj::writesimplicesobj ( d3tess const &  tess_  )  [inline]

Definition at line 118 of file d3tessdraw.h.

00119     : tess(tess_) {}

writesimplicesobj::writesimplicesobj ( d4tess const &  _tess  )  [inline]

Definition at line 67 of file d4tessdraw.h.

00068     : tess(_tess) {}


Member Function Documentation

void writesimplicesobj::draw (  )  const

Definition at line 301 of file d4tessdraw.cpp.

References gobj::global, d4tri::pi, d3tess::pt, and d3tess::vi.

00302 {
00303   gobjContainer & x = * gobjContainer::global;
00304 
00305   x.push_back( new gobjglPushAttrib(GL_CURRENT_BIT) );
00306   x.push_back( new gobjglPushAttrib(GL_LIGHTING_BIT) );
00307 
00308   x.push_back( new gobjglDisable(GL_LIGHTING) );
00309 
00310   x.push_back( new gobjglColor3f(1.0,0.0,0.0) );
00311     
00312   uintc n = tess.vi.size();
00313   vector< pt4 > v;
00314   uint k;
00315   pt4 w;
00316 
00317   // The first tet is void.
00318   v.push_back(w);  
00319 
00320   for (uint i=1; i<n; ++i)
00321   {
00322     d4tri const & t(tess.vi[i]);
00323     w = pt4();
00324 
00325     for (k=0; k<4; ++k)
00326       w += tess.pt[ t.pi[k] ];
00327 
00328     w *= 0.25;
00329     v.push_back(w);
00330   }
00331 
00332   displaypoints<pt4> dp(x,v,false);
00333 
00334   x.push_back( new gobjglPopAttrib() );
00335   x.push_back( new gobjglPopAttrib() );
00336 }

void writesimplicesobj::draw (  )  [virtual]

Draw the object.

Implements gobj.

Definition at line 139 of file d3tessdraw.cpp.

References gobj::global, simplexD2linked::pi, d3tess::pt, gobjContainer::push(), and d3tess::vi.

00140 {
00141   gobjContainer & x = * gobjContainer::global;
00142 
00143   x.push( new gobjglPushAttrib(GL_CURRENT_BIT) );
00144   x.push( new gobjglPushAttrib(GL_LIGHTING_BIT) );
00145 
00146   x.push( new gobjglDisable(GL_LIGHTING) );
00147 
00148   x.push( new gobjglColor3f(1.0,0.0,0.0) );
00149     
00150   uintc n = tess.vi.size();
00151   vector< pt3 > v;
00152   uint k;
00153   pt3 w;
00154 
00155   // The first tet is void.
00156   v.push_back(w);  
00157 
00158   for (uint i=1; i<n; ++i)
00159   {
00160     simplexD2linked const & t(tess.vi[i]);
00161     w = pt3();
00162 
00163     for (k=0; k<3; ++k)
00164       w += tess.pt[ t.pi[k] ];
00165 
00166     w *= 0.3333333333333;
00167     v.push_back(w);
00168   }
00169 
00170   //displaypoints<pt3> dp(x,v,false);
00171   pointsdisplay2D<pt3> dp(x,v,false);
00172 
00173   x.push( new gobjglPopAttrib() );
00174   x.push( new gobjglPopAttrib() );
00175 }


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

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