Class TLcdProfileGenerator

java.lang.Object
com.luciad.tea.TLcdProfileGenerator

public class TLcdProfileGenerator extends Object

Generate terrain profile points for line segments.

This class needs to be configured with the georeference in which the points of the segments are defined. This reference is called the "segment reference" and can be set using setSegmentReference().

In some cases, a different georeference than the segment reference of the given points might be used for scanning. This is done to ensure that the scanned profile points lie on the segment as it is drawn on the view (e.g. geodesic or straight). We call this reference the "scan reference". It can be retrieved by calling getScanReference(). All points passed to the function given as a paremeter to generateTerrainProfile() will be with reference to the segment's original segment reference. For the convenience of the user, there are two methods to transform points between the scan reference and the segment reference of the given points: modelPoint2ScanPointSFCT() and scanPoint2ModelPointSFCT(). By default, the scan reference is taken to be the same as the segment reference. To change this behavior, the method provideSegmentScanReference() needs to be overridden.

  • Constructor Details

  • Method Details

    • getSegmentReference

      public ILcdGeoReference getSegmentReference()
      Gets the reference system in which the points of the segment for which the profile needs to be generated are defined.
      Returns:
      A reference system.
    • setSegmentReference

      public void setSegmentReference(ILcdGeoReference aGeoReference)
      Set the reference system in which the points of the segment for which the profile needs to be generated are defined. Currently, ILcdGeodeticReference and ILcdGridReference are supported.
      Parameters:
      aGeoReference - A reference system.
    • generateTerrainProfile

      public void generateTerrainProfile(ILcdPoint aStartPoint, ILcdPoint aEndPoint, double aDistanceDelta, ILcdOnPointFunction aFunction)
      Generate a terrain profile for the segment between aStartPoint and aEndPoint.
      Parameters:
      aStartPoint - Start point of profile segment.
      aEndPoint - End point of profile segment.
      aDistanceDelta - Scan resolution in meters.
      aFunction - Function to apply on resulting points. The objects passed to the function will always be ILcd3DEditablePoints. The same instance is passed each time, so the caller will have to clone it if he wants to keep a reference.
    • modelPointDistance2D

      public double modelPointDistance2D(ILcdPoint aStartPoint, ILcdPoint aEndPoint)
      Returns distance between two model points in the reference used for scanning. The points are transformed to the scan reference before calculating the distance.
      Parameters:
      aStartPoint - First point.
      aEndPoint - Second point.
      Returns:
      Distance in the scanning reference system.
    • scanPointDistance2D

      public double scanPointDistance2D(ILcdPoint aStartPoint, ILcdPoint aEndPoint)
      Returns distance between two scan points in the reference used for scanning. This is the distance along the line segment as it is drawn on the view. The points are assumed to be with reference to the scan reference.
      Parameters:
      aStartPoint - First point.
      aEndPoint - Second point.
      Returns:
      Distance in the scanning reference system.
    • distance2D

      protected double distance2D(ILcdPoint aStartPoint, ILcdPoint aEndPoint, ILcdGeoReference aReference)
      Returns the distance between two points in the given reference system. This implementation supports ILcdGeodeticReference and ILcdGridReference.
      Parameters:
      aStartPoint - First point.
      aEndPoint - Second point.
      aReference - Reference system for the points.
      Returns:
      Distance in meters.
    • getTerrainElevationProvider

      public ALcdTerrainElevationProvider getTerrainElevationProvider()
      Gets the elevation provider to use for getting the terrain elevation.
      Returns:
      the elevation provider to use for getting the terrain elevation.
    • setTerrainElevationProvider

      public void setTerrainElevationProvider(ALcdTerrainElevationProvider aElevationProvider)
      Set the elevation provider to use for getting the terrain elevation.
      Parameters:
      aElevationProvider - the elevation provider to use for getting the terrain elevation.
    • provideSegmentScanReference

      protected ILcdGeoReference provideSegmentScanReference()
      Returns the reference in which a line contained in the given layer should be discretized. The current implementation always returns the segment reference ( getSegmentReference() ). Override to use another reference.
      Returns:
      Reference to be used for scanning.
    • getScanReference

      public ILcdGeoReference getScanReference()
      Retrieve the reference that will be used for scanning the segment. This reference is chosen (call to provideSegmentScanReference()) when setSegmentReference() is called.
      Returns:
      The reference used for scanning.
    • modelPoint2ScanPoint

      public void modelPoint2ScanPoint(ILcdPoint aModelPoint, ILcd3DEditablePoint aScanPointSFCT) throws TLcdOutOfBoundsException
      Utility method to transform a point from the model reference of the current layer to the current scan reference.
      Parameters:
      aModelPoint - Model point to transform.
      aScanPointSFCT - Resulting scan reference point side-effect parameter.
      Throws:
      TLcdOutOfBoundsException
    • scanPoint2ModelPoint

      public void scanPoint2ModelPoint(ILcdPoint aScanPoint, ILcd3DEditablePoint aModelPointSFCT) throws TLcdOutOfBoundsException
      Throws:
      TLcdOutOfBoundsException
    • setClassTraceOn

      public static void setClassTraceOn(boolean aClassTraceOn)
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Enables tracing for all instances of this class. If the argument is true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
      Parameters:
      aClassTraceOn - if true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
    • setTraceOn

      public void setTraceOn(boolean aTraceOn)
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Enables tracing for this class instance. Calling this method with either true or false as argument automatically turns off tracing for all other class instances for which setTraceOn has not been called. If the argument is false then only the informative, warning and error log messages are recorded.
      Parameters:
      aTraceOn - if true then all log messages are recorded for this instance. If false, then only the informative, warning and error log messages are recorded.
    • isTraceOn

      public boolean isTraceOn()
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Returns true if tracing is enabled for this class.
      Returns:
      true if tracing is enabled for this class, false otherwise.