unc.cdva.problems
Class ProblemTriangle

java.lang.Object
  extended by unc.cdva.utils.TaggedObject
      extended by unc.cdva.problems.ProblemTriangle
All Implemented Interfaces:
Problem, Taggable

public class ProblemTriangle
extends TaggedObject
implements Problem

Right Triangle Problem.

Author:
Dan Van Atta, Guillaume Conte

Constructor Summary
ProblemTriangle(javax.vecmath.Vector3f ret, javax.vecmath.Vector3f gun, Id id)
          Constructs a triangle bean.
 
Method Summary
 Object3D getDrawable()
          Returns a drawable object that is meant to be drawn when the problem is created.
 float getGunRange()
           
 java.lang.String[] getProblemLabels()
          Used to retrieve labels that the problem would like to show the user.
 float getSolutionRange()
           
 ProblemType getType()
          Returns the problem type.
 void setInputValues(long[] value)
          Used to pass user parameters into the problem
 
Methods inherited from class unc.cdva.utils.TaggedObject
createId, equals, getId, hashCode, setId, setId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface unc.cdva.utils.Taggable
getId
 

Constructor Detail

ProblemTriangle

public ProblemTriangle(javax.vecmath.Vector3f ret,
                       javax.vecmath.Vector3f gun,
                       Id id)
Constructs a triangle bean. Can construct one of two triangles. The first points up, ie: the right angle will be in the top left corner, pointing down the right angle is in the bottom left corner.

Parameters:
ret - Reticle location.
gun - Gun location.
Method Detail

getGunRange

public float getGunRange()
Specified by:
getGunRange in interface Problem
Returns:
How far the gun is supposed to shoot in logical unit
See Also:
Problem.getGunRange()

setInputValues

public void setInputValues(long[] value)
Description copied from interface: Problem
Used to pass user parameters into the problem

Specified by:
setInputValues in interface Problem
Parameters:
value - An array of values, the ordering and meaning of the values is dependant upon the exact problem type.
See Also:
Problem.setInputValues(long[])

getType

public ProblemType getType()
Description copied from interface: Problem
Returns the problem type.

Specified by:
getType in interface Problem
See Also:
Problem.getType()

getProblemLabels

public java.lang.String[] getProblemLabels()
Description copied from interface: Problem
Used to retrieve labels that the problem would like to show the user.

Specified by:
getProblemLabels in interface Problem
Returns:
An array of strings representing labels, the value and ordering of the elements is dependant upon the problem type, and are interpretted according to the problem type.
See Also:
Problem.getProblemLabels()

getDrawable

public Object3D getDrawable()
Description copied from interface: Problem
Returns a drawable object that is meant to be drawn when the problem is created. (generally these objects will reside in RAGraphics.models)

Specified by:
getDrawable in interface Problem
See Also:
Problem.getDrawable()

getSolutionRange

public float getSolutionRange()
Specified by:
getSolutionRange in interface Problem
Returns:
the solution of the problem