|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gishur.core.geom.Intersection | +--gishur.x2.core.Intersection
Intersection class for the planar X-objects. This class contains special access methods for various X-objects.
(for calculating the intersection between two segments)
// Create the segments... XSegment s1=new XSegment(100,100,600,400); XSegment s2=new XSegment(600,50,50,300); // Calculate the intersection... Intersection inter=new Intersection(s1,s2); // Analyze the result... if (inter.singleXPoint()) System.out.println("Intersection at "+inter.xpoint()); else System.out.println("No Intersection!");
Constructor Summary | |
Intersection()
Constructs an empty Intersection. |
|
Intersection(java.lang.Object o1,
java.lang.Object o2)
Constructs an Intersection object through calculating the intersection of the two given objects. |
Method Summary | |
boolean |
singleXPoint()
Returns true, if and only if the intersection set consists of XPoint . |
XPoint |
xpoint()
Returns the (first) intersection point of the intersection set or null if the intersection set does not contain a XPoint . |
XPoint |
xpoint(int i)
Returns the i-th intersection point of type XPoint
or null if there is no i-th intersection object or
the i-th intersection object is no XPoint . |
XSegment |
xsegment(int i)
Returns the i-th intersection segment of type XSegment
or null if there is no i-th intersection object or
the i-th intersection object is no XSegment . |
Methods inherited from class gishur.core.geom.Intersection |
empty, getObjectArray, getObjectList, length, object, object, single, toString, type, type |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Intersection()
public Intersection(java.lang.Object o1, java.lang.Object o2)
o1,o2
- intersecting ObjectsIntersectionException
- Method Detail |
public boolean singleXPoint()
XPoint
.public XPoint xpoint()
XPoint
.public XPoint xpoint(int i)
XPoint
or null if there is no i-th intersection object or
the i-th intersection object is no XPoint
.i
- index of the requested intersection objectpublic XSegment xsegment(int i)
XSegment
or null if there is no i-th intersection object or
the i-th intersection object is no XSegment
.i
- index of the requested intersection object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |