public final class PointsUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static org.eclipse.draw2d.geometry.PrecisionPoint |
doRotate(org.eclipse.draw2d.geometry.PrecisionPoint point,
double angle,
org.eclipse.draw2d.geometry.PrecisionPoint rotationPoint)
Rotates the given
Point with the given angle relative to the rotation point. |
static org.eclipse.draw2d.geometry.Point |
flipPointHorizontally(org.eclipse.draw2d.geometry.Point point,
int center)
Flip point horizontally from center point.
|
static org.eclipse.draw2d.geometry.PointList |
flipPointsHorizontally(org.eclipse.draw2d.geometry.PointList points)
Flip points horizontally.
|
static org.eclipse.draw2d.geometry.PointList |
flipPointsHorizontally(org.eclipse.draw2d.geometry.PointList points,
int centerX)
Flip points horizontally.
|
static org.eclipse.draw2d.geometry.PointList |
flipPointsVertically(org.eclipse.draw2d.geometry.PointList points)
Flip points vertically.
|
static org.eclipse.draw2d.geometry.PointList |
flipPointsVertically(org.eclipse.draw2d.geometry.PointList points,
int centerY)
Flip points vertically.
|
static org.eclipse.draw2d.geometry.Point |
flipPointVertically(org.eclipse.draw2d.geometry.Point point,
int center)
Flip point vertically from center point.
|
static org.eclipse.draw2d.geometry.PrecisionPoint |
rotate(org.eclipse.draw2d.geometry.Point point,
double angle,
org.eclipse.draw2d.geometry.Point rotationPoint)
Rotates the given
Point with the given angle relative to the rotation point. |
static org.eclipse.draw2d.geometry.PointList |
rotatePoints(org.eclipse.draw2d.geometry.PointList points,
double angle)
Rotates all points.
|
static org.eclipse.draw2d.geometry.PointList |
rotatePoints(org.eclipse.draw2d.geometry.PointList points,
double angle,
org.eclipse.draw2d.geometry.Point center)
Rotates all points.
|
static void |
scalePoints(org.eclipse.draw2d.geometry.PointList points,
double widthRatio,
double heightRatio)
Scale the geometry size of a pointlist.
|
static org.eclipse.draw2d.geometry.PointList |
scalePointsBySize(org.eclipse.draw2d.geometry.PointList points,
int width,
int height)
Scale the bound size of a point list.
|
public static org.eclipse.draw2d.geometry.PrecisionPoint rotate(org.eclipse.draw2d.geometry.Point point, double angle, org.eclipse.draw2d.geometry.Point rotationPoint)
Point
with the given angle relative to the rotation point.
Converts the given point to a PrecisionPoint
and calls doRotate(PrecisionPoint, double, PrecisionPoint)
.point
- The Point
to rotateangle
- The angle to rotate (in Degrees)rotationPoint
- The rotation pointpublic static org.eclipse.draw2d.geometry.PrecisionPoint doRotate(org.eclipse.draw2d.geometry.PrecisionPoint point, double angle, org.eclipse.draw2d.geometry.PrecisionPoint rotationPoint)
Point
with the given angle relative to the rotation point.point
- The Point
to rotateangle
- The angle to rotate (in Degrees)rotationPoint
- The rotation pointpublic static final org.eclipse.draw2d.geometry.PointList rotatePoints(org.eclipse.draw2d.geometry.PointList points, double angle)
points
- The PoinList, which points should be rotatedangle
- The angle to rotatepublic static final org.eclipse.draw2d.geometry.PointList rotatePoints(org.eclipse.draw2d.geometry.PointList points, double angle, org.eclipse.draw2d.geometry.Point center)
points
- The PoinList, which points should be rotatedangle
- The angle to rotatepublic static final org.eclipse.draw2d.geometry.Point flipPointHorizontally(org.eclipse.draw2d.geometry.Point point, int center)
point
- the point to be flipped.center
- the center point.public static final org.eclipse.draw2d.geometry.Point flipPointVertically(org.eclipse.draw2d.geometry.Point point, int center)
point
- the point to be flipped.center
- the center point.public static final org.eclipse.draw2d.geometry.PointList flipPointsHorizontally(org.eclipse.draw2d.geometry.PointList points)
points
- the points to be flipped.public static final org.eclipse.draw2d.geometry.PointList flipPointsHorizontally(org.eclipse.draw2d.geometry.PointList points, int centerX)
points
- the points to be flipped.centerX
- the center X positionpublic static final org.eclipse.draw2d.geometry.PointList flipPointsVertically(org.eclipse.draw2d.geometry.PointList points)
points
- the points to be flipped.public static final org.eclipse.draw2d.geometry.PointList flipPointsVertically(org.eclipse.draw2d.geometry.PointList points, int centerY)
points
- the points to be flipped.centerY
- the center Y position.public static final void scalePoints(org.eclipse.draw2d.geometry.PointList points, double widthRatio, double heightRatio)
points
- points to be scaled.widthRatio
- width scale ratio.heightRatio
- height scale ratio.public static org.eclipse.draw2d.geometry.PointList scalePointsBySize(org.eclipse.draw2d.geometry.PointList points, int width, int height)
points
- the points to be scaled.width
- the new width.height
- the new height