EnvironmentRenderer

io.github.srs.view.rendering.EnvironmentRenderer

Headless renderer for generating environment images without Swing components. Suitable for server-side rendering via gRPC.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def renderToPNG(env: Environment, width: Int, height: Int): Array[Byte]

Renders environment and encodes as PNG bytes.

Renders environment and encodes as PNG bytes.

Value parameters

env

Environment to render

height

Image height

width

Image width

Attributes

Returns

PNG-encoded byte array

Inherited 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

Inherited from:
EnvironmentDrawing
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

Inherited from:
EnvironmentDrawing
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

Inherited from:
EnvironmentDrawing
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

Inherited from:
EnvironmentDrawing
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

Inherited from:
EnvironmentDrawing
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

Inherited from:
EnvironmentDrawing
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

Inherited from:
EnvironmentDrawing
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

Inherited from:
EnvironmentDrawing
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

Inherited from:
EnvironmentDrawing