arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

GLUItem Class Reference

#include <GLItems.h>

Inheritance diagram for GLUItem:

GLItem GLUEdgeWidget GLUNodeWidget List of all members.

Detailed Description

a generic glu object.

Its drawGLDef() does nothing, but it does allow you to draw various items. A concrete subclass should implement "drawGLDef()" and call one or more of the draw-shape functions. You can also create a GLUItem and just call the draw-shape functions.

Definition at line 97 of file GLItems.h.

Slices & Stacks.

These define the subdivisions used to tesselate the quadric to a polygon.

int getSlice () const
void setSlice (int slice)
int getStack () const
void setStack (int stack)

Draw-shape, creates the geometry for a shape

void drawSphere (const gutz::vec3f &pos, float rad)
 GLUItem :: draw sphere.

void drawBar (const gutz::vec3f &start, const gutz::vec3f &end, float rad)
 GLUItem :: draw bar.


compile to a display list?

bool compiles () const
void setCompile (bool yes)

Public Member Functions

 GLUItem (int slice=20, int stack=20)
 GLUItem :: construct.

 GLUItem (const GLUItem &gi)
GLUItemoperator= (const GLUItem &gi)
 assign

virtual ~GLUItem ()
 GLUItem :: destruct.

GLUquadricObj * getObj () const
void drawGL ()
 drawGL handles some display list stuff for you, you have to call "setUP()" if the object changes and needs to have the disp list re-compiled.

void setUp (bool yes=true)
 object needs update? something changed, for display lists mostly

void initNames (unsigned int name1, unsigned int name2)
 gl name for picking + push "this pointer" as second name be sure to call "popNames when you are through" ...

void pushName (unsigned int name)
 push a name on the pick stack, keeps track of how many you pushed so that when you call popNames() they all come off

void popNames ()
 pop all names pushed on stack


Protected Member Functions

virtual void drawGLDef ()
 does nothing!!!


Protected Attributes

GLUquadricObj * _qobj
int _slice
int _stack
GLuint _listName
bool _compile
bool _update
int _numNames


Constructor & Destructor Documentation

GLUItem::GLUItem int  slice = 20,
int  stack = 20
 

GLUItem :: construct.

Definition at line 90 of file GLItems.cpp.

GLUItem::GLUItem const GLUItem gi  ) 
 

Definition at line 96 of file GLItems.cpp.

GLUItem::~GLUItem  )  [virtual]
 

GLUItem :: destruct.

Definition at line 117 of file GLItems.cpp.

References _qobj.


Member Function Documentation

bool GLItem::compiles  )  const [inline, inherited]
 

Definition at line 47 of file GLItems.h.

References GLItem::_compile.

void GLUItem::drawBar const gutz::vec3f start,
const gutz::vec3f end,
float  rad
 

GLUItem :: draw bar.

Definition at line 138 of file GLItems.cpp.

References _qobj, _slice, _stack, end, glMultMatrixf(), glPopMatrix(), glPushMatrix(), len, gutz::mat4f, start, gutz::vec3f, and gutz::vec3f_z.

Referenced by GLUEdgeWidget::drawGLDef().

void GLItem::drawGL  )  [inherited]
 

drawGL handles some display list stuff for you, you have to call "setUP()" if the object changes and needs to have the disp list re-compiled.

drawGL() only calls "drawGLDef()" if the display list is being recompiled or you turn compilation off.

See also:
setCompile

Definition at line 31 of file GLItems.cpp.

References GLItem::_compile, GLItem::_listName, GLItem::_update, GLItem::drawGLDef(), GL_COMPILE, glCallList(), glEndList(), glErr(), glGenLists(), glIsList(), and glNewList().

Referenced by GLUEdgeWidget::drawDef(), and GLUNodeWidget::drawDef().

virtual void GLUItem::drawGLDef  )  [inline, protected, virtual]
 

does nothing!!!

Implements GLItem.

Reimplemented in GLUNodeWidget, and GLUEdgeWidget.

Definition at line 128 of file GLItems.h.

void GLUItem::drawSphere const gutz::vec3f pos,
float  rad
 

