proj home

Files   Classes   Functions   Hierarchy  

writesurfaceobj Class Reference

#include <d3tessdraw.h>

Inheritance diagram for writesurfaceobj:
Collaboration diagram for writesurfaceobj:

List of all members.

Public Member Functions

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

Public Attributes

gobjglColor3ub surfacecolor
d3marchdisp surface
d4marchdisp surface


Detailed Description

Definition at line 136 of file d3tessdraw.h.


Constructor & Destructor Documentation

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

Definition at line 147 of file d3tessdraw.h.

00148     : tess(tess_), surfacecolor(gobjglColor3ub(255,0,0)) {}

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

Definition at line 96 of file d4tessdraw.h.

00097     : tess(_tess), surfacecolor(gobjglColor3ub(255,0,0)) {}


Member Function Documentation

void writesurfaceobj::draw (  )  const

Definition at line 215 of file d4tessdraw.cpp.

References d3marchdisp::eval(), gobj::global, d4tri::isnull(), d4tri::pi, d3tess::pt, surface, surfacecolor, and d3tess::vi.

00216 {
00217   gobjContainer & x = * gobjContainer::global;
00218 
00219   x.push_back( new gobjglPushAttrib(GL_CURRENT_BIT) );
00220   x.push_back( new gobjglPushAttrib(GL_LIGHTING_BIT) );
00221 
00222   x.push_back( new gobjglEnable(GL_LIGHTING) );
00223 
00224   x.push_back( new gobjglColor3ub(surfacecolor) );
00225 
00226   uintc imax = tess.vi.size();
00227   for (uint i=1; i<imax; ++i)
00228   {
00229     d4tri t(tess.vi[i]);
00230 
00231     if (t.isnull())
00232       continue;
00233 
00234     pt4c & P0(tess.pt[t.pi[0]]); 
00235     pt4c & P1(tess.pt[t.pi[1]]); 
00236     pt4c & P2(tess.pt[t.pi[2]]); 
00237     pt4c & P3(tess.pt[t.pi[2]]); 
00238 
00239     surface.eval(P0,P1,P2,P3);
00240   }
00241 
00242   x.push_back( new gobjglPopAttrib() );
00243   x.push_back( new gobjglPopAttrib() );
00244 }

void writesurfaceobj::draw (  )  [virtual]

Draw the object.

Implements gobj.

Definition at line 25 of file d3tessdraw.cpp.

References gobjglColor3ub::draw(), d3marchdisp::eval(), simplexD2linked::isnull(), simplexD2linked::pi, d3tess::pt, surface, surfacecolor, and d3tess::vi.

00026 {
00027   surfacecolor.draw();
00028     
00029   uintc imax = tess.vi.size();
00030   for (uint i=1; i<imax; ++i)
00031   {
00032     simplexD2linked t(tess.vi[i]);
00033 
00034     if (t.isnull())
00035       continue;
00036 
00037     pt3c & P0(tess.pt[t.pi[0]]); 
00038     pt3c & P1(tess.pt[t.pi[1]]); 
00039     pt3c & P2(tess.pt[t.pi[2]]); 
00040 
00041     surface.eval(P0,P1,P2);
00042   }
00043 }


Member Data Documentation

Definition at line 94 of file d4tessdraw.h.

Definition at line 145 of file d3tessdraw.h.

Referenced by draw().

Definition at line 142 of file d3tessdraw.h.

Referenced by draw().


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