Package org.opentrafficsim.draw
Class PaintPolygons
java.lang.Object
org.opentrafficsim.draw.PaintPolygons
Paint a (series of) filled polygon(s) defined as a Path2D.Double
Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Peter Knoppers, Wouter Schakel
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.djutils.draw.point.Point2dDummy coordinate that forces the drawing operation to start a new path. -
Method Summary
Modifier and TypeMethodDescriptionstatic Set<Path2D.Float>Returns drawable paths of a polygon.static Set<Path2D.Float>getPaths(org.djutils.draw.point.OrientedPoint2d referencePoint, List<org.djutils.draw.point.Point2d> line) Returns drawable paths of a polygon.static Set<Path2D.Float>Returns drawable paths of a polygon.static voidpaintPaths(Graphics2D graphics, Color color, Set<Path2D.Float> paths, boolean fill) Paint (fill) a polygon or a series of polygons.
-
Field Details
-
NEWPATH
public static final org.djutils.draw.point.Point2d NEWPATHDummy coordinate that forces the drawing operation to start a new path.
-
-
Method Details
-
getPaths
public static Set<Path2D.Float> getPaths(org.djutils.draw.point.Point2d referencePoint, List<org.djutils.draw.point.Point2d> line) Returns drawable paths of a polygon.- Parameters:
referencePoint- the reference pointline- array of points- Returns:
- Set<Path2D.Float>; drawable paths.
-
getPaths
public static Set<Path2D.Float> getPaths(org.djutils.draw.point.OrientedPoint2d referencePoint, List<org.djutils.draw.point.Point2d> line) Returns drawable paths of a polygon.- Parameters:
referencePoint- the reference pointline- array of points- Returns:
- Set<Path2D.Float>; drawable paths.
-
getPaths
Returns drawable paths of a polygon.- Parameters:
line- array of points- Returns:
- Set<Path2D.Float>; drawable paths.
-
paintPaths
public static void paintPaths(Graphics2D graphics, Color color, Set<Path2D.Float> paths, boolean fill) Paint (fill) a polygon or a series of polygons.- Parameters:
graphics- the graphics environmentcolor- the color to usepaths- Set<Path2D.Float>; drawable paths.fill- fill or just contour
-