|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nasa.worldwindx.examples.ApplicationTemplate
gov.nasa.worldwindx.examples.tutorial.Cube
public class Cube
Example of a custom Renderable that draws a cube at a geographic position. This class shows the simplest
possible example of a Renderable, while still following World Wind best practices.
| Nested Class Summary | |
|---|---|
protected static class |
Cube.AppFrame
|
| Nested classes/interfaces inherited from class gov.nasa.worldwindx.examples.ApplicationTemplate |
|---|
ApplicationTemplate.AppPanel |
| Field Summary | |
|---|---|
protected Extent |
extent
|
protected double |
eyeDistance
Distance from the eye point to the cube. |
protected long |
frameTimestamp
|
protected PickSupport |
pickSupport
Support object to help with pick resolution. |
protected Vec4 |
placePoint
Cartesian position of the cube, computed from position. |
protected Position |
position
Geographic position of the cube. |
protected double |
size
Length of each face, in meters. |
| Constructor Summary | |
|---|---|
Cube(Position position,
double sizeInMeters)
|
|
| Method Summary | |
|---|---|
protected void |
beginDrawing(DrawContext dc)
Setup drawing state in preparation for drawing the cube. |
protected void |
drawOrderedRenderable(DrawContext dc,
PickSupport pickCandidates)
Set up drawing state, and draw the cube. |
protected void |
drawUnitCube(DrawContext dc)
Draw a unit cube, using the active modelview matrix to orient the shape. |
protected void |
endDrawing(DrawContext dc)
Restore drawing state changed in beginDrawing to the default. |
double |
getDistanceFromEye()
Returns the ordered renderable's distance from the current view's eye point. |
protected boolean |
intersectsFrustum(DrawContext dc)
Determines whether the cube intersects the view frustum. |
static void |
main(String[] args)
|
protected void |
makeOrderedRenderable(DrawContext dc)
Compute per-frame attributes, and add the ordered renderable to the ordered renderable list. |
void |
pick(DrawContext dc,
Point pickPoint)
Executes a pick of the ordered renderable. |
void |
render(DrawContext dc)
Causes this Renderable to render itself using the provided draw context. |
| Methods inherited from class gov.nasa.worldwindx.examples.ApplicationTemplate |
|---|
insertAfterPlacenames, insertBeforeCompass, insertBeforeLayerName, insertBeforePlacenames, start |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Extent extent
protected double eyeDistance
protected long frameTimestamp
protected PickSupport pickSupport
protected Vec4 placePoint
position.
protected Position position
protected double size
| Constructor Detail |
|---|
public Cube(Position position,
double sizeInMeters)
| Method Detail |
|---|
protected void beginDrawing(DrawContext dc)
dc - Active draw context.
protected void drawOrderedRenderable(DrawContext dc,
PickSupport pickCandidates)
dc - Current draw context.protected void drawUnitCube(DrawContext dc)
dc - Current draw context.protected void endDrawing(DrawContext dc)
dc - Active draw context.public double getDistanceFromEye()
OrderedRenderable
getDistanceFromEye in interface OrderedRenderableprotected boolean intersectsFrustum(DrawContext dc)
dc - the current draw context.
public static void main(String[] args)
protected void makeOrderedRenderable(DrawContext dc)
dc - Current draw context.
public void pick(DrawContext dc,
Point pickPoint)
OrderedRenderable
pick in interface OrderedRenderabledc - the current draw context.pickPoint - the pick point.public void render(DrawContext dc)
RenderableRenderable to render itself using the provided draw context.
render in interface Renderabledc - the DrawContext to be usedDrawContext
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||