Class GroupShapeRenderer

java.lang.Object
com.amalgamasimulation.graphicaleditor.renderers.GroupShapeRenderer

public class GroupShapeRenderer extends Object
A tile-based renderer for efficiently processing and rendering GroupShape objects.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears all currently loaded shape data from the renderer.
    double[]
    Union of visible bitmap tile bounds in model space ([minX, minY, maxX, maxY]), or null when no visible tiles are loaded.
    getSiblingsPoints(double x, double y)
    Retrieves all distinct endpoints of line segments located in the tile containing the specified point and its eight neighboring tiles.
    void
    renderVisibleTiles(javafx.scene.canvas.GraphicsContext gc, double viewportMinX, double viewportMinY, double viewportWidth, double viewportHeight, double zoom, double canvasHeight, double rulerOffset)
    Renders all visible shapes within the specified viewport.
    void
    setGroupShape(com.amalgamasimulation.animation.shapes.shapes2d.GroupShape groupShape)
    Loads a GroupShape into the renderer for processing and rendering.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GroupShapeRenderer

      public GroupShapeRenderer()
  • Method Details

    • clear

      public void clear()
      Clears all currently loaded shape data from the renderer.
    • getImageTileModelBounds

      public double[] getImageTileModelBounds()
      Union of visible bitmap tile bounds in model space ([minX, minY, maxX, maxY]), or null when no visible tiles are loaded. Y increases north (editor viewport).
    • setGroupShape

      public void setGroupShape(com.amalgamasimulation.animation.shapes.shapes2d.GroupShape groupShape)
      Loads a GroupShape into the renderer for processing and rendering.
    • getSiblingsPoints

      public Set<Point> getSiblingsPoints(double x, double y)
      Retrieves all distinct endpoints of line segments located in the tile containing the specified point and its eight neighboring tiles.
    • renderVisibleTiles

      public void renderVisibleTiles(javafx.scene.canvas.GraphicsContext gc, double viewportMinX, double viewportMinY, double viewportWidth, double viewportHeight, double zoom, double canvasHeight, double rulerOffset)
      Renders all visible shapes within the specified viewport.
      Parameters:
      gc - the graphics context to render onto
      viewportMinX - the minimum X coordinate of the visible area in model space
      viewportMinY - the minimum Y coordinate of the visible area in model space
      viewportWidth - the width of the visible area in model units
      viewportHeight - the height of the visible area in model units
      zoom - the current zoom factor (pixels per model unit)
      canvasHeight - the height of the canvas in pixels (for Y inversion)
      rulerOffset - the horizontal offset for ruler alignment in pixels