Shape

Description

abstract class Tinman.Terrain.Shapes.Shape

Derived from

ShapeBase abstract

Extended by

ShapeVertices abstract

Abstract base class for implementation of the IShape interface.

Public / Constructors

ArcInner


[Pure]
public static method ArcInner → (5)

center in : Vec2D

The center of the oval from which to create the arc.

in : Vec2D

Vector pointing from center in to start of arc.

in : Vec2D

Vector pointing from center in to end of arc.

in : int32

[>=1]
The number of segments between in and in.

georef opt : CoordinateSystem = null

The coordinate system or null.

returns → IShape

The shape.

Creates an arc shape that runs from in to in over the inner path (i.e. the shorter one).

ArcOuter


[Pure]
public static method ArcOuter → (5)

center in : Vec2D

The center of the oval from which to create the arc.

in : Vec2D

Vector pointing from center in to start of arc.

in : Vec2D

Vector pointing from center in to end of arc.

in : int32

[>=1]
The number of segments between in and in.

georef opt : CoordinateSystem = null

The coordinate system or null.

returns → IShape

The shape.

Creates an arc shape that runs from in to in over the outer path (i.e. the longer one).

Arrow


[Pure]
public static method Arrow → (7)

from in : Vec2D

Base point of arrow.

to in : Vec2D

Tip point of arrow.

width opt : float64 = 0.7

Scale factor from length to width.

widthShaft opt : float64 = 0.25

Scale factor from width to widthShaft.

lengthShaft opt : float64 = 0.5

Scale factor length to lengthShaft.

lengthHead opt : float64 = 0.6

Scale factor length to lengthHead.

georef opt : CoordinateSystem = null

The coordinate system or null.

returns → IShape

The shape.

Creates an arrow shape.

The arrow shape vertices a are determined by the these dimensions:

       /         /\             \
       |        /  \            |
       |       /    \           |
       |      /      \          | lengthHead
       |     /        \         |
length |    /  _    _  \        |
       |   /.-´ |  | `-.\   \   /
       |        |  |        |
       |        |  |        | lengthShaft
       \        `--´        /

                \__/
             widthShaft

           \____________/
               width

The length is the distance between from in and to in. The other dimensions are defined by the ratios given as parameters.

Box


[Pure]
public static method Box → (2)

bounds in : Box2D

The bounds of the box.

georef opt : CoordinateSystem = null

The coordinate system or null.

returns → IShape

The shape.

Creates a new box shape.

CheckerBoard


[Pure]
public static method CheckerBoard → (3)

size opt : float64 = 1

[>0]
Edge length of checkerboard tiles.

offset opt : Vec2D = default(Vec2D)

Tile corner offset.

georef opt : CoordinateSystem = null

The coordinate system or null.

returns → IShape

The shape.

Creates a new checkerboard shape.

Circle

2 overloads


[Pure]
public static method Circle1 → (4)

center in : Vec2D

The circle center.

radius in : float64

[>=0]
The circle radius.

in : int32

[>=1]
The number of segments per circle quadrant.

georef opt : CoordinateSystem = null

The coordinate system or null.

returns → IShape

this

Creates a new circle shape by defining an approximating polygon.


[Pure]
public static method Circle2 → (3)

center in : Vec2D

Coordinates of center of circle.

radius opt : float64 = 0

[>=0]
Radius of circle. Set to 0 to create a point shape.

georef opt : CoordinateSystem = null

The coordinate system or null.

returns → IShape

The shape.

Creates a new circle shape by defining a signed distance field.

See also

ShapeType.Points

File

2 overloads


[Pure]
public static method File1 → (3)

file in : Path

[not-null]
The file path.

format opt : ShapeFormat = null

The file format or null if not known.

flags opt : ReadShapeFlags = ReadShapeFlags.Geo

The reader flags to use.

returns → IShape

The shape.

Reads the given shape file.


[Pure]
public static method File2 → (3)

file in : IFileData

[not-null]
The file data.

format opt : ShapeFormat = null

The file format or null if not known.

flags opt : ReadShapeFlags = ReadShapeFlags.Geo

The reader flags to use.

returns → IShape

The shape.

Reads the given shape file.

GeographicPolygon

2 overloads


[Pure]
public static method GeographicPolygon1 → (2)

vertices in : LatLon [ ]

[not-null]
The polygon vertices, given as a non-closed polyline that represents a weakly simple polygon.

datum opt : GeodeticDatum = null

The geographic datum. If null, GeodeticDatum.WGS84 will be used.

returns → IShape

The resulting shape.

Creates a polygon shape in a geographic coordinate system.

The winding the shape vertices is not relevant.


[Pure]
public static method GeographicPolygon2 → (2)

vertices in : IVectorConst<LatLon>

[not-null]
The polygon vertices, given as a non-closed polyline that represents a weakly simple polygon.

datum opt : GeodeticDatum = null

The geographic datum. If null, GeodeticDatum.WGS84 will be used.

returns → IShape

The resulting shape.

Creates a polygon shape in a geographic coordinate system.

The winding the shape vertices is not relevant.

Geometry


public static method Geometry → (3)

vertices opt : int32 = 0

[>=0]
Initial vertex capacity.

edges opt : int32 = 0

[>=0]
Initial edge capacity.

triangles opt : int32 = 0

[>=0]
Initial triangle capacity.

returns → ShapeBuilder

The shape builder object.

Returns a ShapeBuilder object for creating geometry based shapes (i.e. vertices, edges and/or triangles).

Grid


[Pure]
public static method Grid → (7)

in : Vec2D

First grid corner point.

in : Vec2D

Second grid corner point.

in : Vec2D

Third grid corner point.

in : Vec2D

Fourth grid corner point.

in : int32

[>=1]
Number of segment lines between in and in (inclusive).

