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

class Pyramid in Tinman.Terrain.Pyramids

Abstract base class for IPyramid implementations.

abstract class Pyramid with <TData> as class
  extends Disposable
  implements IPyramid<TData>
  base of PixelPyramid
  TexelPyramid

Public / Attributes

CanUpdate

Does this map allow updates to its content (i.e. sample data and/or metadata)?

public abstract property CanUpdate { get }
type bool
value true if the map content can be updated, false if not.
implements IMapEntity.CanUpdate

Flags

Additional behaviour flags of the pyramid.

public virtual property Flags { get }
type PyramidFlags
value The pyramid flags.
implements IPyramidBase.Flags

FullSize

The size of the bottom-most pyramid level.

public property FullSize { get }
type int32
value [pow2] The pyramid size (width and height), in samples.
implements IPyramidBase.FullSize

Georef

Returns georeferencing information.

public virtual property Georef { get }
type Raster
value The georeferencing object or null if no georeferencing is available.
implements IGeorefInfo.Georef

Levels

The number of pyramid levels.

public property Levels { get }
type int32
value [>=1] The number of pyramid levels.
implements IPyramidBase.Levels

LifecycleState

Returns the lifecycle state of this object.

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

Map

Returns a MapInfo value that describes the used map raster.

public property Map { get }
type MapInfo
value The map info value.
implements IMapInfo.Map

OnUpdated

Event for listening to updates made to this pixel pyramid.

public property OnUpdated { get }
type IEventGeneric<PyramidEventArgs>
value [not-null] The event object.
implements IPyramidBase.OnUpdated

Remarks:

This event will be fired by the thread that performs the map update.

TilePad

The pad width of this cube pyramid.

public property TilePad { get }
type int32
value [>=0] The pad width.
implements IPyramidBase.TilePad

Remarks:

Tile padding is used to avoid color bleeding that will occur when texture samples are filtered at the edge of a pyramid tile (assuming tiles are stored in some kind of texture atlas). The tile pad width gives the number of safety pixels at the that are borrowed from neighbouring pyramid tiles:

      8x8 tile, with a pad of 2:

    0   1   2   3   4   5   6   7
  +---+---+---+---+---+---+---+---+
0 |###|###|###|###|###|###|###|###|
  +---+---+---+---+---+---+---+---+
1 |###|###|###|###|###|###|###|###|
  +---+--(X)--+---+---+--(X)--+---+
2 |###|###|   |   |   |   |###|###|
  +---+---+---+---+---+---+---+---+
3 |###|###|   |   |   |   |###|###|
  +---+---+---+---+---+---+---+---+
4 |###|###|   |   |   |   |###|###|
  +---+---+---+---+---+---+---+---+
5 |###|###|   |   |   |   |###|###|
  +---+--(X)--+---+---+--(X)--+---+
6 |###|###|###|###|###|###|###|###|
  +---+---+---+---+---+---+---+---+
7 |###|###|###|###|###|###|###|###|
  +---+---+---+---+---+---+---+---+
The point coordinates marked with (X) will be mapped to the corner vertices of each terrain mesh sector. Only the effective region of a padded tile (i.e. the square surrounded by (X)) contains actual data. The padded pixels are sampled from neighbouring source tiles and carry redundant information.

TileSize

The size of a single map tile, in pixels.

public property TileSize { get }
type int32
value [pow2] The tile size.
implements IPyramidBase.TileSize

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.

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.

Flush

Flushes all cached data.

public virtual method Flush ()
implements IFlushable.Flush

Remarks:

Performing a flush may result in I/O work. Depending on the semantics of the implementing class, this work may need to be wrapped in special Begin / End method calls. See the documentation of the implementing classes for details.

In case this object represents a read-only resource, calling the Flush method has no effect.

GetTileData

Returns the data content of the given map tile.

[ThreadSafe]
public method GetTileData (PyramidCoords coords, TData data, int32 dataX = 0, int32 dataY = 0)
type TileDataResult
params coords The pyramid tile coords.
  data [not-null] The output buffer to use.
  dataX [>=0] X-coordinate of top-left corner of output rectangle.
  dataY [>=0] Y-coordinate of top-left corner of output rectangle.
returns The result code.
implements IPyramid.GetTileData

Returns the image pixels of the given map tile.

