org.osm2world.core.target.jogl
Class JOGLTarget

Object
  extended by AbstractTarget<R>
      extended by PrimitiveTarget<RenderableToJOGL>
          extended by JOGLTarget
All Implemented Interfaces:
Target<RenderableToJOGL>

public class JOGLTarget
extends PrimitiveTarget<RenderableToJOGL>


Constructor Summary
JOGLTarget(GL gl, Camera camera)
           
 
Method Summary
 void drawArrow(Color color, float headLength, VectorXYZ... vs)
           
 void drawLineLoop(Color color, List<? extends VectorXYZ> vs)
           
 void drawLineStrip(Color color, int width, VectorXYZ... vs)
           
 void drawLineStrip(Color color, List<VectorXYZ> vs)
           
 void drawLineStrip(Color color, VectorXYZ... vs)
           
 void drawPoints(Color color, VectorXYZ... vs)
           
 void drawPolygon(Color color, VectorXYZ... vs)
           
protected  void drawPrimitive(Primitive.Type type, Material material, List<? extends VectorXYZ> vertices, VectorXYZ[] normals)
           
 void drawText(String string, int x, int y, int screenWidth, int screenHeight, Color color)
           
 void drawText(String string, Vector3D pos, Color color)
           
 void drawTriangles(Color color, Collection<TriangleXYZ> triangles)
           
 void drawTriangleStrip(Color color, VectorXYZ... vs)
           
static int getGLConstant(Primitive.Type type)
           
 Class<RenderableToJOGL> getRenderableType()
          returns the renderable type designed for this target
 void render(RenderableToJOGL renderable)
          renders a renderable object to this target.
static void setCameraMatrices(GL gl, Camera camera)
           
static void setFrontMaterialColor(GL gl, int pname, Color color)
           
static void setMaterial(GL gl, Material material)
           
static void setProjectionMatrices(GL gl, Projection projection)
           
static void setProjectionMatricesForPart(GL gl, Projection projection, double xStart, double xEnd, double yStart, double yEnd)
          similar to setProjectionMatrices(GL, Projection), but allows rendering only a part of the "normal" image.
 
Methods inherited from class PrimitiveTarget
drawPolygon, drawPolygon, drawTriangleFan, drawTriangles, drawTriangleStrip, drawTriangleStrip, drawTrianglesWithNormals
 
Methods inherited from class AbstractTarget
beginObject, drawBox, drawColumn
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JOGLTarget

public JOGLTarget(GL gl,
                  Camera camera)
Method Detail

getRenderableType

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


render

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


drawPrimitive

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

drawPoints

public void drawPoints(Color color,
                       VectorXYZ... vs)

drawLineStrip

public void drawLineStrip(Color color,
                          VectorXYZ... vs)

drawLineStrip

public void drawLineStrip(Color color,
                          List<VectorXYZ> vs)

drawLineStrip

public void drawLineStrip(Color color,
                          int width,
                          VectorXYZ... vs)

drawLineLoop

public void drawLineLoop(Color color,
                         List<? extends VectorXYZ> vs)

drawArrow

public void drawArrow(Color color,
                      float headLength,
                      VectorXYZ... vs)

drawTriangleStrip

public void drawTriangleStrip(Color color,
                              VectorXYZ... vs)

drawTriangles

public void drawTriangles(Color color,
                          Collection<TriangleXYZ> triangles)

drawPolygon

public void drawPolygon(Color color,
                        VectorXYZ... vs)

drawText

public void drawText(String string,
                     Vector3D pos,
                     Color color)

drawText

public void drawText(String string,
                     int x,
                     int y,
                     int screenWidth,
                     int screenHeight,
                     Color color)

setCameraMatrices

public static final void setCameraMatrices(GL gl,
                                           Camera camera)

setProjectionMatrices

public static final void setProjectionMatrices(GL gl,
                                               Projection projection)

setProjectionMatricesForPart

public static final void setProjectionMatricesForPart(GL gl,
                                                      Projection projection,
                                                      double xStart,
                                                      double xEnd,
                                                      double yStart,
                                                      double yEnd)
similar to setProjectionMatrices(GL, Projection), but allows rendering only a part of the "normal" image. For example, with xStart=0, xEnd=0.5, yStart=0 and yEnd=1, only the left half of the full image will be rendered, but it will be stretched to cover the available space. Only supported for orthographic projections!


setMaterial

public static final void setMaterial(GL gl,
                                     Material material)

setFrontMaterialColor

public static final void setFrontMaterialColor(GL gl,
                                               int pname,
                                               Color color)

getGLConstant

public static final int getGLConstant(Primitive.Type type)