GLUItem :: draw sphere.

Definition at line 125 of file GLItems.cpp.

References _qobj, _slice, _stack, glPopMatrix(), glPushMatrix(), and glTranslatef().

Referenced by GLUNodeWidget::drawGLDef(), and GLSurfaceWidget::drawQuad().

GLUquadricObj* GLUItem::getObj  )  const [inline]
 

Definition at line 104 of file GLItems.h.

References _qobj.

int GLUItem::getSlice  )  const [inline]
 

Definition at line 111 of file GLItems.h.

References _slice.

int GLUItem::getStack  )  const [inline]
 

Definition at line 113 of file GLItems.h.

References _stack.

void GLItem::initNames unsigned int  name1,
unsigned int  name2
[inherited]
 

gl name for picking + push "this pointer" as second name be sure to call "popNames when you are through" ...

the drawGL() calls initNames() draw() popNames()

Definition at line 60 of file GLItems.cpp.

References GLItem::pushName().

Referenced by GLUEdgeWidget::drawDef(), and GLUNodeWidget::drawDef().

GLUItem & GLUItem::operator= const GLUItem gi  ) 
 

assign

Definition at line 105 of file GLItems.cpp.

References _slice, _stack, and GLItem::setUp().

Referenced by GLUEdgeWidget::operator=(), and GLUNodeWidget::operator=().

void GLItem::popNames  )  [inherited]
 

pop all names pushed on stack

Definition at line 72 of file GLItems.cpp.

References GLItem::_numNames, and glPopName().

Referenced by GLUEdgeWidget::drawDef(), and GLUNodeWidget::drawDef().

void GLItem::pushName unsigned int  name  )  [inherited]
 

push a name on the pick stack, keeps track of how many you pushed so that when you call popNames() they all come off

Definition at line 66 of file GLItems.cpp.

References GLItem::_numNames, glPushName(), and name.

Referenced by GLItem::initNames().

void GLItem::setCompile bool  yes  )  [inline, inherited]
 

Definition at line 48 of file GLItems.h.

References GLItem::_compile.

void GLUItem::setSlice int  slice  )  [inline]
 

Definition at line 112 of file GLItems.h.

References _slice, and GLItem::setUp().

void GLUItem::setStack int  stack  )  [inline]
 

Definition at line 114 of file GLItems.h.

References _stack, and GLItem::setUp().

void GLItem::setUp bool  yes = true  )  [inline, inherited]
 

object needs update? something changed, for display lists mostly

Definition at line 55 of file GLItems.h.

References GLItem::_update.

Referenced by GLUEdgeWidget::appearanceChanged(), GLUNodeWidget::appearanceChanged(), operator=(), setSlice(), and setStack().


Member Data Documentation

bool GLItem::_compile [protected, inherited]
 

Definition at line 75 of file GLItems.h.

Referenced by GLItem::compiles(), GLItem::drawGL(), GLItem::GLItem(), and GLItem::setCompile().

GLuint GLItem::_listName [protected, inherited]
 

Definition at line 74 of file GLItems.h.

Referenced by GLItem::drawGL(), and GLItem::GLItem().

int GLItem::_numNames [protected, inherited]
 

Definition at line 77 of file GLItems.h.

Referenced by GLItem::GLItem(), GLItem::popNames(), and GLItem::pushName().

GLUquadricObj* GLUItem::_qobj [protected]
 

Definition at line 129 of file GLItems.h.

Referenced by drawBar(), drawSphere(), getObj(), and ~GLUItem().

int GLUItem::_slice [protected]
 

Definition at line 130 of file GLItems.h.

Referenced by drawBar(), drawSphere(), getSlice(), operator=(), and setSlice().

int GLUItem::_stack [protected]
 

Definition at line 131 of file GLItems.h.

Referenced by drawBar(), drawSphere(), getStack(), operator=(), and setStack().

bool GLItem::_update [protected, inherited]
 

Definition at line 76 of file GLItems.h.

Referenced by GLItem::drawGL(), GLItem::GLItem(), and GLItem::setUp().


The documentation for this class was generated from the following files:
Send questions, comments, and bug reports to:
jmk