edu.ohiou.cs456_badabing.sceneapi.visualize
Class Sphere

java.lang.Object
  extended by edu.ohiou.cs456_badabing.sceneapi.basic.ANode
      extended by edu.ohiou.cs456_badabing.sceneapi.visualize.Sphere

public class Sphere
extends ANode

draws Spheres.

Description: This class extends ANode, and renders a sphere.

Copyright: Copyright (c) 2008, Lev A Neiman

Company: Ohio University EECS


Field Summary
private static int detail
          detail to use for Sphere.
private static int g_disp_list
          display list handle.
private static Material mtl
          material to use for all spheres.
static boolean need_to_generate_display_list
          if this is true, then display list needs to be (re)generated.
private  float radius
          size of the sphere as radius.
 
Fields inherited from class edu.ohiou.cs456_badabing.sceneapi.basic.ANode
children, display_list, name, no_disp_list, parent, ppop, rotation, rotation_angle, scale, show, translation
 
Constructor Summary
Sphere()
          default constructor.
 
Method Summary
 float getRadius()
          return radius.
 void render(GLAutoDrawable panel)
          generates display list if needed.
 void setRadius(float new_radius)
          sets the new radius for this sphere.
static void setTransperency(float new_transperency)
          set new transpereny for all Spheres.
 
Methods inherited from class edu.ohiou.cs456_badabing.sceneapi.basic.ANode
addChild, countNodes, drawCube, getName, getNormal, hideTree, pushPop, renderTree, rotation, scale, setName, setParent, setPushPop, showTree, translation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

radius

private float radius
size of the sphere as radius.


detail

private static int detail
detail to use for Sphere. The higher, the more detailed it is, but also is not rendered as fast.


mtl

private static Material mtl
material to use for all spheres.


need_to_generate_display_list

public static boolean need_to_generate_display_list
if this is true, then display list needs to be (re)generated.


g_disp_list

private static int g_disp_list
display list handle.

Constructor Detail

Sphere

public Sphere()
default constructor.

Method Detail

setTransperency

public static void setTransperency(float new_transperency)
set new transpereny for all Spheres. this causes display list to be re-generated.

Parameters:
new_transperency - float

setRadius

public void setRadius(float new_radius)
sets the new radius for this sphere.

Parameters:
new_radius - float

getRadius

public float getRadius()
return radius.

Returns:
float

render

public void render(GLAutoDrawable panel)
generates display list if needed. Remember that ANode can render display lists, which is what it does after the display list has been generated.

Overrides:
render in class ANode
Parameters:
panel - GLAutoDrawable