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

class RasterTransform in Tinman.Terrain.Georef

Abstract base class for IRasterTransform implementations.

abstract class RasterTransform implements IRasterTransform
  extends SerializableBase
  base of RasterTransformMatrix

Configuration

Config

The configurator object for this type.

public static property Config { get }
type IConfigurator<IRasterTransform>
value [not-null] The configurator object.

Public / Constants

Identity

public static readonly field Identity
type IRasterTransform

Public / Attributes

IsCubemap

Is this raster transform a placeholder for a cubemap raster?

public virtual property IsCubemap { get }
type bool
value true if this raster transform is a cubemap raster placeholder, false if not.
implements IRasterTransform.IsCubemap

Remarks:

A cubemap is composed of six two-dimensional rasters, one for each cubemap face. A georeferencing Raster only contains a single raster transform object which takes two-dimensional raster coordinates as input.

Matrix

Returns the homogeneous 2D transformation matrix that corresponds to this raster transform (i.e. RasterToMap).

public virtual property Matrix { get }
type Mat3D
value The homogeneous 2D transformation matrix, or Zero if this raster transform cannot be represented with a matrix.
implements IRasterTransform.Matrix

SerialType

Returns the serial type of this object.

public property SerialType { get }
type ISerialTypeInfo
value [not-null] The serial type.
inherited SerializableBase.SerialType

SerialVersion

Returns the serial data version.

public virtual property SerialVersion { get }
type int32
value [>=1] The serial data version tag.
inherited SerializableBase.SerialVersion

Remarks:

An ISerializable implementation is required to support all versions up to the one returned by SerialVersion.

See also:

ISerializable.Serialize
ISerializable.Deserialize

Public / Constructors

Barycentric

Creates a new instance of IRasterTransform that ties a triangle in map space to a triangle in raster space using barycentric coordinates.

public static method Barycentric (Vec2D rasterA, Vec2D mapA, Vec2D rasterB, Vec2D mapB, Vec2D rasterC, Vec2D mapC)
type IRasterTransform
params rasterA First tiepoint, in raster space.
  mapA First tiepoint, in map space.
  rasterB Second tiepoint, in raster space.
  mapB Second tiepoint, in map space.
  rasterC Third tiepoint, in raster space.
  mapC Third tiepoint, in map space.
returns [not-null] The created IRasterTransform object.

Cube

Creates a new instance of RasterTransform that interprets input raster coordinates as cubemap face coordinates on the NegZ face and converts them to output map coordinates as geographic coordinates in the given unit.

public static method Cube (int32 size = MappingUtil.MaxSize, UnitOfMeasure unit = null)
type IRasterTransform
params size [pow2] The cubemap size (edge length, not sample count). Defaults to MaxSize.
  unit The geographic unit. If null, Degree will be used. Defaults to null.
returns [not-null] The creates IRasterTransform object.

ForBounds

Creates a new instance of RasterTransform that maps a cubemap face raster to the given bounds.

public static method ForBounds (int32 size, Box2D map)
type IRasterTransform
params size [pow2] The cubemap face raster size (edge length, not sample count).
  map The map bounds.
returns [not-null] The created IRasterTransform object.

TiepointScale

Creates a new instance of IRasterTransform that ties the given map point to the specified raster point.

public static method TiepointScale (Vec2D raster, Vec2D map, Vec2D scale)
type IRasterTransform
params raster The raster point coordinates.
  map The map point coordinates.
  scale Scale factors per axis, from raster coordinates to map coordinates.
returns [not-null] The created IRasterTransform object.

Remarks:

The following formulas describe the transformation between map coordinates and raster coordinates:

a.X = (b.X - raster.X) * scale.X + map.X
a.Y = (b.Y - raster.Y) * scale.Y + map.Y
b.X = (a.X - map.X) / scale.X + raster.X
b.Y = (a.Y - map.Y) / scale.Y + raster.Y
where a represents the map coordinates of a point and b represents its raster coordinates.

Transform

Creates a new instance of IRasterTransform that uses an affine transformation from raster space to map space.

public static method Transform (float64 a, float64 b, float64 d, float64 e, float64 f, float64 h)
type IRasterTransform
params a Transformation matrix component.
  b Transformation matrix component.
  d Transformation matrix component.
  e Transformation matrix component.
  f Transformation matrix component.
  h Transformation matrix component.
