org.osm2world.core.target.jogl
Class PrimitiveBuffer

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

public class PrimitiveBuffer
extends PrimitiveTarget<RenderableToPrimitiveTarget>

Storage for low-level rendering information (vertex and primitive data) that can be displayed using graphics APIs, e.g. OpenGL. Higher-level information, such as object coherence, OSM attributes or representations, isn't present in a PrimitiveBuffer.


Field Summary
 
Fields inherited from class AbstractTarget
BOX_TEX_COORDS_1, BOX_TEX_COORDS_2, config
 
Constructor Summary
PrimitiveBuffer()
           
 
Method Summary
protected  void drawPrimitive(Primitive.Type type, Material material, List<VectorXYZ> vertices, List<VectorXYZ> normals, List<List<VectorXZ>> texCoordLists)
           
 Set<Material> getMaterials()
          returns all materials used in the buffer
 Collection<Primitive> getPrimitives(Material material)
          returns all primitives that use a given material
 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
beginObject, drawBox, drawColumn, drawConvexPolygon, finish, setConfiguration
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrimitiveBuffer

public PrimitiveBuffer()
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.


drawPrimitive

protected void drawPrimitive(Primitive.Type type,
                             Material material,
                             List<VectorXYZ> vertices,
                             List<VectorXYZ> normals,
                             List<List<VectorXZ>> texCoordLists)
Specified by:
drawPrimitive in class PrimitiveTarget<RenderableToPrimitiveTarget>
vertices - 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

getMaterials

public Set<Material> getMaterials()
returns all materials used in the buffer


getPrimitives

public Collection<Primitive> getPrimitives(Material material)
returns all primitives that use a given material