public abstract class AbstractGLMapItem2 extends java.lang.Object implements GLMapItem2, MapItem.OnVisibleChangedListener, MapItem.OnZOrderChangedListener, MapItem.OnClickableChangedListener
GLMapItem2.OnBoundsChangedListener, GLMapItem2.OnVisibleChangedListener
Modifier and Type | Field and Description |
---|---|
protected MutableGeoBounds |
bounds |
protected boolean |
clickable |
protected MapRenderer |
context |
protected static double |
DEFAULT_MAX_ALT |
protected static double |
DEFAULT_MIN_ALT |
protected double |
minMapGsd |
protected int |
renderPass |
protected MapItem |
subject |
protected boolean |
visible |
protected double |
zOrder |
Modifier | Constructor and Description |
---|---|
protected |
AbstractGLMapItem2(MapRenderer context,
MapItem subject,
int renderPass) |
Modifier and Type | Method and Description |
---|---|
void |
addBoundsListener(GLMapItem2.OnBoundsChangedListener l) |
void |
addVisibleListener(GLMapItem2.OnVisibleChangedListener l) |
protected void |
dispatchOnBoundsChanged() |
protected void |
dispatchOnVisibleChanged() |
static void |
forward(GLMapView ortho,
java.nio.Buffer pBuf,
java.nio.FloatBuffer vBuf,
GeoBounds bounds) |
static void |
forward(GLMapView ortho,
java.nio.Buffer pBuf,
int srcSize,
java.nio.FloatBuffer vBuf,
int dstSize,
GeoBounds bounds) |
static void |
forward(GLMapView ortho,
GeoPoint gp,
PointD point) |
static void |
forward(GLMapView ortho,
GeoPoint gp,
PointD point,
double unwrap)
Transforms the specified coordinate, applying any elevation adjustments
(e.g.
|
static void |
forward(GLMapView ortho,
GeoPoint gp,
PointD point,
double unwrap,
double terrain) |
static void |
forward(GLMapView ortho,
GeoPoint gp,
PointD point,
double unwrap,
double terrain,
boolean clampSubAlt)
Transforms the specified coordinate, applying any elevation adjustments
(e.g.
|
static void |
forward(GLMapView ortho,
GeoPoint gp,
android.graphics.PointF retval,
double unwrap) |
void |
getBounds(MutableGeoBounds bnds) |
boolean |
getClampToGroundAtNadir() |
protected boolean |
getClickable()
Determine whether or not this item is touchable
By default this is tied to
MapItem.getClickable() |
double |
getMinDrawResolution() |
java.lang.Object |
getOpaque()
Returns the data previously set via the call to
GLMapItem2.setOpaque(Object) . |
int |
getRenderPass() |
MapItem |
getSubject() |
double |
getZOrder() |
HitTestResult |
hitTest(MapRenderer3 renderer,
HitTestQueryParameters params)
Hit test control implementation that checks touchability
Sub-classes should override the
hitTestImpl(MapRenderer3, HitTestQueryParameters) method |
protected HitTestResult |
hitTestImpl(MapRenderer3 renderer,
HitTestQueryParameters params)
Perform a hit test on this map item
Sub-classes should override this method for hit-testing
|
boolean |
isVisible() |
protected void |
markSurfaceDirty(boolean realtime) |
void |
onClickableChanged(MapItem item) |
void |
onVisibleChanged(MapItem item) |
void |
onZOrderChanged(MapItem item) |
void |
release() |
void |
removeBoundsListener(GLMapItem2.OnBoundsChangedListener l) |
void |
removeVisibleListener(GLMapItem2.OnVisibleChangedListener l) |
protected void |
runOnGLThread(java.lang.Runnable r)
Run a method on the GL thread
Unlike calling
MapRenderer#queueEvent directly, this will
run the method immediately if we're already on the GL thread |
void |
setClampToGroundAtNadir(boolean v)
Rendering style modified by the
ClampToGroundControl |
void |
setOpaque(java.lang.Object opaque)
Sets opaque data that can be used by the renderer.
|
void |
startObserving()
Start observing the subject.
|
void |
stopObserving()
Stops observing the subject.
|
protected static final double DEFAULT_MIN_ALT
protected static final double DEFAULT_MAX_ALT
protected final MapRenderer context
protected final MapItem subject
protected final int renderPass
protected boolean visible
protected final MutableGeoBounds bounds
protected double zOrder
protected boolean clickable
protected double minMapGsd
protected AbstractGLMapItem2(MapRenderer context, MapItem subject, int renderPass)
public final MapItem getSubject()
getSubject
in interface GLMapItem2
public final void setOpaque(java.lang.Object opaque)
GLMapItem2
GLMapItem
should invoke this method.
This method serves as a convenience to allow the render to store application specific data with an item.
setOpaque
in interface GLMapItem2
opaque
- An objectpublic final java.lang.Object getOpaque()
GLMapItem2
GLMapItem2.setOpaque(Object)
. This method
should really only be invoked by the object that set the opaque data.
This method serves as a convenience to allow the render to obtain the application specific data that has been previously associated with an item.
getOpaque
in interface GLMapItem2
public void startObserving()
GLMapItem2
Invoking this method should generally refresh the state of the item.
This method may not be invoked on the GL context thread.
startObserving
in interface GLMapItem2
public void stopObserving()
startObserving()
.
This method may not be invoked on the GL context thread.
stopObserving
in interface GLMapItem2
public final int getRenderPass()
public void release()
public final boolean isVisible()
isVisible
in interface GLMapItem2
public final double getZOrder()
getZOrder
in interface GLMapItem2
public final double getMinDrawResolution()
getMinDrawResolution
in interface GLMapItem2
public void setClampToGroundAtNadir(boolean v)
ClampToGroundControl
v
- True if at NADIR the item is clamped to groundpublic boolean getClampToGroundAtNadir()
public final void addBoundsListener(GLMapItem2.OnBoundsChangedListener l)
addBoundsListener
in interface GLMapItem2
public final void removeBoundsListener(GLMapItem2.OnBoundsChangedListener l)
removeBoundsListener
in interface GLMapItem2
protected final void dispatchOnBoundsChanged()
public final void addVisibleListener(GLMapItem2.OnVisibleChangedListener l)
addVisibleListener
in interface GLMapItem2
public final void removeVisibleListener(GLMapItem2.OnVisibleChangedListener l)
removeVisibleListener
in interface GLMapItem2
protected final void dispatchOnVisibleChanged()
public final void getBounds(MutableGeoBounds bnds)
getBounds
in interface GLMapItem2
public final void onVisibleChanged(MapItem item)
onVisibleChanged
in interface MapItem.OnVisibleChangedListener
public final void onZOrderChanged(MapItem item)
onZOrderChanged
in interface MapItem.OnZOrderChangedListener
public void onClickableChanged(MapItem item)
onClickableChanged
in interface MapItem.OnClickableChangedListener
public final HitTestResult hitTest(MapRenderer3 renderer, HitTestQueryParameters params)
hitTestImpl(MapRenderer3, HitTestQueryParameters)
methodrenderer
- GL instance of the map viewparams
- Query parametersprotected boolean getClickable()
MapItem.getClickable()
protected HitTestResult hitTestImpl(MapRenderer3 renderer, HitTestQueryParameters params)
renderer
- Map rendererparams
- Query parametersprotected void runOnGLThread(java.lang.Runnable r)
MapRenderer#queueEvent
directly, this will
run the method immediately if we're already on the GL threadr
- Runnableprotected final void markSurfaceDirty(boolean realtime)
public static void forward(GLMapView ortho, GeoPoint gp, PointD point, double unwrap)
point
.
If gp
does not have a valid altitude, or its altitude is
below the terrain surface, the terrain surface value will be used.
ortho
- The viewgp
- The LLA coordinatepoint
- Returns the x,y,z for the coordinateunwrap
- Longitudinal unwrap value (360, -360, or 0 to ignore)public static void forward(GLMapView ortho, GeoPoint gp, PointD point, double unwrap, double terrain, boolean clampSubAlt)
point
.
If gp
does not have a valid altitude, or its altitude is
below the terrain surface, the terrain surface value will be used.
ortho
- The viewgp
- The LLA coordinatepoint
- Returns the x,y,z for the coordinateunwrap
- Longitudinal unwrap value (360, -360, or 0 to ignore)terrain
- The local terrain value at the locationclampSubAlt
- True to clamp sub-terrain altitude to the groundpublic static void forward(GLMapView ortho, GeoPoint gp, PointD point, double unwrap, double terrain)
public static void forward(GLMapView ortho, GeoPoint gp, PointD point)
public static void forward(GLMapView ortho, GeoPoint gp, android.graphics.PointF retval, double unwrap)
public static void forward(GLMapView ortho, java.nio.Buffer pBuf, java.nio.FloatBuffer vBuf, GeoBounds bounds)
public static void forward(GLMapView ortho, java.nio.Buffer pBuf, int srcSize, java.nio.FloatBuffer vBuf, int dstSize, GeoBounds bounds)