ShapeGeometry

Description

abstract class Tinman.Terrain.Shapes.ShapeGeometry

Derived from

Shape abstract

Extended by

ShapePolygonBase abstract

Abstract base class for IShape implementations that are based on geometry and thus store vertex data.

Public / Constants

Value​Index​Max


public constant ValueIndexMax → (1:int32)

Maximum index value that is returned by ValueIndex2.

Public / Methods

Value​Index

2 overloads


[Pure]
public static method ValueIndex1 → (1)

index in : int32

The flat value storage index.

returns → ShapeValue

The custom per-vertex value. Will never be ShapeValue.All. Will be ShapeValue.None iff index in is less than zero or greater than ValueIndexMax.

Returns the custom per-vertex value for the given flat storage index.


[Pure]
public static method ValueIndex2 → (1)

shapeValue in : ShapeValue

The custom per-vertex value.

returns → int32

The flat value storage index.

Returns the flat storage index of the given custom per-vertex value.

The flat value storage index uniquely identifies a single-bit value of ShapeValue in a persistent manner, i.e. it will not change in the future.

Protected / Constructors

Shape​Geometry

2 overloads


protected constructor ShapeGeometry1 → (1)

serialId in : ISerialTypeInfo

[not-null]
The serial type ID.

Creates a new instance of ShapeGeometry.


protected constructor ShapeGeometry2 → (5)

serialId in : ISerialTypeInfo

[not-null]
The serial type ID.

vertices in : Vec2D [ ]

[not-null]
The shape vertices.

georef in : CoordinateSystem

Optional geo-reference.

metadata in : IJsonValue

Optional metadata.

values in : float64 [ ] [ ]

The custom per-vertex values, indexed as follows:

values[index][vertex] := value

where index is the result of ValueIndex2, vertex is a vertex index in the range [0..IShapeInfo.VertexCount-1] and value is the custom per-vertex value that will be returned by IShape.ValueAt. If null, IShapeInfo.ValueMask will return ShapeValue.None.

Creates a new instance of ShapeGeometry.

Protected / Attributes

epsilon


protected attribute epsilon → (float64)

A 'very small' positive value in the scale of this shape.

values


protected attribute values → (float64 [ ] [ ])

The custom per-vertex values, indexed with ordinal values of ShapeValue.

vertex​Bounds


protected attribute vertexBounds → (Box2D)

The bounding box of the shape vertices.

vertices


protected attribute vertices → (Vec2D [ ])

The list of shape vertices.