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

class TerrainLayer in Tinman.AddOns.Components

The TerrainLayer class represents a layer of a terrain mesh.

sealed class TerrainLayer extends Disposable
  implements IComparable<TerrainLayer>

Remarks

Each terrain layer has three sub-layers, which can be enabled or disabled individually:

  1. Colors (see ShowColors):
    Plain terrain mesh, rendered with vertex colors from the heightmap (see Texture).
    This is the bottom-most sub-layer; it is hidden by the others.
  2. Imagery (see ShowTexture):
    The texture tiles from the pixel pyramid (see PixelPyramid).
  3. Highlights (see ShowRegions):
    Data regions of a selected dataset (see RegionDataset).

Public / Attributes

Flags

The terrain layer flags.

public property Flags { get set }
type TerrainLayerFlags
value The terrain layer flags.

Remarks:

Defaults to None.

HasColors

Does this layer have vertex colors?

public property HasColors { get }
type bool
value true if this layer renders vertex colors, false if not.

See also:

TerrainLayerFlags.ShowColors

HasRegion

Does this layer have a highlighted dataset region?

public property HasRegion { get }
type bool
value true if this layer highlights dataset regions, false if not.

See also:

TerrainLayerFlags.ShowRegions

HasTexture

Does this layer have a texture pyramid?

public property HasTexture { get }
type bool
value true if this layer has a texture pyramid, false if not.

See also:

TerrainLayerFlags.ShowTexture

IsOpaque

Is this terrain layer opaque, i.e. it fully occludes all layers below?

public property IsOpaque { get }
type bool
value true if this terrain layer is opaque, false if not.

LifecycleState

Returns the lifecycle state of this object.

public virtual property LifecycleState { get }
type LifecycleState
value The lifecycle state.
inherited Disposable.LifecycleState

Name

Human-readable name of this layer.

public property Name { get set }
type string
value The layer name or null.

PixelPyramid

The pixel pyramid of this terrain layer.

public property PixelPyramid { get }
type IPixelPyramid
value The pixel pyramid or null.

See also:

TextureSet

PixelPyramidId

The pixel pyramid ID to use for caching (see PyramidFileCache).

public property PixelPyramidId { get }
type int32
value [-1..1023] The pixel pyramid ID or -1 if caching is disabled.

Range

The distance range in which this terrain layer is visible.

public property Range { get set }
type Vec2F
value The layer distance range.

Remarks:

The terrain layer is fully faded in when the camera distance is equal to X and fully faded out when the distance is equal to Y.

If X is equal to Y, the distance range is disabled and the terrain layer is visible everywhere.

Defaults to Zero.

RegionColor

The color to use for highlighting existing data regions.

public property RegionColor { get set }
type int64
value The color (see Colors).

Remarks:

Defaults to 0.

See also:

TerrainLayerFlags.ShowRegions
RegionDataset

RegionDataset

The dataset for which to highlight existing data regions.

[OwnerValue]
public property RegionDataset { get set }
type IHeightmap
value The dataset or null.

Remarks:

Defaults to null.

See also:

TerrainLayerFlags.ShowRegions
RegionColor

SortIndex

The sort index value of this terrain layer.

public property SortIndex { get set }
type int32
value The layer sort index.

Remarks:

Layers with larger sort index values are rendered on top of those with smaller sort index values.

TexelPyramid

The texel pyramid of this terrain layer.

public property TexelPyramid { get }
type ITexelPyramid
value The texel pyramid or null.

See also:

TextureSet

Public / Methods

AcquireTry

Acquires a strong reference to this disposable object.

[OwnerReturn, ThreadSafe]
public method AcquireTry ()
type IDisposable
returns this if a new strong reference has been acquired, null if this object is already being disposed.
inherited Disposable.AcquireTry

Remarks:

The object will not be actually disposed by calls to Dispose when there is at least one strong reference left. Code that calls the AcquireTry method is responsible for calling the Dispose method accordingly.

This method is not intended to be used in performance-critical code. It should only be used to high-level resource management.

CompareTo

Compares this object with the given one.

[Pure]
public method CompareTo (TerrainLayer other)
type int32
params other The object to compare to.
returns < 0 : if this object is less than other,
= 0 : if this object is equal to other,
> 0 : if this object is greater than other.
implements IComparable.CompareTo

Dispose

Releases all resources held by this object if there are no more strong references to it, decrements the reference counter by one otherwise.

[Dispose, OwnerThis, ThreadSafe]
public method Dispose ()
inherited Disposable.Dispose

Remarks:

The Dispose method silently returns if the object has already been disposed.

TextureClear

Removes the layer texture.

public method TextureClear ()

See also:

TerrainLayerFlags.ShowTexture

TextureSet

Sets the layer texture.

public method TextureSet ([Owner] IPixelPyramid pyramid, int32 pyramidId = -1)
params pyramid [not-null] The pixel pyramid.
  pyramidId The pyramid cache ID. Defaults to -1.

Remarks:

Because of adjustments that might be necessary for the given pyramid, the actual pixel pyramid of the layer (see PixelPyramid) can be a different instance than the given pyramid.

Once a pixel pyramid has been assigned to the persistent cache, modifications made to it will invalidate the cache contents.

The Alpha flag is used to choose the texture atlas (see TextureAtlasOpaque and TextureAtlasTransparent) to use for the given layer pyramid.

See also:

TerrainLayerFlags.ShowTexture
PixelPyramid
TexelPyramid