2 Copyright (C) 2001, 2006 United States Government
3 as represented by the Administrator of the
4 National Aeronautics and Space Administration.
7 package gov
.nasa
.worldwind
;
9 import com
.sun
.opengl
.util
.texture
.*;
10 import gov
.nasa
.worldwind
.geom
.*;
14 * @version $Id: DrawContext.java 1409 2007-04-06 23:06:36Z tgaskins $
16 public interface DrawContext
extends WWObject
19 * Assigns this <code>DrawContext</code> a new </code>javax.media.opengl.GLContext</code>. May throw a
20 * <code>NullPointerException</code> if <code>glContext</code> is null.
22 * @param glContext the new <code>javax.media.opengl.GLContext</code>
23 * @throws NullPointerException if glContext is null
26 void setGLContext(javax
.media
.opengl
.GLContext glContext
);
29 * Retrieves this <code>DrawContext</code>s </code>javax.media.opengl.GLContext</code>. If this method returns null,
30 * then there are potentially no active <code>GLContext</code>s and rendering should be aborted.
32 * @return this <code>DrawContext</code>s </code>javax.media.opengl.GLContext</code>.
35 javax
.media
.opengl
.GLContext
getGLContext();
38 * Retrieves the current <code>javax.media.opengl.GL</code>. A <code>GL</code> or <code>GLU</code> is required for
39 * all graphical rendering in World Wind Raptor.
41 * @return the current <code>GL</code> if available, null otherwise
44 javax
.media
.opengl
.GL
getGL();
47 * Retrieves the current <code>javax.media.opengl.glu.GLU</code>. A <code>GLU</code> or <code>GL</code> is required
48 * for all graphical rendering in World Wind Raptor.
50 * @return the current <code>GLU</code> if available, null otherwise
53 javax
.media
.opengl
.glu
.GLU
getGLU();
56 * Retrieves the current<code>javax.media.opengl.GLDrawable</code>. A <code>GLDrawable</code> can be used to create
57 * a <code>GLContext</code>, which can then be used for rendering.
59 * @return the current <code>GLDrawable</code>, null if none available
62 javax
.media
.opengl
.GLDrawable
getGLDrawable();
65 * Retrieves the drawable width of this <code>DrawContext</code>.
67 * @return the drawable width of this <code>DrawCOntext</code>
70 int getDrawableWidth();
73 * Retrieves the drawable height of this <code>DrawContext</code>.
75 * @return the drawable height of this <code>DrawCOntext</code>
78 int getDrawableHeight();
81 * Initializes this <code>DrawContext</code>. This method should be called at the beginning of each frame to prepare
82 * the <code>DrawContext</code> for the coming render pass.
84 * @param glContext the <code>javax.media.opengl.GLContext</code> to use for this render pass
87 void initialize(javax
.media
.opengl
.GLContext glContext
);
90 * Assigns a new <code>View</code>. Some layers cannot function properly with a null <code>View</code>. It is
91 * recommended that the <code>View</code> is never set to null during a normal render pass.
93 * @param view the enw <code>View</code>
96 void setView(View view
);
99 * Retrieves the current <code>View</code>, which may be null.
101 * @return the current <code>View</code>, which may be null
107 * Assign a new <code>Model</code>. Some layers cannot function properly with a null <code>Model</code>. It is
108 * recommended that the <code>Model</code> is never set to null during a normal render pass.
110 * @param model the new <code>Model</code>
113 void setModel(Model model
);
116 * Retrieves the current <code>Model</code>, which may be null.
118 * @return the current <code>Model</code>, which may be null
124 * Retrieves the current <code>Globe</code>, which may be null.
126 * @return the current <code>Globe</code>, which may be null
132 * Retrieves a list containing all the current layers. No guarantee is made about the order of the layers.
134 * @return a <code>LayerList</code> containing all the current layers
137 LayerList
getLayers();
140 * Retrieves a <code>Sector</code> which is at least as large as the current visible sector. The value returned is
141 * the value passed to <code>SetVisibleSector</code>. This method may return null.
143 * @return a <code>Sector</code> at least the size of the curernt visible sector, null if unavailable
146 gov
.nasa
.worldwind
.geom
.Sector
getVisibleSector();
149 * Sets the visible <code>Sector</code>. The new visible sector must completely encompass the Sector which is
150 * visible on the display.
152 * @param s the new visible <code>Sector</code>
155 void setVisibleSector(gov
.nasa
.worldwind
.geom
.Sector s
);
158 * Sets the vertical exaggeration. Vertical exaggeration affects the appearance of areas with varied elevation. A
159 * vertical exaggeration of zero creates a surface which exactly fits the shape of the underlying
160 * <code>Globe</code>. A vertical exaggeration of 3 will create mountains and valleys which are three times as
161 * high/deep as they really are.
163 * @param verticalExaggeration the new vertical exaggeration.
166 void setVerticalExaggeration(double verticalExaggeration
);
169 * Retrieves the current vertical exaggeration. Vertical exaggeration affects the appearance of areas with varied
170 * elevation. A vertical exaggeration of zero creates a surface which exactly fits the shape of the underlying
171 * <code>Globe</code>. A vertical exaggeration of 3 will create mountains and valleys which are three times as
172 * high/deep as they really are.
174 * @return the current vertical exaggeration
177 double getVerticalExaggeration();
179 // not used (12th January 2007)
180 final static String HIGH_PRIORITY
= "gov.nasa.worldwind.DrawContext.HighPriority";
181 final static String LOW_PRIORITY
= "gov.nasa.worldwind.DrawContext.LowPriority";
184 * Retrieves a list of all the sectors rendered so far this frame.
186 * @return a <code>SectorGeometryList</code> containing every <code>SectorGeometry</code> rendered so far this
190 SectorGeometryList
getSurfaceGeometry();
194 // * Sets the average render time per frame in milliseconds.
196 // * @param timeMillis the new average time in milliseconds
199 // void setAverageRenderTimeMillis(double timeMillis);
202 // * Retrieves the current average render time for a frame. The average render time can be used to calculate the
205 // * @return the current average render time for a frame
208 // double getAverageRenderTimeMillis();
211 * Returns the list of objects picked during the most recent pick traversal.
212 * @return the list of picked objects
214 gov
.nasa
.worldwind
.PickedObjectList
getPickedObjects();
217 * Adds a collection of picked objects to the current picked-object list
218 * @param pickedObjects the objects to add
220 void addPickedObjects(PickedObjectList pickedObjects
);
223 * Adds a single insatnce of the picked object to the current picked-object list
224 * @param pickedObject the object to add
226 void addPickedObject(PickedObject pickedObject
);
229 * Returns a unique color to serve as a pick identifier during picking.
230 * @return a unique pick color
232 java
.awt
.Color
getUniquePickColor();
234 java
.awt
.Color
getClearColor();
237 * Enables color picking mode
239 void enablePickingMode();
242 * Returns true if the Picking mode is active, otherwise return false
243 * @return true for Picking mode, otherwise false
245 boolean isPickingMode();
248 * Disables color picking mode
250 void disablePickingMode();
252 void addOrderedRenderable(OrderedRenderable orderedRenderable
);
254 java
.util
.Queue
<OrderedRenderable
> getOrderedRenderables();
258 void drawUnitQuad(TextureCoords texCoords
);
260 int getNumTextureUnits();
262 void setNumTextureUnits(int numTextureUnits
);
264 void setSurfaceGeometry(SectorGeometryList surfaceGeometry
);
266 Point
getPointOnGlobe(Angle latitude
, Angle longitude
);
268 SurfaceTileRenderer
getSurfaceTileRenderer();