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

class HeightmapGrinder in Tinman.Terrain.Heightmaps

Helper class for merging IHeightmap objects.

sealed class HeightmapGrinder extends Disposable

Public / Attributes

LifecycleState

Returns the lifecycle state of this object.

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

List

The heightmaps in the grinder.

public property List { get }
type IVectorConst<IHeightmap>
value [not-null] The heightmaps.

Public / Constructors

HeightmapGrinder

Creates a new instance of HeightmapGrinder.

public constructor HeightmapGrinder ()

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.

Add

Adds a heightmap to the grinder.

public method Add ([Owner] IHeightmap heightmap)
type HeightmapGrinder
params heightmap The heightmap to add.
returns [not-null] this

Adds heightmaps to the grinder.

public method Add ([Owner] IHeightmap[] heightmaps)
type HeightmapGrinder
params heightmaps The heightmaps to add.
returns [not-null] this

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.

Group

Groups the heightmaps in the grinder by their internal size (see Size) and merges the heightmaps in each group.

public method Group ()
type HeightmapGrinder
returns [not-null] this

Remarks:

When this method returns, List will contain one merged heightmap per group, sorted in ascending order by internal size.

Heightmap

Merges the heightmaps in the grinder in the order as they appear in List.

[OwnerReturn]
public method Heightmap (HeightmapLayer layer = HeightmapLayer.All)
type IHeightmap
params layer Optional heightmap layer filter. At least one of the given layers must be present in a heightmap to be included by this method. Defaults to All.
returns The merged heightmap or null if List is empty.

Pyramid

Creates a pixel pyramid for each heightmap group and then merges the pixel pyramids.

[OwnerReturn]
public method Pyramid (IPixelLayer layer, int32 tileSize = 256, int32 tilePad = 0, int32 levels = 0)
type IPixelPyramid
params layer [not-null] The pixel layer to use.
  tileSize [pow2] The tile size. Defaults to 256.
  tilePad [>=0] The tile pad. Defaults to 0.
  levels [>=0] Number of pyramid data levels to use. See ToPyramid for details.
returns The merged pixel pyramid or null if List is empty.

Remarks:

You can also call the Group method and then manually traverse the grouped heightmaps via List if you need more control over the pixel layers of each group.

Sort

Sorts the heightmaps in the grinder in ascending order by their internal size (see Size.

public method Sort ()
type HeightmapGrinder
returns [not-null] this

See also:

List