jdsl.geomobj.ref
Class RealSegment2D

java.lang.Object
  |
  +--jdsl.geomobj.ref.AbstractGeomObject2D
        |
        +--jdsl.geomobj.ref.AbstractLinearCurve2D
              |
              +--jdsl.geomobj.ref.AbstractRealLinearCurve2D
                    |
                    +--jdsl.geomobj.ref.RealSegment2D
All Implemented Interfaces:
Curve2D, GeomObject, GeomObject2D, LinearCurve2D, OpenCurve2D, Segment2D

public class RealSegment2D
extends AbstractRealLinearCurve2D
implements Segment2D

RealSegment2D is a Segment2D constructed using two distinct real points.

Version:
$Id: RealSegment2D.java,v 1.1 2000/06/27 15:46:11 lv Exp $
Author:
Luca Vismara (lv)

Inner classes inherited from class jdsl.geomobj.api.GeomObject2D
GeomObject2D.NoneGeomObject2D
 
Fields inherited from class jdsl.geomobj.ref.AbstractRealLinearCurve2D
dir_, p1_, p2_
 
Fields inherited from class jdsl.geomobj.ref.AbstractLinearCurve2D
bottom_, INFINITE, left_, NEGATIVE, POSITIVE, right_, slope_, top_, ZERO
 
Fields inherited from class jdsl.geomobj.ref.AbstractGeomObject2D
gt, jn
 
Fields inherited from interface jdsl.geomobj.api.GeomObject2D
NONE
 
Constructor Summary
RealSegment2D(Point2D p1, Point2D p2)
          Creates a segment passing with endpoints p1 and p2; the underlying direction is from p1 to p2.
 
Method Summary
 Point2D bottomPoint()
           
 boolean equals(java.lang.Object obj)
           
 Point2D leftPoint()
           
 Point2D rightPoint()
           
 Line2D supportingLine()
           
 Point2D topPoint()
           
 
Methods inherited from class jdsl.geomobj.ref.AbstractRealLinearCurve2D
arithmeticType, direction, points
 
Methods inherited from class jdsl.geomobj.ref.AbstractLinearCurve2D
isDecreasing, isHorizontal, isIncreasing, isVertical, toString
 
Methods inherited from class jdsl.geomobj.ref.AbstractGeomObject2D
dim
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jdsl.geomobj.api.LinearCurve2D
direction, isDecreasing, isHorizontal, isIncreasing, isVertical
 
Methods inherited from interface jdsl.geomobj.api.OpenCurve2D
points
 
Methods inherited from interface jdsl.geomobj.api.GeomObject
arithmeticType, dim
 

Constructor Detail

RealSegment2D

public RealSegment2D(Point2D p1,
                     Point2D p2)
              throws InvalidPointException
Creates a segment passing with endpoints p1 and p2; the underlying direction is from p1 to p2.
Parameters:
p1 - one endpoint of the segment; must be a real point
p2 - the other endpoint of the segment; must be a real point distinct from p1
Throws:
InvalidPointException - if p1 and p2 are not real points, or if p1 and p2 are coincident
Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

bottomPoint

public Point2D bottomPoint()
Specified by:
bottomPoint in interface Segment2D
Following copied from interface: jdsl.geomobj.api.Segment2D
Returns:
the bottom endpoint of this; any endpoint if this is horizontal

topPoint

public Point2D topPoint()
Specified by:
topPoint in interface Segment2D
Following copied from interface: jdsl.geomobj.api.Segment2D
Returns:
the top endpoint of this; any endpoint if this is horizontal

leftPoint

public Point2D leftPoint()
Specified by:
leftPoint in interface Segment2D
Following copied from interface: jdsl.geomobj.api.Segment2D
Returns:
the leftmost endpoint of this; any endpoint if this is vertical

rightPoint

public Point2D rightPoint()
Specified by:
rightPoint in interface Segment2D
Following copied from interface: jdsl.geomobj.api.Segment2D
Returns:
the rightmost endpoint of this; any endpoint if this is vertical

supportingLine

public Line2D supportingLine()
Specified by:
supportingLine in interface Segment2D
Following copied from interface: jdsl.geomobj.api.Segment2D
Returns:
the line passing through the endpoints and with the same direction of this