org.osm2world.core.target.common
Class PrimitiveTarget<R extends Renderable>

Object
  extended by AbstractTarget<R>
      extended by PrimitiveTarget<R>
All Implemented Interfaces:
Target<R>
Direct Known Subclasses:
JOGLTarget, PrimitiveBuffer, StatisticsTarget

public abstract class PrimitiveTarget<R extends Renderable>
extends AbstractTarget<R>

superclass for targets that are based on OpenGL primitives. These targets will treat different primitives similarly: They convert them all to a list of vertices and represent the primitive type using an enum or flags.


Field Summary
 
Fields inherited from class AbstractTarget
BOX_TEX_COORDS_1, BOX_TEX_COORDS_2, config
 
Constructor Summary
PrimitiveTarget()
           
 
Method Summary
protected abstract  void drawPrimitive(Primitive.Type type, Material material, List<VectorXYZ> vs, List<VectorXYZ> normals, List<List<VectorXZ>> texCoordLists)
           
 void drawTriangleFan(Material material, List<VectorXYZ> vs, List<List<VectorXZ>> texCoordLists)
          draws a triangle fan.
 void drawTriangles(Material material, Collection<? extends TriangleXYZ> triangles, List<List<VectorXZ>> texCoordLists)
          draws triangles.
 void drawTriangleStrip(Material material, List<VectorXYZ> vs, List<List<VectorXZ>> texCoordLists)
          draws a triangle strip.
 void drawTrianglesWithNormals(Material material, Collection<? extends TriangleXYZWithNormals> triangles, List<List<VectorXZ>> texCoordLists)
          draws triangles with explicitly defined normal vectors.
 
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
 
Methods inherited from interface Target
getRenderableType, render
 

Constructor Detail

PrimitiveTarget

public PrimitiveTarget()
Method Detail

drawPrimitive

protected abstract void drawPrimitive(Primitive.Type type,
                                      Material material,
                                      List<VectorXYZ> vs,
                                      List<VectorXYZ> normals,
                                      List<List<VectorXZ>> texCoordLists)
Parameters:
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

drawTriangleStrip

public void drawTriangleStrip(Material material,
                              List<VectorXYZ> vs,
                              List<List<VectorXZ>> texCoordLists)
Description copied from interface: Target
draws a triangle strip.

Specified by:
drawTriangleStrip in interface Target<R extends Renderable>
Overrides:
drawTriangleStrip in class AbstractTarget<R extends Renderable>
vs - vertices of the triangle strip
texCoordLists - one texture coordinate list per texture. Each must have the same length as the "vs" parameter. Can be null if no texturing information is available.

drawTriangleFan

public void drawTriangleFan(Material material,
                            List<VectorXYZ> vs,
                            List<List<VectorXZ>> texCoordLists)
Description copied from interface: Target
draws a triangle fan.

Specified by:
drawTriangleFan in interface Target<R extends Renderable>
Overrides:
drawTriangleFan in class AbstractTarget<R extends Renderable>
See Also:
Target.drawTriangleStrip(Material, List, List)

drawTriangles

public void drawTriangles(Material material,
                          Collection<? extends TriangleXYZ> triangles,
                          List<List<VectorXZ>> texCoordLists)
Description copied from interface: Target
draws triangles.

texCoordLists - one texture coordinate list per texture. Each must have three coordinates per triangle. Can be null if no texturing information is available.

drawTrianglesWithNormals

public void drawTrianglesWithNormals(Material material,
                                     Collection<? extends TriangleXYZWithNormals> triangles,
                                     List<List<VectorXZ>> texCoordLists)
Description copied from interface: Target
draws triangles with explicitly defined normal vectors.

See Also:
Target.drawTriangles(Material, Collection, List)