public class IlvMakeGradientInteractor extends IlvDragRectangleInteractor implements IlvImageComputation
IlvMakeGradientInteractor
is an interactor used to create a
line of visibility.Constructor and Description |
---|
IlvMakeGradientInteractor()
The default constructor.
|
IlvMakeGradientInteractor(IlvInputStream stream)
The Stream constructor.
|
Modifier and Type | Method and Description |
---|---|
short[] |
buildImage(IlvRasterProperties p,
IlvThreadMonitoringData monitorInfo,
IlvManager manager,
IlvGradientRasterStyle style)
Returns a table of pixel values computed for the parameter passed.
|
IlvMapLayer |
createMapInsertionLayer()
Creates the map layer that will contain gradients.
|
protected void |
createObject(IlvRect rect,
IlvMapLayer ml)
Creates the gradient object when the user finishes a rectangular
selection.
|
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.
|
protected static double |
getSlope(IlvManager manager,
double lon,
double lat,
double precision,
IlvEllipsoid el,
IlvAltitudeProvider provider)
Computes the slope at the specified point.
|
IlvGradientRasterStyle |
makeStyle(IlvRasterAbstractReader r)
Creates a style for this reader.
|
boolean |
mustReload(NamedPropertyEvent event)
Indicates if a named property change necessitates rebuilding the
raster data source.
|
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.
|
addRectangleDraggedListener, attach, detach, dragscroll, drawGhost, fireRectangleDraggedEvent, getCursor, getDraggedRectangle, getLineStyle, getRectangleAspectRatio, getStartDragModifier, getStartPoint, handleButtonDown, handleButtonDragged, handleButtonUp, isGridMode, isOpaqueMode, isRotationAllowed, isStartDragModifierDown, isXORGhost, processMouseEvent, processMouseMotionEvent, removeRectangleDraggedListener, setCursor, setGridMode, setLineStyle, setOpaqueMode, setRectangleAspectRatio, setRotationAllowed, setStartDragModifier
adjustPointIfOutsideView, doAutoScroll, getMaximumScrollDistance, getScrollTiming, isProgressiveScroll, setMaximumScrollDistance, setProgressiveScroll, setScrollTiming, startDraggingScrollTimer, stopDraggingScrollTimer
addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, allowEnsureVisible, allowEnsureVisible, disableEvents, drawGhost, enableEvents, ensureVisible, ensureVisible, getManager, getManagerView, getTransformer, handleExpose, processEvent, processFocusEvent, processKeyEvent, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, setXORGhost
public IlvMakeGradientInteractor()
public IlvMakeGradientInteractor(IlvInputStream stream)
stream
- The stream to read from.protected String getLayerName()
public IlvMapLayer createMapInsertionLayer()
protected String getActivityDescription()
protected String getDialogTitle()
protected void createObject(IlvRect rect, IlvMapLayer ml)
rect
- The manager coordinates of the rectangle selected.ml
- The map layer to add the gradient to.public boolean mustReload(StyleEvent event)
mustReload
in interface IlvMapLayerStyleControl
event
- The event sent by the StyleListener
instance installed
on the layer style.true
is returned.public boolean mustReload(NamedPropertyEvent event)
mustReload
in interface IlvMapLayerStyleControl
event
- The event sent by the StyleListener
instance
installed on the layer style.true
is returned.public short[] buildImage(IlvRasterProperties p, IlvThreadMonitoringData monitorInfo, IlvManager manager, IlvGradientRasterStyle style)
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 IlvImageComputation
p
- The raster properties of the image to create.monitorInfo
- The thread monitoring reference.manager
- The manager to create the image for.style
- The style of the raster image.IlvImageComputation.buildImage(ilog.views.maps.raster.IlvRasterProperties, ilog.views.maps.raster.datasource.IlvThreadMonitoringData, ilog.views.IlvManager, ilog.views.maps.defense.terrain.IlvGradientRasterStyle)
protected static double getSlope(IlvManager manager, double lon, double lat, double precision, IlvEllipsoid el, IlvAltitudeProvider provider)
manager
- The manager to retrieve altitude from.lon
- The longitude of the point.lat
- The latitude of the point.precision
- The precision of the image, that is, the size of each
pixel in meters.el
- The ellipsoid to use when making distance computations.provider
- The altitude provider. For optimization reasons this must
be the one used by the manager.public IlvGradientRasterStyle makeStyle(IlvRasterAbstractReader r)
r
- The reader to be passed to the style constructor.IlvGradientRasterStyle
instance that uses the
correct color model.public void write(IlvOutputStream stream)
write
in interface IlvPersistentObject
stream
- the output streamIlvPersistentObject.write(ilog.views.io.IlvOutputStream)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.