in : int32

[>=1]
Number of segment lines between in and in (inclusive).

georef opt : CoordinateSystem = null

The coordinate system or null.

returns → IShape

The shape.

Creates a grid shape.

The grid is specified by the four given control points:

(a)----- + ----- + ----- + -----(b)
 |       |       |       |       |
 + ----- + ----- + ----- + ----- +
 |       |       |       |       |
 + ----- + ----- + ----- + ----- +
 |       |       |       |       |
(d)----- + ----- + ----- + -----(c)
See also

ShapeType.Graph

Oval


[Pure]
public static method Oval → (5)

center in : Vec2D

The center of the oval.

in : Vec2D

First vector pointing from center in to oval edge.

in : Vec2D

Second vector pointing from center in to oval edge.

in : int32

[>=1]
The number of segments between in and in.

georef opt : CoordinateSystem = null

The coordinate system or null.

returns → IShape

The shape.

Creates an oval shape.

Polygon

2 overloads


[Pure]
public static method Polygon1 → (2)

vertices in : Vec2D [ ]

[not-null]
The polygon vertices, given as a non-closed polyline that represents a weakly simple polygon.

georef opt : CoordinateSystem = null

The coordinate system or null.

returns → IShape

The shape.

Creates a polygon shape.

The winding the shape vertices is not relevant.


[Pure]
public static method Polygon2 → (2)

vertices in : IVectorConst<Vec2D>

[not-null]
The polygon vertices, given as a non-closed polyline that represents a weakly simple polygon.

georef opt : CoordinateSystem = null

The coordinate system or null.

returns → IShape

The shape.

Creates a polygon shape.

The winding the shape vertices is not relevant.

Polyline

2 overloads


[Pure]
public static method Polyline1 → (3)

vertices in : Vec2D [ ]

[not-null]
The polyline vertices.

closed in : bool

Attach last vertex to first one?

georef opt : CoordinateSystem = null

The coordinate system or null.

returns → IShape

The shape.

Creates a polyline shape.

See also

ShapeType.Graph


[Pure]
public static method Polyline2 → (3)

vertices in : IVectorConst<Vec2D>

[not-null]
The polyline vertices.

closed in : bool

Attach last vertex to first one?

georef opt : CoordinateSystem = null

The coordinate system or null.

returns → IShape

The shape.

Creates a polyline shape.

See also

ShapeType.Graph

ReadCSH

2 overloads


public static method ReadCSH1 → (1)

path in : Path

[not-null]
The file path.

returns → IShape

The resulting shape.

Reads a shape from a CSH file.

IOException

If an I/O error has occurred.


public static method ReadCSH2 → (1)

stream in : IDataStream

[not-null]
The input data stream.

returns → IShape

The resulting shape.

Reads a shape from a CSH file.

IOException

If an I/O error has occurred.

Public / Methods

RasterizerFactory

5 overloads


public static method RasterizerFactory1 → (2)

sample in : HeightmapSample

The uniform heightmap sample data to use.

falloff in : float64

[>=0]
Distance falloff value (see remarks).

returns → IShapeRasterizerFactory<HeightmapRegion>

The shape rasterizer.

Returns a IShapeRasterizerFactory object that rasterizes distance values into the given sample buffer.

Distance values are converted into heightmap samples by computing weighted vertex sums. Distance values of zero or less will produce heightmap samples that have full coverage; values greater than or equal to falloff in will produce void heightmap samples (i.e. zero coverage). Values in-between create have a smooth transition.


public static method RasterizerFactory2 → (2)

samples in : HeightmapSamples

[not-null]
Heightmap sample data for each vertex of the input shape (see IShape.VertexAt).

falloff in : float64

[>=0]
Distance falloff value (see remarks).

returns → IShapeRasterizerFactory<HeightmapRegion>

The shape rasterizer.

Returns a IShapeRasterizerFactory object that rasterizes distance values into the given sample buffer.

Distance values are converted into heightmap samples by computing weighted vertex sums. Distance values of zero or less will produce heightmap samples that have full coverage; values greater than or equal to falloff in will produce void heightmap samples (i.e. zero coverage). Values in-between create have a smooth transition.

Per-vertex heightmap sample values can only be used for explicit shapes that have an edge parity of zero. See IShape for details.


public static method RasterizerFactory3 → ()

returns → IShapeRasterizerFactory<DistanceBuffer>

The shape rasterizer.

Returns a IShapeRasterizerFactory object that rasterizes distance values into a sample buffer.

The distance value range (see ISampleBuffer.ScanlineRange) of the target sample buffer is used to optimize the rasterization process.

See also

DistanceBuffer


public static method RasterizerFactory4 → (1)

colorRamp in : IColorRamp

[not-null]
The color ramp to use.

returns → IShapeRasterizerFactory<ColorBuffer>

The shape rasterizer.

Returns a IShapeRasterizerFactory object that rasterizes distance values into the given sample buffer.

Distance values are converted into color values by performing a color ramp lookup.


public static method RasterizerFactory5 → (2)

colorRamp in : IColorRamp

[not-null]
The color ramp to use.

lineStipple in : LineStipple

The line stipple pattern to use.

returns → IShapeRasterizerFactory<ColorBuffer>

The shape rasterizer.

Returns a IShapeRasterizerFactory object that rasterizes distance values into the given sample buffer.

Distance values are converted into color values by performing a color ramp lookup.

Protected / Constructors

Shape


protected constructor Shape → (2)

serialId in : ISerialTypeInfo

[not-null]
The serial type ID.

georef opt : CoordinateSystem = null

Georef object or null.

Creates a new instance of Shape.

Configuration

Config


public static attribute Config → (get)

value : IConfigurator<IShape>

[not-null]
The configurator object.

The configurator object for this type.