GridLineBuilder

Description

sealed class Tinman.Terrain.Tools.GridLineBuilder

The GridLineBuilder is a tool for building grid lines (e.g. meridians and parallels) on a projected map (see IMapProjection).

Public / Constructors

Grid​Line​Builder


public constructor GridLineBuilder → (2)

projection in : IMapProjection

[not-null]
The map projection to use.

transform in : Mat3D

Homogeneous 2D transformation matrix to apply to map coordinates of grid lines before storing them in GridLine.Coordinate.

Creates a new instance of GridLineBuilder.

In the source map (see IMapProjection.Source) of the given projection in, all gridlines are parallel to the X-axis resp. Y-axis. Use From and To to define the area in which gridlines will be computed. Use Origin and Step to control placement and number of gridlines. Use Error to control tessellation quality.

Public / Methods

Grid​Lines​For


public method GridLinesFor → (2)

face in : CubemapFace

The cubemap face.

orientation opt : int32 = 0

Return horizontal grid lines (>0), vertical grid lines (<0) or both ( =0)?

returns → RangeI

The list index range, which can be empty (see RangeI.IsEmpty).

Returns the list index range in GridLines for the given cubemap face and orientation.

Public / Attributes

Error


public attribute Error → (get,set)

value : float64

[>0]
The maximum geometric error, measured in the target map units (see IMapProjection.Target) of the map projection (see Projection).

The maximum geometric error to allow for grid lines on a cubemap face.

The default value is 1.

From


public attribute From → (get,set)

value : Vec2D

The source map coordinates.

First corner of source map rectangle which defines the area where gridlines will be computed.

The coordinates refer to the source map (see IMapProjection.Source) of the configured map projection (see Projection).

Grid​Lines


public attribute GridLines → (get)

value : IVectorConst<GridLine>

[not-null]
The grid lines.

Returns the resulting grid lines.

The grid lines in the returned list are sorted by orientation (horizontal / vertical) and cubemap face. Use the GridLinesFor method to obtain the respective list index ranges.

Origin


public attribute Origin → (get,set)

value : Vec2D

The map origin.

The map origin to use for computing grid lines.

The values for origin and step determine the coordinates of horizontal and vertical grid lines (see GridLine.Coordinate):

  • Horizontal (e.g. meridian):
    c := origin.Y + n * step.Y

  • Vertical (e.g. parallel):
    c := origin.X + n * step.X

The coordinates refer to the source map (see IMapProjection.Source) of the configured map projection (see Projection).

The default value is (0,0).

Projection


public attribute Projection → (get)

value : IMapProjection

[not-null]
The map projection.

The used map projection.

Step


public attribute Step → (get,set)

value : Vec2D

The step distance.

The step distance to use for computing grid lines.

The values for origin and step determine the coordinates of horizontal and vertical grid lines:

  • Horizontal (e.g. meridian):
    c := origin.Y + n * step.Y

  • Vertical (e.g. parallel):
    c := origin.X + n * step.X

The step values refer to the source map (see IMapProjection.Source) of the configured map projection (see Projection).

The default value is (1,1).

To


public attribute To → (get,set)

value : Vec2D

The source map coordinates.

Second corner of source map rectangle which defines the area where gridlines will be computed.

The coordinates refer to the source map (see IMapProjection.Source) of the configured map projection (see Projection).