TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

interface IMapProjection in Tinman.Terrain.Mapping

Base interface for classes that provide a projection method between two dataset spaces.

interface IMapProjection base of MapProjectionBase

Remarks

Depending on the map type of a dataset, the dataset space is defined as follows:

A dataset has a certain pixel coverage semantic (see Coverage). Raster space (as defined by MapInfo) is defined per cubemap face, taking into account the dataset sample coverage semantic.

Interpolation of a dataset sample S at coordinates (x,y) follows these rules:

(x0,y0)   (x1,y0)   x0 := floor(x)
   A---------B      y0 := floor(y)
   |         |      x1 := floor(x) + 1
   |    S    |      y1 := floor(y) + 1
   |  (x,y)  |
   C---------D      fx := x - floor(x)
(x0,y1)   (x2,y1)   fy := y - floor(y)

(x,y) := Coordinates of sample in raster space:
         0 <= x <= raster width
         0 <= y <= raster height

Linear interpolation of the sample S at (x,y) would then be performed as:

S :=   (A * (1-fx) + B * fx) * (1-fy)
     + (C * (1-fx) + D * fx) * fy
Wrapping (according to values of SourceWrapX, SourceWrapY, TargetWrapX and TargetWrapY) must be performed by the class that implements IMapProjection in these cases: Since IMapProjection instances operate on dataset coordinates, pixel coverage offsets must be applied by implementors (see Coverage).

It may not be possible to project a given set of dataset coordinates to the target dataset space. In this case, the projection methods will return an undefined vector (see IsUndefined).

Attributes

Source

The source raster definition.

property Source { get }
type MapInfo
value The source raster.

SourceWrapX

The source raster wrapping behaviour along the map X-axis.

property SourceWrapX { get }
type MapWrap
value The wrapping behaviour.

Remarks:

Wrapping is only applied to rectangular maps (see Type).

See also:

Source

SourceWrapY

The source raster wrapping behaviour along the map Y-axis.

property SourceWrapY { get }
type MapWrap
value The wrapping behaviour.

Remarks:

Wrapping is only applied to rectangular maps (see Type).

See also:

Source

Target

The target raster definition.

property Target { get }
type MapInfo
value The target raster.

TargetWrapX

The target raster wrapping behaviour along the map X-axis.

property TargetWrapX { get }
type MapWrap
value The wrapping behaviour.

Remarks:

Wrapping is only applied to rectangular maps (see Type).

See also:

Target

TargetWrapY

The target raster wrapping behaviour along the map Y-axis.

property TargetWrapY { get }
type MapWrap
value The wrapping behaviour.

Remarks:

Wrapping is only applied to rectangular maps (see Type).

See also:

Target

Methods

Reverse

Returns the reverse map projection.

method Reverse ()
type IMapProjection
returns [not-null] The reverse map projection.

Transform

Transform the given dataset coordinates.

method Transform (float64 x, float64 y, float64 z)
type Vec3D
params x Source dataset X-coordinate.
  y Source dataset Y-coordinate.
  z Source dataset Z-coordinate. Only used if source raster is a cubemap (see Type). Will be ignored otherwise.
returns The target dataset coordinates. Z will be zero if target raster is not a cubemap (see Type). In case that the projection cannot be performed, Undefined is returned.

Transform the given raster coordinates.

method Transform (float64 x, float64 y, float64 z, float64 h)
type Vec4D
params x Source dataset X-coordinate.
  y Source dataset Y-coordinate.
  z Source dataset Z-coordinate.
  h Source dataset height value.
returns The target dataset coordinates. Z will be zero if target raster is not a cubemap (see Type). The target dataset height value is stored in W. In case that the projection cannot be performed, Undefined is returned.

Extensions

Append

Appends the given map projection to this one.

method Append (IMapProjection other)
type IMapProjection
params other [not-null] The map projection to append to this one.
returns [not-null] The resulting map projection.

Remarks:

This method does not check if the output coordinates of this projection have the same meaning as the input coordinates of other; the calling code must make sure that the resulting projection has a correct meaning.

IsFromTo

Checks if this map projection has the given source and target raster types.

method IsFromTo (MapType source, MapType target)
type bool
params source The source raster type.
  target The target raster type.
returns true if the map projection transforms from source to target, false if not.

Transform

Transform the given dataset coordinates.

method Transform (Vec3D v)
type Vec3D
params v Source dataset coordinates. Z is only used if source raster is a cubemap (see Type). Will be ignored otherwise.
returns The target dataset coordinates. Z will be zero if target raster is not a cubemap (see Type). In case that the projection cannot be performed, Undefined is returned.

Transform the given raster coordinates.

method Transform (Vec4D v)
type Vec4D
params v Source dataset coordinates and height value. Z is only used if source raster is a cubemap (see Type). Will be ignored otherwise. W is the source dataset height value.
returns The target dataset coordinates. Z will be zero if target raster is not a cubemap (see Type). The target dataset height value is stored in W. In case that the projection cannot be performed, Undefined is returned.