[ThreadSafe]
public method GetTileData (CubemapFace face, int32 level, int32 x, int32 y, TData data, int32 dataX = 0, int32 dataY = 0)
type TileDataResult
params face Cubemap face of map tile. Set to NegZ for unprojected map pyramids. Defaults to NegZ.
  level [>=0] The pyramid level.
  x Cubemap face X-coordinate of map tile in level.
  y Cubemap face Y-coordinate of map tile in level.
  data [not-null] The output buffer to use.
  dataX [>=0] X-coordinate of top-left corner of output rectangle.
  dataY [>=0] Y-coordinate of top-left corner of output rectangle.
returns The result code.
implements IPyramid.GetTileData

HasTileData

Returns if there is any data content for the given map tile.

[ThreadSafe]
public method HasTileData (PyramidCoords coords)
type bool
params coords The pyramid tile coords.
returns true if data for the given map tile exists, false if not.
implements IPyramidBase.HasTileData

Returns if there is any data content for the given map tile (i.e. Ok or Empty).

[ThreadSafe]
public method HasTileData (CubemapFace face, int32 level, int32 x, int32 y)
type bool
params face Cubemap face of map tile. Set to NegZ for unprojected map pyramids. Defaults to NegZ.
  level [>=0] The pyramid level.
  x Cubemap face X-coordinate of map tile in level.
  y Cubemap face Y-coordinate of map tile in level.
returns true if data for the given map tile exists, false if not.
implements IPyramidBase.HasTileData

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.

UpdateGeoref

Updates georeferencing data of this heightmap.

[ThreadSafe]
public abstract method UpdateGeoref (Raster georef)
params georef The new georeferencing data or null.
implements IMapEntity.UpdateGeoref

See also:

IMapEntity.CanUpdate

Protected / Attributes

fullSize

The full pyramid size.

protected readonly field fullSize
type int32

Remarks:

This is the size of the bottom-most pyramid level, given in tile pixels.

levels

The number of pyramid levels.

protected readonly field levels
type int32

onUpdated

The event object of OnUpdated.

[Owner]
protected field onUpdated
type EventGeneric<PyramidEventArgs>

tilePad

The pad width of this cube pyramid.

protected readonly field tilePad
type int32

tileSize

Size of a pyramid tile, in pixels.

protected readonly field tileSize
type int32

tileSizeShift

Logarithm of base two of tileSize.

protected readonly field tileSizeShift
type int32

Protected / Constructors

Pyramid

Creates a new instance of Pyramid.

protected constructor Pyramid (IPyramidBase pyramid)
params pyramid [not-null] The pyramid to take values from for TileSize, FullSize and TilePad.

Creates a new instance of Pyramid.

protected constructor Pyramid (MapType type, int32 tileSize, int32 fullSize, int32 tilePad)
params type The map type.
  tileSize [pow2] The tile size.
  fullSize [pow2] The size of the bottom-most level.
  tilePad [>=0] The tile pad width.

Protected / Methods

DisposeManaged

Disposes the managed resources held by a concrete subclass. This method will be called at most once per subclass.

protected override method DisposeManaged ()
overrides Disposable.DisposeManaged

Remarks:

This method will only be called when a disposable object is explicitly destroyed by user code calling the Dispose method. It will not be called when the object is collected as garbage by the system.

Overriding methods must call the DisposeManaged method of their base class. The base call should be the last statement.

The DisposeManaged method is called before the DisposeUnmanaged method.

DisposeUnmanaged

Disposes the unmanaged resources held by a concrete subclass. This method will be called exactly once per subclass.

protected virtual method DisposeUnmanaged ()
inherited Disposable.DisposeUnmanaged

Remarks:

Overriding methods must call the DisposeUnmanaged method of their base class. The base call should be the last statement.

The DisposeUnmanaged method is called after the DisposeManaged method.

DoGetTileData

Get the data content of the given pyramid tile.

protected abstract method DoGetTileData (CubemapFace face, int32 level, int32 x, int32 y, TData data, int32 dataX, int32 dataY)
type TileDataResult
params face The cubemap face.
  level The pyramid level.
  x The tile X-coordinate.
  y The tile Y-coordinate.
  data Output buffer to data content.
  dataX X-coordinate of top-left pixel in data to fill.
  dataY Y-coordinate of top-left pixel in data to fill.
returns The result code.

Remarks:

The given pyramid tile coordinates are always valid.

DoHasTileData

Checks if data content for the given pyramid tile exists.

protected abstract method DoHasTileData (CubemapFace face, int32 level, int32 x, int32 y)
type bool
params face The cubemap face.
  level The pyramid level.
  x The tile X-coordinate.
  y The tile Y-coordinate.
returns true if data content is available, false if not.

Remarks:

The given pyramid tile coordinates are always valid.