proj home

Files   Classes   Functions   Hierarchy  

tetrahedrondraw< T, D > Class Template Reference

Create geometry from tetrahedron. Send to gobj graphics stack for processing. More...

#include <tetrahedrondraw.h>

Inheritance diagram for tetrahedrondraw< T, D >:
Collaboration diagram for tetrahedrondraw< T, D >:

List of all members.

Public Member Functions

 tetrahedrondraw (T const p0_, T const p1_, T const p2_, T const p3_)
void displayedges () const
void displaybase () const
void displaywinding () const


Detailed Description

template<typename T, typename D>
class tetrahedrondraw< T, D >

Create geometry from tetrahedron. Send to gobj graphics stack for processing.

Definition at line 14 of file tetrahedrondraw.h.


Constructor & Destructor Documentation

template<typename T , typename D >
tetrahedrondraw< T, D >::tetrahedrondraw ( T const   p0_,
T const   p1_,
T const   p2_,
T const   p3_ 
) [inline]

Definition at line 194 of file tetrahedrondraw.h.

00200   : tetrahedron<T,D>(p0_,p1_,p2_,p3_)
00201 {
00202 }


Member Function Documentation

template<typename T , typename D >
void tetrahedrondraw< T, D >::displaybase (  )  const [inline]

Definition at line 111 of file tetrahedrondraw.h.

References gobj::global, and gobjContainer::push().

Referenced by writebaseobj::draw().

00112 {
00113   gobjContainer* c = gobjContainer::global;
00114   c->push( new gobjglPushAttrib(GL_CURRENT_BIT) );
00115   c->push( new gobjglPushAttrib(GL_LIGHTING_BIT) );
00116 
00117   T N(tetrahedron<T,D>::hi[3].normal);
00118   T N2(N);
00119   N2 *= -1.0;
00120 
00121   c->push( new gobjglBegin(GL_TRIANGLES) );
00122 
00123   c->push( new gobjglColor3ub(255,0,0) );
00124   c->push( new gobjglNormal3f(N) );
00125   c->push( new gobjglVertex3f(tetrahedron<T,D>::pi[0]) );
00126   c->push( new gobjglColor3ub(0,255,0) );
00127   c->push( new gobjglNormal3f(N) );
00128   c->push( new gobjglVertex3f(tetrahedron<T,D>::pi[1]) );
00129   c->push( new gobjglColor3ub(0,0,255) );
00130   c->push( new gobjglNormal3f(N) );
00131   c->push( new gobjglVertex3f(tetrahedron<T,D>::pi[2]) );
00132 
00133 
00134   c->push( new gobjglColor3ub(0,0,255) );
00135   c->push( new gobjglNormal3f(N2) );
00136   c->push( new gobjglVertex3f(tetrahedron<T,D>::pi[2]) );
00137   c->push( new gobjglColor3ub(255,255,0) );
00138   c->push( new gobjglNormal3f(N2) );
00139   c->push( new gobjglVertex3f(tetrahedron<T,D>::pi[1]) );
00140   c->push( new gobjglColor3ub(255,0,0) );
00141   c->push( new gobjglNormal3f(N2) );
00142   c->push( new gobjglVertex3f(tetrahedron<T,D>::pi[0]) );
00143 
00144 
00145 
00146 
00147 
00148 
00149   c->push( new gobjglEnd() );
00150 
00151   c->push( new gobjglPopAttrib() );
00152   c->push( new gobjglPopAttrib() );
00153 }

template<typename T , typename D >
void tetrahedrondraw< T, D >::displayedges (  )  const [inline]

Definition at line 158 of file tetrahedrondraw.h.

References gobj::global, and gobjContainer::push().

Referenced by drawspheres01().

00159 {
00160   gobjContainer* c = gobjContainer::global;
00161 //  c->push_back( new gobjglPushAttrib(GL_CURRENT_BIT) );
00162 //  c->push_back( new gobjglPushAttrib(GL_LIGHTING_BIT) );
00163 
00164   //c->push_back( new gobjglColor3f(0.6,0.3,0.0) );
00165   c->push( new gobjglColor3ub(0,0,255) );
00166   c->push( new gobjglDisable(GL_LIGHTING) );
00167   c->push( new gobjglBegin(GL_LINES) );
00168 
00169   c->push( new gobjglVertex3f(tetrahedron<T,D>::pi[0]) );
00170   c->push( new gobjglVertex3f(tetrahedron<T,D>::pi[1]) );
00171   c->push( new gobjglVertex3f(tetrahedron<T,D>::pi[0]) );
00172   c->push( new gobjglVertex3f(tetrahedron<T,D>::pi[2]) );
00173   c->push( new gobjglVertex3f(tetrahedron<T,D>::pi[0]) );
00174   c->push( new gobjglVertex3f(tetrahedron<T,D>::pi[3]) );
00175 
00176   c->push( new gobjglVertex3f(tetrahedron<T,D>::pi[1]) );
00177   c->push( new gobjglVertex3f(tetrahedron<T,D>::pi[2]) );
00178   c->push( new gobjglVertex3f(tetrahedron<T,D>::pi[1]) );
00179   c->push( new gobjglVertex3f(tetrahedron<T,D>::pi[3]) );
00180 
00181   c->push( new gobjglVertex3f(tetrahedron<T,D>::pi[2]) );
00182   c->push( new gobjglVertex3f(tetrahedron<T,D>::pi[3]) );
00183 
00184   c->push( new gobjglEnd() );
00185 
00186 //  c->push_back( new gobjglPopAttrib() );
00187 //  c->push_back( new gobjglPopAttrib() );
00188 }

template<typename T , typename D >
void tetrahedrondraw< T, D >::displaywinding (  )  const [inline]

Definition at line 91 of file tetrahedrondraw.h.

References gobj::global, tetrahedron< T, D >::pi, gobjContainer::push(), and TET3SIDE.

Referenced by writewindingobj::draw().

00092 {
00093   gobjContainer & c = * gobjContainer::global;
00094 
00095   c.push( new gobjglEnable(GL_LIGHTING) );
00096 
00097   c.push( new gobjglBegin(GL_TRIANGLES) );
00098  
00099   TET3SIDE(hi[3],pi[0],pi[1],pi[2])
00100 
00101   TET3SIDE(hi[0],pi[2],pi[1],pi[3])
00102 
00103   TET3SIDE(hi[1],pi[3],pi[0],pi[2])
00104 
00105   TET3SIDE(hi[2],pi[1],pi[0],pi[3])
00106 
00107   c.push( new gobjglEnd() );
00108 }


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

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