org.osm2world.core.target
R
- subtype of Renderable
designed for visualization
with this targetpublic interface Target<R extends Renderable>
WorldObject
s to.Modifier and Type | Method and Description |
---|---|
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 |
drawExtrudedShape(Material material,
ShapeXZ shape,
List<VectorXYZ> path,
List<VectorXYZ> upVectors,
List<Double> scaleFactors,
List<List<VectorXZ>> texCoordLists,
EnumSet<ExtrudeOption> options)
extrudes a 2d shape along a path.
|
void |
drawShape(Material material,
SimpleClosedShapeXZ shape,
VectorXYZ point,
VectorXYZ frontVector,
VectorXYZ upVector)
draws a flat shape in 3D space, at an arbitrary rotation.
|
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) |
Class<R> getRenderableType()
void setConfiguration(Configuration config)
void render(R renderable)
void beginObject(WorldObject object)
WorldObject
.
This allows targets to group them, if desired.
Otherwise, this can be ignored.void drawTriangles(Material material, Collection<? extends TriangleXYZ> triangles, List<List<VectorXZ>> texCoordLists)
texCoordLists
- one texture coordinate list per texture.
Each must have three coordinates per triangle.
Can be null if no texturing information is available.void drawTrianglesWithNormals(Material material, Collection<? extends TriangleXYZWithNormals> triangles, List<List<VectorXZ>> texCoordLists)
void drawTriangleStrip(Material material, List<VectorXYZ> vs, List<List<VectorXZ>> texCoordLists)
vs
- vertices of the triangle striptexCoordLists
- 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.void drawTriangleFan(Material material, List<VectorXYZ> vs, List<List<VectorXZ>> texCoordLists)
void drawConvexPolygon(Material material, List<VectorXYZ> vs, List<List<VectorXZ>> texCoordLists)
void drawShape(Material material, SimpleClosedShapeXZ shape, VectorXYZ point, VectorXYZ frontVector, VectorXYZ upVector)
material
- the material used for the extruded shape; != nullshape
- the shape to be drawn; != nullpoint
- position where the shape is drawn; != nullfrontVector
- direction the shape is facing.
Defines the shape's rotation along with upVector; != nullupVector
- up direction of the shape.
Defines the shape's rotation along with frontVector; != nullvoid drawExtrudedShape(Material material, ShapeXZ shape, List<VectorXYZ> path, List<VectorXYZ> upVectors, List<Double> scaleFactors, List<List<VectorXZ>> texCoordLists, EnumSet<ExtrudeOption> options)
For problematic input parameters, the resulting geometry might end up self-intersecting or contain zero-area triangles.
material
- the material used for the extruded shape; != nullshape
- the shape to be extruded; != nullpath
- the path along which the shape is extruded. Implicitly,
this also defines a rotation for the shape at each point.
Must have at least two points; != null.upVectors
- defines the rotation (along with the path) at each point.
Must have the same number of elements as path; != null.
You can use Collections.nCopies(int, Object)
if you want the same up vector for all points of the path.scaleFactors
- optionally allows the shape to be scaled at each point.
Must have the same number of elements as path.
Can be set to null for a constant scale factor of 1texCoordLists
- one texture coordinate list per texture.
The number of vectors in each must be equal to the number of
vertices of the shape, multiplied by the length of the path.
Can be null, in which case it falls back to a default.options
- flags setting additional options; can be null for no options.IllegalArgumentException
- if upVectors are null and cannot be inferred
from the path. This happens for completely vertical
or otherwise ambiguous paths.void drawBox(Material material, VectorXYZ bottomCenter, VectorXZ faceDirection, double height, double width, double depth)
faceDirection
- direction for the "front" of the boxvoid drawColumn(Material material, Integer corners, VectorXYZ base, double height, double radiusBottom, double radiusTop, boolean drawBottom, boolean drawTop)
corners
- number of corners; null creates a cylinder
for radiusBottom == radiusTop or (truncated) cone otherwisevoid finish()