unc.cdva.graphics.models
Class RightTriangle

java.lang.Object
  extended by unc.cdva.graphics.models.RightTriangle
All Implemented Interfaces:
Object3D

public class RightTriangle
extends java.lang.Object
implements Object3D

This class lets you draw a right triangle on the screen with a length label above the horizontal side and an angle label between that side and the hypothenuse of the triangle


Constructor Summary
RightTriangle(javax.vecmath.Vector3f[] vertices, java.lang.String[] labels)
          Intialize a triangle object using vertices defining the base triangle and labels (distance and angle)
 
Method Summary
 Object3D clone()
          Clone the object (copy all the attributes)
 java.lang.String getAngle()
           
 javax.vecmath.Vector3f getAngleVertex()
           
 java.lang.String getDistance()
           
 javax.vecmath.Vector3f getDistanceVertex()
           
 javax.vecmath.Vector3f getQuestionMarkVertex()
           
 javax.vecmath.Vector3f getVertex1()
           
 javax.vecmath.Vector3f getVertex2()
           
 javax.vecmath.Vector3f getVertex3()
           
 javax.vecmath.Vector3f getVertex4()
           
 javax.vecmath.Vector3f getVertex5()
           
 boolean isCached()
           
 void render(javax.media.opengl.GL gl)
          Render an object.
 void setAngle(java.lang.String angle)
           
 void setAngleVertex(javax.vecmath.Vector3f angleVertex)
           
 void setCached(boolean cached)
           
 void setDistance(java.lang.String distance)
           
 void setDistanceVertex(javax.vecmath.Vector3f distanceVertex)
           
 void setQuestionMarkVertex(javax.vecmath.Vector3f questionMarkVertex)
           
 void setVertex1(javax.vecmath.Vector3f vertex1)
           
 void setVertex2(javax.vecmath.Vector3f vertex2)
           
 void setVertex3(javax.vecmath.Vector3f vertex3)
           
 void setVertex4(javax.vecmath.Vector3f vertex4)
           
 void setVertex5(javax.vecmath.Vector3f vertex5)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RightTriangle

public RightTriangle(javax.vecmath.Vector3f[] vertices,
                     java.lang.String[] labels)
Intialize a triangle object using vertices defining the base triangle and labels (distance and angle)

Parameters:
vertices - vertices of the triangle
labels - distance and angle label
Method Detail

render

public void render(javax.media.opengl.GL gl)
Description copied from interface: Object3D
Render an object. By default the object is rendered in the first opengl basis. The transformations are performed in the rendering engine according to the data stored in the corresponding interactive item

Specified by:
render in interface Object3D
Parameters:
gl - gl context
See Also:
Object3D.render(javax.media.opengl.GL)

getAngle

public java.lang.String getAngle()
Returns:
the angle

getAngleVertex

public javax.vecmath.Vector3f getAngleVertex()
Returns:
the angleVertex

isCached

public boolean isCached()
Returns:
returns true if all the data of the triangle is cached, else returns no

getDistance

public java.lang.String getDistance()
Returns:
the distance

getDistanceVertex

public javax.vecmath.Vector3f getDistanceVertex()
Returns:
the distanceVertex

getQuestionMarkVertex

public javax.vecmath.Vector3f getQuestionMarkVertex()
Returns:
the questionMarkVertex

getVertex1

public javax.vecmath.Vector3f getVertex1()
Returns:
the vertex1

getVertex2

public javax.vecmath.Vector3f getVertex2()
Returns:
the vertex2

getVertex3

public javax.vecmath.Vector3f getVertex3()
Returns:
the vertex3

getVertex4

public javax.vecmath.Vector3f getVertex4()
Returns:
the vertex4

getVertex5

public javax.vecmath.Vector3f getVertex5()
Returns:
the vertex5

setAngle

public void setAngle(java.lang.String angle)
Parameters:
angle - the angle to set

setAngleVertex

public void setAngleVertex(javax.vecmath.Vector3f angleVertex)
Parameters:
angleVertex - the angleVertex to set

setCached

public void setCached(boolean cached)
Parameters:
cached - the cached to set

setDistance

public void setDistance(java.lang.String distance)
Parameters:
distance - the distance to set

setDistanceVertex

public void setDistanceVertex(javax.vecmath.Vector3f distanceVertex)
Parameters:
distanceVertex - the distanceVertex to set

setQuestionMarkVertex

public void setQuestionMarkVertex(javax.vecmath.Vector3f questionMarkVertex)
Parameters:
questionMarkVertex - the questionMarkVertex to set

setVertex1

public void setVertex1(javax.vecmath.Vector3f vertex1)
Parameters:
vertex1 - the vertex1 to set

setVertex2

public void setVertex2(javax.vecmath.Vector3f vertex2)
Parameters:
vertex2 - the vertex2 to set

setVertex3

public void setVertex3(javax.vecmath.Vector3f vertex3)
Parameters:
vertex3 - the vertex3 to set

setVertex4

public void setVertex4(javax.vecmath.Vector3f vertex4)
Parameters:
vertex4 - the vertex4 to set

setVertex5

public void setVertex5(javax.vecmath.Vector3f vertex5)
Parameters:
vertex5 - the vertex5 to set

clone

public Object3D clone()
Description copied from interface: Object3D
Clone the object (copy all the attributes)

Specified by:
clone in interface Object3D
Overrides:
clone in class java.lang.Object
Returns:
cloned object
See Also:
Object3D.clone()