Package org.opentrafficsim.draw
Class OtsRenderable<L extends org.opentrafficsim.base.geometry.OtsLocatable>
java.lang.Object
nl.tudelft.simulation.dsol.animation.d2.Renderable2d<L>
org.opentrafficsim.draw.OtsRenderable<L>
- Type Parameters:
L- locatable type
- All Implemented Interfaces:
Serializable,nl.tudelft.simulation.dsol.animation.d2.Renderable2dInterface<L>
- Direct Known Subclasses:
AbstractLineAnimation,CrossSectionElementAnimation,DefaultCarAnimation,GtuGeneratorPositionAnimation,LaneAnimation.CenterLineAnimation,LinkAnimation,NodeAnimation,PriorityAnimation,SpeedSignAnimation,StaticObjectAnimation,StripeAnimation,TrafficLightDetectorAnimation
public abstract class OtsRenderable<L extends org.opentrafficsim.base.geometry.OtsLocatable>
extends nl.tudelft.simulation.dsol.animation.d2.Renderable2d<L>
Extends
Renderable2d to let the contains method look at the actual bounds shape, rather than only the box.
Copyright (c) 2024-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Wouter Schakel
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionOtsRenderable(L source, nl.tudelft.simulation.naming.context.Contextualized contextProvider) Constructs a new Renderable2d. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(org.djutils.draw.point.Point2d pointWorldCoordinates, org.djutils.draw.bounds.Bounds2d extent) protected voidresetRendering(Graphics2D graphics) Resets rendering hints that this renderable changed throughsetRendering().protected voidsetRendering(Graphics2D graphics) Set standard rendering hints for this renderable to paint.Methods inherited from class nl.tudelft.simulation.dsol.animation.d2.Renderable2d
bind2Context, destroy, getId, getSource, isFlip, isRotate, isScale, isScaleObject, isScaleY, isTranslate, paint, paint, paintComponent, setFlip, setRotate, setScale, setScaleObject, setScaleY, setTranslate, toString
-
Constructor Details
-
OtsRenderable
Constructs a new Renderable2d.- Parameters:
source- the sourcecontextProvider- the object that can provide the context to store the animation objects
-
-
Method Details
-
setRendering
Set standard rendering hints for this renderable to paint. The graphics should be reset usingresetRendering()after painting.- Parameters:
graphics- graphics.
-
resetRendering
Resets rendering hints that this renderable changed throughsetRendering().- Parameters:
graphics- graphics.
-
contains
public boolean contains(org.djutils.draw.point.Point2d pointWorldCoordinates, org.djutils.draw.bounds.Bounds2d extent)
-