ShapeBuilder
Description
Helper class for building geometric shapes.
To build a geometric shape, perform the following steps:
-
Create a shape builder via Shape.Geometry or call Clear on an existing builder for starting from scratch.
-
Configure the shape builder flags via Flags.
-
Configure the geo-reference via Georef.
-
Configure a transformation via Transform.
-
Add geometric primitives:
-
Vertices (see
Vertex*
methods) -
Edges (see
Edge*
methods) -
Triangles (see
Triangle*
methods)
-
-
Finish shape building by calling one of the following methods:
- See also
Public / Constructors
Build
Creates a new instance of IShape from the specified vertices (see Vertex1), edges (see Edge1) and/or triangles (see Triangle1).
This method only delegates to other method, in the following order:
Hull
Creates a new instance of IShape that represents the convex hull of the specified vertices (see Vertex1).
The returned shape is a convex polygon that contains all specified vertices (the signed distance from the vertex to the shape is less than or equal to zero).
All geometry data is cleared after the shape has been built.
Mesh
Creates a new instance of IShape from the specified vertices and triangles.
All geometry data is cleared after the shape has been built.
Polygon
The signed area of a polygon can be used to determine the parity, if the vertex winding is not intended to be relevant (see Geometric.AreaPolygon).
All geometry data is cleared after the shape has been built.
Public / Methods
Add
2 overloads
Adds all vertices, edges and triangles of the given shape.
When flip opt is true
, edges (A,B)
resp. triangles (A,B,C) are added as (B,A)
resp. (C,B,A)
.
Adds all vertices, edges and triangles of the given shape.
When flip in is true
, edges (A,B)
resp. triangles (A,B,C) are added as (B,A)
resp. (C,B,A)
.
Area
2 overloads
Computes the signed area of the simple polygon defined by the sequence of vertices that have been added to this builder.
- See also
Computes the signed area of the simple polygon defined by the given sequence of vertices.
- See also
EdgeList
6 overloads
Specifies a sequence of connected edges (polyline) when building a graph shape (see Graph) or polygon shape (see Polygon).
An edge is generated for each pair of consecutive vertices. When this method is called multiple times, edges are generated only for newly specified vertices.
Specifies a sequence of connected edges (polyline) when building a graph shape (see Graph) or polygon shape (see Polygon).
The vertex sequence can be reversed by swapping a in and b in.
Specifies a sequence of connected edges (polyline) when building a graph shape (see Graph) or polygon shape (see Polygon).
Specifies a series of edges.
Specifies a series of edges.
Specifies a series of edges.
Rectangle
3 overloads
Specifies a rectangle.
This method delegates to Rectangle3,
Specifies a rectangle.
This method delegates to Rectangle3,
Specifies a rectangle.
This method calls Vertex1 in this order:
-
(x0 in, y0 in)
-
(x1 in, y0 in)
-
(x1 in, y1 in)
-
(x0 in, y1 in)
Then, the EdgeList1 method is called.
Transform
Applies the given coordinate transform while building shapes.
When a coordinate transform is given, the specified vertices are expected to be in the source coordinate system (see CoordinateSystemTransform.Source). The built shapes will have the target coordinate system as geo-reference (see IShapeInfo.Georef). So it is not necessary to call Georef when using a transform.
All existing geometry is cleared by this method.
- See also
Triangle
2 overloads
Specifies a triangle when building a mesh shape (see Mesh).
If necessary, the given triangle vertices will be adjusted to meet the requirements of IShape.TriangleAt.
Specifies a triangle when building a mesh shape (see Mesh).
If necessary, the given triangle vertices will be adjusted to meet the requirements of IShape.TriangleAt.
Public / Attributes
Geocentric
In geocentric mode (see Transform), returns the helper object that is used for geocentric computations.