Wormhole2D

interface Wormhole2D<P : Position2D<out P>?>(source)

A Wormhole (in this context) is an entity that "connects" two worlds: the "environment" and the "view". Above all it provides services to convert coordinates from the "environment-space" to the "view-space". IWormhole2D is the type of a wormhole whose both environment and view are bi-dimensional spaces. Terminology: - "Environment" is the 'rectangle' we need to render ON the view. - "View" is a 'window' that let us see the environment. - "Environment-space" is the algebraic space on which 'lies' the environment. - "View-space" is the algebraic space on which 'lies' the view. - "Env" before a point's name => it refers to a point into the environment-space. - "View" before a point's name => it refers to a point into the view-space. - "Position" is the point of the view-space every transformation applied to the environment refers to: e.g. if I want to move the environment, I have to change the position; it is also the point the environment rotates around. - "EnvOffset" is the vector from (0; 0) into env-space to the left-bottom corner of the part of the environment we want to render. E.g. if I am representing a map with Earth-coordinates (16; 48), the intersection between the prime meridian and the equator is (0; 0), so I have to set the envOffset to (16; 48) in order to see the "beginning" of the map on the left-bottom corner of the view.

Parameters

<P>

position type

Inheritors

Types

Link copied to clipboard
enum Mode
Wormhole mode.

Functions

Link copied to clipboard
abstract fun center()
Points the center of the view on the center of the environment.
Link copied to clipboard
abstract fun getEnvPoint(viewPoint: Point): P
Converts a point from the view-space to the env-space.
Link copied to clipboard
abstract fun getMode(): Wormhole2D.Mode
Gets the rendering mode.
Link copied to clipboard
abstract fun getViewPoint(envPoint: P): Point
Converts a point from the env-space to the view-space.
Link copied to clipboard
abstract fun getViewPosition(): Point
Gets the Position.
Link copied to clipboard
abstract fun getViewSize(): Dimension2D
Gets the view's size.
Link copied to clipboard
abstract fun getZoom(): Double
Gets the zoom factor.
Link copied to clipboard
abstract fun isInsideView(viewPoint: Point): Boolean
Check if a point of the view-space is "visible", i.e.
Link copied to clipboard
abstract fun optimalZoom()
Automatically sets the zoom rate in order to make the environment entirely visible on the view.
Link copied to clipboard
abstract fun rotateAroundPoint(p: Point, a: Double)
Rotates around a point into the view-space.
Link copied to clipboard
abstract 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
abstract 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
abstract fun zoomOnPoint(p: Point, z: Double)
Zooms on a point into the view-space.