|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nasa.worldwind.AVListImpl
gov.nasa.worldwind.WWObjectImpl
gov.nasa.worldwind.AbstractView
public abstract class AbstractView
| Field Summary |
|---|
| Fields inherited from class gov.nasa.worldwind.AVListImpl |
|---|
changeSupport |
| Constructor Summary | |
|---|---|
AbstractView()
|
|
| Method Summary | |
|---|---|
void |
apply(DrawContext dc)
Calculates and applies View's internal state to the graphics context in DrawContext. |
protected void |
applyMatrixState(DrawContext dc,
Matrix4 modelView,
Matrix4 projection)
|
double |
computeHorizonDistance()
Returns the distance from the View's eye point to the horizon point on the last rendered
Globe. |
protected double |
computeHorizonDistance(Globe globe,
double verticalExaggeration,
Point eyePoint)
|
double |
computePixelSizeAtDistance(double distance)
Computes the screen-aligned dimension (in meters) that a screen pixel would cover at a given distance (also in meters). |
Position |
computePositionFromScreenPoint(double x,
double y)
Computes the intersection of a line originating from the eye point (passing throught (x, y)) with the last rendered SectorGeometry, or the last analytical Globe if no rendered geometry exists. |
Line |
computeRayFromScreenPoint(double x,
double y)
Computes a line, in model coordinates, originating from the eye point, and passing throught the point contained by (x, y) on the View's projection plane (or after projection into model space). |
protected abstract void |
doApply(DrawContext dc)
|
Point |
getEyePoint()
Returns the eye position in model coordinates. |
Angle |
getFieldOfView()
Returns the horizontal field-of-view angle (the angle of visibility) associated with this View, or
null if the View implementation does not support a field-of-view. |
Point |
getForwardVector()
Returns the View z-axis orientation in model coordinates. |
Frustum |
getFrustumInModelCoordinates()
Returns the viewing Frustum transformed to model coordinates. |
Matrix4 |
getModelViewMatrix()
Returns the 'model-view' matrix computed in apply(), which transforms model coordinates to eye
coordinates (where the eye is located at the origin, facing down the negative-z axis). |
Matrix4 |
getProjectionMatrix()
Returns the 'projection' matrix computed in apply(), which transforms eye coordinates to homogeneous
clip coordinates (a box of dimension (2, 2, 2) centered at the origin). |
Point |
getUpVector()
Returns the View y-axis orientation in model coordinates. |
Rectangle |
getViewport()
Returns a Rectangle representing the window bounds (x, y, width, height) of the viewport, computed in apply(). |
void |
popReferenceCenter(DrawContext dc)
Removes the model-view matrix on top of the matrix stack, and restores the matrix now on top. |
Point |
project(Point modelPoint)
Maps a Point in model (cartesian) coordinates to a Point in screen coordinates. |
void |
pushReferenceCenter(DrawContext dc,
Point referenceCenter)
Generates a new coordinate system in which the View does not move, and model coordinates are reverse
transformed into eye coordinates. |
void |
setFieldOfView(Angle newFov)
Sets the horiziontal field-of-view angle (the angle of visibillity) associated with this View. |
Point |
unProject(Point windowPoint)
Maps a Point in screen coordinates to a Point in model coordinates. |
protected void |
validateDrawContext(DrawContext dc)
|
| Methods inherited from class gov.nasa.worldwind.AVListImpl |
|---|
addPropertyChangeListener, addPropertyChangeListener, copy, firePropertyChange, firePropertyChange, getStringValue, getValue, hasKey, propertyChange, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface gov.nasa.worldwind.View |
|---|
getAltitude, getFrustum, getHeading, getPitch, getPitchConstraints, getPosition, getRoll, getZoom, getZoomConstraints, goToAltitude, goToCoordinate, goToLatLon, isEnablePitchConstraints, isEnableZoomConstraints, setEnablePitchConstraints, setEnableZoomConstraints, setHeading, setPitch, setPitchConstraints, setRoll, setZoom, setZoomConstraints |
| Methods inherited from interface gov.nasa.worldwind.AVList |
|---|
addPropertyChangeListener, addPropertyChangeListener, copy, firePropertyChange, firePropertyChange, getStringValue, getValue, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue |
| Methods inherited from interface java.beans.PropertyChangeListener |
|---|
propertyChange |
| Constructor Detail |
|---|
public AbstractView()
| Method Detail |
|---|
public void apply(DrawContext dc)
ViewView's internal state to the graphics context in DrawContext.
All subsequently rendered objects use this new state. Upon return, the OpenGL graphics context reflects the
values of this view, as do any computed values of the view, such as the model-view matrix and
Frustum.
apply in interface Viewdc - the current World Wind drawing context on which View's state will apply.
protected void applyMatrixState(DrawContext dc,
Matrix4 modelView,
Matrix4 projection)
public double computeHorizonDistance()
ViewView's eye point to the horizon point on the last rendered
Globe.
computeHorizonDistance in interface View
protected double computeHorizonDistance(Globe globe,
double verticalExaggeration,
Point eyePoint)
public double computePixelSizeAtDistance(double distance)
View
computePixelSizeAtDistance in interface Viewdistance - the distance from the eye point, in eye coordinates, along the z-axis. This value must be
positive but is otherwise unbounded.
public Position computePositionFromScreenPoint(double x,
double y)
ViewSectorGeometry, or the last analytical Globe if no rendered geometry exists.
computePositionFromScreenPoint in interface Viewx - the horizontal coordinate originating from the left side of View's projection plane.y - the vertical coordinate originating from the top of View's projection plane.
public Line computeRayFromScreenPoint(double x,
double y)
ViewView's projection plane (or after projection into model space).
computeRayFromScreenPoint in interface Viewx - the horizontal coordinate originating from the left side of View's projection plane.y - the vertical coordinate originating from the top of View's projection plane.
View's eye point and passing throught (x, y) transformed into model
space.protected abstract void doApply(DrawContext dc)
public Point getEyePoint()
View
getEyePoint in interface Viewpublic Angle getFieldOfView()
ViewView, or
null if the View implementation does not support a field-of-view.
getFieldOfView in interface Viewpublic Point getForwardVector()
ViewView z-axis orientation in model coordinates.
getForwardVector in interface Viewpublic Frustum getFrustumInModelCoordinates()
ViewFrustum transformed to model coordinates. Model coordinate frustums are useful
for performing multiple intersection tests in model coordinates.
getFrustumInModelCoordinates in interface Viewpublic Matrix4 getModelViewMatrix()
Viewapply(), which transforms model coordinates to eye
coordinates (where the eye is located at the origin, facing down the negative-z axis). This matrix is constructed
using the model space translation and orientation specific to each implementation of View.
getModelViewMatrix in interface Viewpublic Matrix4 getProjectionMatrix()
Viewapply(), which transforms eye coordinates to homogeneous
clip coordinates (a box of dimension (2, 2, 2) centered at the origin). This matrix is constructed using the
projection parameters specific to each implementation of View (e.g. field-of-view, clipping plane
distances). The View.getFrustum() method returns the planes corresponding to this matrix.
getProjectionMatrix in interface Viewpublic Point getUpVector()
ViewView y-axis orientation in model coordinates.
getUpVector in interface Viewpublic Rectangle getViewport()
Viewapply(). Implementations of View will configure themselves to render in this viewport.
getViewport in interface Viewpublic void popReferenceCenter(DrawContext dc)
Viewapply(), this method will
throw an exception.
popReferenceCenter in interface Viewdc - the current World Wind drawing context on which View's state will apply.public Point project(Point modelPoint)
ViewPoint in model (cartesian) coordinates to a Point in screen coordinates. The
returned x and y are relative to the lower left hand screen corner, while z is the screen depth-coordinate. If
the model point cannot be sucessfully mapped, this will return null.
project in interface ViewmodelPoint - the model coordinate Point to project.
Point.
public void pushReferenceCenter(DrawContext dc,
Point referenceCenter)
ViewView does not move, and model coordinates are reverse
transformed into eye coordinates. The origin for these coordinates will be referenceCenter,
therefore all objects drawn after a call to pushReferenceCenter should be with respect to this
Point, rather than the customary origin (0, 0, 0). This creates a new model-view matrix, which is
placed on the top of a matrix stack, and immediately applied to the current OpenGL context. In order to return to
the original coordinate space, callers should invoke View.popReferenceCenter(gov.nasa.worldwind.DrawContext) after rendering is complete.
Note that calls to View.getModelViewMatrix() will not return reference-center model-view matrix, but the
original matrix.
pushReferenceCenter in interface Viewdc - the current World Wind drawing context on which View's state will apply.referenceCenter - the Point to become the new model space origin.public void setFieldOfView(Angle newFov)
ViewView. This
call may be ignored by implementations that do not support a field-of-view.
setFieldOfView in interface ViewnewFov - the new horizontal field-of-view angle.public Point unProject(Point windowPoint)
ViewPoint in screen coordinates to a Point in model coordinates. The input x and y
are relative to the lower left hand screen corner, while z is the screen depth-coordinate. If the screen point
cannot be sucessfully mapped, this will return null.
unProject in interface ViewwindowPoint - the window coordinate Point to project.
Point.protected void validateDrawContext(DrawContext dc)
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||