Package snap.gfx3d

Class PolygonPath3D

All Implemented Interfaces:
Cloneable, PropChange.DoChange

public class PolygonPath3D extends FacetShape implements Cloneable
This Shape subclass represents one or more polygons.
  • Constructor Details

    • PolygonPath3D

      public PolygonPath3D()
      Constructor.
    • PolygonPath3D

      public PolygonPath3D(Shape aShape, double aDepth)
      Constructor for given Shape.
  • Method Details

    • getPolygons

      public Polygon3D[] getPolygons()
      Returns the Polygons.
    • getPolygonCount

      public int getPolygonCount()
      Returns the number of polygons.
    • addPolygon

      public void addPolygon(Polygon3D aPoly, int anIndex)
      Adds a polygon.
    • getLastPolygon

      public Polygon3D getLastPolygon()
      Returns the last polygon.
    • moveTo

      public void moveTo(double aX, double aY, double aDepth)
      Moveto.
    • lineTo

      public void lineTo(double aX, double aY, double aDepth)
      LineTo.
    • close

      public void close()
      Closes the current polygon.
    • appendShape

      public void appendShape(Shape aShape, double aDepth)
      Appends given shape to this polygon path.
    • appendPathIter

      public void appendPathIter(PathIter aPathIter, double aDepth)
      Appends given PathIter to this polygon path.
    • createNormal

      protected Vector3D createNormal()
      Override for this shape.
      Specified by:
      createNormal in class FacetShape
    • getPointCount

      public int getPointCount()
      Override to support polygon array.
      Specified by:
      getPointCount in class FacetShape
    • getPoint

      public Point3D getPoint(int anIndex)
      Override to support polygon array.
      Specified by:
      getPoint in class FacetShape
    • createBounds3D

      protected Bounds3D createBounds3D()
      Override to return combined Shape2D for polygons.
      Specified by:
      createBounds3D in class Shape3D
    • getShape2D

      public Shape getShape2D()
      Override to return combined Shape2D for polygons.
      Specified by:
      getShape2D in class FacetShape
    • getStrokeTriangleArray

      protected VertexArray getStrokeTriangleArray()
      Returns a VertexArray for path stroke.
      Overrides:
      getStrokeTriangleArray in class FacetShape
    • reverse

      public void reverse()
      Override to support this class.
      Specified by:
      reverse in class FacetShape
    • copyForMatrix

      public PolygonPath3D copyForMatrix(Matrix3D aTrans)
      Override to support this class.
      Specified by:
      copyForMatrix in class FacetShape
    • clone

      public PolygonPath3D clone()
      Standard clone implementation.
      Overrides:
      clone in class FacetShape
    • createFacetShapeForShapeAndDepth

      public static FacetShape createFacetShapeForShapeAndDepth(Shape aShape, double aDepth)
      Creates a Shape3D (either Polygon3D or PolygonPath3D) for given shape and depth.