artofillusion.view
Interface CanvasDrawer

All Known Implementing Classes:
GLCanvasDrawer, SoftwareCanvasDrawer

public interface CanvasDrawer

This interface defines an object which renders the content of a ViewerCanvas.


Method Summary
 void drawBorder()
          Draw a border around the rendered image.
 void drawBox(int x, int y, int width, int height, java.awt.Color color)
          Draw a filled box in the rendered image.
 void drawBoxes(java.util.List<java.awt.Rectangle> box, java.awt.Color color)
          Draw a set of filled boxes in the rendered image.
 void drawDraggedShape(java.awt.Shape shape)
          Show feedback to the user in response to a mouse drag, by drawing a Shape over the image.
 void drawHRule(int y, java.awt.Color color)
          Draw a horizontal line across the rendered image.
 void drawImage(java.awt.Image image, int x, int y)
          Draw an image onto the canvas.
 void drawLine(java.awt.Point p1, java.awt.Point p2, java.awt.Color color)
          Draw a line into the rendered image.
 void drawShape(java.awt.Shape shape, java.awt.Color color)
          Draw the outline of a Shape into the canvas.
 void drawString(java.lang.String text, int x, int y, java.awt.Color color)
          Draw a piece of text onto the canvas.
 void drawVRule(int x, java.awt.Color color)
          Draw a vertical line across the rendered image.
 void fillShape(java.awt.Shape shape, java.awt.Color color)
          Draw a filled Shape onto the canvas.
 void imageChanged(java.awt.Image image)
          This should be called to indicate that a previously drawn image has changed, and cached information for it needs to be discarded.
 void renderBox(int x, int y, int width, int height, double depth, java.awt.Color color)
          Render a filled box at a specified depth in the rendered image.
 void renderBoxes(java.util.List<java.awt.Rectangle> box, java.util.List<java.lang.Double> depth, java.awt.Color color)
          Render a set of filled boxes at specified depths in the rendered image.
 void renderImage(java.awt.Image image, Vec3 p1, Vec3 p2, Vec3 p3, Vec3 p4, Camera camera)
          Render an image onto the canvas.
 void renderLine(Vec2 p1, double zf1, Vec2 p2, double zf2, Camera cam, java.awt.Color color)
          Render a line into the image.
 void renderLine(Vec3 p1, Vec3 p2, Camera cam, java.awt.Color color)
          Render a line into the image.
 void renderMesh(RenderingMesh mesh, VertexShader shader, Camera cam, boolean closed, boolean[] hideFace)
          Render a mesh to the canvas.
 void renderMeshTransparent(RenderingMesh mesh, VertexShader shader, Camera cam, Vec3 viewDir, boolean[] hideFace)
          Render an object with flat shading in subtractive (transparent) mode.
 void renderWireframe(WireframeMesh mesh, Camera cam, java.awt.Color color)
          Render a wireframe object.
 void setTemplateImage(java.awt.Image im)
          Set the template image.
 

Method Detail

setTemplateImage

void setTemplateImage(java.awt.Image im)
Set the template image.


drawDraggedShape

void drawDraggedShape(java.awt.Shape shape)
Show feedback to the user in response to a mouse drag, by drawing a Shape over the image. Unlike the other methods of this class, this method may be called at arbitrary times (though always from the event dispatch thread), not during the process of rendering the image.


drawBorder

void drawBorder()
Draw a border around the rendered image.


drawHRule

void drawHRule(int y,
               java.awt.Color color)
Draw a horizontal line across the rendered image. The parameters are the y coordinate of the line and the line color.


drawVRule

void drawVRule(int x,
               java.awt.Color color)
Draw a vertical line across the rendered image. The parameters are the x coordinate of the line and the line color.


drawBox

void drawBox(int x,
             int y,
             int width,
             int height,
             java.awt.Color color)
Draw a filled box in the rendered image.


drawBoxes

void drawBoxes(java.util.List<java.awt.Rectangle> box,
               java.awt.Color color)
Draw a set of filled boxes in the rendered image.


renderBox

void renderBox(int x,
               int y,
               int width,
               int height,
               double depth,
               java.awt.Color color)
Render a filled box at a specified depth in the rendered image.


renderBoxes

void renderBoxes(java.util.List<java.awt.Rectangle> box,
                 java.util.List<java.lang.Double> depth,
                 java.awt.Color color)
Render a set of filled boxes at specified depths in the rendered image.


drawLine

void drawLine(java.awt.Point p1,
              java.awt.Point p2,
              java.awt.Color color)
Draw a line into the rendered image.


renderLine

void renderLine(Vec3 p1,
                Vec3 p2,
                Camera cam,
                java.awt.Color color)
Render a line into the image.

Parameters:
p1 - the first endpoint of the line
p2 - the second endpoint of the line
cam - the camera from which to draw the line
color - the line color

renderLine

void renderLine(Vec2 p1,
                double zf1,
                Vec2 p2,
                double zf2,
                Camera cam,
                java.awt.Color color)
Render a line into the image.

Parameters:
p1 - the first endpoint of the line, in screen coordinates
zf1 - the z coordinate of the first endpoint, in view coordinates
p2 - the second endpoint of the line, in screen coordinates
zf2 - the z coordinate of the second endpoint, in view coordinates
cam - the camera from which to draw the line
color - the line color

renderWireframe

void renderWireframe(WireframeMesh mesh,
                     Camera cam,
                     java.awt.Color color)
Render a wireframe object.


renderMeshTransparent

void renderMeshTransparent(RenderingMesh mesh,
                           VertexShader shader,
                           Camera cam,
                           Vec3 viewDir,
                           boolean[] hideFace)
Render an object with flat shading in subtractive (transparent) mode.


renderMesh

void renderMesh(RenderingMesh mesh,
                VertexShader shader,
                Camera cam,
                boolean closed,
                boolean[] hideFace)
Render a mesh to the canvas.


drawString

void drawString(java.lang.String text,
                int x,
                int y,
                java.awt.Color color)
Draw a piece of text onto the canvas.


drawImage

void drawImage(java.awt.Image image,
               int x,
               int y)
Draw an image onto the canvas.


renderImage

void renderImage(java.awt.Image image,
                 Vec3 p1,
                 Vec3 p2,
                 Vec3 p3,
                 Vec3 p4,
                 Camera camera)
Render an image onto the canvas.

Parameters:
image - the image to render
p1 - the coordinates of the first corner of the image
p2 - the coordinates of the second corner of the image
p3 - the coordinates of the third corner of the image
p4 - the coordinates of the fourth corner of the image
camera - the camera from which to draw the image

drawShape

void drawShape(java.awt.Shape shape,
               java.awt.Color color)
Draw the outline of a Shape into the canvas.


fillShape

void fillShape(java.awt.Shape shape,
               java.awt.Color color)
Draw a filled Shape onto the canvas.


imageChanged

void imageChanged(java.awt.Image image)
This should be called to indicate that a previously drawn image has changed, and cached information for it needs to be discarded.



Copyright © 1999-2011 by Peter Eastman.