Rtin

Description

sealed class Tinman.Terrain.Kernel.Rtin
<TVertex val : IRtinVertexTrait>
<TTriangle val : IRtinTriangleTrait>

Derived from

ICapacity

A general-purpose right-triangulated irregular network (RTIN).

The following steps are necessary to build and use an RTIN mesh:

Public / Constructors

Rtin


public constructor Rtin → (2)

vertex in : TVertex

The vertex type trait.

triangle in : TTriangle

The triangle type trait.

Creates a new instance of Rtin.

The initial mesh capacity will be zero (see ICapacity.Capacity).

Public / Methods

Add


public method Add → (2)

vertex in : int32

[0..ICapacity.Capacity-1]
The vertex index.

index in : int32

[0..3]
The child index, one of XDag.LL, XDag.LR, XDag.RL and XDag.RR.

returns → int32

The child vertex or XDag.Void if the vertex would lie outside of the mesh bounds or XDag.Null iff the capacity is exhausted.

Returns the index in-th child of the given vertex, creating it if necessary.

This method will delegate to AddLL, AddLR, AddRL or AddRR.

Add​LL


public method AddLL → (1)

vertex in : int32

[0..ICapacity.Capacity-1]
The vertex index.

returns → int32

The child vertex or XDag.Void if the vertex would lie outside of the mesh bounds or XDag.Null iff the capacity is exhausted.

Returns the XDag.LL child of the given vertex, creating it if necessary.

Add​LR


public method AddLR → (1)

vertex in : int32

[0..ICapacity.Capacity-1]
The vertex index.

returns → int32

The child vertex or XDag.Void if the vertex would lie outside of the mesh bounds or XDag.Null iff the capacity is exhausted.

Returns the XDag.LR child of the given vertex, creating it if necessary.

Add​RL


public method AddRL → (1)

vertex in : int32

[0..ICapacity.Capacity-1]
The vertex index.

returns → int32

The child vertex or XDag.Void if the vertex would lie outside of the mesh bounds or XDag.Null iff the capacity is exhausted.

Returns the XDag.RL child of the given vertex, creating it if necessary.

Add​RR


public method AddRR → (1)

vertex in : int32

[0..ICapacity.Capacity-1]
The vertex index.

returns → int32

The child vertex or XDag.Void if the vertex would lie outside of the mesh bounds or XDag.Null iff the capacity is exhausted.

Returns the XDag.RR child of the given vertex, creating it if necessary.

Create


public method Create → (1)

type in : MapType

The map type of the mesh to create.

Creates a new mesh, discarding the existing mesh, if any.

LicenceException

If the licence check has failed.

Delete


public method Delete → (1)

vertex in : int32

The vertex.

returns → bool

true if vertex in was a leaf and has been deleted,
false if vertex in was not a leaf and has not been deleted.

Deletes the given leaf vertex.

See also

Rtin.Leaf

Down


public method Down → (2)

vertex in : int32

[0..ICapacity.Capacity-1]
The vertex.

index in : int32

[0..3]
The child index, one of XDag.LL, XDag.LR, XDag.RL and XDag.RR.

returns → int32

The child vertex or XDag.Void if the vertex would lie outside of the mesh bounds or XDag.Null if not existent.

Returns the index in-th child of the given vertex.

This method will delegate to DownLL, DownLR, DownRL or DownRR.

Down​LL


public method DownLL → (1)

in : int32

The vertex.

returns → int32

The child vertex or XDag.Void if the vertex would lie outside of the mesh bounds or XDag.Null if not existent.

Returns the XDag.LL child of the given vertex.

Down​LR


public method DownLR → (1)

in : int32

The vertex.

returns → int32

The child vertex or XDag.Void if the vertex would lie outside of the mesh bounds or XDag.Null if not existent.

Returns the XDag.LR child of the given vertex.

Down​RL


public method DownRL → (1)

in : int32

The vertex.

returns → int32

The child vertex or XDag.Void if the vertex would lie outside of the mesh bounds or XDag.Null if not existent.

Returns the XDag.RL child of the given vertex.

Down​RR


public method DownRR → (1)

in : int32

The vertex.

returns → int32

The child vertex or XDag.Void if the vertex would lie outside of the mesh bounds or XDag.Null if not existent.

