Package snap.gfx3d

Class FacetShape

All Implemented Interfaces:
PropChange.DoChange
Direct Known Subclasses:
Path3D, Polygon3D, PolygonPath3D

public abstract class FacetShape extends Shape3D
This Shape3D subclass represents a surface.
  • Field Details

    • _triangleArray

      protected VertexArray _triangleArray
  • Constructor Details

    • FacetShape

      public FacetShape()
  • Method Details

    • getTexture

      public Texture getTexture()
      Returns the texture to render on the facet shape surface.
    • setTexture

      public void setTexture(Texture aTexture)
      Sets the texture to render on the facet shape surface.
    • getPainter

      public Painter3D getPainter()
      Returns the painter to render texture for this path.
    • setPainter

      public void setPainter(Painter3D aPntr)
      Sets the painter to render texture for this path.
    • getNormal

      public Vector3D getNormal()
      Returns the normal of the facet.
    • createNormal

      protected abstract Vector3D createNormal()
      Returns the normal of the facet.
    • getPointCount

      public abstract int getPointCount()
      Returns the number of points in the facet.
    • getPoint

      public abstract Point3D getPoint(int anIndex)
      Returns the Point3D at given index.
    • getShape2D

      public abstract Shape getShape2D()
      Returns the 2D shape for the FacetShape (should only be called when path is facing Z).
    • getTriangleArray

      public VertexArray getTriangleArray()
      Returns a VertexArray of shape surface triangles.
      Specified by:
      getTriangleArray in class Shape3D
    • createVertexArrays

      protected VertexArray createVertexArrays()
      Creates the VertexArrays.
    • createTriangleArray

      protected VertexArray createTriangleArray()
      Creates a VertexArray of shape surface triangles.
    • getStrokeTriangleArray

      protected VertexArray getStrokeTriangleArray()
      Returns a VertexArray for path stroke.
    • getPainterVertexArray

      protected VertexArray getPainterVertexArray()
      Returns the painter VertexArray for 'painted' triangles on shape surface.
    • reverse

      public abstract void reverse()
      Reverses the path3d.
    • getPainterToLocal

      public Matrix3D getPainterToLocal()
      Returns the transform from Painter to this shape.
    • getTransformToAlignToVector

      public Matrix3D getTransformToAlignToVector(double aX, double aY, double aZ)
      Returns the transform to make this FacetShape align with given vector.
    • clearCachedValues

      protected void clearCachedValues()
      Clears cached values when path changes.
      Overrides:
      clearCachedValues in class Shape3D
    • copyForMatrix

      public abstract FacetShape copyForMatrix(Matrix3D aTrans)
      Copies path for given transform matrix.
    • clone

      public FacetShape clone()
      Standard clone implementation.
      Overrides:
      clone in class PropObject