jass.generators
Class TubeModel

java.lang.Object
  extended by jass.generators.TubeModel
All Implemented Interfaces:
TubeShape

public class TubeModel
extends java.lang.Object
implements TubeShape

Describes a 1-d tube of varying radius, specified by a bunch of equidistant radii, starting at begin and ending at end. So there is one more radius than segments. Deals with geometry only

Author:
Kees van den Doel (kvdoel@cs.ubc.ca)

Constructor Summary
TubeModel(int nRadii)
          Create tube defined by a set of radii from glottis to lip end.
 
Method Summary
 double getLength()
          Get length (units not specified)
 double getRadius(double x)
          Get radius at point 0
 double getRadius(int k)
          Get the k'th radius
 void setLength(double length)
          Set the length
 void setRadius(int k, double r)
          Set the k'th radius
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TubeModel

public TubeModel(int nRadii)
Create tube defined by a set of radii from glottis to lip end. Then interpolate the shape.

Parameters:
nRadii - number of segments
Method Detail

setLength

public void setLength(double length)
Set the length

Parameters:
length - length

setRadius

public void setRadius(int k,
                      double r)
Set the k'th radius

Parameters:
k - index of radius (starting at 0)
r - radius

getRadius

public double getRadius(int k)
Get the k'th radius

Parameters:
k - index of radius (starting at 0)
Returns:
radius

getLength

public double getLength()
Get length (units not specified)

Specified by:
getLength in interface TubeShape
Returns:
length of tube

getRadius

public double getRadius(double x)
Get radius at point 0
Specified by:
getRadius in interface TubeShape
Parameters:
x - where to get radius
Returns:
radius at x