public class TLcdTerrainRulerController extends TLcdAdvancedMapRulerController
TLcdAdvancedMapRulerController
which takes into account
underlying terrain for distance calculations. Distance of every segment is calculated iteratively until
one of the following conditions is met:
TLcdAdvancedMapRulerController.MeasurementChangeListener
MEASURE_GEODETIC, MEASURE_PROJECTION_PLANE, MEASURE_RHUMBLINE, RULER_MODEL_TYPE_NAME
Constructor and Description |
---|
TLcdTerrainRulerController()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected double |
calculateDistance(ILcdPoint aStartPoint,
ILcdPoint aEndPoint,
ILcdGeoReference aGeoReference,
int aMeasuringMode,
ILcdGXYContext aGXYContext)
Calculates the distance between the two points, taking into account the path defined by the measuring mode.
|
double |
getAbsoluteTolerance()
Returns the absolute tolerance in meters for the distance calculated.
|
int |
getMaximumSamples()
Returns the maximum number of points that should be sampled in between two points for every segment.
|
int |
getMinimumSamples()
Returns the minimum number of intermediate points in between the start point and end point of every segment
which are used in calculation of the distance of one segment.
|
int |
getMinimumStepSize()
Returns the minimum distance (expressed in meters) between two intermediate points generated when calculating the
distance of a segment.
|
double |
getRelativeTolerance()
Returns the relative tolerance for the distance calculated.
|
boolean |
isUseTerrain()
Returns whether terrain should be taken into account when computing the distance.
|
ILcdSegmentScanner |
retrieveSegmentScanner(int aMeasuringMode,
ILcdGeoReference aGeoReference,
ILcdGXYContext aGXYContext)
Returns a suitable segment scanner depending on the measuring mode and the reference of the start and end point.
|
void |
setAbsoluteTolerance(double aAbsoluteTolerance)
Sets the absolute tolerance in meters for the distance calculated.
|
void |
setMaximumSamples(int aMaximumSamples)
Sets the maximum number of points that should be sampled in between two points for every segment.
|
void |
setMinimumSamples(int aMinimumSamples)
Sets the minimum number of intermediate points in between the start point and end point of every segment
which are used in calculation of the distance of one segment.
|
void |
setMinimumStepSize(int aMinimumStepSize)
Sets the minimum distance expressed in meters between two intermediate points generated when calculating the
distance of a segment.
|
void |
setRelativeTolerance(double aRelativeTolerance)
Sets the relative tolerance for the distance calculated.
|
void |
setTerrainElevationProvider(ALcdTerrainElevationProvider aTerrainElevationProvider)
Sets the terrain elevation provider which is responsible for return elevation data on any segment
of the ruler.
|
void |
setTraceOn(boolean aTraceOn)
Enables tracing for this class instance.
|
void |
setUseTerrain(boolean aUseTerrain)
Sets whether terrain should be taken into account when computing the distance.
|
addMeasurementChangeListener, addPropertyChangeListener, appendGXYController, calculateAzimuth, createGXYEqualDistanceCurvePainter, createGXYLabelPainter, createGXYLayer, createGXYLayerLabelPainter, createGXYPolylineEditor, createGXYPolylinePainter, firePropertyChangeEvent, getAzimuthFormat, getCursor, getDistanceFormat, getGXYEditController, getGXYLayer, getGXYNewController, getHaloColor, getHaloThickness, getHotPointIcon, getLabelAlignment, getLabelBackground, getLabelForeground, getLabelSelectionColor, getLabelVGap, getLayered, getLineStyle, getMeasurementGeoReference, getMeasurementPoint, getMeasurementPointCount, getMeasurementSegmentAzimuth, getMeasurementSegmentCount, getMeasurementSegmentDistance, getMeasurementTotalDistance, getMeasureMode, getNextGXYController, getSegmentLabelFont, getSnappables, getTotalDistanceLabelFont, handleAWTEvent, isAddGXYLayerToGXYView, isAllowMultipleMeasurements, isAlwaysCreate, isDisplayAzimuth, isDrawEqualDistanceCurve, isHaloEnabled, isLabelFilled, isLabelFontBorder, isLabelFrame, isLabelRotationAllowed, isPreserveMeasurement, isRemoveGXYLayerFromGXYView, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, paint, recalculateMeasureMents, removeMeasurementChangeListener, removePropertyChangeListener, setAddGXYLayerToGXYView, setAllowMultipleMeasurements, setAlwaysCreate, setAzimuthFormat, setDisplayAzimuth, setDistanceFormat, setDrawEqualDistanceCurve, setGXYEditController, setGXYNewController, setHaloColor, setHaloEnabled, setHaloThickness, setHotPointIcon, setLabelAlignment, setLabelBackground, setLabelFilled, setLabelFontBorder, setLabelForeground, setLabelFrame, setLabelRotationAllowed, setLabelSelectionColor, setLabelVGap, setLineStyle, setMeasureMode, setNextGXYController, setPreserveMeasurement, setRemoveGXYLayerFromGXYView, setSegmentLabelFont, setSnappables, setTotalDistanceLabelFont, startInteraction, terminateInteraction, viewRepaint
addUndoableListener, doPanGXYView, doZoomGXYView, fireUndoableEvent, getDownPanChars, getDownPanCodes, getLeftPanChars, getLeftPanCodes, getPanAbsDelta, getPanAbsDelta, getRightPanChars, getRightPanCodes, getUndoableListenerCount, getUpPanChars, getUpPanCodes, getZoomInChars, getZoomInCodes, getZoomOutChars, getZoomOutCodes, isDragging, isPanOnMouseDragExit, isPanOnMouseMoveExit, isPanUndoable, isRequestFocusOnMouseEntered, isRequestFocusOnMousePressed, isTraceOn, isZoomUndoable, removeUndoableListener, setDownPanChars, setDownPanCodes, setIsDragging, setLeftPanChars, setLeftPanCodes, setPanAbsDelta, setPanOnMouseDragExit, setPanOnMouseMoveExit, setPanUndoable, setRequestFocusOnMouseEntered, setRequestFocusOnMousePressed, setRightPanChars, setRightPanCodes, setUpPanChars, setUpPanCodes, setZoomInChars, setZoomInCodes, setZoomOutChars, setZoomOutCodes, setZoomUndoable, updateViewLocationAfterZoomSFCT
addStatusListener, asGXYController, fireStatusEvent, getGXYView, getIcon, getName, getShortDescription, registerInstance, removeStatusListener, retrieveGXYViewXYWorldTransformation, setClassTraceOn, setCursor, setGXYView, setIcon, setName, setShortDescription
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getIcon, getName, getShortDescription
public TLcdTerrainRulerController()
public void setTerrainElevationProvider(ALcdTerrainElevationProvider aTerrainElevationProvider)
aTerrainElevationProvider
- the terrain elevation provider which is responsible for return elevation data on any segment
of the ruler.protected double calculateDistance(ILcdPoint aStartPoint, ILcdPoint aEndPoint, ILcdGeoReference aGeoReference, int aMeasuringMode, ILcdGXYContext aGXYContext)
isUseTerrain()
the terrain altitude provided by the terrain elevation provider
is taken into account.calculateDistance
in class TLcdAdvancedMapRulerController
aStartPoint
- the first pointaEndPoint
- the second pointaGeoReference
- the reference the points are defined inaMeasuringMode
- the mode defining the path from the start point to the end pointaGXYContext
- the context in which the distance is measured.public void setAbsoluteTolerance(double aAbsoluteTolerance)
aAbsoluteTolerance
- the absolute tolerance in meters for the distance calculated.getAbsoluteTolerance()
,
setRelativeTolerance(double)
public double getAbsoluteTolerance()
setAbsoluteTolerance(double)
,
setRelativeTolerance(double)
public void setRelativeTolerance(double aRelativeTolerance)
aRelativeTolerance
- the relative tolerance for the distance calculated.getRelativeTolerance()
,
setAbsoluteTolerance(double)
public double getRelativeTolerance()
setRelativeTolerance(double)
,
setAbsoluteTolerance(double)
public void setUseTerrain(boolean aUseTerrain)
aUseTerrain
- whether terrain should be taken into account when computing the distance.isUseTerrain()
public boolean isUseTerrain()
setUseTerrain(boolean)
public ILcdSegmentScanner retrieveSegmentScanner(int aMeasuringMode, ILcdGeoReference aGeoReference, ILcdGXYContext aGXYContext) throws IllegalArgumentException
aMeasuringMode
- the mode defining the path between the two points.aGeoReference
- the reference of the two points.TLcdGeodeticSegmentScanner
for TLcdAdvancedMapRulerController.MEASURE_GEODETIC
,
a TLcdRhumblineSegmentScanner
for TLcdAdvancedMapRulerController.MEASURE_RHUMBLINE
IllegalArgumentException
- when the measuring mode is
TLcdAdvancedMapRulerController.MEASURE_PROJECTION_PLANE
and the world reference of the view is not a
grid reference.public int getMinimumSamples()
setMinimumSamples(int)
public void setMinimumSamples(int aMinimumSamples)
aMinimumSamples
- the minimum number of points in between the start point and end point.getMinimumSamples()
public int getMinimumStepSize()
setMinimumStepSize(int)
public void setMinimumStepSize(int aMinimumStepSize)
aMinimumStepSize
- the minimum distance (expressed in meters) between two intermediate points generated when calculating the
distance of a segment.getMinimumStepSize()
public int getMaximumSamples()
public void setMaximumSamples(int aMaximumSamples)
aMaximumSamples
- the maximum number of points that should be sampled in between two points for every segment.public void setTraceOn(boolean aTraceOn)
ALcdGXYSmartController
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.setTraceOn
in class ALcdGXYSmartController
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.