HeightmapBuilder

Description

sealed class Tinman.Terrain.Heightmaps.HeightmapBuilder

Derived from

IMapInfo

A builder for IHeightmap objects.

Public / Constructors

Constant


[OwnerReturn]
public method Constant → (2)

sample in : HeightmapSample

The constant heightmap sample.

layers opt : HeightmapLayer = HeightmapLayer.None

The heightmap layers. If HeightmapLayer.None, the layers of sample in will be used (see HeightmapSample.LayerMask).

returns → IHeightmap

The created IHeightmap object.

Creates a constant heightmap.

Dataset

3 overloads


[OwnerReturn]
public method Dataset1 → (3)

file in : string

[not-null]
The output file.

format in : IHeightmapFormat

[not-null]
The heightmap format.

wait opt : int32 = 0

[>=0]
Maximum time to wait for other threads to close the dataset, in milliseconds.

returns → IHeightmapDataset

The created IHeightmap object.

Creates a mutable heightmap that is kept in the given *.HGT file.

Storage space is only allocated for regions that contain data (see IHeightmap.HasRegion). So storage space consumption does not depend on the heightmap size, but on the quantity of data that has been fed into it.

IOException

If an I/O error has occurred.


[OwnerReturn]
public method Dataset2 → (3)

file in : Path

[not-null]
The output file.

format in : IHeightmapFormat

[not-null]
The heightmap format.

wait opt : int32 = 0

[>=0]
Maximum time to wait for other threads to close the dataset, in milliseconds.

returns → IHeightmapDataset

The created IHeightmap object.

Creates a mutable heightmap that is kept in the given *.HGT file.

Storage space is only allocated for regions that contain data (see IHeightmap.HasRegion). So storage space consumption does not depend on the heightmap size, but on the quantity of data that has been fed into it.

IOException

If an I/O error has occurred.


[OwnerReturn]
public method Dataset3 → (2)

file in : IFile own

[not-null]
The output file.

format in : IHeightmapFormat

[not-null]
The heightmap format.

returns → IHeightmapDataset

The created IHeightmap object.

Creates a mutable heightmap that is kept in the given *.HGT file.

Storage space is only allocated for regions that contain data (see IHeightmap.HasRegion). So storage space consumption does not depend on the heightmap size, but on the quantity of data that has been fed into it.

IOException

If an I/O error has occurred.

Memory


[OwnerReturn]
public method Memory → (1)

layers opt : HeightmapLayer = HeightmapLayer.All

The heightmap layers.

returns → IHeightmap

The created IHeightmap object.

Creates a mutable heightmap that is kept entirely in memory.

Memory is only allocated for regions that contain data (see IHeightmap.HasRegion). So memory consumption does not depend on the heightmap size, but on the quantity of data that has been fed into it.

Proxy


[OwnerReturn]
public method Proxy → (1)

layers opt : HeightmapLayer = HeightmapLayer.All

The heightmap layers.

returns → IHeightmapProxy

The created IHeightmapProxy object.

Creates a IHeightmapProxy using the current settings.

Shapes


[OwnerReturn]
public method Shapes → (1)

layers opt : HeightmapLayer = HeightmapLayer.All

The heightmap layers.

returns → IHeightmapShape

The resulting heightmap object.

Creates a heightmap that performs on-the-fly rasterization of vector shapes.

This method calls GeorefDefault.

IOException

If an I/O error has occurred.

Public / Methods

Georef


public method Georef → (1)

georef in : Raster

The geo-reference raster or null. If Raster.RasterType of of the given raster is different to MapInfo.Type of IMapInfo.Map of this builder, the parameter value will be ignored and null will be used instead.

returns → HeightmapBuilder

this

Specifies the geo-reference for the heightmap.

The cubemap size of the given raster transform (see IRasterTransform.Size of Raster.Transform of georef in) will be adjusted by this method and may thus have an arbitrary value.

Georef​Default


public method GeorefDefault → ()

returns → HeightmapBuilder

this

Specifies a default geo-reference for the heightmap, if necessary.

If no geo-reference raster has been specified (i.e. HasGeoref returns false), a default raster will be chosen depending on the map type that has been chosen with Heightmap.Builder2 resp. Heightmap.Builder1:

To specify another geo-reference, use the Georef method, before calling this method.

Identifier


public method Identifier → (1)

identifier in : GUID

The dataset identifier or GUID.Zero to generate a random one with GUID.Generate.

returns → HeightmapBuilder

this

Specifies the dataset identifier to use.

The default value is GUID.Zero.

See also

DatasetId.Guid

Procedural


public method Procedural → (2)

scale opt : float64 = 1000

Scale factor from terrain-space to noise-space.

seed opt : Vec3D = default(Vec3D)

Pseudo-random seed vector to use.

returns → ProceduralHeightmapBuilder

The procedural heightmap builder.

Builds a procedural heightmap, based on the settings of this heightmap builder.

Range


public method Range → (1)

range in : VerticalRange

The terrain-space range.

returns → HeightmapBuilder

this

Specifies the vertical range (i.e. elevation range, in terrain-space) of the heightmap.

The default range is VerticalRange.Default.

Public / Attributes

Has​Georef


public attribute HasGeoref → (get)

value : bool

true if a valid geo-reference raster has been specified,
false if there is no geo-reference raster.

Returns whether the builder has a valid geo-reference raster.