Class RenderState<P extends Pure,O extends GObject>

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

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

    • parent

      private final O 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, O 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 O 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()