Returns the XDag.RR child of the given vertex.

Face


public method Face → (1)

face opt : CubemapFace = CubemapFace.NegZ

The cubemap face.

returns → int32

The root vertex or XDag.Void if not existent.

Returns the root vertex of the given cubemap face.

Leaf


public method Leaf → (1)

vertex in : int32

[0..ICapacity.Capacity-1]
The vertex index.

returns → bool

true if vertex in is a leaf, false if not.

Checks if the given vertex is a leaf, i.e. it does not have any child vertices.

Sector

2 overloads


public method Sector1 → (1)

sector in : int32

[0..ICapacity.Capacity-1]
The vertex index.

returns → bool

true if sector in is a mesh sector, false if not.

Checks if the given vertex is the center of a mesh sector.


public method Sector2 → (2)

sector in : int32

[0..ICapacity.Capacity-1]
The mesh sector.

index in : int32

[0..3]
The child index.

returns → int32

The child mesh sector or XDag.Null if not existent.

Returns the index in-th child sector.

This method will delegate to Sector0, Sector1, Sector2 or Sector3.

Sector0


public method Sector0 → (1)

sector in : int32

[0..ICapacity.Capacity-1]
The mesh sector.

returns → int32

The child mesh sector or XDag.Null if not existent.

Returns the child sector at index 0.

Sector1


public method Sector1 → (1)

sector in : int32

[0..ICapacity.Capacity-1]
The mesh sector.

returns → int32

The child mesh sector or XDag.Null if not existent.

Returns the child sector at index 1.

Sector2


public method Sector2 → (1)

sector in : int32

[0..ICapacity.Capacity-1]
The mesh sector.

returns → int32

The child mesh sector or XDag.Null if not existent.

Returns the child sector at index 2.

Sector3


public method Sector3 → (1)

sector in : int32

[0..ICapacity.Capacity-1]
The mesh sector.

returns → int32

The child mesh sector or XDag.Null if not existent.

Returns the child sector at index 3.

Triangulate

2 overloads


public method Triangulate1 → ()

Triangulates the whole mesh.

This method iterates over all Cubemap faces, calls Face for each one and finally delegates to Triangulate2.


public method Triangulate2 → (1)

sector in : int32

[0..ICapacity.Capacity-1]
The mesh sector to triangulate.

Triangulates the given mesh sector.

If sector in does not refer to a valid mesh sector vertex, this method returns silently.

See also

Rtin.Sector1

Up


public method Up → (2)

vertex in : int32

[0..ICapacity.Capacity-1]
The vertex index.

index in : int32

[0..3]
The parent index, one of XDag.L, XDag.R, XDag.A and XDag.G.

returns → int32

The parent vertex or XDag.Void if the vertex would lie outside of the mesh bounds or XDag.Null if not existent.

Returns the index in-th parent of the given vertex.

This method will delegate to UpL, UpR, UpA or UpG.

Up​A


public method UpA → (1)

vertex in : int32

[0..ICapacity.Capacity-1]
The vertex index.

returns → int32

The ancestor vertex or XDag.Null if not existent.

Returns the ancestor XDag.A of the given vertex.

Up​G


public method UpG → (1)

vertex in : int32

[0..ICapacity.Capacity-1]
The vertex index.

returns → int32

The grand-parent vertex or XDag.Null if not existent.

Returns the grand-parent XDag.G of the given vertex.

Up​L


public method UpL → (1)

vertex in : int32

[0..ICapacity.Capacity-1]
The vertex index.

returns → int32

The left-parent vertex or XDag.Void if the vertex would lie outside of the mesh bounds or XDag.Null if not existent.

Returns the left parent XDag.L of the given vertex.

Up​R


public method UpR → (1)

vertex in : int32

[0..ICapacity.Capacity-1]
The vertex index.

returns → int32

The right-parent vertex or XDag.Void if the vertex would lie outside of the mesh bounds or XDag.Null if not existent.

Returns the right parent XDag.R of the given vertex.

Public / Attributes

Count​Unused


public attribute CountUnused → (get)

value : int32

[0..ICapacity.Capacity]
The number of unused vertices.

Returns the number of unused vertices.

Count​Used


public attribute CountUsed → (get)

value : int32

[0..ICapacity.Capacity]
The number of used vertices.

Returns the number of used vertices.