proj home

Files   Classes   Functions   Hierarchy  

gobjMySphereDraw Class Reference

Draw a translated sphere. More...

#include <graphmisc.h>

Inheritance diagram for gobjMySphereDraw:
Collaboration diagram for gobjMySphereDraw:

List of all members.

Public Member Functions

 gobjMySphereDraw ()
 gobjMySphereDraw (floatc x_, floatc y_, floatc z_, gobjQuadric *quadric_)
 gobjMySphereDraw (doublec x_, doublec y_, doublec z_, gobjQuadric *quadric_)
 gobjMySphereDraw (point3< double > const &p, gobjQuadric *quadric_)
 gobjMySphereDraw (point3< float > const &p, gobjQuadric *quadric_)
 gobjMySphereDraw (point2< double > const &x, gobjQuadric *quadric_)
 gobjMySphereDraw (point2< double > const &x, gobjQuadric &quadricref)
 gobjMySphereDraw (point2< float > const &x, gobjQuadric *quadric_)
void draw ()
 Draw the object.

Public Attributes

gobjQuadricquadric
float x
float y
float z


Detailed Description

Draw a translated sphere.

The client supplies the quadric which allows for reuse - multiple spheres can use the same quadric.

Example
  gobjpush( new gobjglColor3ub(0,255,0) );

  gobjQuadric * q2 = new gobjQuadric();
  q2->radius = 0.02;
  q2->slices=20;
  q2->loops=6;
  gobjpush(q2);
  for (uint i=0; i<greenpoints.size(); ++i)
    gobjpush( new gobjMySphereDraw(greenpoints[i],q2) );

Definition at line 559 of file graphmisc.h.


Constructor & Destructor Documentation

gobjMySphereDraw::gobjMySphereDraw (  )  [inline]

Definition at line 569 of file graphmisc.h.

00570     : quadric(0), x(0.0), y(0.0), z(0.0) {}

gobjMySphereDraw::gobjMySphereDraw ( floatc  x_,
floatc  y_,
floatc  z_,
gobjQuadric quadric_ 
) [inline]

Definition at line 573 of file graphmisc.h.

00579     : quadric(quadric_), x(x_), y(y_), z(z_) {}

gobjMySphereDraw::gobjMySphereDraw ( doublec  x_,
doublec  y_,
doublec  z_,
gobjQuadric quadric_ 
) [inline]

Definition at line 582 of file graphmisc.h.

00588     : quadric(quadric_), x(x_), y(y_), z(z_) {}

gobjMySphereDraw::gobjMySphereDraw ( point3< double > const &  p,
gobjQuadric quadric_ 
) [inline]

Definition at line 591 of file graphmisc.h.

00595     : quadric(quadric_), x(p.x), y(p.y), z(p.z) {}

gobjMySphereDraw::gobjMySphereDraw ( point3< float > const &  p,
gobjQuadric quadric_ 
) [inline]

Definition at line 598 of file graphmisc.h.

00602     : quadric(quadric_), x(p.x), y(p.y), z(p.z) {}

gobjMySphereDraw::gobjMySphereDraw ( point2< double > const &  x,
gobjQuadric quadric_ 
) [inline]

Definition at line 605 of file graphmisc.h.

00609     : quadric(quadric_), x(x.x), y(x.y), z(0.0) {}

gobjMySphereDraw::gobjMySphereDraw ( point2< double > const &  x,
gobjQuadric quadricref 
) [inline]

Definition at line 613 of file graphmisc.h.

00617     : quadric(&quadricref), x(x.x), y(x.y), z(0.0) {}

gobjMySphereDraw::gobjMySphereDraw ( point2< float > const &  x,
gobjQuadric quadric_ 
) [inline]

Definition at line 620 of file graphmisc.h.

00624     : quadric(quadric_), x(x.x), y(x.y), z(0.0) {}


Member Function Documentation

void gobjMySphereDraw::draw (  )  [inline, virtual]

Draw the object.

Implements gobj.

Definition at line 626 of file graphmisc.h.

References GOBJDEBUGCODE, gobjQuadric::loops, gobjQuadric::quadric, quadric, gobjQuadric::radius, gobjQuadric::slices, and z.

00627   {
00628     GOBJDEBUGCODE
00629     assert(quadric!=0);
00630 
00631     glPushMatrix();
00632     glTranslatef(x,y,z);
00633     gluSphere(quadric->quadric,quadric->radius,quadric->slices,quadric->loops);
00634     glPopMatrix();
00635   }


Member Data Documentation

Definition at line 563 of file graphmisc.h.

Referenced by draw().

Definition at line 565 of file graphmisc.h.

Definition at line 566 of file graphmisc.h.

Definition at line 567 of file graphmisc.h.

Referenced by draw().


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

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