|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjwo.landserf.gui3d.SurfaceRenderer
Creates and draws spatial objects in 3D coordinate space. Uses the GL4Java OpenGL bindings.
Constructor Summary | |
SurfaceRenderer(GUI3d gui)
Creates a surface to display from the given 3d GUI. |
Method Summary | |
boolean |
canUseMultiTextures()
Reports whether multi-textures can be used. |
void |
cleanup()
Releases texture and other 3d resources before quitting. |
void |
createSnapshot(SnapshotListener snapListener)
Performs a screen snapshot for printing or animation. |
void |
display(net.java.games.jogl.GLDrawable drawable)
Called by the drawable class to render. |
void |
displayChanged(net.java.games.jogl.GLDrawable drawable,
boolean modeChanged,
boolean deviceChanged)
Called by the drawable when the display mode or the display device associated with the GLDrawable has changed. |
Camera |
getCamera()
Supplies the camera that is used to control view of the surface. |
float |
getEasting(float x)
Converts the given rendering x coordinate to its geographical equivalent. |
float |
getElevation(float z)
Converts the given rendering z coordinate to its geographical equivalent. |
Color |
getFogColour()
Reports the current fog colour. |
boolean |
getGridded()
Reports whether the surface is represented as a gridded lattice or a TIN. |
float |
getHoverHeight()
Reports the minimium height of camera above surface. |
boolean |
getLined()
Reports whether the surface is to be drawn as lines or not. |
float |
getNorthing(float y)
Converts the given rendering y coordinate to its geographical equivalent. |
String[] |
getOpenGLInfo()
Reports OpenGL implementation information. |
float |
getPointSize()
Gets the size of the point feature representation. |
int |
getSampleInterval()
Reports the current sample interval for the surface mesh. |
Color |
getSeaColour()
Reports the current sea colour. |
Color |
getSkyColour()
Reports the current sky colour. |
float |
getTriangleHeight(float x,
float y)
Gets the planar intoplated height at the given location based on the current surface triangulation. |
float |
getVectHeight()
Reports height that vectors are drawn above the surface. |
float |
getVectWidth()
Reports the width that vectors are drawn. |
float |
getVerticalScale()
Reports the current vertical scaling factor. |
Color |
getWallColour()
Reports the current surface wall colour. |
float |
getX(float easting)
Converts the given geographical coordinate to its rendering x coordinate equivalent. |
float |
getY(float northing)
Converts the given geographical coordinate to its rendering y coordinate equivalent. |
float |
getZ(float elevation)
Converts the given geographical coordinate to its rendering z coordinate equivalent. |
void |
hugSurface(boolean hug)
Sets movement to hug surface (ie no flying). |
void |
init(net.java.games.jogl.GLDrawable drawable)
Called by the drawable class immediately after the OpenGL context is initialized; the GLContext has already been made current when this method is called. |
void |
initVector(GISFrame gisFrame)
Initialises the vector map representation. |
boolean |
isDrawDetail()
Reports if the detailed texture is drawn or not. |
boolean |
isFadeDetail()
Reports if the detailed texture fades with distance. |
boolean |
isVectClipped()
Reports whether vectors are to be depth clipped. |
boolean |
isVectSmoothed()
Reports whether vectors displayed as smoothed. |
void |
makeDetailTexture(Image detailImage,
float transparency)
Creates the detail texture to be used with close views. |
void |
makeTexture(int textureSize,
boolean smooth)
Creates a texture from the currently selected drape. |
void |
rescale()
Recalculates the local scaling of the model. |
void |
reshape(net.java.games.jogl.GLDrawable drawable,
int x,
int y,
int width,
int height)
Recalculates viewing volume and updates field of view. |
void |
setDetailSize(float size)
Sets the size of the detail texture relative to 1 grid cell. |
void |
setDrapeImage(Image image)
Sets the image to be draped over the surface. |
void |
setDrawDetail(boolean detail)
Determines if the detailed texture is to be drawn or not. |
void |
setFadeDetail(boolean fadeDetail)
Determines if the detailed texture is to fade with distance. |
void |
setFogColour(Color colour)
Sets a new fog colour. |
void |
setFogDensity(float density)
Sets a new fog density. |
void |
setFOV(float fov)
Sets a new field of view. |
void |
setGridded(boolean useGrid)
Sets the rendering to use a gridded lattice or a TIN. |
void |
setHoverHeight(float skimHeight)
Sets the minimium height of camera above surface. |
void |
setLined(boolean lines)
Allows the surface to be drawn as lines or solid polygons. |
void |
setPointSize(float pointSize)
Sets the size of the point feature representation. |
void |
setSampleInterval(int interval)
Sets a new sample interval for the surface mesh triangulation. |
void |
setSeaColour(Color colour)
Sets a new sea colour. |
void |
setSky(boolean sky)
Turns the sky on or off. |
void |
setSkyColour(Color colour)
Sets a new sky colour. |
void |
setSmoothed(boolean smoothed)
Sets texture mapping to smoothed or unsmoothed. |
void |
setVectClipped(boolean clipVect)
Sets whether vectors are drawn with (true) or without (false) depth clipping.. |
void |
setVectHeight(float vectHeight)
Sets the height that vectors are drawn above the surface. |
void |
setVectSmoothed(boolean smoothed)
Sets whether vectors displayed as smoothed. |
void |
setVectWidth(float vectWidth)
Sets the line width of vectors. |
void |
setVerticalScale(float zScale)
Sets a new vertical scaling |
void |
setWallColour(Color colour)
Sets a new colour for the vertical walls bounding a surface. |
void |
showVector(boolean vect)
Identifies whether a vector is drawn or not. |
void |
updateTexture(int textureSize0,
int textureSize,
boolean smooth)
Updates a texture at a given texture size. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SurfaceRenderer(GUI3d gui)
gui
- Parent GUI controlling 3d view.Method Detail |
public void init(net.java.games.jogl.GLDrawable drawable)
init
in interface net.java.games.jogl.GLEventListener
drawable
- The drawable class that this renders into.public void display(net.java.games.jogl.GLDrawable drawable)
display
in interface net.java.games.jogl.GLEventListener
drawable
- The drawable class that this renders into.public void cleanup()
public void reshape(net.java.games.jogl.GLDrawable drawable, int x, int y, int width, int height)
reshape
in interface net.java.games.jogl.GLEventListener
drawable
- The drawable class that this renders into.x
- X-coordinate of the left of the drawable area.y
- Y-coordinate of the top of the drawable area.width
- Width of the drawable area.height
- Height of the drawable area.public void displayChanged(net.java.games.jogl.GLDrawable drawable, boolean modeChanged, boolean deviceChanged)
displayChanged
in interface net.java.games.jogl.GLEventListener
drawable
- Drawable object that made a call to this method.modeChanged
- True if mode has changed (e.g. from 16 to 32 bit colour).deviceChanged
- True if device has changed (e.g. dragging window from one monitor to another).public void rescale()
public void makeTexture(int textureSize, boolean smooth)
textureSize
- Size of 1 side of (square) texture to drape.
This should be a power of 2 from 64 to 2048.smooth
- Texture is smoothed if true.public void updateTexture(int textureSize0, int textureSize, boolean smooth)
setDrapeImage()
before calling this method.
textureSize0
- Currenly selected maximum texture size.textureSize
- Size of 1 side of (square) texture to drape.
This should be a power of 2 from 1 to 2048.smooth
- Texture is smoothed if true.public void makeDetailTexture(Image detailImage, float transparency)
detailImage
- Image providing the detailed texture.transparency
- Level of transparency for texture.public void createSnapshot(SnapshotListener snapListener)
snapListener
- Snapshot listener to be informed when picture is ready.public void setSmoothed(boolean smoothed)
smoothed
- Texture is smoothed if true.public void setSampleInterval(int interval)
interval
- New sample interval - 1 is full resolution,
32 sample every 32nd cell etc.public void setDetailSize(float size)
size
- Number of grid cells occupied by the detail texture.public int getSampleInterval()
public float getVerticalScale()
public float getHoverHeight()
public float getPointSize()
public boolean getGridded()
public void setGridded(boolean useGrid)
useGrid
- Uses a gridded lattice if true, a TIN if false.public boolean getLined()
public float getVectHeight()
public float getVectWidth()
public boolean isVectClipped()
public boolean isVectSmoothed()
public String[] getOpenGLInfo()
public void setDrawDetail(boolean detail)
detail
- True if detail is to be drawn.public boolean isDrawDetail()
public void setFadeDetail(boolean fadeDetail)
fadeDetail
- True if detail is to fade with distance.public boolean isFadeDetail()
public void setLined(boolean lines)
lines
- True if surface is to be drawn with lines.public void showVector(boolean vect)
vect
- Draws a vector over surface if true.public void initVector(GISFrame gisFrame)
gisFrame
- GUI holding vector representation.public void hugSurface(boolean hug)
hug
- Camera will hug surface if true.public void setHoverHeight(float skimHeight)
skimHeight
- Minimum height of camera above surface. 0 indicates
no collision detection, 1-10 varying hover height.public void setPointSize(float pointSize)
pointSize
- Size of point features represented on surface. Scaled
between 0 and 10. If 0, no point features shown.public void setVerticalScale(float zScale)
zScale
- New vertical scaling.public void setFOV(float fov)
fov
- New field of view in degrees (1-180).public void setFogDensity(float density)
density
- New fog density.public void setVectClipped(boolean clipVect)
clipVect
- Determines whether vectors are depth clipped.public void setVectSmoothed(boolean smoothed)
smoothed
- True if vectors are to be smoothed.public void setVectHeight(float vectHeight)
vectHeight
- Vector height in elevation units.public void setVectWidth(float vectWidth)
vectWidth
- Vector width in rendering units.public void setSky(boolean sky)
sky
- Sky is shown if true.public void setSkyColour(Color colour)
colour
- New sky colour.public void setFogColour(Color colour)
colour
- New fog colour.public void setSeaColour(Color colour)
colour
- New sea colour.public void setWallColour(Color colour)
colour
- New wall colour.public void setDrapeImage(Image image)
makeTexture()
is called.
image
- Image to be draped over surface.public float getEasting(float x)
x
- Rendering x coordinate.
public float getNorthing(float y)
y
- Rendering y coordinate.
public float getTriangleHeight(float x, float y)
x
- x coordinate of location to query in rendering coords.y
- y coordinate of location to query in rendering coords.
public float getElevation(float z)
z
- Rendering z coordinate.
public float getX(float easting)
easting
- Geographical coordinate.
public float getY(float northing)
northing
- Geographical coordinate.
public float getZ(float elevation)
elevation
- Geographical coordinate.
public Camera getCamera()
public Color getSkyColour()
public Color getFogColour()
public Color getSeaColour()
public Color getWallColour()
public boolean canUseMultiTextures()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |