Geometry

Description

abstract class Tinman.Terrain.Geometries.Geometry

Derived from

GeometryBase abstract

Base class for default IGeometry implementations in the Tinman SDK.

Public / Constructors

For​Coordinate​System


public static method ForCoordinateSystem → (3)

coordSys in : CoordinateSystem

[not-null]
The coordinate system.

map in : MapInfo

The map raster.

raster opt : IRasterTransform = null

Optional raster transform. If null, the geometry will be of type MapType.Cube; otherwise it will be MapType.Rect.

returns → IGeometry

The created IGeometry object.

Creates a new instance of IGeometry that computes geocentric coordinates based on the given geo-reference.

Please refer to Cubemap, LatLon and Geocentric for details on the mapping between terrain-space, heightmap, geographic and geocentric coordinates.

For geographic and projected coordinate systems (see CoordinateSystem.IsGeographic and CoordinateSystem.IsProjection), the IGeometry.ToGeocentric property of the created IGeometry object will return a Geocentric object that has been created with Geocentric.For1, using CoordinateSystem.Geographic of coordSys in.

For local coordinate systems (see CoordinateSystem.IsLocal), this method will create a planar IGeometry object, analogously to Plane.

GeorefException

If the given geo-reference is not suitable.

For​Georef


public static method ForGeoref → (1)

georef in : IGeorefInfo

[not-null]
The geo-reference to use.

returns → IGeometry

The created IGeometry object.

Creates a new instance of IGeometry that computes geocentric coordinates based on the given geo-reference.

This method delegates to ForRaster, using IGeorefInfo.Georef of georef in.

GeorefException

If the given geo-reference is not suitable.

For​Raster


public static method ForRaster → (2)

raster in : Raster

[not-null]
The geo-reference.

map in : MapInfo

The map raster.

returns → IGeometry

The created IGeometry object.

Creates a new instance of IGeometry that computes geocentric coordinates based on the given geo-reference.

This method delegates to ForCoordinateSystem using Raster.Coordinates and Raster.Transform, taking into account Raster.RasterType to distinguish between rectangular and cubemap rasters.

GeorefException

If the given geo-reference is not suitable.

Plane


public static method Plane → (4)

width in : int32

[>0]
The heightmap width.

height in : int32

[>0]
The heightmap height.

scale in : float64

Scale factor from heightmap coordinates to terrain-space.

unit opt : UnitOfMeasure = null

The terrain-space unit. If null, UnitOfMeasure.Metre will be used.

returns → IGeometry

The created IGeometry object.

Creates a new instance of IGeometry of type MapType.Rect that uses a plane as base geometry.

The positive heightmap space X-axis is mapped to the positive terrain space X-axis, the positive heightmap space Y-axis is mapped to the positive terrain space Z-axis and the heightmap elevation is mapped to the positive terrain space Y-axis. The center sample of the heightmap is mapped to the terrain space origin:

Heightmap space:
----------------

O--------+     +----> X
|(0,0)   |     |
|        |     |
|        |     V
|   (w,h)|
+--------O     Y

Terrain space:
--------------
                  | Z-
 (-w/2,-h/2)      |      (w/2,-h/2)
            +-----+-----+
            |     |     |
            |     |     |
     X- ----+-----0-----+---- X+
            |     |     |
            |     |     |
            +-----+-----+
 (-w/2,-h/2)      |      (w/2,h/2)
                  | Z+

w := Heightmap width, minus one
h := Heightmap height, minus one

The IGeometry.ToGeocentric property of the created IGeometry object will return null.

Sphere


public static method Sphere → (3)

cubeSize in : int32

[pow2+1]
The heightmap size which will be used with the geometry object.

radius in : float64

[>0]
Radius of zero-altitude sphere, in terrain-space.

unit opt : UnitOfMeasure = null

The terrain-space unit. If null, UnitOfMeasure.Metre will be used.

returns → IGeometry

The created IGeometry object.

Creates a new instance of IGeometry that uses a sphere as base geometry.

Please refer to Cubemap, LatLon and Geocentric for details on the mapping between terrain-space, heightmap, geographic and geocentric coordinates.

The IGeometry.ToGeocentric property of the created IGeometry object will return a Geocentric object that has been created with Geocentric.For3, using unit opt and radius in (as both semi-major and semi-minor axis).

Protected / Constructors

Geometry

2 overloads


protected constructor Geometry1 → (1)

size in : int32

[pow2+1]
The map size.

Creates a new instance of Geometry for MapType.Cube.


protected constructor Geometry2 → (2)

width in : int32

[>0]
The map width.

height in : int32

[>0]
The map height.

Creates a new instance of Geometry for MapType.Rect.