org.osm2world.core.target.statistics
Class StatisticsTarget

Object
  extended by AbstractTarget<R>
      extended by PrimitiveTarget<RenderableToPrimitiveTarget>
          extended by StatisticsTarget
All Implemented Interfaces:
Target<RenderableToPrimitiveTarget>

public class StatisticsTarget
extends PrimitiveTarget<RenderableToPrimitiveTarget>

a target that simply counts the primitives that are sent to it to create statistics.


Nested Class Summary
static class StatisticsTarget.Stat
           
 
Field Summary
 
Fields inherited from class AbstractTarget
BOX_TEX_COORDS_1, BOX_TEX_COORDS_2, config
 
Constructor Summary
StatisticsTarget()
           
 
Method Summary
 void beginObject(WorldObject object)
          announces the begin of the draw* calls for a WorldObject.
 void clear()
           
protected  void drawPrimitive(Primitive.Type type, Material material, List<VectorXYZ> vs, List<VectorXYZ> normals, List<List<VectorXZ>> texCoordLists)
           
 long getCountForClass(Class<?> c, StatisticsTarget.Stat stat)
           
 long getCountForMaterial(Material material, StatisticsTarget.Stat stat)
           
 long getGlobalCount(StatisticsTarget.Stat stat)
           
 Set<Material> getKnownMaterials()
           
 Set<Class<?>> getKnownRenderableClasses()
           
 Class<RenderableToPrimitiveTarget> getRenderableType()
          returns the renderable type designed for this target
 void render(RenderableToPrimitiveTarget renderable)
          renders a renderable object to this target.
 
Methods inherited from class PrimitiveTarget
drawTriangleFan, drawTriangles, drawTriangleStrip, drawTrianglesWithNormals
 
Methods inherited from class AbstractTarget
drawBox, drawColumn, drawConvexPolygon, finish, setConfiguration
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatisticsTarget

public StatisticsTarget()
Method Detail

getRenderableType

public Class<RenderableToPrimitiveTarget> getRenderableType()
Description copied from interface: Target
returns the renderable type designed for this target


render

public void render(RenderableToPrimitiveTarget renderable)
Description copied from interface: Target
renders a renderable object to this target. Usually, this means calling a "renderTo" method on that renderable, with this target as a parameter.


beginObject

public void beginObject(WorldObject object)
Description copied from interface: Target
announces the begin of the draw* calls for a WorldObject. This allows targets to group them, if desired. Otherwise, this can be ignored.

Specified by:
beginObject in interface Target<RenderableToPrimitiveTarget>
Overrides:
beginObject in class AbstractTarget<RenderableToPrimitiveTarget>

drawPrimitive

protected void drawPrimitive(Primitive.Type type,
                             Material material,
                             List<VectorXYZ> vs,
                             List<VectorXYZ> normals,
                             List<List<VectorXZ>> texCoordLists)
Specified by:
drawPrimitive in class PrimitiveTarget<RenderableToPrimitiveTarget>
vs - vertices that form the primitive
normals - normal vector for each vertex; same size as vs
texCoordLists - texture coordinates for each texture layer, each list has the same size as vs

clear

public void clear()

getGlobalCount

public long getGlobalCount(StatisticsTarget.Stat stat)

getKnownMaterials

public Set<Material> getKnownMaterials()

getCountForMaterial

public long getCountForMaterial(Material material,
                                StatisticsTarget.Stat stat)

getKnownRenderableClasses

public Set<Class<?>> getKnownRenderableClasses()

getCountForClass

public long getCountForClass(Class<?> c,
                             StatisticsTarget.Stat stat)