public class IlvLineOfVisibility extends IlvMapPolyline
IlvLineOfVisibility
represents a georeferenced polyline that is
colored according the visibility information.Modifier and Type | Class and Description |
---|---|
static interface |
IlvLineOfVisibility.ComputeListener
ComputeListener represents a listener interface that can be
attached to the line of view, and used to track its changes. |
static class |
IlvLineOfVisibility.Segment
This class contains the distances from the beginning of a visible or
invisible segment.
|
style
Constructor and Description |
---|
IlvLineOfVisibility(IlvInputStream stream)
Reads an
IlvLineOfVisibility instance from an
IlvInputStream . |
IlvLineOfVisibility(IlvLineOfVisibility source)
Creates an
IlvLineOfVisibility object by copying an
existing one. |
IlvLineOfVisibility(IlvManager manager,
double pointOfViewHeight,
double precision,
IlvCoordinate pointOfView,
IlvCoordinate targetPoint)
Creates a new
IlvLineOfVisibility object. |
IlvLineOfVisibility(IlvManager manager,
double pointOfViewHeight,
double precision,
IlvCoordinateSystem cs,
IlvAltitudeProvider elevationProvider,
IlvCoordinate pointOfView,
IlvCoordinate targetPoint)
Creates a new
IlvLineOfVisibility object. |
IlvLineOfVisibility(IlvManager manager,
double pointOfViewHeight,
double precision,
IlvPoint p1,
IlvPoint p2)
Creates a new
IlvLineOfVisibility object. |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(IlvLineOfVisibility.ComputeListener c)
Adds a listener to this line of view instance that will be called
whenever visibility information has changed.
|
void |
applyTransform(IlvTransformer t)
This overridden method of the superclass is used to make sure colors are
updated.
|
protected void |
computeSegments(double[] measureDistances,
boolean[] visibilities)
Computes and sets the segment list from the curvilinear abscissa
and visibility arrays.
|
protected void |
computeVisibility()
Computes the new visible and invisible segments arrays.
|
IlvGraphic |
copy()
Copies this object.
|
void |
draw(Graphics dst,
IlvTransformer t)
Draws this
IlvMapPolyline object with the specified graphics
and transformer. |
protected void |
fireChange()
Fires a change in the line of visibility that will execute all registered
listeners.
|
protected double |
getDistance(double lon1,
double lat1,
double lon2,
double lat2)
Returns the distance in meters between the specified latitude and
longitude coordinates.
|
IlvAltitudeProvider |
getElevationProvider()
Returns the elevation provider.
|
protected IlvGeodeticComputation |
getGeodeticComputation()
Returns the geodetic computation used to compute distances on the surface
of the earth
|
Color |
getHiddenZoneColor()
Returns the color of non-visible zones.
|
protected IlvLineOfVisibility.Segment[] |
getInvisibleSegments()
Possibly computes and return the array of invisible segments.
|
protected IlvCoordinateTransformation |
getKernelToSystemTransformation()
Returns the kernel to system transformation.
|
protected IlvCoordinate |
getLatLon(int iPoint)
Returns a point on the line in latitude and longitude coordinates..
|
double |
getLength()
Returns the distance between the viewpoint and the target in meters.
|
IlvLineOfVisibilityStyle |
getLineOfVisibilityStyle()
Returns the style of this line.
|
IlvManager |
getManager()
Returns the reference manager.
|
IlvCoordinate |
getPointOfView()
Returns the current viewpoint location.
|
double |
getPointOfViewHeight()
Returns the viewpoint height.
|
double |
getPrecision()
Returns the current precision.
|
IlvMapStyle |
getStyle()
Retrieves the
IlvMapStyle attached to this graphic. |
protected IlvCoordinateTransformation |
getSystemToKernelTransformation()
Returns the system to kernel transformation.
|
IlvCoordinate |
getTargetPoint()
Returns the current viewpoint location.
|
protected IlvLineOfVisibility.Segment[] |
getVisibleSegments()
Returns the array of visible segments.
|
Color |
getVisibleZoneColor()
Returns the color of the visible zones.
|
boolean |
isUsingEarthCurvature()
Tests if the computation should take into account the mean curvature of
the earth.
|
boolean |
isVisible(double distanceFromStart)
Returns whether or not the point located at a certain distance is visible
to the observer using the current line of visibility parameters.
|
void |
move(double x,
double y)
This overridden method of the superclass also calls
mustRecompute() . |
void |
movePoint(int index,
double x,
double y,
IlvTransformer t)
This overridden method of the superclass also calls
mustRecompute() . |
void |
moveResize(IlvRect r)
This overridden method of the superclass also calls
mustRecompute() . |
protected void |
mustRecompute()
Indicates that the computed list of invisible and visible segments is no
longer valid.
|
void |
refresh()
Forces the recomputation of the visible and invisible segments.
|
void |
removeChangeListener(IlvLineOfVisibility.ComputeListener c)
Removes a listener from the listener list.
|
protected void |
setCoordinateSystem(IlvCoordinateSystem coordinateSystem)
Sets the geodetic computation according to the ellipsoid defined in the
coordinate system projection.
|
protected void |
setElevationProvider(IlvAltitudeProvider provider)
Sets the elevation provider that is used to retrieve altitudes
from latitude and longitude coordinates.
|
protected void |
setGeodeticComputation(IlvGeodeticComputation geodeticComputation)
Sets the geodetic computation used to compute the distance
between pairs of latitude and longitude coordinates.
|
void |
setHiddenZoneColor(Color hiddenZoneColor)
Sets the color of non-visible zones.
|
void |
setPointOfView(IlvCoordinate pointOfView)
Sets the new viewpoint location.
|
void |
setPointOfViewHeight(double pointOfViewHeight)
Sets the new viewpoint height.
|
void |
setPrecision(double precision)
Sets the new precision in meters.
|
void |
setStyle(IlvMapStyle style)
This overridden method is used to install a listener on the
style changes that can require the recomputation of the line.
|
void |
setTargetPoint(IlvCoordinate targetPoint)
Sets the new target point location.
|
void |
setUsingEarthCurvature(boolean usingEarthCurvature)
Set to
true if the computation should take into account the
mean curvature of the earth. |
void |
setVisibleZoneColor(Color visibleZoneColor)
Sets the color of visible segments.
|
void |
write(IlvOutputStream stream)
Writes this
IlvLineOfVisibility object to the
IlvOutputStream passed as parameter. |
boundingBox, contains, copy, drawDecoration, getBackground, getDecoration, getDecorationPaint, getEndCap, getForeground, getLineJoin, getLineStyle, getLineWidth, getLineWidth, getMaximumLineWidth, isDecorationOnly, isPreciseContains, makeGeometry, setBackground, setDecoration, setDecorationOnly, setDecorationPaint, setEndCap, setForeground, setLineJoin, setLineStyle, setLineWidth, setPreciseContains, zoomable
computeBBox, finalize, getIntersectionWithOutline, pointsInBBox, setMaximumLineWidth
allowsPointInsertion, allowsPointMove, allowsPointRemoval, getPointAt, getPoints, getPointsCardinal, inBBox, insertPoint, intersects, makeSelection, recomputeBBox, removePoint, translate
addActionListener, addNamedPropertyListener, allViewsRemoved, baseTextDirectionChanged, blinkingStateOn, boundingBox, callDraw, componentOrientationChanged, getAndAssociateObjectInteractor, getBaseTextDirection, getBlinkingAction, getBlinkingObjectOwner, getBlinkingOffPeriod, getBlinkingOnPeriod, getCenter, getComponentOrientation, getDefaultInteractor, getGraphicBag, GetGraphicObject, getLocale, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenu, getPopupMenuName, getProperty, getResolvedBaseTextDirection, getToolTipBaseTextDirection, getToolTipText, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, getULocale, getZOrderIndex, hasProperty, inside, invalidateBBoxCache, invalidateBidiCache, isBaseTextDirectionSensitive, isComponentOrientationSensitive, isDataFlavorSupported, isEditable, isInApplyToObject, isLocaleSensitive, isMovable, isPersistent, isSelectable, isVisible, localeChanged, move, needsViewNotification, notifyObjectInteractorToManager, processActionEvent, reDraw, registerBlinkingResource, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, resize, rotate, scale, setBaseTextDirection, setBaseTextDirectionDuringConstruction, setBlinkingAction, setBlinkingOffPeriod, setBlinkingOnPeriod, setEditable, setFillOn, setGraphicBag, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipBaseTextDirection, setToolTipText, setVisible, setZOrderIndex, toString, updateNeedsViewNotification, usesBidiMarkers, viewAddedOrRemoved
public IlvLineOfVisibility(IlvManager manager, double pointOfViewHeight, double precision, IlvCoordinateSystem cs, IlvAltitudeProvider elevationProvider, IlvCoordinate pointOfView, IlvCoordinate targetPoint)
IlvLineOfVisibility
object.manager
- The manager the line of visibility is attached to.pointOfViewHeight
- The altitude of the observer above the ground.precision
- The step in meters.cs
- The coordinate system.elevationProvider
- The elevation provider.pointOfView
- The viewpoint coordinates.targetPoint
- The target coordinates.public IlvLineOfVisibility(IlvInputStream stream) throws IlvReadFileException
IlvLineOfVisibility
instance from an
IlvInputStream
.stream
- The stream to read from.IlvReadFileException
- if there is a problem reading from
stream
.public IlvLineOfVisibility(IlvManager manager, double pointOfViewHeight, double precision, IlvCoordinate pointOfView, IlvCoordinate targetPoint)
IlvLineOfVisibility
object.manager
- The manager the line of visibility is attached to.pointOfViewHeight
- The altitude of the observer above ground.precision
- The step in meters.pointOfView
- The viewpoint coordinates.targetPoint
- The target coordinates.public IlvLineOfVisibility(IlvManager manager, double pointOfViewHeight, double precision, IlvPoint p1, IlvPoint p2)
IlvLineOfVisibility
object.manager
- The manager the line of visibility is attached to.pointOfViewHeight
- The altitude of the observer above ground.precision
- The step in meters.p1
- An IlvPoint
instance that represents the viewpoint.p2
- An IlvPoint
instance that represents the target.public IlvLineOfVisibility(IlvLineOfVisibility source)
IlvLineOfVisibility
object by copying an
existing one.source
- The source IlvLineOfVisibility
instance.public void write(IlvOutputStream stream) throws IOException
IlvLineOfVisibility
object to the
IlvOutputStream
passed as parameter.write
in interface IlvPersistentObject
write
in class IlvMapPolyline
stream
- The stream to write to.IOException
- if there is a problem writing to stream
.public void draw(Graphics dst, IlvTransformer t)
IlvMapPolyline
object with the specified graphics
and transformer.draw
in class IlvMapPolyline
dst
- The graphics to draw to.t
- The view transformer.IlvPolyline.draw(java.awt.Graphics,
ilog.views.IlvTransformer)
public Color getHiddenZoneColor()
null
is returned.protected IlvLineOfVisibility.Segment[] getInvisibleSegments()
public double getLength()
getGeodeticComputation()
public IlvCoordinate getPointOfView()
public double getPointOfViewHeight()
public double getPrecision()
public IlvCoordinate getTargetPoint()
protected IlvLineOfVisibility.Segment[] getVisibleSegments()
public Color getVisibleZoneColor()
null
is returned.public boolean isVisible(double distanceFromStart)
Note: this method is designed for an external use by an application, it uses the internally computed visible segments.
distanceFromStart
- The distance from the view point.true
is returned.public void applyTransform(IlvTransformer t)
applyTransform
in class IlvPolyPoints
t
- The transformer for this object.IlvPolyPoints.applyTransform(ilog.views.IlvTransformer)
public void refresh()
public void setHiddenZoneColor(Color hiddenZoneColor)
hiddenZoneColor
- The color of non-visible zones. Set to null
if these
zones should not appear.public void setPointOfView(IlvCoordinate pointOfView)
pointOfView
- The new viewpoint location.public void setPointOfViewHeight(double pointOfViewHeight)
pointOfViewHeight
- The new viewpoint height.public void setPrecision(double precision)
precision
- The new precision.public void setTargetPoint(IlvCoordinate targetPoint)
targetPoint
- The latitude and logitude coordinates of the new target point.public void setVisibleZoneColor(Color visibleZoneColor)
visibleZoneColor
- The color of visible zones. Set to null
if these
segments should not appear.protected void computeVisibility()
computeSegments(double[], boolean[])
.protected void computeSegments(double[] measureDistances, boolean[] visibilities)
measureDistances
- The curvilinear abscissa.visibilities
- The visibility array.public void addChangeListener(IlvLineOfVisibility.ComputeListener c)
c
- The listener to add.public void removeChangeListener(IlvLineOfVisibility.ComputeListener c)
c
- The listener to remove.protected void fireChange()
protected double getDistance(double lon1, double lat1, double lon2, double lat2)
lon1
- The longitude in radians of the first point.lat1
- The latitude in radians of the first point.lon2
- The longitude in radians of the second point.lat2
- The latitude in radians of the second point.IlvGeodeticComputation
protected IlvCoordinate getLatLon(int iPoint)
iPoint
- Should be 0
or 1
.protected IlvGeodeticComputation getGeodeticComputation()
protected void setGeodeticComputation(IlvGeodeticComputation geodeticComputation)
geodeticComputation
- The geodetic computation to use.public IlvAltitudeProvider getElevationProvider()
protected void setElevationProvider(IlvAltitudeProvider provider)
provider
- The elevation provider to use to retrieve altitudes from
latitude and longitude coordinates.public IlvManager getManager()
protected IlvCoordinateTransformation getKernelToSystemTransformation()
protected IlvCoordinateTransformation getSystemToKernelTransformation()
protected void setCoordinateSystem(IlvCoordinateSystem coordinateSystem)
IlvManager
coordinates.coordinateSystem
- The coordinateSystem to set.protected void mustRecompute()
public boolean isUsingEarthCurvature()
true
is returned.setUsingEarthCurvature(boolean )
public void setUsingEarthCurvature(boolean usingEarthCurvature)
true
if the computation should take into account the
mean curvature of the earth.
The default value is true
.usingEarthCurvature
- Set to true
if the computation should take into
account the mean curvature of the earth.public IlvLineOfVisibilityStyle getLineOfVisibilityStyle()
public IlvMapStyle getStyle()
IlvMapStyle
attached to this graphic.getStyle
in interface IlvMapGraphic
getStyle
in class IlvMapPolyline
IlvMapStyle
attached to this graphic.IlvMapPolyline.getStyle()
public void setStyle(IlvMapStyle style)
setStyle
in interface IlvMapGraphic
setStyle
in class IlvMapPolyline
style
- The IlvMapStyle
to set. This parameter must be
a IlvLineOfVisibilityStyle
instance.public IlvGraphic copy()
copy
in class IlvMapPolyline
IlvLineOfVisibility
object.IlvGraphic
public void move(double x, double y)
mustRecompute()
.move
in class IlvGraphic
x
- The x
coordinate.y
- The y
coordinate.IlvGraphic.move(double, double)
public void movePoint(int index, double x, double y, IlvTransformer t)
mustRecompute()
.movePoint
in interface IlvPolyPointsInterface
movePoint
in class IlvPolyPoints
index
- The index of the point.x
- The x
coordinate.y
- The y
coordinate.t
- The transformer to move the point.IlvPolyPoints.movePoint(int, double, double,
ilog.views.IlvTransformer)
public void moveResize(IlvRect r)
mustRecompute()
.moveResize
in class IlvGraphic
r
- The rectangle to recompute.IlvGraphic.moveResize(ilog.views.IlvRect)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.