com.partnersoft.maps.render
Class OpenglDrawingSurface

java.lang.Object
  extended by com.partnersoft.maps.render.AbstractDrawingSurface
      extended by com.partnersoft.maps.render.OpenglDrawingSurface
All Implemented Interfaces:
RoverConstants, DrawingSurface

public class OpenglDrawingSurface
extends AbstractDrawingSurface
implements RoverConstants

Rendering of map geometry via OpenGL.

Copyright 2003-2009 Partner Software, Inc.

Version:
$Id: OpenglDrawingSurface.java 2474 2010-03-13 14:28:43Z paul $
Author:
Paul Reavis

Field Summary
 javax.media.opengl.GL gl
           
 javax.media.opengl.glu.GLU glu
           
 
Fields inherited from class com.partnersoft.maps.render.AbstractDrawingSurface
backgroundColor, currentImageStyle, currentMapSet, currentPointStyle, currentPolygonStyle, currentPolylineStyle, currentTextStyle, foregroundColor, frame, invisiblePolylineStyle, printing, renderImageStyle, renderMode, renderPointStyle, renderPolygonStyle, renderPolylineStyle, renderQuality, renderTextStyle, showInvisibleGraphics
 
Fields inherited from interface com.partnersoft.io.formats.rover.RoverConstants
ALIGN_BOTTOM_CENTER, ALIGN_BOTTOM_FIT, ALIGN_BOTTOM_LEFT, ALIGN_BOTTOM_RIGHT, ALIGN_CENTER, ALIGN_CENTER_LEFT, ALIGN_CENTER_RIGHT, ALIGN_CODE_CENTER, ALIGN_CODE_FIT, ALIGN_CODE_HIGH, ALIGN_CODE_LOW, ALIGN_FIT, ALIGN_FIT_LEFT, ALIGN_FIT_RIGHT, ALIGN_TOP_CENTER, ALIGN_TOP_FIT, ALIGN_TOP_LEFT, ALIGN_TOP_RIGHT, COMMENT, DATA_FIELDS_MAX, EOF, FLOAT_COORDS, GEOMETRY_TYPE_NAMES, HAS_DATA, HAS_OFFSET, HAS_ROTATION, IMAGE, LIST, MASK_TYPECODE, NAMING, POINT, POINT_COLOR, POLYGON, POLYLINE, POP, PUSH, ROTATION_MULT, TEXEL_COORD_MAX, TEXEL_COORD_SIZE, TEXT, TEXT_LONG, TILE_COORD_MAX, TILE_SIZE_PIXELS, VALUE
 
Fields inherited from interface com.partnersoft.maps.render.DrawingSurface
QUALITY_GOOD, QUALITY_OK, QUALITY_POOR, RENDER_EPHEMERA, RENDER_INDICATION, RENDER_RASTER, RENDER_RETICLE, RENDER_SELECTION, RENDER_VECTOR
 
Constructor Summary
OpenglDrawingSurface(OpenglControl control, javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu, VideoPreferences videoPreferences)
           
 
Method Summary
 void clear()
           
 int displayListFor(long key)
           
 int displayListFor(java.lang.Object key)
           
 void drawDisplayList(int displayListID)
           
 void drawImage(int dataID, double x, double y, int ox, int oy, int rotation, ImageSource image, double imageScale, int pixelsWide, int pixelsHigh)
           
 void drawLiteralPoints(LiteralPointFile literalPoints)
          Renders a set of literal (explicit color instead of styled "logical") points.
 void drawPoint(int dataID, double x, double y, int ox, int oy, int rotation)
           
 void drawPolygon(int dataID, DynamicDoubleArray coords)
           
 void drawPolyline(int dataID, DoubleBuffer coords)
           
 void drawRasterImage(RasterImage image)
           
 void drawText(int dataID, double x, double y, int ox, int oy, int rotation, int alignment, java.lang.String text)
           
 void drawTexture(OpenglTextureHandle texture, double x, double y, double rotation, double textureScale)
          Just draws the given textureHandle as a rotated, scaled icon.
 void drawWheelMenu(WheelMenu menu)
           
 void drawWheelMenuCenter(WheelMenu menu)
           
 void endDisplayList()
           
 void endTile()
           
 OpenglControl getControl()
          Please don't abuse this.
 boolean isDirty()
           
 void popName()
           
 void pushName(int i)
           
 void removeDisplayList(int displayListID)
           
 void setBackgroundColor(int rgb)
           
 void setForegroundColor(int rgb)
           
 void setFrame(MapViewFrame newFrame)
           
 void setPointStyle(int style)
           
 void setPointStyle(PointStyle style)
           
 void setPolygonStyle(int style)
           
 void setPolygonStyle(PolygonStyle style)
           
 void setPolylineStyle(int style)
           
 void setPolylineStyle(PolylineStyle style)
           
 void setTextStyle(int style)
           
 void setTextStyle(TextStyle style)
           
 int startDisplayList(long key)
           
 int startDisplayList(java.lang.Object key)
           
 void startDrawing()
           
 void startTile(RoverBytes bytes)
          Sets up the transformations for the coordinates that are coming in.
 void stopDrawing()
           
 
