public class TLcdXYCircularArcBy3Points extends ALcd2DEditableShape implements ILcd2DEditableCircularArcBy3Points, ILcdCache
ILcd2DEditableCircularArcBy3Points
in the
cartesian space.
This class is thread-safe for concurrent read-only access of its contents. For read-write access,
external locking must be used. Such locking is typically done at the model level.INTERPOLATION_CIRCLE_BY_3POINTS, INTERPOLATION_CIRCLE_BY_CENTERPOINT, INTERPOLATION_CIRCULARARC_BY_3POINTS, INTERPOLATION_CIRCULARARC_BY_BULGE, INTERPOLATION_CIRCULARARC_BY_CENTERPOINT, INTERPOLATION_ELLIPTICAL, INTERPOLATION_GEODESIC, INTERPOLATION_LINEAR, INTERPOLATION_MIXED, INTERPOLATION_RHUMB
Constructor and Description |
---|
TLcdXYCircularArcBy3Points()
Default constructor, initializing all three points at (0,0).
|
TLcdXYCircularArcBy3Points(double aStartX,
double aStartY,
double aIntermediateX,
double aIntermediateY,
double aEndX,
double aEndY)
Creates a new circular arc using the given point coordinates.
|
TLcdXYCircularArcBy3Points(ILcdPoint aStartPoint,
ILcdPoint aIntermediatePoint,
ILcdPoint aEndPoint)
Creates a new circular arc using the given points.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
Clears the cache.
|
Object |
clone()
Creates and returns a copy of this object, by delegating to
Object.clone() . |
void |
computePointSFCT(double aParam,
ILcd3DEditablePoint aPointSFCT)
Computes a point of the curve, defined by the given parameter.
|
boolean |
contains2D(double aX,
double aY)
Checks whether this
ILcdShape contains the given point in
the 2D space. |
boolean |
equals(Object o)
An object is considered equal to this shape if it has the same class.
|
double |
getArcAngle()
Returns the angle over which this
ILcdCircularArc extends (in degrees). |
ILcdBounds |
getBounds()
Returns the
ILcdBounds by which the geometry of this ILcdBounded object
is bounded. |
Object |
getCachedObject(Object aKey)
Looks up and returns the cached Object corresponding to the given key.
|
ILcdPoint |
getCenter()
Returns the center of this
ILcdCircularArc . |
ILcdPoint |
getEndPoint()
Retrieves the end point of the curve.
|
double |
getEndTangent2D()
Returns the angle of the curve's tangent at the end point,
in degrees counterclockwise from the direction at 3 o'clock.
|
ILcdPoint |
getFocusPoint()
Returns the focus point of this
ILcdShape . |
ILcdPoint |
getIntermediatePoint()
Returns an intermediate point of this arc.
|
String |
getInterpolation()
Returns the interpolation method used by this curve,
which is
ILcdCurve.INTERPOLATION_CIRCULARARC_BY_3POINTS . |
double |
getLength2D(double aParam1,
double aParam2)
Returns the length between two points of the curve,
defined by the given parameters.
|
int |
getLineSegmentIntersectionCount(ILcdPoint aP1,
ILcdPoint aP2)
Returns the number of intersections between this curve and a line segment
defined by the two specified points.
|
double |
getRadius()
Returns the radius of this
ILcdCircularArc . |
double |
getStartAngle()
Returns the start angle of this
ILcdCircularArc (in degrees). |
ILcdPoint |
getStartPoint()
Retrieves the start point of the curve.
|
double |
getStartTangent2D()
Returns the angle of the curve's tangent at the start point,
in degrees counterclockwise from the direction at 3 o'clock.
|
double |
getTangent2D(double aParam)
Returns the angle of the curve's tangent in the point defined
by the given parameter, in degrees counterclockwise from the
direction at 3 o'clock.
|
int |
hashCode()
The hash code of this shape is the hash code of its class, in order to
be consistent with the
ALcdShape.equals(Object) method. |
void |
insertIntoCache(Object aKey,
Object aObject)
Inserts a cache Object corresponding to the given key Object.
|
void |
moveEndPoint2D(double aX,
double aY)
Moves the end point to the given point in the 2D space.
|
void |
moveIntermediatePoint2D(double aX,
double aY)
Moves the intermediate point to the given point in the 2D space.
|
void |
moveStartPoint2D(double aX,
double aY)
Moves the start point to the given point in the 2D space.
|
Object |
removeCachedObject(Object aKey)
Looks up and removes the cached Object corresponding to the given key.
|
String |
toString() |
void |
translate2D(double aDeltaX,
double aDeltaY)
Translates this
ILcd2DEditableShape from its current position over the given translation
vector in the 2D space. |
void |
translateEndPoint2D(double aDeltaX,
double aDeltaY)
Translates the end point from its current position
over the given translation vector in the 2D space.
|
void |
translateIntermediatePoint2D(double aDeltaX,
double aDeltaY)
Translates the intermediate point from its current position
over the given translation vector in the 2D space.
|
void |
translateStartPoint2D(double aDeltaX,
double aDeltaY)
Translates the start point from its current position
over the given translation vector in the 2D space.
|
contains3D, move2D, move2D
contains2D, contains3D, fromDomainObject
finalize, getClass, notify, notifyAll, wait, wait, wait
contains2D, contains3D, contains3D
move2D, move2D
public TLcdXYCircularArcBy3Points()
public TLcdXYCircularArcBy3Points(ILcdPoint aStartPoint, ILcdPoint aIntermediatePoint, ILcdPoint aEndPoint)
aStartPoint
- the start point of the arcaIntermediatePoint
- a point on the arc that is not the start nor the end pointaEndPoint
- the end point of the arcpublic TLcdXYCircularArcBy3Points(double aStartX, double aStartY, double aIntermediateX, double aIntermediateY, double aEndX, double aEndY)
aStartX
- X-coordinate of the arc's start pointaStartY
- Y-coordinate of the arc's start pointaIntermediateX
- X-coordinate of a point on the arc that is not the start nor the end
pointaIntermediateY
- Y-coordinate of a point on the arc that is not the start nor the end
pointaEndX
- X-coordinate of the arc's end pointaEndY
- Y-coordinate of the arc's end pointpublic ILcdPoint getCenter()
ILcdCircularArc
ILcdCircularArc
.getCenter
in interface ILcdCircularArc
ILcdCircularArc
.public double getRadius()
ILcdCircularArc
ILcdCircularArc
.getRadius
in interface ILcdCircularArc
ILcdCircularArc
.public double getStartAngle()
ILcdCircularArc
ILcdCircularArc
(in degrees). The angle is
measured from 3 o'clock position, positive counter-clockwise.getStartAngle
in interface ILcdCircularArc
public double getArcAngle()
ILcdCircularArc
ILcdCircularArc
extends (in degrees). The angle
is positive counter-clockwise.getArcAngle
in interface ILcdCircularArc
public ILcdPoint getFocusPoint()
ILcdShape
ILcdShape
.getFocusPoint
in interface ILcdShape
ILcdShape
.public boolean contains2D(double aX, double aY)
ILcdShape
ILcdShape
contains the given point in
the 2D space. Only the first two dimensions of the ILcdShape
are considered.contains2D
in interface ILcdShape
aX
- the x coordinate of the point.aY
- the y coordinate of the point.public ILcdBounds getBounds()
ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.
If the geometry does not allow retrieving valid bounds (for example a polyline with 0 points)
the return value is unspecified.
It is highly recommended to return an undefined
bounds.
You can create undefined bounds using the default constructors
of TLcdLonLatBounds
or TLcdXYBounds
.
getBounds
in interface ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.public void translate2D(double aDeltaX, double aDeltaY)
ILcd2DEditableShape
ILcd2DEditableShape
from its current position over the given translation
vector in the 2D space. Only the first two dimensions of the ILcdShape
are considered.
The third dimension is left unchanged.translate2D
in interface ILcd2DEditableShape
aDeltaX
- the x coordinate of the translation vector.aDeltaY
- the y coordinate of the translation vector.public void moveStartPoint2D(double aX, double aY)
ILcd2DEditableCircularArcBy3Points
ILcdShape
are considered.
The third dimension is left unchanged.moveStartPoint2D
in interface ILcd2DEditableCircularArcBy3Points
aX
- the x coordinate of the point.aY
- the y coordinate of the point.public void moveEndPoint2D(double aX, double aY)
ILcd2DEditableCircularArcBy3Points
ILcdShape
are considered.
The third dimension is left unchanged.moveEndPoint2D
in interface ILcd2DEditableCircularArcBy3Points
aX
- the x coordinate of the point.aY
- the y coordinate of the point.public void moveIntermediatePoint2D(double aX, double aY)
ILcd2DEditableCircularArcBy3Points
ILcdShape
are considered.
The third dimension is left unchanged.moveIntermediatePoint2D
in interface ILcd2DEditableCircularArcBy3Points
aX
- the x coordinate of the point.aY
- the y coordinate of the point.public void translateStartPoint2D(double aDeltaX, double aDeltaY)
ILcd2DEditableCircularArcBy3Points
translateStartPoint2D
in interface ILcd2DEditableCircularArcBy3Points
aDeltaX
- the x coordinate of the translation vector.aDeltaY
- the y coordinate of the translation vector.public void translateEndPoint2D(double aDeltaX, double aDeltaY)
ILcd2DEditableCircularArcBy3Points
translateEndPoint2D
in interface ILcd2DEditableCircularArcBy3Points
aDeltaX
- the x coordinate of the translation vector.aDeltaY
- the y coordinate of the translation vector.public void translateIntermediatePoint2D(double aDeltaX, double aDeltaY)
ILcd2DEditableCircularArcBy3Points
translateIntermediatePoint2D
in interface ILcd2DEditableCircularArcBy3Points
aDeltaX
- the x coordinate of the translation vector.aDeltaY
- the y coordinate of the translation vector.public ILcdPoint getIntermediatePoint()
ILcdCircularArcBy3Points
getIntermediatePoint
in interface ILcdCircularArcBy3Points
public ILcdPoint getStartPoint()
ILcdCurve
This is equivalent to computePointSFCT(0)
.
getStartPoint
in interface ILcdCurve
public ILcdPoint getEndPoint()
ILcdCurve
This is equivalent to computePointSFCT(1)
.
getEndPoint
in interface ILcdCurve
public double getStartTangent2D()
ILcdCurve
The tangent orientation is from the start point towards the rest of the shape.
This is the same as getTangent2D(0)
.
getStartTangent2D
in interface ILcdCurve
public double getEndTangent2D()
ILcdCurve
The tangent orientation is from the end point, away from the curve before it.
This is the same as getTangent2D(1)
.
getEndTangent2D
in interface ILcdCurve
public double getTangent2D(double aParam)
ILcdCurve
The tangent orientation is from the point at parameter aParam
towards the rest of the shape.
ILcdCurve.getStartTangent2D()
.ILcdCurve.getEndTangent2D()
.getTangent2D
in interface ILcdCurve
aParam
- a value of the closed interval [0,1]public double getLength2D(double aParam1, double aParam2)
ILcdCurve
aParam1 == aParam2
, the length is 0.aParam1 == 0 and aParam2 == 1
, the length is the whole length of the curve.aParam1 > aParam2
, the length is (aParam1 to 1
) + (0 to aParam2
).getLength2D
in interface ILcdCurve
aParam1
- a value of the closed interval [0,1]aParam2
- a value of the closed interval [0,1]public String getInterpolation()
ILcdCurve.INTERPOLATION_CIRCULARARC_BY_3POINTS
.getInterpolation
in interface ILcdCircularArc
getInterpolation
in interface ILcdCircularArcBy3Points
getInterpolation
in interface ILcdCurve
INTERPOLATION_CIRCULARARC_BY_3POINTS
.public void computePointSFCT(double aParam, ILcd3DEditablePoint aPointSFCT)
ILcdCurve
ILcdCurve.getStartPoint()
.ILcdCurve.getEndPoint()
.computePointSFCT
in interface ILcdCurve
aParam
- a value of the closed interval [0,1]aPointSFCT
- the point to store the computed curve point inpublic void insertIntoCache(Object aKey, Object aObject)
ILcdCache
insertIntoCache
in interface ILcdCache
aKey
- the key Object that will be used to identify the Object.
The key must therefore be a unique identifier, typically the caller
itself: insertIntoCache(this, ...)
.aObject
- the Object to be cached.public Object getCachedObject(Object aKey)
ILcdCache
getCachedObject
in interface ILcdCache
aKey
- the key Object that was used for storing the cache Object.public Object removeCachedObject(Object aKey)
ILcdCache
removeCachedObject
in interface ILcdCache
aKey
- the key Object that was used for storing the cache Object.public void clearCache()
ILcdCache
clearCache
in interface ILcdCache
public Object clone()
ALcdShape
Object.clone()
. Extensions should delegate to this implementation
with super.clone()
, in order to create an object instance of
the right type, with all fields copied. They then should explicitly
clone any non-primitive fields for which a deeper clone is required.clone
in interface ILcdCloneable
clone
in class ALcdShape
Object.clone()
public boolean equals(Object o)
ALcdShape
public int hashCode()
ALcdShape
ALcdShape.equals(Object)
method.
Extensions should refine this implementation, based on their properties.public int getLineSegmentIntersectionCount(ILcdPoint aP1, ILcdPoint aP2)
ILcdCurve
This information can be used to perform containment calculations, if this curve is closed or if this curve is part of a composite closed curve. By determining the number of intersections between this curve and a line segment starting from a given point in a fixed direction, one can determine whether a point is located within the closed curve by using the even-odd rule.
getLineSegmentIntersectionCount
in interface ILcdCurve
aP1
- the first point of the line segmentaP2
- the second point of the line segment