computational.geometry
Class HorizontalRay

java.lang.Object
  extended by computational.geometry.Ray
      extended by computational.geometry.HorizontalRay
All Implemented Interfaces:
Shape, java.io.Serializable, java.lang.Cloneable

public class HorizontalRay
extends Ray
implements Shape

See Also:
Serialized Form

Field Summary
 
Fields inherited from class computational.geometry.Ray
direction, label, origin
 
Constructor Summary
HorizontalRay(int x0, int y0)
           
HorizontalRay(Point origin)
           
HorizontalRay(java.lang.String label, int x0, int y0)
           
HorizontalRay(java.lang.String label, Point origin)
          CONSTRUCTORS
 
Method Summary
 boolean contains(Point p)
          Tells whether the shape encloses a given point.
 void draw(java.awt.Graphics gfx)
          Draws the shape, using the current graphics context's color.
 void drawLabels(java.awt.Graphics gfx)
          Draws the shape's associated labels, using the graphics context's color.
 void drawPoints(java.awt.Graphics gfx)
          Draws the shape's defining points, using the graphics context's color.
 java.util.List getPoints()
          Shape Implementation
 int intersect(Segment s)
           
 
Methods inherited from class computational.geometry.Ray
boundingBox, clone, cross, crossLine, getDirection, getLabel, getOrigin, setDirection, setLabel, toString, translate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface computational.geometry.Shape
getLabel, setLabel, translate
 

Constructor Detail

HorizontalRay

public HorizontalRay(int x0,
                     int y0)

HorizontalRay

public HorizontalRay(Point origin)

HorizontalRay

public HorizontalRay(java.lang.String label,
                     int x0,
                     int y0)

HorizontalRay

public HorizontalRay(java.lang.String label,
                     Point origin)
CONSTRUCTORS

Method Detail

contains

public boolean contains(Point p)
Description copied from interface: Shape
Tells whether the shape encloses a given point. To the aims of this test, we consider the shape to be closed, so that a point lying on the shape's boundaries results as enclosed in the shape.

Specified by:
contains in interface Shape
Overrides:
contains in class Ray
Parameters:
p - the point we test for encloseness.
Returns:
true iff the point is enclosed in the shape.

draw

public void draw(java.awt.Graphics gfx)
Description copied from interface: Shape
Draws the shape, using the current graphics context's color.

Specified by:
draw in interface Shape
Overrides:
draw in class Ray
Parameters:
gfx - the graphics context where this shape has to be drawn.

drawLabels

public void drawLabels(java.awt.Graphics gfx)
Description copied from interface: Shape
Draws the shape's associated labels, using the graphics context's color.

Specified by:
drawLabels in interface Shape
Overrides:
drawLabels in class Ray
Parameters:
gfx - the graphics context where this shape's labels have to be drawn.

drawPoints

public void drawPoints(java.awt.Graphics gfx)
Description copied from interface: Shape
Draws the shape's defining points, using the graphics context's color.

Specified by:
drawPoints in interface Shape
Overrides:
drawPoints in class Ray
Parameters:
gfx - the graphics context where this shape's points have to be drawn.

getPoints

public java.util.List getPoints()
Shape Implementation

Specified by:
getPoints in interface Shape
Overrides:
getPoints in class Ray
Returns:
the shape's cloned defining points.

intersect

public int intersect(Segment s)