| 
deegree 2.6-pre (2011/11/29 00:10 build-378-unofficial) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.deegree.model.spatialschema.LinearizationUtil
public class LinearizationUtil
Utility class for the linearization of arcs and circles.
| Constructor Summary | |
|---|---|
LinearizationUtil()
 | 
|
| Method Summary | |
|---|---|
static boolean | 
areCollinear(Position p0,
                         Position p1,
                         Position p2)
Tests if the given three points are collinear.  | 
protected static javax.vecmath.Vector2d | 
calcVector(Position p0,
                     Position p1)
Finds the vector between two points. which is the difference between p1 and p0 and the direction is from p0 to p1.  | 
protected static Position[] | 
doubleToPosition(double[] doubles)
Transforms an array of double to an array of Position  | 
(package private) static Position | 
findCircleCenter(Position p0,
                                 Position p1,
                                 Position p2)
Finds the center of a cirlce/arc using three points that lie on the circle.  | 
(package private) static boolean | 
isClockwise(Position p0,
                       Position p1,
                       Position p2)
Returns whether the order of the given three points is clockwise or counterclockwise.  | 
static Position[] | 
linearizeArc(Position p0,
                         Position p1,
                         Position p2)
Takes in a three Position of an arc and computes a linearized Arc (linestring) using 150 positions/vertices  | 
static Position[] | 
linearizeArc(Position p0,
                         Position p1,
                         Position p2,
                         int numberOfOpPositions)
Takes in a three Positions of an Arc and computes a linearized Arc (linestring).  | 
static Position[] | 
linearizeCircle(Position p0,
                               Position p1,
                               Position p2,
                               int numberOfPositions)
Calculates a sequence of Positions on the arc of a circle. | 
protected static double[] | 
positionToDouble(Position[] positions)
Transforms an array of Position to an array of double  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public LinearizationUtil()
| Method Detail | 
|---|
public static Position[] linearizeArc(Position p0,
                                      Position p1,
                                      Position p2)
p0 - p1 - p2 - 
public static Position[] linearizeArc(Position p0,
                                      Position p1,
                                      Position p2,
                                      int numberOfOpPositions)
p0 - p1 - p2 - numberOfOpPositions - the number of linearized Positions to produce
public static Position[] linearizeCircle(Position p0,
                                         Position p1,
                                         Position p2,
                                         int numberOfPositions)
Positions on the arc of a circle.
 The circle is constructed from the input points: All three points belong to the arc of the circle. They must be distinct and non-colinear. To form a complete circle, the arc is extended past the third control point until the first control point is encountered.
p0 - start point on the arc of the circlep1 - second point on the arc of the circlep2 - third point on the arc of the circlenumberOfPositions - number of interpolation points, the returned array contains numberOfPositions+1 entries, to ensure
            that the first point is identical to the last
IllegalArgumentException - if no order can be determined, because the points are identical or co-linear
static final boolean isClockwise(Position p0,
                                 Position p1,
                                 Position p2)
                          throws IllegalArgumentException
p0 - first pointp1 - second pointp2 - third point
IllegalArgumentException - if no order can be determined, because the points are identical or co-linear
public static boolean areCollinear(Position p0,
                                   Position p1,
                                   Position 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 - 
protected static double[] positionToDouble(Position[] positions)
positions - 
protected static Position[] doubleToPosition(double[] doubles)
doubles - 
static Position findCircleCenter(Position p0,
                                 Position p1,
                                 Position p2)
                          throws IllegalArgumentException
p0 - p1 - p2 - 
IllegalArgumentException - if the points are co linear, e.g. on a line.
protected static javax.vecmath.Vector2d calcVector(Position p0,
                                                   Position p1)
p0 - p1 - 
  | 
deegree 2.6-pre (2011/11/29 00:10 build-378-unofficial) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
an open source project founded by lat/lon, Bonn, Germany.
                    For more information visit: http://www.deegree.org