Package snap.gfx3d

Class Renderer2D

java.lang.Object
snap.gfx3d.Renderer
snap.gfx3d.Renderer2D

public class Renderer2D extends Renderer
This Renderer subclass tries to render the Scene using the standard Painter (2D).
  • Constructor Details

    • Renderer2D

      public Renderer2D(Camera aCamera)
      Constructor.
  • Method Details

    • getName

      public String getName()
      Returns the name.
      Specified by:
      getName in class Renderer
    • isSortSurfaces

      public boolean isSortSurfaces()
      Returns whether to sort surfaces.
    • setSortSurfaces

      public void setSortSurfaces(boolean aValue)
      Sets whether to sort surfaces.
    • getFacetShapesInViewCoords

      public List<FacetShape> getFacetShapesInViewCoords()
      Returns a list of all Scene FacetShapes in view coords.
    • getFacetShapesInViewCoordsImpl

      protected List<FacetShape> getFacetShapesInViewCoordsImpl()
      Returns a list of all Scene FacetShape in view coords.
    • getFacetShapesInCameraCoords

      protected List<FacetShape> getFacetShapesInCameraCoords()
      Returns a list of all Scene FacetShapes in camera coords.
    • addFacetShapesInCameraCoords

      protected void addFacetShapesInCameraCoords(Shape3D aShape, List<FacetShape> facetShapeList)
      Adds the paths for shape.
    • addFacetShapeInCameraCoords

      protected void addFacetShapeInCameraCoords(FacetShape facetShape, List<FacetShape> facetShapeList)
      Adds given FacetShape in camera space if visible.
    • getSceneBoundsInView

      public Rect getSceneBoundsInView()
      Returns the bounding rect of scene in view coords.
      Overrides:
      getSceneBoundsInView in class Renderer
    • rebuildFacetShapes

      protected void rebuildFacetShapes()
      Called to indicate that FacetShapes list needs to be rebuilt.
    • cameraDidPropChange

      protected void cameraDidPropChange(PropChange aPC)
      Override to rebuild FacetShapes for camera changes.
      Overrides:
      cameraDidPropChange in class Renderer
    • sceneDidChange

      protected void sceneDidChange()
      Called when scene changes.
      Overrides:
      sceneDidChange in class Renderer
    • renderAndPaint

      public void renderAndPaint(Painter aPntr)
      Renders scene for given painter, camera and scene.
      Specified by:
      renderAndPaint in class Renderer
    • paintFacetShapes

      public void paintFacetShapes(Painter aPntr)
      Paints shape children.
    • paintFacetShape

      protected void paintFacetShape(Painter aPntr, FacetShape aFacetShape)
      Paints a Path3D.