|
deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.geometry.linearization.CurveLinearizer
public class CurveLinearizer
Provides methods for the linearization of Curve
s and CurveSegment
s.
Currently, the following CurveSegment
variants are handled correctly:
Arc
Circle
CubicSpline
LineStringSegment
(trivial)
Constructor Summary | |
---|---|
CurveLinearizer(GeometryFactory geomFac)
|
Method Summary | |
---|---|
static boolean |
areCollinear(Point p0,
Point p1,
Point p2)
Tests if the given three points are collinear. |
(package private) Point |
calcCircleCenter(Point p0,
Point p1,
Point p2)
Finds the center of a circle/arc that is specified by three points that lie on the circle's boundary. |
(package private) boolean |
isClockwise(Point p0,
Point p1,
Point p2)
Returns whether the order of the given three points is clockwise or counterclockwise. |
Curve |
linearize(Curve curve,
LinearizationCriterion crit)
Returns a linearized version of the given Curve geometry. |
LineStringSegment |
linearize(CurveSegment segment,
LinearizationCriterion crit)
Returns a linearized version (i.e. a LineStringSegment ) of the given CurveSegment . |
LineStringSegment |
linearizeArc(Arc arc,
LinearizationCriterion crit)
Returns a linearized version (i.e. a LineStringSegment ) of the given Arc . |
LineStringSegment |
linearizeCubicSpline(CubicSpline spline,
LinearizationCriterion crit)
Returns a linearized version (i.e. a LineStringSegment ) of the given CubicSpline . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CurveLinearizer(GeometryFactory geomFac)
geomFac
- Method Detail |
---|
public Curve linearize(Curve curve, LinearizationCriterion crit)
Curve
geometry.
NOTE: This method respects the semantic difference between Curve
and Ring
geometries: if the
input is a Ring
, a ring geometry will be returned.
curve
- crit
-
public LineStringSegment linearize(CurveSegment segment, LinearizationCriterion crit)
LineStringSegment
) of the given CurveSegment
.
segment
- the segment to be linearizedcrit
- determines the interpolation quality / number of interpolation points
public LineStringSegment linearizeArc(Arc arc, LinearizationCriterion crit)
LineStringSegment
) of the given Arc
.
If the three control points p0
, p1
and p2
of the arc are collinear, i.e.
on a straight line, the behaviour depends on the type of Arc
:
arc
- curve segment to be linearizedcrit
- determines the interpolation quality / number of interpolation points
public LineStringSegment linearizeCubicSpline(CubicSpline spline, LinearizationCriterion crit)
LineStringSegment
) of the given CubicSpline
.
A cubic spline consists of n polynomials of degree 3: Sj(x) = aj + bj*(x-xj) + cj*(x-xj)2 + dj*(x-xj)3; that acts upon the interval [xj,xj+1], 0 <=j< n.
The algorithm for generating points on a spline defined with only control points and starting/ending tangents can be found at http://persson.berkeley.edu/128A/lec14-2x3.pdf (last visited 19/08/09)
spline
- curve segment to be linearizedcrit
- determines the interpolation quality / number of interpolation points
Point calcCircleCenter(Point p0, Point p1, Point p2) throws IllegalArgumentException
Credits go to wikipedia (visited on 13/08/09).
p0
- first pointp1
- second pointp2
- third point
IllegalArgumentException
- if the points are collinear, i.e. on a single lineboolean isClockwise(Point p0, Point p1, Point p2) throws IllegalArgumentException
p0
- first pointp1
- second pointp2
- third point
IllegalArgumentException
- if no order can be determined, because the points are identical or collinearpublic static boolean areCollinear(Point p0, Point p1, Point p2)
NOTE: Only this method should be used throughout the whole linearization process for testing collinearity to avoid inconsistent results (the necessary EPSILON would differ).
p0
- p1
- p2
-
|
deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |