org.osm2world.core.target.common
Class PrimitiveTarget

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

public abstract class PrimitiveTarget
extends AbstractTarget

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.


Constructor Summary
PrimitiveTarget()
           
 
Method Summary
 void drawPolygon(Material material, List<? extends VectorXYZ> vs)
           
 void drawPolygon(Material material, VectorXYZ... vs)
           
protected abstract  void drawPrimitive(Primitive.Type type, Material material, List<? extends VectorXYZ> vs, VectorXYZ[] normals)
           
 void drawTriangleFan(Material material, List<? extends VectorXYZ> vs)
           
 void drawTriangles(Material material, Collection<TriangleXYZ> triangles)
           
 void drawTriangleStrip(Material material, List<? extends VectorXYZ> vs)
           
 void drawTriangleStrip(Material material, VectorXYZ... vs)
           
 void drawTrianglesWithNormals(Material material, Collection<TriangleXYZWithNormals> triangles)
           
 
Methods inherited from class AbstractTarget
drawBox, drawColumn
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrimitiveTarget

public PrimitiveTarget()
Method Detail

drawPrimitive

protected abstract void drawPrimitive(Primitive.Type type,
                                      Material material,
                                      List<? extends VectorXYZ> vs,
                                      VectorXYZ[] normals)
Parameters:
vs - vertices that form the primitive
normals - normal vector for each vertex; same size as vs

drawTriangleStrip

public void drawTriangleStrip(Material material,
                              VectorXYZ... vs)

drawTriangleStrip

public void drawTriangleStrip(Material material,
                              List<? extends VectorXYZ> vs)

drawTriangleFan

public void drawTriangleFan(Material material,
                            List<? extends VectorXYZ> vs)

drawPolygon

public void drawPolygon(Material material,
                        VectorXYZ... vs)

drawPolygon

public void drawPolygon(Material material,
                        List<? extends VectorXYZ> vs)

drawTriangles

public void drawTriangles(Material material,
                          Collection<TriangleXYZ> triangles)

drawTrianglesWithNormals

public void drawTrianglesWithNormals(Material material,
                                     Collection<TriangleXYZWithNormals> triangles)