nl.tudelft.goal.ut2004.visualizer.timeline.map
Class MapRenderer

Package class diagram package MapRenderer
java.lang.Object
  extended by nl.tudelft.goal.ut2004.visualizer.timeline.map.MapRenderer
All Implemented Interfaces:
ISubGLRenderer<cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap>

public class MapRenderer
extends Object
implements ISubGLRenderer<cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap>

Renderer of map. Because of uncomplete server implementation I have no way of knowing state of the server, so I hope this will work. I *assume* that server is up and running and I can get worldmap from it.

Author:
Honza

Field Summary
 int GRID_SCALE
           
 double NAVPOINT_RADIUS
           
 
Constructor Summary
MapRenderer(cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap map, int glName)
          GameBots provides us with flags about pathways between navpoints.
 
Method Summary
 int createMapBackground(javax.media.opengl.GL gla)
          Create a diplay list for map background image, i.e.
 void destroy()
          Clean up the component (listeners, contexts ect.)
 int getGLName()
           
static Color getHighColor()
           
static Color getLowColor()
           
 cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap getObject()
          Return object this renderer draws.
 void prepare(javax.media.opengl.GL gl)
          Precreate display lists for map, because map can be quite large and it would be troublesome to do it every rendering.
 void render(javax.media.opengl.GL gla)
          Display stuff you want to.
static void setHighColor(Color c)
           
static void setLowColor(Color c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GRID_SCALE

public final int GRID_SCALE
See Also:
Constant Field Values

NAVPOINT_RADIUS

public final double NAVPOINT_RADIUS
See Also:
Constant Field Values
Constructor Detail

MapRenderer

public MapRenderer(cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap map,
                   int glName)
GameBots provides us with flags about pathways between navpoints. This class is human readable names for flags. The reason why is this class and not enum is that it is a bitmap mask so they can easily combine. For now.

Method Detail

getObject

public cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap getObject()
Description copied from interface: ISubGLRenderer
Return object this renderer draws. Because objects we want to draw can change rapidly, we have to remove and add subrenderers based on passed objects (renderer R draws object A, now we don't want to draw A anymore, we have to go through subrenderers to find which ones draws it).

Specified by:
getObject in interface ISubGLRenderer<cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap>
Returns:
Object this renderer draws.

prepare

public void prepare(javax.media.opengl.GL gl)
Precreate display lists for map, because map can be quite large and it would be troublesome to do it every rendering.

Specified by:
prepare in interface ISubGLRenderer<cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap>
Parameters:
gl -

createMapBackground

public int createMapBackground(javax.media.opengl.GL gla)
Create a diplay list for map background image, i.e. image that is show above grid to give a better idea about world. It is mostly screenshot from UnrealEd.

Parameters:
gl -
Returns:
id of display list

render

public void render(javax.media.opengl.GL gla)
Description copied from interface: ISubGLRenderer
Display stuff you want to. Assume that settings have already been set in CollectionRenderer

Specified by:
render in interface ISubGLRenderer<cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap>

getHighColor

public static Color getHighColor()

setHighColor

public static void setHighColor(Color c)

getLowColor

public static Color getLowColor()

setLowColor

public static void setLowColor(Color c)

destroy

public void destroy()
Clean up the component (listeners, contexts ect.)

Specified by:
destroy in interface ISubGLRenderer<cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap>

getGLName

public int getGLName()
Specified by:
getGLName in interface ISubGLRenderer<cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap>


Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.