IShapeOps

Description

interface Tinman.Terrain.Shapes.IShapeOps

Extended by

IShape

Base interface that declares shape operations that can be performed on IShape objects.

Public / Methods

Absolute


public method Absolute → ()

returns → IShape

The transforming shape (i.e. deferred transformation is performed by the returned IShape object, not by this method).

Returns a shape that returns the absolute distance value (i.e. the outline of this shape).

This method modifies the distance field of the shape. No geometric processing is performed.

Compile


public method Compile → ()

returns → IShape

The resulting shape.

Compiles this shape into the most compact form.

Calling this method will not modify the geometry or distance field of a shape, only the object model structure. Deferred computations are resolved, where possible.

Convert


public method Convert → (1)

type in : ShapeType

The shape type to convert to.

returns → IShape

The converted shape (i.e. the conversion is performed by this method). Will be null if the conversion is not possible (see remarks).

Converts this shape to the given type.

The following conversions are possible:

From / To | Implicit | Points | Graph | Polygon | Mesh
----------+----------+--------+-------+---------+------
Implicit  |      (1) |    n/a |   (2) |     n/a |  n/a
----------+----------+--------+-------+---------+------
Points    |      n/a |    (1) |   n/a |     n/a |  (3)
----------+----------+--------+-------+---------+------
Graph     |      n/a |    (4) |   (1) |     (5) |  (6)
----------+----------+--------+-------+---------+------
Polygon   |      n/a |    (4) |   (7) |     (1) |  (8)
----------+----------+--------+-------+---------+------
Mesh      |      n/a |    (4) |   (9) |    (10) |  (1)

These are the conversion methods:

  1. The conversion to the same type is a no-op, the method will return this.

  2. The signed distance field is traced in order to generate edges that approximate the contour at distance zero.
    This conversion is not implemented yet and will return null!

  3. A Delaunay triangulation is computed for the point soup.
    This conversion is not implemented yet and will return null!

  4. The edges resp. triangles are discarded, the vertices are used as a point soup.

  5. First, all pairs of flipped edges (AB, BA) are dropped from the graph. Then, each island of connected edges in the graph must represent a polyline (closed or non-closed). Those will be interpreted as polygon contours.

  6. Each triplet of connected edges in the graph is interpreted as a triangle. All other edges are discarded.

  7. The polygon contour edges and vertices are used to build a graph.

  8. The polygon is triangulated using the Ear-Cutting algorithm.

  9. The triangle edges and vertices are used to build a graph.

  10. All triangle edges without an adjacent triangle are output as contour edges.

The following conversions will round-trip without losing information:

See also

IShapeInfo.Type

Invert


public method Invert → ()

returns → IShape

The transforming shape (i.e. deferred transformation is performed by the returned IShape object, not by this method).

Inverts this shape.

This method modifies the distance field of the shape. No geometric processing is performed.

Maximum


public method Maximum → (1)

shape in : IShape

[not-null]
The other shape.

returns → IShape

The transforming shape (i.e. deferred transformation is performed by the returned IShape object, not by this method).

Returns a composite shape that returns the maximum distance value (i.e. intersection of this shape and the given one).

This method modifies the distance field of the shape. No geometric processing is performed.

Minimum


public method Minimum → (1)

shape in : IShape

[not-null]
The other shape.

returns → IShape

The transforming shape (i.e. deferred transformation is performed by the returned IShape object, not by this method).

Returns a composite shape that returns the minimum distance value (i.e. the union of this shape and the given one).

This method modifies the distance field of the shape. No geometric processing is performed.

Offset


public method Offset → (1)

offset in : float64

The distance offset to apply.

returns → IShape

The transforming shape (i.e. deferred transformation is performed by the returned IShape object, not by this method).

Applies a distance offset to this shape.

This method modifies the distance field of the shape. No geometric processing is performed.

PrepareLazy


public method PrepareLazy → ()

returns → IShape

this

Prepares all lazy-loaded resp. lazy-generated data for this shape.

IOException

If an I/O error has occurred while lazy-loading model data.

GeorefException

If the required geo-reference parameters are incomplete or invalid.

