Package snap.gfx3d

Class Painter3D

java.lang.Object
snap.gfx3d.Painter3D
All Implemented Interfaces:
Cloneable

public class Painter3D extends Object implements Cloneable
This class renders 2D painting on a 3D plane.
  • Constructor Details

    • Painter3D

      public Painter3D(double aWidth, double aHeight)
      Constructor.
  • Method Details

    • getWidth

      public double getWidth()
      Returns the width.
    • getHeight

      public double getHeight()
      Returns the height.
    • getColor

      public Color getColor()
      Returns the current paint.
    • setColor

      public void setColor(Color aColor)
      Sets the current paint.
    • getStroke

      public Stroke getStroke()
      Returns the current stroke.
    • setStroke

      public void setStroke(Stroke aStroke)
      Sets the current stroke.
    • draw

      public void draw(Shape aShape)
      Draws the given shape.
    • drawRect

      public void drawRect(double aX, double aY, double aW, double aH)
      Draws a rect.
    • moveTo

      public void moveTo(double aX, double aY)
      Adds a moveTo segment.
    • lineTo

      public void lineTo(double aX, double aY)
      Adds a lineTo segment.
    • quadTo

      public void quadTo(double aCX, double aCY, double aX, double aY)
      Adds a quad segment.
    • cubicTo

      public void cubicTo(double aC1X, double aC1Y, double aC2X, double aC2Y, double aX, double aY)
      Adds a cubic segment.
    • closePath

      public void closePath()
      Adds a close path segment.
    • addLayerOffset

      public void addLayerOffset(double aDist)
      Adds an offset (along normal) so successive drawing is above previous drawing.
    • flushTask

      public void flushTask()
      Flushes the current task.
    • getPaintTasks

      public Painter3D.PaintTask[] getPaintTasks()
      Returns the PaintTasks.
    • addPaintTask

      protected void addPaintTask(Painter3D.PaintTask aTask)
      Adds a PaintTask.
    • flipX

      public void flipX()
      Flips painter by X.
    • flipY

      public void flipY()
      Flips painter by Y.
    • getTriangleArray

      public VertexArray getTriangleArray()
      Returns the VertexArray for drawing.
    • clone

      public Painter3D clone()
      Standard clone implementation.
      Overrides:
      clone in class Object