|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.rsl.konrad.geometry.AbstractShape
edu.stanford.rsl.konrad.geometry.AbstractCurve
edu.stanford.rsl.konrad.geometry.shapes.simple.StraightLine
public class StraightLine
Constructor Summary | |
---|---|
StraightLine(PointND point,
PointND point2)
Creates a new Straight line passing from point to point2 |
|
StraightLine(PointND point,
SimpleVector dir)
Creates a StraightLine from point with direction dir |
Method Summary | |
---|---|
void |
applyTransform(Transform t)
Applies the Transform t to the object. |
double |
computeDistanceTo(PointND p)
Computes the closest distance between the line and the point p. |
PointND |
evaluate(double u)
Returns a point on the Curve at position u [0, 1]; |
int |
getDimension()
Returns the external dimension of the shape. |
SimpleVector |
getDirection()
|
PointND |
getPoint()
|
PointND[] |
getRasterPoints(int number)
Rasters the shape with a given number of points or less. |
void |
init(PointND point,
PointND point2)
|
void |
init(PointND point,
SimpleVector dir)
|
java.util.ArrayList<PointND> |
intersect(AbstractCurve other)
Returns the intersection points between the curve and the shape. |
PointND |
intersect(StraightLine line)
|
boolean |
isBounded()
Returns true if the shape is of limited space |
void |
normalize()
|
void |
setDirection(SimpleVector direction)
|
void |
setPoint(PointND point)
|
java.lang.String |
toString()
|
Methods inherited from class edu.stanford.rsl.konrad.geometry.AbstractCurve |
---|
evaluate, getInternalDimension |
Methods inherited from class edu.stanford.rsl.konrad.geometry.AbstractShape |
---|
getHitsOnBoundingBox_slow, getHitsOnBoundingBox, getMax, getMin |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public StraightLine(PointND point, SimpleVector dir)
point
- the pointdir
- the directionpublic StraightLine(PointND point, PointND point2)
point
- the base pointpoint2
- the other pointMethod Detail |
---|
public void init(PointND point, SimpleVector dir)
public void init(PointND point, PointND point2)
public void normalize()
public PointND evaluate(double u)
AbstractCurve
evaluate
in class AbstractCurve
u
- the internal position
public int getDimension()
AbstractShape
getDimension
in class AbstractShape
public java.util.ArrayList<PointND> intersect(AbstractCurve other)
AbstractShape
intersect
in class AbstractShape
public PointND intersect(StraightLine line)
public SimpleVector getDirection()
public void setDirection(SimpleVector direction)
direction
- the direction to setpublic PointND getPoint()
public void setPoint(PointND point)
point
- the point to setpublic boolean isBounded()
AbstractShape
isBounded
in class AbstractShape
public double computeDistanceTo(PointND p)
p
- the point p
public void applyTransform(Transform t)
Transformable
applyTransform
in interface Transformable
applyTransform
in class AbstractShape
t
- the transform to apply to the object.public PointND[] getRasterPoints(int number)
AbstractShape
getRasterPoints
in class AbstractShape
number
- the number of points
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |