Package com.j3d.engine.scene.draw
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, extendingPure.O- The type of the graphical object, extendingGObject.
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final UUIDprivate Consumer<Graphics2D> private Consumer<Graphics2D> private final OThe graphical object instance that this render state belongs to.private final PThe pure geometric definition associated with this render state.private booleanWhether this render state is valid or not. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(Graphics2D graphics2D) Draws this geometry to the screen.voiddrawSelected(Graphics2D graphics2D) Draws this geometry to the screen, but in a selected state.getId()getPivot()getPure()voidMarks this render state as invalid.booleanisValid()Checks if this render state is currently valid.voidsetConsumers(Consumer<Graphics2D> onDraw, Consumer<Graphics2D> onDrawSelected)
-
Field Details
-
parent
The graphical object instance that this render state belongs to. -
pure
The pure geometric definition associated with this render state. -
id
-
valid
private boolean validWhether this render state is valid or not. -
onDraw
-
onDrawSelected
-
-
Constructor Details
-
RenderState
-
-
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:
trueif the render state is valid,falseotherwise.
-
getParent
-
getPure
-
getId
-
setConsumers
-
draw
Description copied from interface:DrawableDraws this geometry to the screen. -
drawSelected
Description copied from interface:DrawableDraws this geometry to the screen, but in a selected state.- Specified by:
drawSelectedin interfaceDrawable- Parameters:
graphics2D- The Graphics2D instance
-
getPivot
-