gizmoball.graphics
Class PrimitivesDrawer

java.lang.Object
  extended by gizmoball.graphics.PrimitivesDrawer

public class PrimitivesDrawer
extends java.lang.Object

Draws the primitives on the given opengl object. All of the commands only draw the geometry; all other states (such as textures, lighting, etc) must be set beforehand, and will not be changed. All the commands leave the position matrix the same way it was at the start of the call. ie, there is a call to glPushMatrix() at the beginning and a call to glPopMatrix() at the end. Only those properties are guaranteed to hold. It has no observable state.


Constructor Summary
PrimitivesDrawer()
           
 
Method Summary
 void drawCircle(PlaneCircle c, GL gl, GLU glu, GLUquadric quadric)
          Draws the specified circle, on the specified GL context.
 void drawCylinder(LateralCylinder l, GL gl, GLU glu, GLUquadric quadric)
          Draws the specified cylinder, on the specified GL context.
 void drawPolygon(PlanePolygon p, GL gl)
          Draws the specified polygon, in the specified GL context.
 void drawSphere(Sphere s, GL gl, GLU glu, GLUquadric quadric)
          Draws the specified sphere, on the specified GL context.
 void drawSphere(Sphere s, GL gl, GLU glu, GLUquadric quadric, int numSlices, int numStacks)
          Draws the specified sphere, on the specified GL context.
 void drawTorus(Torus t, GL gl)
          Draws the specified cylinder, on the specified GL context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrimitivesDrawer

public PrimitivesDrawer()
Method Detail

drawSphere

public void drawSphere(Sphere s,
                       GL gl,
                       GLU glu,
                       GLUquadric quadric)
Draws the specified sphere, on the specified GL context. You pass in the GLU object, and the quadric object holding the quadric information.


drawSphere

public void drawSphere(Sphere s,
                       GL gl,
                       GLU glu,
                       GLUquadric quadric,
                       int numSlices,
                       int numStacks)
Draws the specified sphere, on the specified GL context. You pass in the GLU object, and the quadric object holding the quadric information. You must also specify the quality of the sphere to be drawn.


drawPolygon

public void drawPolygon(PlanePolygon p,
                        GL gl)
Draws the specified polygon, in the specified GL context.


drawCircle

public void drawCircle(PlaneCircle c,
                       GL gl,
                       GLU glu,
                       GLUquadric quadric)
Draws the specified circle, on the specified GL context. You pass in the GLU object, and the quadric object holding the quadric information.


drawCylinder

public void drawCylinder(LateralCylinder l,
                         GL gl,
                         GLU glu,
                         GLUquadric quadric)
Draws the specified cylinder, on the specified GL context.


drawTorus

public void drawTorus(Torus t,
                      GL gl)
Draws the specified cylinder, on the specified GL context. You pass in the GLU object, and the quadric object holding the quadric information.