org.osm2world.viewer.view.debug
Class DebugView

Object
  extended by DebugView
Direct Known Subclasses:
ClearingDebugView, EleDebugView, FaceDebugView, HelpView, Map2dTreeDebugView, MapDataBoundsDebugView, MapDataDebugView, MapDataElevationDebugView, NetworkDebugView, OrthoBoundsDebugView, QuadtreeDebugView, RoofDataDebugView, SkyboxView, TerrainAABBDebugView, TerrainBoundaryAABBDebugView, TerrainBoundaryDebugView, TerrainCellLabelsView, TerrainElevationGridDebugView, TerrainNormalsDebugView, TerrainOutlineDebugView, TerrainView, WorldObjectNormalsDebugView, WorldObjectView

public abstract class DebugView
extends Object

contains some common methods for debug views


Field Summary
protected  Camera camera
           
protected  Configuration config
           
protected  CellularTerrainElevation eleData
           
protected  MapData map
           
protected  Projection projection
           
protected  Terrain terrain
           
 
Constructor Summary
DebugView()
           
 
Method Summary
 boolean canBeUsed()
          returns true if this DebugView can currently be used for rendering.
protected static void drawArrow(JOGLTarget target, Color color, float headLength, VectorXYZ... vs)
           
protected static void drawBox(JOGLTarget target, Color color, VectorXYZ v1, VectorXYZ v2, VectorXYZ v3, VectorXYZ v4)
           
protected static void drawBoxAround(JOGLTarget target, VectorXYZ center, Color color, float halfWidth)
           
protected static void drawBoxAround(JOGLTarget target, VectorXZ center, Color color, float halfWidth)
           
protected abstract  void fillTarget(JOGLTarget target)
          lets the subclass add all content and settings for rendering.
 String getDescription()
          returns a description of the debug view
 void renderTo(GL2 gl, Camera camera, Projection projection)
          renders the content added by fillTarget(JOGLTarget).
 void setConfiguration(Configuration config)
           
 void setConversionResults(ConversionFacade.Results conversionResults)
           
protected  void updateTarget(JOGLTarget target, boolean viewChanged)
          lets the subclass update the target after the initial fillTarget(JOGLTarget).
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

protected Configuration config

map

protected MapData map

terrain

protected Terrain terrain

eleData

protected CellularTerrainElevation eleData

camera

protected Camera camera

projection

protected Projection projection
Constructor Detail

DebugView

public DebugView()
Method Detail

setConfiguration

public final void setConfiguration(Configuration config)

setConversionResults

public void setConversionResults(ConversionFacade.Results conversionResults)

canBeUsed

public boolean canBeUsed()
returns true if this DebugView can currently be used for rendering. By default, this checks whether all the setters have been used with non-null values, but subclasses can overwrite it with their own checks.


getDescription

public String getDescription()
returns a description of the debug view


renderTo

public void renderTo(GL2 gl,
                     Camera camera,
                     Projection projection)
renders the content added by fillTarget(JOGLTarget). Only has an effect if canBeUsed() is true.

Parameters:
gl - needs to be the same gl as in previous calls

fillTarget

protected abstract void fillTarget(JOGLTarget target)
lets the subclass add all content and settings for rendering. Will only be called if canBeUsed() is true.


updateTarget

protected void updateTarget(JOGLTarget target,
                            boolean viewChanged)
lets the subclass update the target after the initial fillTarget(JOGLTarget).

Parameters:
viewChanged - true if camera or projection have changed

drawBoxAround

protected static final void drawBoxAround(JOGLTarget target,
                                          VectorXZ center,
                                          Color color,
                                          float halfWidth)

drawBoxAround

protected static final void drawBoxAround(JOGLTarget target,
                                          VectorXYZ center,
                                          Color color,
                                          float halfWidth)

drawBox

protected static final void drawBox(JOGLTarget target,
                                    Color color,
                                    VectorXYZ v1,
                                    VectorXYZ v2,
                                    VectorXYZ v3,
                                    VectorXYZ v4)

drawArrow

protected static final void drawArrow(JOGLTarget target,
                                      Color color,
                                      float headLength,
                                      VectorXYZ... vs)