Methods inherited from class com.partnersoft.maps.render.AbstractDrawingSurface
copyBackBuffer, drawPolygon, drawPolyline, drawPolyline, isBackBufferSupported, isDisplayListSupported, isDrawingToBackBuffer, popState, pushState, setDrawingToBackBuffer, setImageStyle, setImageStyle, setImageStyle, setMapSet, setPointStyle, setPolygonStyle, setPolylineStyle, setPrinting, setRenderMode, setRenderQuality, setRenderScaleRegion, setShowInvisibleGraphics, setTextStyle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gl

public javax.media.opengl.GL gl

glu

public javax.media.opengl.glu.GLU glu
Constructor Detail

OpenglDrawingSurface

public OpenglDrawingSurface(OpenglControl control,
                            javax.media.opengl.GL gl,
                            javax.media.opengl.glu.GLU glu,
                            VideoPreferences videoPreferences)
Method Detail

getControl

public OpenglControl getControl()
Please don't abuse this.


isDirty

public boolean isDirty()
Specified by:
isDirty in interface DrawingSurface

startDrawing

public void startDrawing()
Specified by:
startDrawing in interface DrawingSurface
Specified by:
startDrawing in class AbstractDrawingSurface

setFrame

public void setFrame(MapViewFrame newFrame)
Specified by:
setFrame in interface DrawingSurface
Overrides:
setFrame in class AbstractDrawingSurface

stopDrawing

public void stopDrawing()
Specified by:
stopDrawing in interface DrawingSurface
Specified by:
stopDrawing in class AbstractDrawingSurface

startTile

public void startTile(RoverBytes bytes)
Sets up the transformations for the coordinates that are coming in.

Specified by:
startTile in interface DrawingSurface
Parameters:
bytes - everything we need to set up our transformation.

endTile

public void endTile()
Specified by:
endTile in interface DrawingSurface

clear

public void clear()
Specified by:
clear in interface DrawingSurface

setBackgroundColor

public void setBackgroundColor(int rgb)
Specified by:
setBackgroundColor in interface DrawingSurface
Overrides:
setBackgroundColor in class AbstractDrawingSurface

setForegroundColor

public void setForegroundColor(int rgb)
Specified by:
setForegroundColor in interface DrawingSurface
Overrides:
setForegroundColor in class AbstractDrawingSurface

setPolygonStyle

public void setPolygonStyle(PolygonStyle style)
Specified by:
setPolygonStyle in interface DrawingSurface
Overrides:
setPolygonStyle in class AbstractDrawingSurface

setPolygonStyle

public void setPolygonStyle(int style)
Specified by:
setPolygonStyle in interface DrawingSurface
Overrides:
setPolygonStyle in class AbstractDrawingSurface

setPolylineStyle

public void setPolylineStyle(int style)
Specified by:
setPolylineStyle in interface DrawingSurface
Overrides:
setPolylineStyle in class AbstractDrawingSurface

setPolylineStyle

public void setPolylineStyle(PolylineStyle style)
Specified by:
setPolylineStyle in interface DrawingSurface
Overrides:
setPolylineStyle in class AbstractDrawingSurface

setPointStyle

public void setPointStyle(int style)
Specified by:
setPointStyle in interface DrawingSurface
Overrides:
setPointStyle in class AbstractDrawingSurface

