askalon.graph.chartpack.diagram3d
Class Renderer

java.lang.Object
  extended byaskalon.graph.chartpack.diagram3d.Renderer

public class Renderer
extends java.lang.Object

Copyright (c) 2002 Thomas Fahringer, Institute for Software Science, University of Vienna, Austria

We provide the ASKALON Visualization Diagramm Class Library (below described as ASKALON") on an AS IS basis, and do not warrant its validity or performance. We reserve the right to update, modify, or discontinue this software at any time. We shall have no obligation to supply such updates or modifications or any other form of support to you.

This license is for research uses. For such uses, there is no charge. We define "research use" to mean you may freely use it inside your organization for whatever purposes you see fit. But you may not re-distribute ASKALON or parts of ASKALON, in any form source or binary (including derivatives), electronic or otherwise, to any other organization or entity without our permission. (for other uses, please contact us at tf@par.univie.ac.at)

All warranties, including without limitation, any warranty of merchantability or fitness for a particular purpose, are hereby excluded.

By your use of ASKALON, you understand and agree that we (or any other person or entity with proprietary rights in ASKALON) are under no obligation to provide either maintenance services, update services, notices of latent defects, or correction of defects for ASKALON.

Even if advised of the possibility of such damages, under no circumstances shall we (or any other person or entity with proprietary rights in the software licensed hereunder) be liable to you or any third party for direct, indirect, or consequential damages of any character regardless of type of action, including, without limitation, loss of profits, loss of use, loss of good will, or computer failure or malfunction. You agree to indemnify us (and any other person or entity with proprietary rights in the software licensed hereunder) for any and all liability it may incur to third parties resulting from your use of ASKALON.


Version:
$Revision: 1.14 $ / $Date: 2004/03/23 11:49:34 $.
Author:
Sascha Nemecek/9825915.

Field Summary
static float MINIMUM_BRIGHTNESS
           
static int RENDERING_QUALITY_HIGH
           
static int RENDERING_QUALITY_LOW
           
static int RENDERING_QUALITY_MEDIUM
           
 
Constructor Summary
Renderer(Portal3D p)
          Initialises the renderer.
 
Method Summary
 java.awt.image.MemoryImageSource getImage()
          Retrieve an image from the current rendered scene.
 int[] init(int W, int H)
          Initializes the renderer.
(package private)  void line(int x1, int y1, double z1, int x2, int y2, double z2, int c)
          Plots a line using pixels and Bresenham's Algorithm for lines with +ve slope < 1.
(package private)  void line(Point3D p1, Point3D p2, java.awt.Color c)
           
 int[] reinit(int W, int H)
          Initializes the renderer.
 void renderLine(Line3D l)
          Renders the given line in a image buffer (a simple array).
 void renderLine(Point3D start, Point3D end, int color)
          Renders the given line in a image buffer (a simple array).
 void renderScene()
          Renderes the scene.
 void renderTriangle(Triangle3D s, double maxY)
          Renders the given triangle in a image buffer (a simple array).
 void setRenderingQuality(int rq)
          Sets the rendering quality (high, medium, low).
 void setShowMesh(boolean sm)
          If enabled, the mesh around the triangles will be rendered.
 void setShowMeshOnly(boolean smo)
          If enabled, only the mesh will be rendered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MINIMUM_BRIGHTNESS

public static final float MINIMUM_BRIGHTNESS
See Also:
Constant Field Values

RENDERING_QUALITY_HIGH

public static final int RENDERING_QUALITY_HIGH
See Also:
Constant Field Values

RENDERING_QUALITY_MEDIUM

public static final int RENDERING_QUALITY_MEDIUM
See Also:
Constant Field Values

RENDERING_QUALITY_LOW

public static final int RENDERING_QUALITY_LOW
See Also:
Constant Field Values
Constructor Detail

Renderer

public Renderer(Portal3D p)
Initialises the renderer.

Parameters:
p - The portal to the scene to be rendered.
Method Detail

renderScene

public void renderScene()
Renderes the scene.


getImage

public java.awt.image.MemoryImageSource getImage()
Retrieve an image from the current rendered scene.

Returns:
The rendered scene.

renderLine

public void renderLine(Line3D l)
Renders the given line in a image buffer (a simple array).

Parameters:
l - The line to render.

renderLine

public void renderLine(Point3D start,
                       Point3D end,
                       int color)
Renders the given line in a image buffer (a simple array).

Parameters:
start - The starting point of the line to render.
end - The ending point of the line to render.
color - The color of the line.

line

void line(Point3D p1,
          Point3D p2,
          java.awt.Color c)

line

void line(int x1,
          int y1,
          double z1,
          int x2,
          int y2,
          double z2,
          int c)
Plots a line using pixels and Bresenham's Algorithm for lines with +ve slope < 1.


renderTriangle

public void renderTriangle(Triangle3D s,
                           double maxY)
Renders the given triangle in a image buffer (a simple array).

Parameters:
s - The triangle to render.

setRenderingQuality

public void setRenderingQuality(int rq)
Sets the rendering quality (high, medium, low).

Parameters:
rq - The rendering quality to set.

setShowMesh

public void setShowMesh(boolean sm)
If enabled, the mesh around the triangles will be rendered.

Parameters:
sm - True, to enable mesh rendering.

setShowMeshOnly

public void setShowMeshOnly(boolean smo)
If enabled, only the mesh will be rendered. This improves rendering speed.

Parameters:
smo - True, for mesh only.

init

public int[] init(int W,
                  int H)
Initializes the renderer.

Parameters:
W - The framebuffer width.
H - The framebuffer height.
Returns:
The framebuffer array.

reinit

public int[] reinit(int W,
                    int H)
Initializes the renderer.

Parameters:
W - The framebuffer width.
H - The framebuffer height.
Returns:
The framebuffer array.