public abstract class AbstractArc extends AbstractCurve implements Arc
Geometry.DIMENSIONS, Geometry.OPERATIONS, Geometry.SUBTYPES, Geometry.TYPES, Geometry.ValidationStatus
Modifier and Type | Field and Description |
---|---|
protected Point |
end |
protected Point |
init |
protected Point |
middle
This is the middle point (belongs to the arc), not the center
of the circle/ellipse
|
logger
BEST, E, EXTENDED_GEOMSUBTYPE_OFFSET, EXTENDED_GEOMTYPE_OFFSET, N, NE, NW, S, SE, SELECTHANDLER, STRETCHINGHANDLER, SW, W
Modifier | Constructor and Description |
---|---|
protected |
AbstractArc(int subtype) |
Modifier and Type | Method and Description |
---|---|
void |
addMoveToVertex(Point point)
Adds a vertex (or direct position) to the curve
|
void |
addVertex(double x,
double y)
Utility method for add a vertex
|
void |
addVertex(double x,
double y,
double z)
Utility method for add a vertex
|
void |
addVertex(Point point)
Adds a vertex (or direct position) to the curve
|
void |
closePrimitive()
Closes the geometry
|
void |
ensureCapacity(int capacity) |
protected abstract Point |
fixPoint(Point point) |
void |
flip()
Flip the coordinates of the geometry.
|
double |
getCoordinateAt(int index,
int dimension)
Gets the one of the values of a coordinate (direct position) in a
concrete dimension.
|
int |
getDimension()
Returns the largest number n such that each direct position in a
geometric set can be associated with a subset that has the direct
position in its interior and is similar (isomorphic) to Rn, Euclidean
n-space.
|
double |
getEndAngle()
Returns the counterclockwise angle formed by the horizontal line passing
through the center, the center itself and the ending point.
|
Point |
getEndPoint()
Return the end point that has been used to create the arc.
|
GeneralPathX |
getGeneralPath()
Get GeneralPathIterator, to do registered operations to it.
|
Point |
getInitPoint()
Return the first point that has been used to create the arc.
|
Point |
getMiddlePoint()
Return the middle point of the arc.
|
int |
getNumVertices()
Gets the number of vertices (direct positions) of the curve
|
PathIterator |
getPathIterator(AffineTransform at)
If applies an affine transformation and returns the GeneralPathXIterator
with this geometry's information.
|
PathIterator |
getPathIterator(AffineTransform at,
double flatness)
If applies an affine transformation and returns the GeneralPathXIterator
with this geometry's information.
|
protected AffineTransform |
getScaleAffineTransform(Point center,
Double scale) |
Shape |
getShape() |
Shape |
getShape(AffineTransform affineTransform) |
double |
getStartAngle()
Returns the counterclockwise angle formed by the horizontal line passing
through the center, the center itself and the starting point.
|
Point |
getVertex(int index)
Gets a vertex (direct position)
|
void |
insertVertex(int index,
Point p)
Inserts a vertex (direct position) to the curve.
|
boolean |
is3D() |
protected double |
normalizeAngle(double angle)
Leaves the angle between PI and -PI
|
Geometry |
offset(double distance) |
void |
removeVertex(int index)
Remove a vertex (direct position) to the curve
|
void |
reProject(ICoordTrans ct)
Reprojects this geometry by the coordinate transformer passed as
parameter.
|
void |
setCoordinateAt(int index,
int dimension,
double value)
Sets the value of a coordinate (direct position) in a concrete dimension
|
void |
setGeneralPath(GeneralPathX generalPathX)
Sets all the coordinates of the curve
|
void |
setPoints(Point initialPoint,
Point endPoint)
Sets the initial point and the end point of the curve.
|
void |
setPoints(Point startPoint,
Point midPoint,
Point endPoint)
Sets the three points to define an arc.
|
void |
setPointsStartEnd(Point center,
double radius,
double startAngle,
double endAngle)
Sets the values to define an arc.
|
void |
setPointsStartExt(Point center,
double radius,
double startAngle,
double angleExt)
Sets the values to define an arc.
|
void |
setVertex(int index,
Point p)
Sets a vertex in a concrete position and replaces the
previous one that was in this position.
|
void |
transform(AffineTransform at)
It applies an affine transformation to the geometry.
|
getHandlers
area, buffer, centroid, closestPoints, compareTo, contains, contains, contains, contains, contains, convertToEWKB, convertToEWKB, convertToEWKBForcingType, convertToWKB, convertToWKB, convertToWKBForcingType, convertToWKT, convexHull, coveredBy, covers, crosses, difference, disjoint, distance, ensureOrientation, equals, fastIntersects, getBounds, getBounds2D, getEnvelope, getGeometryType, getInteriorPoint, getInternalShape, getManager, getType, getValidationStatus, intersection, intersects, intersects, intersects, invokeOperation, invokeOperation, isCCW, isSimple, isValid, isWithinDistance, makeValid, move, notifyDeprecated, out, overlaps, perimeter, rotate, scale, snapTo, toString, touches, union, within
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getCenterPoint, setPoints
area, buffer, centroid, cloneGeometry, closestPoints, contains, convertToEWKB, convertToEWKB, convertToEWKBForcingType, convertToWKB, convertToWKB, convertToWKBForcingType, convertToWKT, convexHull, coveredBy, covers, crosses, difference, disjoint, distance, ensureOrientation, fastIntersects, getBounds2D, getEnvelope, getGeometryType, getHandlers, getInteriorPoint, getInternalShape, getType, getValidationStatus, intersection, intersects, intersects, invokeOperation, invokeOperation, isCCW, isSimple, isValid, isWithinDistance, makeValid, move, out, overlaps, perimeter, rotate, scale, snapTo, toLines, toPoints, toPolygons, touches, union, within
contains, contains, contains, contains, getBounds, intersects
compareTo
getJTS
protected Point init
protected Point middle
protected Point end
public void setPoints(Point initialPoint, Point endPoint)
Curve
public double getCoordinateAt(int index, int dimension)
OrientablePrimitive
getCoordinateAt
in interface OrientablePrimitive
index
- The index of the direct position to set.dimension
- The dimension of the direct position.public void setCoordinateAt(int index, int dimension, double value)
OrientablePrimitive
setCoordinateAt
in interface OrientablePrimitive
index
- The index of the direct position to setdimension
- The dimension of the direct positionvalue
- The value to setpublic void addVertex(Point point)
OrientablePrimitive
addVertex
in interface OrientablePrimitive
point
- The new point to addpublic void addVertex(double x, double y)
OrientablePrimitive
addVertex
in interface OrientablePrimitive
OrientablePrimitive.addVertex(Point)
public void addVertex(double x, double y, double z)
OrientablePrimitive
addVertex
in interface OrientablePrimitive
OrientablePrimitive.addVertex(Point)
public void removeVertex(int index)
OrientablePrimitive
removeVertex
in interface OrientablePrimitive
index
- The index of the vertex to removepublic Point getVertex(int index)
OrientablePrimitive
getVertex
in interface OrientablePrimitive
index
- The index of the vertex to getpublic int getNumVertices()
OrientablePrimitive
getNumVertices
in interface OrientablePrimitive
public void insertVertex(int index, Point p)
OrientablePrimitive
insertVertex
in interface OrientablePrimitive
index
- The index of the vertex where the new point has to be added.p
- The vertex to add.public void setVertex(int index, Point p)
OrientablePrimitive
setVertex
in interface OrientablePrimitive
index
- The index of the vertex where the new point has to be replaced.p
- The vertex to set.public void setGeneralPath(GeneralPathX generalPathX)
OrientablePrimitive
setGeneralPath
in interface OrientablePrimitive
generalPathX
- The generalPath that contains all the coordinatespublic void addMoveToVertex(Point point)
OrientablePrimitive
addMoveToVertex
in interface OrientablePrimitive
point
- The new point to addpublic void closePrimitive()
OrientablePrimitive
closePrimitive
in interface OrientablePrimitive
public void ensureCapacity(int capacity)
ensureCapacity
in interface OrientablePrimitive
public void reProject(ICoordTrans ct)
Geometry
public void transform(AffineTransform at)
Geometry
public int getDimension()
Geometry
getDimension
in interface Geometry
public Shape getShape(AffineTransform affineTransform)
public Shape getShape()
public boolean is3D()
is3D
in interface GeometryJTS
public void setPoints(Point startPoint, Point midPoint, Point endPoint)
Arc
public Point getInitPoint()
Arc
getInitPoint
in interface Arc
public Point getEndPoint()
Arc
getEndPoint
in interface Arc
public Point getMiddlePoint()
Arc
getMiddlePoint
in interface Arc
protected double normalizeAngle(double angle)
angle
- (radians)public void setPointsStartExt(Point center, double radius, double startAngle, double angleExt)
Arc
setPointsStartExt
in interface Arc
center
- The center of the arc.radius
- The radius.startAngle
- The start angle of the arc (in radians)angleExt
- The angular extent of the arc (in radians).
The sign convention is:
startAngle = 0 is "3 o'clock";
startAngle = (PI / 3) is "1 o'clock";
angleExt > 0 means "advancing clockwise";
angleExt < 0 means "advancing counterclockwise".public void setPointsStartEnd(Point center, double radius, double startAngle, double endAngle)
Arc
setPointsStartEnd
in interface Arc
center
- The center of the arc.radius
- The radius.startAngle
- The start angle of the arc (in radians)endAngle
- The end angle of the arc (in radians).public GeneralPathX getGeneralPath()
Geometry
getGeneralPath
in interface Geometry
public PathIterator getPathIterator(AffineTransform at)
Geometry
getPathIterator
in interface Shape
getPathIterator
in interface Geometry
at
- The transformation to apply.public PathIterator getPathIterator(AffineTransform at, double flatness)
Geometry
getPathIterator
in interface Shape
getPathIterator
in interface Geometry
at
- The affine transformation.public void flip() throws GeometryOperationNotSupportedException, GeometryOperationException
Geometry
flip
in interface Geometry
GeometryOperationNotSupportedException
GeometryOperationException
public double getStartAngle() throws GeometryOperationNotSupportedException, GeometryOperationException
Arc
getStartAngle
in interface Arc
GeometryOperationNotSupportedException
GeometryOperationException
public double getEndAngle() throws GeometryOperationNotSupportedException, GeometryOperationException
Arc
getEndAngle
in interface Arc
GeometryOperationNotSupportedException
GeometryOperationException
public Geometry offset(double distance) throws GeometryOperationNotSupportedException, GeometryOperationException
offset
in interface Geometry
GeometryOperationNotSupportedException
GeometryOperationException
protected AffineTransform getScaleAffineTransform(Point center, Double scale) throws GeometryOperationNotSupportedException, GeometryOperationException