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 and Description |
---|
TLcdProfileGenerator(ALcdTerrainElevationProvider aElevationProvider) |
Modifier and Type | Method and Description |
---|---|
protected double |
distance2D(ILcdPoint aStartPoint,
ILcdPoint aEndPoint,
ILcdGeoReference aReference)
Returns the distance between two points in the given reference system.
|
void |
generateTerrainProfile(ILcdPoint aStartPoint,
ILcdPoint aEndPoint,
double aDistanceDelta,
ILcdOnPointFunction aFunction)
Generate a terrain profile for the segment between aStartPoint and aEndPoint.
|
ILcdGeoReference |
getScanReference()
Retrieve the reference that will be used for scanning the segment.
|
ILcdGeoReference |
getSegmentReference()
Gets the reference system in which the points of the segment for which the profile
needs to be generated are defined.
|
ALcdTerrainElevationProvider |
getTerrainElevationProvider()
Gets the elevation provider to use for getting the terrain elevation.
|
boolean |
isTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
modelPoint2ScanPoint(ILcdPoint aModelPoint,
ILcd3DEditablePoint aScanPointSFCT)
Utility method to transform a point from the model reference of the current layer to
the current scan reference.
|
double |
modelPointDistance2D(ILcdPoint aStartPoint,
ILcdPoint aEndPoint)
Returns distance between two model points in the reference used for scanning.
|
protected ILcdGeoReference |
provideSegmentScanReference()
Returns the reference in which a line contained in the given layer should be discretized.
|
void |
scanPoint2ModelPoint(ILcdPoint aScanPoint,
ILcd3DEditablePoint aModelPointSFCT) |
double |
scanPointDistance2D(ILcdPoint aStartPoint,
ILcdPoint aEndPoint)
Returns distance between two scan points in the reference used for scanning.
|
static void |
setClassTraceOn(boolean aClassTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
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.
|
void |
setTerrainElevationProvider(ALcdTerrainElevationProvider aElevationProvider)
Set the elevation provider to use for getting the terrain elevation.
|
void |
setTraceOn(boolean aTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
public TLcdProfileGenerator(ALcdTerrainElevationProvider aElevationProvider)
public ILcdGeoReference getSegmentReference()
public void setSegmentReference(ILcdGeoReference aGeoReference)
aGeoReference
- A reference system.public void generateTerrainProfile(ILcdPoint aStartPoint, ILcdPoint aEndPoint, double aDistanceDelta, ILcdOnPointFunction aFunction)
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.public double modelPointDistance2D(ILcdPoint aStartPoint, ILcdPoint aEndPoint)
aStartPoint
- First point.aEndPoint
- Second point.public double scanPointDistance2D(ILcdPoint aStartPoint, ILcdPoint aEndPoint)
aStartPoint
- First point.aEndPoint
- Second point.protected double distance2D(ILcdPoint aStartPoint, ILcdPoint aEndPoint, ILcdGeoReference aReference)
aStartPoint
- First point.aEndPoint
- Second point.aReference
- Reference system for the points.public ALcdTerrainElevationProvider getTerrainElevationProvider()
public void setTerrainElevationProvider(ALcdTerrainElevationProvider aElevationProvider)
aElevationProvider
- the elevation provider to use for getting the terrain elevation.protected ILcdGeoReference provideSegmentScanReference()
public ILcdGeoReference getScanReference()
public void modelPoint2ScanPoint(ILcdPoint aModelPoint, ILcd3DEditablePoint aScanPointSFCT) throws TLcdOutOfBoundsException
aModelPoint
- Model point to transform.aScanPointSFCT
- Resulting scan reference point side-effect parameter.TLcdOutOfBoundsException
public void scanPoint2ModelPoint(ILcdPoint aScanPoint, ILcd3DEditablePoint aModelPointSFCT) throws TLcdOutOfBoundsException
TLcdOutOfBoundsException
public static void setClassTraceOn(boolean aClassTraceOn)
true
then all log messages are recorded, otherwise only
the informative, warning and error messages are recorded.aClassTraceOn
- if true then all log messages are recorded,
otherwise only the informative, warning and error messages are recorded.public void setTraceOn(boolean aTraceOn)
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.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.public boolean isTraceOn()
true
if tracing is enabled for this class.