public interface ILcdCurve extends ILcdShape
Examples of curves are lines, arcs, or any connected combination thereof.
Note that this interface does not enforce continuity. Rather, this is the responsibility of
the instance (e.g. ILcdGXYEditor
) that creates or manipulates the curves.
You can retrieve points along the curve using computePointSFCT(double, com.luciad.shape.shape3D.ILcd3DEditablePoint)
, for a parameter between
0 and 1, where 0 is the start of the curve and 1 is the end.
You can retrieve the tangent at points along the curve using getTangent2D(double)
using the same parameter.
A curve should have the following invariants:
ILcdRing
Modifier and Type | Field and Description |
---|---|
static String |
INTERPOLATION_CIRCLE_BY_3POINTS
Curve interpolation type: circle by 3 points.
|
static String |
INTERPOLATION_CIRCLE_BY_CENTERPOINT
Curve interpolation type: circle by center point and radius.
|
static String |
INTERPOLATION_CIRCULARARC_BY_3POINTS
Curve interpolation type: circular arc by 3 points.
|
static String |
INTERPOLATION_CIRCULARARC_BY_BULGE
Curve interpolation type: circular arc by 2 points and bulge.
|
static String |
INTERPOLATION_CIRCULARARC_BY_CENTERPOINT
Curve interpolation type: circular arc by center point and radius.
|
static String |
INTERPOLATION_ELLIPTICAL
Curve interpolation type: elliptical.
|
static String |
INTERPOLATION_GEODESIC
Curve interpolation type: geodesic.
|
static String |
INTERPOLATION_LINEAR
Curve interpolation type: linear.
|
static String |
INTERPOLATION_MIXED
Curve interpolation type: mixed.
|
static String |
INTERPOLATION_RHUMB
Curve interpolation type: rhumb.
|
Modifier and Type | Method and Description |
---|---|
void |
computePointSFCT(double aParam,
ILcd3DEditablePoint aPointSFCT)
Computes a point of the curve, defined by the given parameter.
|
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.
|
String |
getInterpolation()
Returns the interpolation method used by this curve.
|
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.
|
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.
|
contains2D, contains2D, contains3D, contains3D, getFocusPoint
getBounds
clone
static final String INTERPOLATION_LINEAR
static final String INTERPOLATION_GEODESIC
static final String INTERPOLATION_RHUMB
static final String INTERPOLATION_CIRCULARARC_BY_3POINTS
static final String INTERPOLATION_CIRCULARARC_BY_BULGE
static final String INTERPOLATION_CIRCULARARC_BY_CENTERPOINT
static final String INTERPOLATION_CIRCLE_BY_3POINTS
static final String INTERPOLATION_CIRCLE_BY_CENTERPOINT
static final String INTERPOLATION_ELLIPTICAL
static final String INTERPOLATION_MIXED
ILcdPoint getStartPoint()
This is equivalent to computePointSFCT(0)
.
ILcdPoint getEndPoint()
This is equivalent to computePointSFCT(1)
.
double getStartTangent2D()
The tangent orientation is from the start point towards the rest of the shape.
This is the same as getTangent2D(0)
.
double getEndTangent2D()
The tangent orientation is from the end point, away from the curve before it.
This is the same as getTangent2D(1)
.
double getTangent2D(double aParam)
The tangent orientation is from the point at parameter aParam
towards the rest of the shape.
getStartTangent2D()
.getEndTangent2D()
.aParam
- a value of the closed interval [0,1]double getLength2D(double aParam1, double aParam2)
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
).aParam1
- a value of the closed interval [0,1]aParam2
- a value of the closed interval [0,1]void computePointSFCT(double aParam, ILcd3DEditablePoint aPointSFCT)
getStartPoint()
.getEndPoint()
.aParam
- a value of the closed interval [0,1]aPointSFCT
- the point to store the computed curve point inString getInterpolation()
A set of predefined constants are defined in this interface,
which are used by the default ILcdCurve
implementations
provided by LuciadLightspeed.
Custom implementations can define their own constants, and use them to interpret the interpolation of the curve.
int getLineSegmentIntersectionCount(ILcdPoint aP1, ILcdPoint aP2)
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.
aP1
- the first point of the line segmentaP2
- the second point of the line segment