|
|||||||||
| 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
public class ANode
Super class for all other nodes in the tree.
Description: Super class for all other nodes in the tree.
Copyright: Lev A Neiman 2008
Company: Ohio University EECS
| Field Summary | |
|---|---|
protected java.util.LinkedList |
children
References to the children nodes. |
protected int |
display_list
if this does not equal to -1 then it refers to some Display List in memory. |
protected java.lang.String |
name
prbl should make this private later on if i still use it. |
protected static int |
no_disp_list
if display_list == -1 then we know it can't refer to valid OpenGL display list, since they cannot be negative. |
protected ANode |
parent
reference to the parent node. |
protected boolean |
ppop
if this is true, then modelview matrix is not pushed and poped around rendering this node. |
protected Coordinate |
rotation
what is the vector about which this node is rotated, relative to its parent? |
float |
rotation_angle
what is the angle of rotation about that vector? |
protected Coordinate |
scale
how big is this node compared to its parent? 1.0 is same size. |
boolean |
show
|
protected Coordinate |
translation
how far away is this node from its parent? |
| Constructor Summary | |
|---|---|
ANode()
default constructor |
|
ANode(int list)
constructor |
|
ANode(java.lang.String name)
constructor |
|
| Method Summary | |
|---|---|
void |
addChild(ANode child)
add child to this node. |
static int |
countNodes(ANode root)
counts the number of nodes in the tree with root as root. |
private static int |
countNodes(ANode root,
int count)
counts the number of nodes in the tree with root as root. |
static void |
drawCube(GLAutoDrawable g)
renders a simple cube. |
java.lang.String |
getName()
|
static Coordinate |
getNormal(Coordinate a,
Coordinate b,
Coordinate c)
computes a normal between (a-c)x(b-c) |
static void |
hideTree(ANode root)
|
private void |
init()
initializes member variables to their default values. |
boolean |
pushPop()
|
void |
render(GLAutoDrawable g)
This method should be typically called from render in all derived classes. |
static void |
renderTree(GLAutoDrawable contex,
ANode root)
This static function renders the tree with root as the root. |
Coordinate |
rotation()
|
Coordinate |
scale()
|
void |
setName(java.lang.String name)
|
void |
setParent(ANode parent)
set parent on this node. |
void |
setPushPop(boolean a)
|
static void |
showTree(ANode root)
|
Coordinate |
translation()
returns translation |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Coordinate translation
protected Coordinate scale
protected Coordinate rotation
public float rotation_angle
protected static final int no_disp_list
protected int display_list
protected boolean ppop
protected java.lang.String name
protected java.util.LinkedList children
protected ANode parent
public boolean show
| Constructor Detail |
|---|
public ANode()
public ANode(java.lang.String name)
name - String - name for this node.public ANode(int list)
list - int - display list that this node will call.| Method Detail |
|---|
public Coordinate translation()
public Coordinate scale()
public Coordinate rotation()
public java.lang.String getName()
public void setName(java.lang.String name)
private void init()
public void addChild(ANode child)
child - ANodepublic void setParent(ANode parent)
parent - ANodepublic void render(GLAutoDrawable g)
g - GLAutoDrawablepublic static void hideTree(ANode root)
public static void showTree(ANode root)
public static void renderTree(GLAutoDrawable contex,
ANode root)
contex - GLAutoDrawableroot - ANodepublic static int countNodes(ANode root)
root - ANode - root to the tree to count nodes of.
private static int countNodes(ANode root,
int count)
root - ANode - root to the tree to count nodes of.count - int - current count.
public boolean pushPop()
public void setPushPop(boolean a)
public static Coordinate getNormal(Coordinate a,
Coordinate b,
Coordinate c)
a - Coordinateb - Coordinatec - Coordinate
public static void drawCube(GLAutoDrawable g)
g - GLAutoDrawable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||