Class TLcdXYPolylineMSupport
ILcdSHPPolylineMSupport
is a support class for
the polylineM implementation in com.luciad.format.shp.
It adds additional operations to that implementation.
In that sense it is a visitor (??).
Conceptually, a polylineM is a polyline that has for each of its containing points a corresponding measure value (called its m-value). The mapping between points and m-values is implementation dependent.
In com.luciad.format.shp, a polylineM is implemented as a
ILcdShapeList
of TLcdSHPPolylineZ
objects.
Moreover, the polylineM is also ILcdFeatured
.
Each PolylineMSupport
supports exactly one polylineM.
This polylineM is called "the polylineM" in
the specifications of the methods of PolylineMSupport
.
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.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
getBeginM
(ILcdShapeList aPolylineM) static ILcdPoint
getBeginPoint
(ILcdShapeList aPolylineM) static double
getEndM
(ILcdShapeList aPolylineM) static ILcdPoint
getEndPoint
(ILcdShapeList aPolylineM) static double
getM
(ILcdShapeList aPolylineM, ILcdPoint aPoint) static double
getMLength
(ILcdShapeList aPolylineM) static ILcdPoint
getPoint
(ILcdShapeList aPolylineM, double aM) static ILcdPoint
getPoint
(ILcdShapeList aPolylineM, double aM, double aOffset) static double
getViewAngle
(ILcdShapeList aPolylineM, double aM, ILcdModelXYWorldTransformation aMWT, ILcdGXYViewXYWorldTransformation aVWT) static double
getViewAngleOfVertex
(ILcdPolyline aPolylineZ, int aPointIndex, ILcdModelXYWorldTransformation aMWT, ILcdGXYViewXYWorldTransformation aVWT) static boolean
interacts
(ILcdShapeList aPolylineM, double aFrom, double aTo, ILcdBounds aBounds) static boolean
interacts
(ILcdShapeList aPolylineM, double aFrom, double aTo, ILcdPolygon aPolygon) static boolean
interacts
(ILcdShapeList aPolylineM, double aLocation, ILcdBounds aBounds)
-
Field Details
-
TRACEON_GETPOINT
public static boolean TRACEON_GETPOINT -
TRACEON_GETM
public static boolean TRACEON_GETM
-
-
Constructor Details
-
TLcdXYPolylineMSupport
public TLcdXYPolylineMSupport()
-
-
Method Details
-
getM
-
getBeginPoint
- Returns:
- the
ILcdPoint
with least m-value in the polylineM
-
getEndPoint
- Returns:
- the
ILcdPoint
with highest m-value in the polylineM
-
getBeginM
- Returns:
- the least m-value in the polylineM
-
getEndM
- Returns:
- the highest m-value in the polylineM
-
getMLength
- Returns:
- the difference of highest and lowest m-value in the polylineM
-
getPoint
- Returns:
- an
ILcdPoint
that has valueaM
as its m-value in the polylineM
-
getPoint
- Returns:
- an
ILcdPoint
that has valueaM
as its m-value in the polylineM, and that has an offset ofaOffset
(in model units) to the right of the polylineM Note: use negative values to specify an offset to the left.
-
interacts
- Returns:
- whether or not the point of this PolylineM at location aLocation interacts with ILcdBounds (Cartesian)
-
interacts
public static boolean interacts(ILcdShapeList aPolylineM, double aFrom, double aTo, ILcdBounds aBounds) - Returns:
- whether or not the segment of this PolylineM between aFrom and aTo interacts with ILcdBounds (Cartesian)
-
interacts
public static boolean interacts(ILcdShapeList aPolylineM, double aFrom, double aTo, ILcdPolygon aPolygon) - Returns:
- whether or not the segment of this PolylineM between aFrom and aTo interacts with ILcdShapeList of ILcdPolyline (Cartesian)
-
getViewAngle
public static double getViewAngle(ILcdShapeList aPolylineM, double aM, ILcdModelXYWorldTransformation aMWT, ILcdGXYViewXYWorldTransformation aVWT) - Returns:
- the view angle (i.e., the angle on an ILcdGXYView )
for the
ILcdPoint
that has valueaM
as its m-value in the polylineM, given the model to world transformation aMWT and the world to view transformation aVWT.If aM is outside the m values of the polylineM, the view angle is 0.0.
For a polylineM with less than two vertices, the view angle is 0.0.
For other polylineM objects, the view angle of the end vertices is the angle of the respective end segment. For other vertices, the view angle is the average of the angle of the segment arriving in the vertex and the segment starting in the vertex. For non-vertices, the view angle is the angle of the segment the point is on.
-
getViewAngleOfVertex
public static double getViewAngleOfVertex(ILcdPolyline aPolylineZ, int aPointIndex, ILcdModelXYWorldTransformation aMWT, ILcdGXYViewXYWorldTransformation aVWT) - Returns:
- the view angle (i.e., the angle on an ILcdGXYView )
for a vertex with index aPointIndex on an ILcdPolyline,
given the model to world transformation aMWT and the
world to view transformation aVWT.
For a PolylineZ with less than two points, the angle is 0.0.
For other PolylineZ objects, the view angle of the end vertices is the angle of the respective end segment. For other vertices, the view angle is the average of the angle of the segment arriving in the vertex and the segment starting in the vertex.
-