Class RenderState<P extends Pure, G extends GObject>

java.lang.Object
com.j3d.engine.scene.draw.RenderState<P,G>
Type Parameters:
P - The type of the pure geometric object, extending Pure.
G - The type of the graphics object, extending GObject.
All Implemented Interfaces:
Drawable

public class RenderState<P extends Pure, G extends GObject> extends Object implements Drawable
Represents the rendering state for a graphics object, linking a pure geometric definition with its graphics object representation. It manages drawing logic and selection state.
Author:
Lehlogonolo Poole
  • Field Details

    • parent

      private final G extends GObject parent
      The graphical object instance that this render state belongs to.
    • pure

      private final P extends Pure pure
      The pure geometric definition associated with this render state.
    • id

      private final UUID id
    • valid

      private boolean valid
      Whether this render state is valid or not.
    • onDraw

      private Consumer<Graphics2D> onDraw
    • onDrawSelected

      private Consumer<Graphics2D> onDrawSelected
  • Constructor Details

    • RenderState

      public RenderState(P pureInstance, G parentInstance)
  • Method Details

    • invalidate

      public void invalidate()
      Marks this render state as invalid. An invalid render state typically means it should no longer be used or rendered.
    • isValid

      public boolean isValid()
      Checks if this render state is currently valid. An invalid render state typically means it should no longer be used or rendered.
      Returns:
      true if the render state is valid, false otherwise.
    • getParent

      public G getParent()
    • getPure

      public P getPure()
    • getId

      public UUID getId()
    • setConsumers

      public void setConsumers(Consumer<Graphics2D> onDraw, Consumer<Graphics2D> onDrawSelected)
    • draw

      public void draw(Graphics2D graphics2D)
      Description copied from interface: Drawable
      Draws this geometry to the screen.
      Specified by:
      draw in interface Drawable
      Parameters:
      graphics2D - The Graphics2D instance
    • drawSelected

      public void drawSelected(Graphics2D graphics2D)
      Description copied from interface: Drawable
      Draws this geometry to the screen, but in a selected state.
      Specified by:
      drawSelected in interface Drawable
      Parameters:
      graphics2D - The Graphics2D instance
    • getPivot

      public Vector3 getPivot()