ValidatingException

If a validation error has occurred for the shape data or a shape reader object.

TransformCoordinates


public method TransformCoordinates → (1)

matrix in : Mat3D

The 2D homogeneous matrix.

returns → IShape

The transforming shape (i.e. deferred transformation is performed by the returned IShape object, not by this method).

Transforms this shape using the given 2D homogeneous matrix.

Shape coordinates of this shape are multiplied with matrix in using Mat3D.Mul22 (w = 1) in order to produce shape coordinates of the returned shape.

TransformCoordinateSystem


public method TransformCoordinateSystem → (2)

target in : CoordinateSystem

[not-null]
The target coordinate system.

accuracy opt : float64 = 0

[>=0]
Optional accuracy to use for subdivision of edges. Given as a maximum error in the target coordinate system (see target in. CoordinateSystem.HorizontalUnit). Set to 0 to disable edge subdivision.

returns → IShape

The transforming shape (i.e. deferred transformation is performed by the returned IShape object, not by this method).

Transforms this shape to the given coordinate system.

Transformation cannot be performed from resp. to a local coordinate system (see CoordinateSystem.IsLocal). A transformation between two local coordinate system is possible, but only a conversion regarding unit of measure (see CoordinateSystem.LocalUnit) and coordinate system flags (see CoordinateSystemFlags) is done.

Implicit shapes cannot be transformed (see IShape).

TransformCubemap


public method TransformCubemap → (1)

accuracy opt : float64 = 0

[>=0]
Optional accuracy to use for subdivision of edges. Given as a maximum error in the target coordinate system (see CoordinateOperationMethod.Face). Set to 0 to disable edge subdivision.

returns → IShape

The transforming shape (i.e. deferred transformation is performed by the returned IShape object, not by this method).

Transforms this shape to a geographic cubemap coordinate system.

TransformGeometry


public method TransformGeometry → (4)

transform in : CoordinateSystemTransform

The coordinate system transformation to apply. May be null iff geocentric opt is not null; in this case, a transformation is created automatically.

accuracy opt : float64 = 0

[>=0]
Optional accuracy to use for subdivision of edges. Given as a maximum error in the target coordinate system (see CoordinateSystem.HorizontalUnit of CoordinateSystemTransform.Target of transform in. Set to 0 to disable edge subdivision.

geocentric opt : Geocentric = null

Depicts how to interpret the given accuracy opt:
null : maximum error in the target coordinate system (see (see CoordinateSystemTransform.Target)
non-null : maximum error in the given geocentric frame.

verticalType opt : VerticalType = VerticalType.Ellipsoid

If geocentric opt is non-null, specifies the vertical coordinate type to use for computing the maximum error in the geocentric frame.

returns → IShape

The transformed shape (i.e. the transformation is performed by this method). Will be null if the transformed shape is empty or if the transformation is not possible (see remarks).

Transforms this shape to the given coordinate system.

Transformation cannot be performed from resp. to a local coordinate system (see CoordinateSystem.IsLocal). A transformation between two local coordinate system is possible, but only a conversion regarding unit of measure (see CoordinateSystem.LocalUnit) and coordinate system flags (see CoordinateSystemFlags) is done.

If both transform in and geocentric opt are not null, the caller is responsible for making sure that the given transform in correlates with the source coordinate system (see IShapeInfo.Georef) and the target coordinate system (see Geocentric.Coordinates).

Implicit shapes cannot be transformed (see IShape).

Extensions

Outline


public static method Outline → (1)

width opt : float64 = 0

[>=0]
Width of outline shape.

returns → IShape

The transforming shape (i.e. deferred transformation is performed by the returned IShape object, not by this method).

Returns a shape that covers the outline of this shape.

This method modifies the distance field of the shape. No geometric processing is performed.

RenderPrepare


public static method RenderPrepare → ()

returns → IShape

The prepared shape (i.e. the preparation is performed by this method).

Prepares this shape for geometric rendering (i.e. triangles, and lines).

The method will convert this shape to ShapeType.Graph (for the lines) and to ShapeType.Mesh (for the triangles). The resulting shapes are returned as a compiled shape group.