returns [not-null] The created IRasterTransform object.

Remarks:

The following matrix will be used to transform raster space to map space:

/   \     /            \  /   \
| E |     | a  b  0  d |  | X |
| N |  =  | e  f  0  h |  | Y |
| 0 |     | 0  0  1  0 |  | 0 |
| 1 |     | 0  0  0  1 |  | 1 |
\   /     \            /  \   /

X := Raster X-coordinate
Y := Raster Y-coordinate
E := Map easting coordinate
N := Map northing coordinate
The given matrix must be invertible, so a*f - e*b must not be zero.

Public / Methods

Deserialize

Initializes the state of this object from the given data stream.

public virtual method Deserialize (int32 serialVersion, ISerializer data)
type ISerializable
params serialVersion [>=1] The serial data version.
  data [not-null] The serial data stream.
returns [not-null] The deserialized object. This will typically be this, but in some circumstances, another instance may be returned (e.g. singletons).
inherited SerializableBase.Deserialize

Remarks:

The Deserialize method will be called immediately after the object has been instantiated via its default constructor.

The provided serialVersion number is guaranteed to be equal to or less than the SerialVersion returned by this object (i.e. ISerializable object must provide backwards compatibility).

See also:

ISerializable.Serialize
ISerializable.SerialVersion

Equals

Compares this object with the given one.

[Pure]
public method Equals (IRasterTransform other)
type bool
params other The object to compare to.
returns true if this object is equal to other, false if not.
implements IEquatable.Equals

MapToRaster

Translates the given map coordinates to raster coordinates.

[Pure]
public abstract method MapToRaster (float64 x, float64 y)
type Vec2D
params x The map X-coordinate.
  y The map Y-coordinate.
returns The raster coordinates.
implements IRasterTransform.MapToRaster

RasterOffset

Returns an IRasterTransform that translates the raster coordinates when applying this transform.

public virtual method RasterOffset (float64 offsetX, float64 offsetY)
type IRasterTransform
params offsetX The translation along the raster X-axis.
  offsetY The translation along the raster Y-axis.
returns [not-null] The resulting raster transform.
implements IRasterTransform.RasterOffset

Remarks:

The given coordinate offsets will be subtracted from the output raster coordinates of IRasterTransform and will be added to the input raster coordinates of IRasterTransform after resp. before plugging them into this raster transform.

RasterScale

Returns an IRasterTransform that scales the raster coordinates when applying this transform.

public virtual method RasterScale (float64 scaleX, float64 scaleY)
type IRasterTransform
params scaleX The scale factor along the raster X-axis.
  scaleY The scale factor along the raster Y-axis.
returns [not-null] The resulting raster transform.
implements IRasterTransform.RasterScale

Remarks:

The output raster coordinates of IRasterTransform will be divided by the given scale factors and the input raster coordinates of IRasterTransform will be multiplied with the scale factors after resp. before plugging them into this raster transform.

RasterToMap

Translates the given raster coordinates to map coordinates.

[Pure]
public abstract method RasterToMap (float64 x, float64 y)
type Vec2D
params x The raster X-coordinate.
  y The raster Y-coordinate.
returns The resulting map coordinates.
implements IRasterTransform.RasterToMap

Serialize

Serializes the current state of this object to the given data stream.

public virtual method Serialize (ISerializer data)
params data [not-null] The serial data stream.
inherited SerializableBase.Serialize

See also:

ISerializable.Deserialize
ISerializable.SerialVersion

ToConfig

Returns the configuration value that describes this object.

public abstract method ToConfig ()
type ConfigValue
returns [not-null] The configuration value.
implements IConfigurable.ToConfig

Remarks:

All configurable objects need to implement this interface. For simple types, it is preferable to delegate to ToValue.

The returned value may be of type Invalid, which means that this object in its current state cannot be described with the configuration API.

Before returning the resulting configuration value, Cache must be called on it, passing this IConfigurable object as parameter.

Protected / Constructors

RasterTransform

Creates a new instance of RasterTransform.

protected constructor RasterTransform (ISerialTypeInfo serialType)
params serialType [not-null] The serial ID.

Protected / Methods

DoEquals

protected abstract method DoEquals (IRasterTransform other)
type bool
params other