AbstractWormhole2D

abstract class AbstractWormhole2D<P : Position2D<out P>?> : Wormhole2D<P> (source)

Partial, abstract, implementation for the interface Wormhole2D. This implementation considers the particular case of the view as an entity into the sceern-space: the y-axis grows on the bottom side of the screen. This abstract class is independent from the 2D graphical component wrapped.

Parameters

<P>

the position type

Constructors

Link copied to clipboard
constructor(@Nonnull environment: Environment<out Any, P>, @Nonnull view: T, @Nonnull viewTypeToPointAdapter: (T) -> PointAdapter<P>)
Wormhole constructor for any ViewPort.

Properties

Link copied to clipboard
Link copied to clipboard
protected open var rotation: Double
Link copied to clipboard
open var zoom: Double

Functions

Link copied to clipboard
open fun center()
Points the center of the view on the center of the environment.
Link copied to clipboard
open fun getEnvPoint(viewPoint: Point): P
Converts a point from the view-space to the env-space.
Link copied to clipboard
open fun getViewPoint(envPoint: P): Point
Converts a point from the env-space to the view-space.
Link copied to clipboard
Gets the Position.
Link copied to clipboard
Gets the view's size.
Link copied to clipboard
open fun isInsideView(viewPoint: Point): Boolean
Check if a point of the view-space is "visible", i.e.
Link copied to clipboard
open fun optimalZoom()
Automatically sets the zoom rate in order to make the environment entirely visible on the view.
Link copied to clipboard
open fun rotateAroundPoint(p: Point, a: Double)
Rotates around a point into the view-space.
Link copied to clipboard
open fun setEnvPosition(envPoint: P)
Sets the position to the view-point corresponding to envPoint.
Link copied to clipboard
abstract fun setRotation(rad: Double)
Rotates the environment around the Position.
Link copied to clipboard
open fun setViewPosition(viewPoint: Point)
Sets the Position to viewPoint.
Link copied to clipboard
abstract fun setZoom(value: Double)
Changes the zoom factor.
Link copied to clipboard
open fun zoomOnPoint(point: Point, zoomRate: Double)
Zooms on a point into the view-space.