proj home

Files   Classes   Functions   Hierarchy  

Public Member Functions | Public Attributes | List of all members
writegridobj Class Reference

#include <d3tessdraw.h>

Inheritance diagram for writegridobj:
Inheritance graph
Collaboration diagram for writegridobj:
Collaboration graph

Public Member Functions

 writegridobj (d3tess const &tess_)
void draw ()
 Draw the object.
 writegridobj (d4tess const &_tess)
void draw () const
- Public Member Functions inherited from gobj
virtual ~gobj ()
 Destructor.

Public Attributes

gobjglColor3ub gridcolor

Additional Inherited Members

- Static Public Member Functions inherited from gobj
static void globaldisplaylist (uintc id)
 Convert the global graphics into a display list.
- Static Public Attributes inherited from gobj
static gobjContainerglobal = 0
 The graphics stream.

Detailed Description

Definition at line 99 of file d3tessdraw.h.

Constructor & Destructor Documentation

writegridobj::writegridobj ( d3tess const &  tess_)
inline

Definition at line 107 of file d3tessdraw.h.

: tess(tess_), gridcolor(gobjglColor3ub(0,0,255)) {}
writegridobj::writegridobj ( d4tess const &  _tess)
inline

Definition at line 110 of file d4tessdraw.h.

: tess(_tess), gridcolor(gobjglColor3ub(0,0,255)) {}

Member Function Documentation

void writegridobj::draw ( )
virtual

Draw the object.

Implements gobj.

Definition at line 99 of file d3tessdraw.cpp.

References simplexD2linked::isnull(), simplexD2linked::pi, point3< T >::x, and point3< T >::y.

{
glPushAttrib(GL_CURRENT_BIT);
glPushAttrib(GL_LIGHTING_BIT);
vector<pt3> const & pt(tess.pt);
vector<simplexD2linked> const & vi(tess.vi);
glBegin(GL_LINES);
uintc imax = tess.vi.size();
for (uint i=1; i<imax; ++i)
{
simplexD2linked const & t(vi[i]);
if (t.isnull())
continue;
pt3c & P0(pt[t.pi[0]]);
pt3c & P1(pt[t.pi[1]]);
pt3c & P2(pt[t.pi[2]]);
glVertex2f(P0.x,P0.y);
glVertex2f(P1.x,P1.y);
glVertex2f(P0.x,P0.y);
glVertex2f(P2.x,P2.y);
glVertex2f(P1.x,P1.y);
glVertex2f(P2.x,P2.y);
}
glEnd();
glPopAttrib();
glPopAttrib();
}
void writegridobj::draw ( ) const

Definition at line 246 of file d4tessdraw.cpp.

References gobj::global, gridcolor, d4tri::isnull(), d4tri::pi, d3tess::pt, d3tess::vi, point4< T >::x, point4< T >::y, and point4< T >::z.

{
x.push_back( new gobjglPushAttrib(GL_CURRENT_BIT) );
x.push_back( new gobjglPushAttrib(GL_LIGHTING_BIT) );
x.push_back( new gobjglDisable(GL_LIGHTING) );
x.push_back( new gobjglColor3ub(gridcolor) );
vector<pt4> const & pt(tess.pt);
vector<d4tri> const & vi(tess.vi);
x.push_back( new gobjglBegin(GL_LINES) );
uintc imax = tess.vi.size();
for (uint i=1; i<imax; ++i)
{
d4tri const & t(vi[i]);
if (t.isnull())
continue;
pt4c & P0(pt[t.pi[0]]);
pt4c & P1(pt[t.pi[1]]);
pt4c & P2(pt[t.pi[2]]);
pt4c & P3(pt[t.pi[3]]);
x.push_back( new gobjglVertex3f(P0.x,P0.y,P0.z) );
x.push_back( new gobjglVertex3f(P1.x,P1.y,P1.z) );
x.push_back( new gobjglVertex3f(P0.x,P0.y,P0.z) );
x.push_back( new gobjglVertex3f(P2.x,P2.y,P2.z) );
x.push_back( new gobjglVertex3f(P0.x,P0.y,P0.z) );
x.push_back( new gobjglVertex3f(P3.x,P3.y,P3.z) );
x.push_back( new gobjglVertex3f(P1.x,P1.y,P1.z) );
x.push_back( new gobjglVertex3f(P2.x,P2.y,P2.z) );
x.push_back( new gobjglVertex3f(P1.x,P1.y,P1.z) );
x.push_back( new gobjglVertex3f(P3.x,P3.y,P3.z) );
x.push_back( new gobjglVertex3f(P2.x,P2.y,P2.z) );
x.push_back( new gobjglVertex3f(P3.x,P3.y,P3.z) );
}
x.push_back( new gobjglEnd() );
x.push_back( new gobjglPopAttrib() );
x.push_back( new gobjglPopAttrib() );
}

Member Data Documentation

gobjglColor3ub writegridobj::gridcolor

Definition at line 105 of file d3tessdraw.h.

Referenced by draw().


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