org.osm2world.core.target.povray
Class POVRayTarget

Object
  extended by AbstractTarget<RenderableToPOVRay>
      extended by POVRayTarget
All Implemented Interfaces:
Target<RenderableToPOVRay>

public class POVRayTarget
extends AbstractTarget<RenderableToPOVRay>


Field Summary
 
Fields inherited from class AbstractTarget
BOX_TEX_COORDS_1, BOX_TEX_COORDS_2, config
 
Constructor Summary
POVRayTarget(PrintStream output)
           
 
Method Summary
 void append(double value)
           
 void append(int value)
           
 void append(String code)
          provides direct write access to the generated source code.
 void appendDefaultParameterValue(String name, String value)
           
 void appendInverseVector(VectorXZ vector)
          append a vector with inverted coordinates
 void appendMaterialDefinitions()
           
 void appendMaterialOrName(Material material)
           
 void appendPolygon(VectorXYZ... vs)
           
 void appendPrism(float y1, float y2, VectorXZ... vs)
           
 void appendRGBColor(Color color)
          adds a color.
 void appendTriangle(VectorXYZ a, VectorXYZ b, VectorXYZ c)
           
 void appendTriangle(VectorXYZ a, VectorXYZ b, VectorXYZ c, VectorXYZ na, VectorXYZ nb, VectorXYZ nc, boolean smooth)
           
 void appendTriangle(VectorXYZ a, VectorXYZ b, VectorXYZ c, VectorXYZ na, VectorXYZ nb, VectorXYZ nc, VectorXZ ta, VectorXZ tb, VectorXZ tc, boolean smooth, boolean texture)
           
 void appendVector(double x, double z)
          adds a vector to the String built by a StringBuilder.
 void appendVector(double x, double y, double z)
           
 void appendVector(float x, float y, float z)
          adds a vector to the String built by a StringBuilder.
 void appendVector(VectorXYZ vector)
          alternative to appendVector(double, double) using a vector object as parameter instead of individual coordinates
 void appendVector(VectorXZ vector)
          alternative to appendVector(double, double) using a vector object as parameter instead of individual coordinates
 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 drawColumn(Material material, Integer corners, VectorXYZ base, VectorXYZ cap, double radiusBottom, double radiusTop, boolean drawBottom, boolean drawTop)
          variant of drawColumn(Material, Integer, VectorXYZ, double, double, double, boolean, boolean) that allows arbitrarily placed columns
 void drawConvexPolygon(Material material, List<VectorXYZ> vs, List<List<VectorXZ>> texCoordLists)
          draws a convex polygon
 void drawTriangles(Material material, Collection<? extends TriangleXYZ> triangles, List<List<VectorXZ>> texCoordLists)
          draws triangles.
 void drawTrianglesWithNormals(Material material, Collection<? extends TriangleXYZWithNormals> triangles, List<List<VectorXZ>> texCoordLists)
          draws triangles with explicitly defined normal vectors.
 Class<RenderableToPOVRay> getRenderableType()
          returns the renderable type designed for this target
 void render(RenderableToPOVRay renderable)
          renders a renderable object to this target.
 
Methods inherited from class AbstractTarget
beginObject, drawBox, drawTriangleFan, drawTriangleStrip, finish, setConfiguration
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

POVRayTarget

public POVRayTarget(PrintStream output)
Method Detail

getRenderableType

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


render

public void render(RenderableToPOVRay 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.


append

public void append(String code)
provides direct write access to the generated source code. This is intended for Renderables using special POVRay features.


append

public void append(int value)

append

public void append(double value)

appendDefaultParameterValue

public void appendDefaultParameterValue(String name,
                                        String value)

appendMaterialDefinitions

public void appendMaterialDefinitions()

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)

drawConvexPolygon

public void drawConvexPolygon(Material material,
                              List<VectorXYZ> vs,
                              List<List<VectorXZ>> texCoordLists)
Description copied from interface: Target
draws a convex polygon

Specified by:
drawConvexPolygon in interface Target<RenderableToPOVRay>
Overrides:
drawConvexPolygon in class AbstractTarget<RenderableToPOVRay>
See Also:
Target.drawTriangleStrip(Material, List, List)

drawColumn

public void drawColumn(Material material,
                       Integer corners,
                       VectorXYZ base,
                       double height,
                       double radiusBottom,
                       double radiusTop,
                       boolean drawBottom,
                       boolean drawTop)
Description copied from interface: Target
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).

Specified by:
drawColumn in interface Target<RenderableToPOVRay>
Overrides:
drawColumn in class AbstractTarget<RenderableToPOVRay>
corners - number of corners; null creates a cylinder for radiusBottom == radiusTop or (truncated) cone otherwise

drawColumn

public void drawColumn(Material material,
                       Integer corners,
                       VectorXYZ base,
                       VectorXYZ cap,
                       double radiusBottom,
                       double radiusTop,
                       boolean drawBottom,
                       boolean drawTop)
variant of drawColumn(Material, Integer, VectorXYZ, double, double, double, boolean, boolean) that allows arbitrarily placed columns


appendTriangle

public void appendTriangle(VectorXYZ a,
                           VectorXYZ b,
                           VectorXYZ c)

appendTriangle

public void appendTriangle(VectorXYZ a,
                           VectorXYZ b,
                           VectorXYZ c,
                           VectorXYZ na,
                           VectorXYZ nb,
                           VectorXYZ nc,
                           boolean smooth)

appendTriangle

public void appendTriangle(VectorXYZ a,
                           VectorXYZ b,
                           VectorXYZ c,
                           VectorXYZ na,
                           VectorXYZ nb,
                           VectorXYZ nc,
                           VectorXZ ta,
                           VectorXZ tb,
                           VectorXZ tc,
                           boolean smooth,
                           boolean texture)

appendRGBColor

public void appendRGBColor(Color color)
adds a color. Syntax is "color rgb ".


appendMaterialOrName

public void appendMaterialOrName(Material material)

appendVector

public void appendVector(float x,
                         float y,
                         float z)
adds a vector to the String built by a StringBuilder. Syntax is "".


appendVector

public void appendVector(double x,
                         double y,
                         double z)

appendVector

public void appendVector(VectorXYZ vector)
alternative to appendVector(double, double) using a vector object as parameter instead of individual coordinates


appendVector

public void appendVector(double x,
                         double z)
adds a vector to the String built by a StringBuilder. Syntax is "".


appendVector

public void appendVector(VectorXZ vector)
alternative to appendVector(double, double) using a vector object as parameter instead of individual coordinates


appendInverseVector

public void appendInverseVector(VectorXZ vector)
append a vector with inverted coordinates


appendPolygon

public void appendPolygon(VectorXYZ... vs)
Parameters:
vs - polygon vertices; first and last should be equal

appendPrism

public void appendPrism(float y1,
                        float y2,
                        VectorXZ... vs)