public class SplineIntersectionPoint
extends java.awt.Point
getSegmentIndexOfSpline1()
and getSegmentIndexOfSpline2()
to identify the segments of the two splines
that intersect.Constructor and Description |
---|
SplineIntersectionPoint(CatmullRomSpline spline1,
CatmullRomSpline spline2,
int x,
int y,
int segIndexSpline1,
int segIndexSpline2)
Creates a new intersection point.
|
Modifier and Type | Method and Description |
---|---|
int |
getSegmentIndexOfSpline1()
Gets the index of the segment in spline 1 that intersects with a segment of spline 2.
|
int |
getSegmentIndexOfSpline2()
Gets the index of the segment in spline 2 that intersects with a segment of spline 1.
|
CatmullRomSpline |
getSpline1()
Gets the first spline that is part of the intersection.
|
CatmullRomSpline |
getSpline2()
Gets the second spline that is part of the intersection.
|
equals, getLocation, getX, getY, move, setLocation, setLocation, setLocation, toString, translate
public SplineIntersectionPoint(CatmullRomSpline spline1, CatmullRomSpline spline2, int x, int y, int segIndexSpline1, int segIndexSpline2) throws java.lang.IllegalArgumentException
spline1
- the first splinespline2
- the second splinex
- the x position of the intersection pointy
- the y position of the intersection pointsegIndexSpline1
- the index of the segment end point in spline 1 that intersects with a segment of spline 2segIndexSpline2
- the index of the segment end point in spline 2 that intersects with a segment of spline 2java.lang.IllegalArgumentException
- public final CatmullRomSpline getSpline1()
public final CatmullRomSpline getSpline2()
public final int getSegmentIndexOfSpline1()
getSegmentIndexOfSpline1() - 1
is the first segment point. So you can use spline1.getPoints[point.getSegmentIndexOfSpline1() - 1]
to get the start point and spline1.getPoints[point.getSegmentIndexOfSpline1()]
to get the end point
of the segment.public final int getSegmentIndexOfSpline2()
getSegmentIndexOfSpline2() - 1
is the first segment point. So you can use spline2.getPoints[point.getSegmentIndexOfSpline2() - 1]
to get the start point and spline2.getPoints[point.getSegmentIndexOfSpline2()]
to get the end point
of the segment.