setPointStyle

public void setPointStyle(PointStyle style)
Specified by:
setPointStyle in interface DrawingSurface
Overrides:
setPointStyle in class AbstractDrawingSurface

setTextStyle

public void setTextStyle(int style)
Specified by:
setTextStyle in interface DrawingSurface
Overrides:
setTextStyle in class AbstractDrawingSurface

setTextStyle

public void setTextStyle(TextStyle style)
Specified by:
setTextStyle in interface DrawingSurface
Overrides:
setTextStyle in class AbstractDrawingSurface

drawPolygon

public void drawPolygon(int dataID,
                        DynamicDoubleArray coords)
Specified by:
drawPolygon in interface DrawingSurface
Specified by:
drawPolygon in class AbstractDrawingSurface

drawImage

public void drawImage(int dataID,
                      double x,
                      double y,
                      int ox,
                      int oy,
                      int rotation,
                      ImageSource image,
                      double imageScale,
                      int pixelsWide,
                      int pixelsHigh)
Specified by:
drawImage in interface DrawingSurface

drawPolyline

public void drawPolyline(int dataID,
                         DoubleBuffer coords)
Specified by:
drawPolyline in interface DrawingSurface
Specified by:
drawPolyline in class AbstractDrawingSurface

drawPoint

public void drawPoint(int dataID,
                      double x,
                      double y,
                      int ox,
                      int oy,
                      int rotation)
Specified by:
drawPoint in interface DrawingSurface
Specified by:
drawPoint in class AbstractDrawingSurface

drawText

public void drawText(int dataID,
                     double x,
                     double y,
                     int ox,
                     int oy,
                     int rotation,
                     int alignment,
                     java.lang.String text)
Specified by:
drawText in interface DrawingSurface
Specified by:
drawText in class AbstractDrawingSurface

drawRasterImage

public void drawRasterImage(RasterImage image)
Specified by:
drawRasterImage in interface DrawingSurface

drawWheelMenuCenter

public void drawWheelMenuCenter(WheelMenu menu)
Specified by:
drawWheelMenuCenter in interface DrawingSurface

drawWheelMenu

public void drawWheelMenu(WheelMenu menu)
Specified by:
drawWheelMenu in interface DrawingSurface

displayListFor

public int displayListFor(java.lang.Object key)
Specified by:
displayListFor in interface DrawingSurface
Overrides:
displayListFor in class AbstractDrawingSurface

displayListFor

public int displayListFor(long key)
Specified by:
displayListFor in interface DrawingSurface
Overrides:
displayListFor in class AbstractDrawingSurface

startDisplayList

public int startDisplayList(long key)
Specified by:
startDisplayList in interface DrawingSurface
Overrides:
startDisplayList in class AbstractDrawingSurface

startDisplayList

public int startDisplayList(java.lang.Object key)
Specified by:
startDisplayList in interface DrawingSurface
Overrides:
startDisplayList in class AbstractDrawingSurface

endDisplayList

public void endDisplayList()
Specified by:
endDisplayList in interface DrawingSurface
Overrides:
endDisplayList in class AbstractDrawingSurface

drawDisplayList

public void drawDisplayList(int displayListID)
Specified by:
drawDisplayList in interface DrawingSurface
Overrides:
drawDisplayList in class AbstractDrawingSurface

removeDisplayList

public void removeDisplayList(int displayListID)
Specified by:
removeDisplayList in interface DrawingSurface
Overrides:
removeDisplayList in class AbstractDrawingSurface

popName

public void popName()
Specified by:
popName in interface DrawingSurface

pushName

public void pushName(int i)
Specified by:
pushName in interface DrawingSurface

drawLiteralPoints

public void drawLiteralPoints(LiteralPointFile literalPoints)
Renders a set of literal (explicit color instead of styled "logical") points.

Specified by:
drawLiteralPoints in interface DrawingSurface
Overrides:
drawLiteralPoints in class AbstractDrawingSurface
Parameters:
literalPoints -

drawTexture

public void drawTexture(OpenglTextureHandle texture,
                        double x,
                        double y,
                        double rotation,
                        double textureScale)
Just draws the given textureHandle as a rotated, scaled icon.