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:
EventListener, PreferenceChangeListener, 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>, PreferenceChangeListener

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.)
 List<BlendTriangle> getBlendedTris()
          Because blending phase of rendering can be done only after all opaque objects has been drawn and because polys has to be back-to-front ordered every renderer will return list of its blended triangles so final renderer can sort all blended triangles from all blended renderers and do it correctly.
 cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap getObject()
          Return object this renderer draws.
 void preferenceChange(PreferenceChangeEvent evt)
           
 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.
 
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 GLRendererCollection

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

preferenceChange

public void preferenceChange(PreferenceChangeEvent evt)
Specified by:
preferenceChange in interface PreferenceChangeListener

getBlendedTris

public List<BlendTriangle> getBlendedTris()
Description copied from interface: ISubGLRenderer
Because blending phase of rendering can be done only after all opaque objects has been drawn and because polys has to be back-to-front ordered every renderer will return list of its blended triangles so final renderer can sort all blended triangles from all blended renderers and do it correctly.

Specified by:
getBlendedTris in interface ISubGLRenderer<cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap>
Returns:
List of blended triangles this renderer wants to render. Empty collection if no such exists.

destroy

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



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