Class GroupShapeRenderer
java.lang.Object
com.amalgamasimulation.graphicaleditor.renderers.GroupShapeRenderer
A tile-based renderer for efficiently processing and rendering GroupShape objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears all currently loaded shape data from the renderer.double[]Union of visible bitmap tile bounds in model space ([minX, minY, maxX, maxY]), ornullwhen 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.voidrenderVisibleTiles(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.voidsetGroupShape(com.amalgamasimulation.animation.shapes.shapes2d.GroupShape groupShape) Loads a GroupShape into the renderer for processing and rendering.
-
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]), ornullwhen 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
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 ontoviewportMinX- the minimum X coordinate of the visible area in model spaceviewportMinY- the minimum Y coordinate of the visible area in model spaceviewportWidth- the width of the visible area in model unitsviewportHeight- the height of the visible area in model unitszoom- 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
-