public class IlvMakeAreaOfSightInteractor extends IlvMakeGradientInteractor
| Constructor and Description |
|---|
IlvMakeAreaOfSightInteractor()
Creates an interactor.
|
IlvMakeAreaOfSightInteractor(IlvInputStream stream)
Stream constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
attach(IlvManagerView v)
overridden to access the altitude provider.
|
short[] |
buildImage(IlvRasterProperties p,
IlvThreadMonitoringData monitorInfo,
IlvManager manager,
IlvGradientRasterStyle rstyle)
Returns a table of pixel values computed for the parameter passed.
|
protected short |
computeVisibility(IlvManager manager,
double lon1,
double lat1,
double lon2,
double lat2,
IlvLineOfSightRasterStyle style)
Default algorithm to compute visibility between two lat/lon points.
|
protected void |
createObject(IlvRect rect,
IlvMapLayer ml)
Creates the gradient object when the user finishes a rectangular
selection.
|
protected void |
detach()
This method is called when the interactor is detached from the view.
|
protected void |
drawGhost(Graphics g)
computes and displays the inter-visibility area.
|
protected String |
getActivityDescription()
Returns the activity description displayed in the thread monitor.
|
protected String |
getDialogTitle()
Returns the settings dialog title.
|
protected String |
getLayerName()
Returns the layer name to use when creating an image.
|
IlvGradientRasterStyle |
makeStyle(IlvRasterAbstractReader r)
Creates a style for this reader.
|
boolean |
mustReload(StyleEvent event)
Indicates if a specific style event necessitates rebuilding the raster
data source.
|
void |
write(IlvOutputStream stream)
Writes the attributes of a persistent object.
|
createMapInsertionLayer, getSlope, mustReloadaddRectangleDraggedListener, dragscroll, fireRectangleDraggedEvent, getCursor, getDraggedRectangle, getLineStyle, getRectangleAspectRatio, getStartDragModifier, getStartPoint, handleButtonDown, handleButtonDragged, handleButtonUp, isGridMode, isOpaqueMode, isRotationAllowed, isStartDragModifierDown, isXORGhost, processMouseEvent, processMouseMotionEvent, removeRectangleDraggedListener, setCursor, setGridMode, setLineStyle, setOpaqueMode, setRectangleAspectRatio, setRotationAllowed, setStartDragModifieradjustPointIfOutsideView, doAutoScroll, getMaximumScrollDistance, getScrollTiming, isProgressiveScroll, setMaximumScrollDistance, setProgressiveScroll, setScrollTiming, startDraggingScrollTimer, stopDraggingScrollTimeraddFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, allowEnsureVisible, allowEnsureVisible, disableEvents, drawGhost, enableEvents, ensureVisible, ensureVisible, getManager, getManagerView, getTransformer, handleExpose, processEvent, processFocusEvent, processKeyEvent, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, setXORGhostpublic IlvMakeAreaOfSightInteractor()
public IlvMakeAreaOfSightInteractor(IlvInputStream stream)
stream - stream to read from.protected void drawGhost(Graphics g)
makeStyle(IlvRasterAbstractReader) to get the default height and color of the interactor.drawGhost in class IlvDragRectangleInteractorg - The Graphics.IlvManagerViewInteractor.drawGhost(java.awt.Graphics)protected void attach(IlvManagerView v)
attach in class IlvDragRectangleInteractorv - The manager view.IlvManagerViewInteractor.attach(ilog.views.IlvManagerView)protected void detach()
detach in class IlvDragRectangleInteractorIlvManagerViewInteractor.attach(ilog.views.IlvManagerView)protected void createObject(IlvRect rect, IlvMapLayer ml)
createObject in class IlvMakeGradientInteractorrect - The manager coordinates of the rectangle selected.ml - The map layer to add the gradient to.IlvMakeGradientInteractor.createObject(ilog.views.IlvRect, ilog.views.maps.beans.IlvMapLayer)public IlvGradientRasterStyle makeStyle(IlvRasterAbstractReader r)
makeStyle in class IlvMakeGradientInteractorr - reader passed to the style constructor.IlvValleyRasterStyle using the correct color model.public boolean mustReload(StyleEvent event)
mustReload in interface IlvMapLayerStyleControlmustReload in class IlvMakeGradientInteractorevent - The event sent by the StyleListener instance installed
on the layer style.true is returned.IlvMakeGradientInteractor.mustReload(ilog.views.maps.graphic.style.StyleEvent)public short[] buildImage(IlvRasterProperties p, IlvThreadMonitoringData monitorInfo, IlvManager manager, IlvGradientRasterStyle rstyle)
The following code example shows how to implement this method:
IlvAltitudeProvider pr = IlvAltitudeProviderProperty.GetAltitudeProvider(manager);
int ncols = properties.getColumnPixelCount();
int nligs = properties.getLinePixelCount();
short pixels[] = new short[ncols * nligs];
monitorInfo.updateProgress(10);
for (int y = 0; y < nligs; y++) {
for (int x = 0; x < ncols; x++) {
double xlon = p.getX() + x * p.getHorizontalPixelDensity();
double ylat = p.getY() + y * p.getVerticalPixelDensity();
double slope = pr.getAltitude(manager, xlon, ylat, 0);
pixels[y * ncols + x] = (short) (slope);
}
}
monitorInfo.updateProgress(100);
return pixels;
buildImage in interface IlvImageComputationbuildImage in class IlvMakeGradientInteractorp - The raster properties of the image to create.monitorInfo - The thread monitoring reference.manager - The manager to create the image for.rstyle - The style of the raster image.IlvMakeGradientInteractor.buildImage(ilog.views.maps.raster.IlvRasterProperties, ilog.views.maps.raster.datasource.IlvThreadMonitoringData, ilog.views.IlvManager, ilog.views.maps.defense.terrain.IlvGradientRasterStyle)protected short computeVisibility(IlvManager manager, double lon1, double lat1, double lon2, double lat2, IlvLineOfSightRasterStyle style)
manager - Manager to use the altitude provider with.lon1 - longitude in radians of point 1.lat1 - latitude in radians of point 1.lon2 - longitude in radians of point 2.lat2 - latitude in radians of point 2.style - style containing the algorithm parameters.protected String getActivityDescription()
getActivityDescription in class IlvMakeGradientInteractorIlvMakeGradientInteractor.getActivityDescription()protected String getDialogTitle()
getDialogTitle in class IlvMakeGradientInteractorprotected String getLayerName()
getLayerName in class IlvMakeGradientInteractorIlvMakeGradientInteractor.getLayerName()public void write(IlvOutputStream stream)
write in interface IlvPersistentObjectwrite in class IlvMakeGradientInteractorstream - the output streamIlvPersistentObject.write(ilog.views.io.IlvOutputStream)© Copyright Rogue Wave Software, Inc. 1997, 2017. All Rights Reserved.