EnvironmentDrawing

io.github.srs.view.rendering.EnvironmentDrawing

Shared rendering logic for both GUI and headless rendering. Can be mixed into components or used directly.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Concrete methods

protected def calculateViewport(env: Environment, width: Int, height: Int): Viewport

Calculates viewport transformation for centering and scaling.

Calculates viewport transformation for centering and scaling.

Value parameters

env

The environment to fit in the viewport

height

Target height in pixels

width

Target width in pixels

Attributes

Returns

Viewport configuration

protected def drawDynamicEntities(g: Graphics2D, env: Environment, vp: Viewport, selectedId: Option[String] = ..., includeId: Boolean = ...): Unit

Draws all robots in the environment.

Draws all robots in the environment.

Value parameters

env

Environment containing robots

g

Graphics context

selectedId

Optional ID of the selected robot

vp

Viewport configuration

Attributes

protected def drawDynamicEntity(g: Graphics2D, de: DynamicEntity, env: Environment, vp: Viewport, selectedId: Option[String], includeId: Boolean): Unit

Draws a single robot with body, direction indicator, and sensors.

Draws a single robot with body, direction indicator, and sensors.

Value parameters

env

Environment for sensor calculations

g

Graphics context

robot

The robot to draw

selectedId

Optional ID of the selected robot

vp

Viewport configuration

Attributes

protected def drawDynamicEntityBody(g: Graphics2D, de: DynamicEntity, radius: Double, vp: Viewport, isSelected: Boolean, includeId: Boolean): Unit

Draws the robot's circular body with gradient and border.

Draws the robot's circular body with gradient and border.

Value parameters

g

Graphics context

isSelected

True if this robot is currently selected

radius

Radius of the robot

robot

The robot to draw

vp

Viewport configuration

Attributes

protected def drawDynamicEntityDirection(g: Graphics2D, de: DynamicEntity, radius: Double, vp: Viewport): Unit

Draws an arrow indicating the robot's orientation.

Draws an arrow indicating the robot's orientation.

Value parameters

g

Graphics context

radius

Radius of the robot

robot

The robot to draw

vp

Viewport configuration

Attributes

protected def drawGrid(g: Graphics2D, env: Environment, vp: Viewport): Unit

Draws the coordinate grid.

Draws the coordinate grid.

Value parameters

env

Environment for dimensions

g

Graphics context

vp

Viewport configuration

Attributes

protected def drawLabels(g: Graphics2D, env: Environment, vp: Viewport): Unit

Draws coordinate labels with adaptive stepping.

Draws coordinate labels with adaptive stepping.

Value parameters

env

Environment for dimensions

g

Graphics context

vp

Viewport configuration

Attributes

protected def drawSensorLines(g: Graphics2D, de: DynamicEntity, radius: Double, env: Environment, vp: Viewport): Unit

Draws sensor detection lines for a robot.

Draws sensor detection lines for a robot.

Value parameters

env

Environment for sensor readings

g

Graphics context

radius

Radius of the robot

robot

The robot whose sensors to draw

vp

Viewport configuration

Attributes

protected def drawStaticEntities(g: Graphics2D, env: Environment, vp: Viewport): Unit

Draws all static entities (obstacles and lights).

Draws all static entities (obstacles and lights).

Value parameters

env

Environment containing entities

g

Graphics context

vp

Viewport configuration

Attributes