org.osm2world.core.target
Interface Target<R extends Renderable>

Type Parameters:
R - subtype of Renderable designed for visualization with this target
All Known Implementing Classes:
AbstractTarget, FaceTarget, JOGLTarget, ObjTarget, POVRayTarget, PrimitiveBuffer, PrimitiveTarget, StatisticsTarget

public interface Target<R extends Renderable>

A sink for rendering/writing WorldObjects to.


Method Summary
 void beginObject(WorldObject object)
          announces the begin of the draw* calls for a WorldObject.
 void drawBox(Material material, VectorXYZ bottomCenter, VectorXZ faceDirection, double height, double width, double depth)
          draws a box with outward-facing polygons.
 void drawColumn(Material material, Integer corners, VectorXYZ base, double height, double radiusBottom, double radiusTop, boolean drawBottom, boolean drawTop)
          draws a column with outward-facing polygons around a point.
 void drawConvexPolygon(Material material, List<VectorXYZ> vs, List<List<VectorXZ>> texCoordLists)
          draws a convex polygon
 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.
 void finish()
          gives the target the chance to perform finish/cleanup operations after all objects have been drawn.
 Class<R> getRenderableType()
          returns the renderable type designed for this target
 void render(R renderable)
          renders a renderable object to this target.
 void setConfiguration(Configuration config)
           
 

Method Detail

getRenderableType

Class<R> getRenderableType()
returns the renderable type designed for this target


setConfiguration

void setConfiguration(Configuration config)

render

void render(R renderable)
renders a renderable object to this target. Usually, this means calling a "renderTo" method on that renderable, with this target as a parameter.


beginObject

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


drawTriangles

void drawTriangles(Material material,
                   Collection<? extends TriangleXYZ> triangles,
                   List<List<VectorXZ>> texCoordLists)
draws triangles.

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

drawTrianglesWithNormals

void drawTrianglesWithNormals(Material material,
                              Collection<? extends TriangleXYZWithNormals> triangles,
                              List<List<VectorXZ>> texCoordLists)
draws triangles with explicitly defined normal vectors.

See Also:
drawTriangles(Material, Collection, List)

drawTriangleStrip

void drawTriangleStrip(Material material,
                       List<VectorXYZ> vs,
                       List<List<VectorXZ>> texCoordLists)
draws a triangle strip.

Parameters:
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

void drawTriangleFan(Material material,
                     List<VectorXYZ> vs,
                     List<List<VectorXZ>> texCoordLists)
draws a triangle fan.

See Also:
drawTriangleStrip(Material, List, List)

drawConvexPolygon

void drawConvexPolygon(Material material,
                       List<VectorXYZ> vs,
                       List<List<VectorXZ>> texCoordLists)
draws a convex polygon

See Also:
drawTriangleStrip(Material, List, List)

drawBox

void drawBox(Material material,
             VectorXYZ bottomCenter,
             VectorXZ faceDirection,
             double height,
             double width,
             double depth)
draws a box with outward-facing polygons.

Parameters:
faceDirection - direction for the "front" of the box

drawColumn

void drawColumn(Material material,
                Integer corners,
                VectorXYZ base,
                double height,
                double radiusBottom,
                double radiusTop,
                boolean drawBottom,
                boolean drawTop)
draws a column with outward-facing polygons around a point. A column is a polygon with > 3 corners extruded upwards. The implementation may decide to reduce the number of corners in order to improve performance (or make rendering possible when a perfect cylinder isn't supported).

Parameters:
corners - number of corners; null creates a cylinder for radiusBottom == radiusTop or (truncated) cone otherwise

finish

void finish()
gives the target the chance to perform finish/cleanup operations after all objects have been drawn.