|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.ohiou.cs456_badabing.sceneapi.basic.ANode
edu.ohiou.cs456_badabing.sceneapi.visualize.PieChart
public class PieChart
Node that renders a Pie Chart
Description: Renders a pie chart where each slice represents numbers put in by the user.
Copyright: Copyright (c) 2008, Lev A Neiman
Company: Ohio University EECS
| Field Summary | |
|---|---|
static java.awt.Color[] |
colors
Colors to use for different members. |
private static double |
d_size_mesh
size of the mesh as a double. |
private static double |
detail
controls the detail of the chart. |
private java.util.HashMap<java.lang.String,java.lang.Double> |
members
Members of this pie chart. |
private static java.util.ArrayList<Triangle> |
mesh
Array of triangles that comprise the mesh of the PieChart. |
private static Material |
mtl
material properties for the pie chart. |
private static boolean |
need_to_build_mesh
true if the mesh needs to be (re)build. |
private static java.nio.FloatBuffer |
normals
FloatBuffer of normals (normal vectors). |
static double |
PI
value of PI = 3.14159265; |
private static double |
radius
radius of the chart. |
private java.util.ArrayList<java.lang.Double> |
slices
Array of Doubles that represents shares of different slices. |
private static double |
thickness
depth of the chart as a ratio between its radius. |
private static boolean |
use_vertex_arrays
true if user wants to use vertex arrays. |
private static boolean |
vertex_arrays_supported
true of this PC is capable of using vertex array. |
private static int |
vertexCount
count of vertices * 3 in the mesh. |
private static java.nio.FloatBuffer |
vertices
FloatBuffer of vertices. |
| 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 | |
|---|---|
PieChart()
default constructor. |
|
| Method Summary | |
|---|---|
private static void |
buildMesh()
builds the mesh for the PieCharts. |
void |
clear()
clears the contents of this PieChart |
static void |
flipUseVertexArrays()
gets called when use clicks on "Disable vertex arrays" option in menu. |
java.lang.Double |
get(java.lang.String a)
get Double that represents share of a. |
java.lang.Double |
put(java.lang.String name,
java.lang.Double share)
Put new member into pie chart. |
void |
render(GLAutoDrawable panel)
renders the chart. |
private int |
roundN3(int a)
take a and round it to the next number that is divisble by 3. |
static void |
setTransperency(float t)
changes transperency of the PieChart to t. |
| 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 |
|---|
private static Material mtl
public static final double PI
private java.util.ArrayList<java.lang.Double> slices
private java.util.HashMap<java.lang.String,java.lang.Double> members
public static java.awt.Color[] colors
private static double thickness
private static double radius
private static double detail
private static java.util.ArrayList<Triangle> mesh
private static boolean need_to_build_mesh
private static double d_size_mesh
private static int vertexCount
private static java.nio.FloatBuffer vertices
private static java.nio.FloatBuffer normals
private static boolean vertex_arrays_supported
private static boolean use_vertex_arrays
| Constructor Detail |
|---|
public PieChart()
| Method Detail |
|---|
public static void setTransperency(float t)
t - float
public java.lang.Double put(java.lang.String name,
java.lang.Double share)
name - Stringshare - Double
public java.lang.Double get(java.lang.String a)
a - String
public void clear()
private int roundN3(int a)
a - int
private static void buildMesh()
public static void flipUseVertexArrays()
public void render(GLAutoDrawable panel)
render in class ANodepanel - GLAutoDrawable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||