Class TLcdXYPolylineMSupport

java.lang.Object
com.luciad.shape.shape2D.TLcdXYPolylineMSupport

public class TLcdXYPolylineMSupport extends Object
A 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 Details

    • TRACEON_GETPOINT

      public static boolean TRACEON_GETPOINT
    • TRACEON_GETM

      public static boolean TRACEON_GETM
  • Constructor Details

    • TLcdXYPolylineMSupport

      public TLcdXYPolylineMSupport()
  • Method Details

    • getM

      public static double getM(ILcdShapeList aPolylineM, ILcdPoint aPoint)
    • getBeginPoint

      public static ILcdPoint getBeginPoint(ILcdShapeList aPolylineM)
      Returns:
      the ILcdPoint with least m-value in the polylineM
    • getEndPoint

      public static ILcdPoint getEndPoint(ILcdShapeList aPolylineM)
      Returns:
      the ILcdPoint with highest m-value in the polylineM
    • getBeginM

      public static double getBeginM(ILcdShapeList aPolylineM)
      Returns:
      the least m-value in the polylineM
    • getEndM

      public static double getEndM(ILcdShapeList aPolylineM)
      Returns:
      the highest m-value in the polylineM
    • getMLength

      public static double getMLength(ILcdShapeList aPolylineM)
      Returns:
      the difference of highest and lowest m-value in the polylineM
    • getPoint

      public static ILcdPoint getPoint(ILcdShapeList aPolylineM, double aM)
      Returns:
      an ILcdPoint that has value aM as its m-value in the polylineM
    • getPoint

      public static ILcdPoint getPoint(ILcdShapeList aPolylineM, double aM, double aOffset)
      Returns:
      an ILcdPoint that has value aM as its m-value in the polylineM, and that has an offset of aOffset (in model units) to the right of the polylineM Note: use negative values to specify an offset to the left.
    • interacts

      public static boolean interacts(ILcdShapeList aPolylineM, double aLocation, ILcdBounds aBounds)
      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 value aM 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.