Namespace: Esri::GameEngine::Geometry
Class: Esri/GameEngine/Geometry/ArcGISGeometryBuilder
Since: 1.0.0
Summary
Geometry builders allow you to create and modify geometries incrementally.
Properties
Property | Type | Nullable | Readonly | Summary |
---|---|---|---|---|
No | Yes | The extent for the geometry being constructed in the geometry builder. | ||
No | Yes | True if the geometry builder currently contains any curve segments, false otherwise. | ||
No | Yes | True if the geometry builder supports geometries with m values, false otherwise. | ||
No | Yes | True if the geometry builder supports geometries with z values, false otherwise. | ||
No | Yes | True if no coordinates have been added to this geometry builder, false otherwise. | ||
No | Yes | True if the geometry builder contains sufficient points to show a valid graphical sketch, false otherwise. | ||
Yes | No | The spatial reference for the geometry. |
Extent
ArcGISEnvelope GetExtent() const
The extent for the geometry being constructed in the geometry builder.
HasCurves
bool GetHasCurves() const
True if the geometry builder currently contains any curve segments, false otherwise.
ArcGIS software supports polygon and polyline geometries that contain curve segments (where ArcGISSegment::IsCurve is true, sometimes known as true curves or nonlinear segments). Curves may be present in certain types of data, such as Mobile Map Packages (MMPKs), or geometry JSON.
You can use curves in a ArcGISMultipartBuilder. New segment types, such as ArcGISCubicBezierSegment and ArcGISEllipticArcSegment, represent types of curve that can be added to polygon and polyline geometries.
HasM
bool GetHasM() const
True if the geometry builder supports geometries with m values, false otherwise.
M values are often referred to as measures, and are used in linear referencing workflows on linear datasets. NaN is a valid m value. If true, m values are stored for each vertex of the constructed Geometry. Geometries with m values are created by using setters or constructors that take an m value as a parameter.
HasZ
bool GetHasZ() const
True if the geometry builder supports geometries with z values, false otherwise.
Z values are generally used as a z coordinate, indicating height or elevation. NaN is a valid z value. If true, z values are stored for each vertex of the constructed Geometry. Geometries with z values are created by using setters or constructors that take a z value as a parameter.
IsEmpty
bool GetIsEmpty() const
True if no coordinates have been added to this geometry builder, false otherwise.
An empty geometry builder may have a valid ArcGISSpatialReference, even without coordinates.
IsSketchValid
bool GetIsSketchValid() const
True if the geometry builder contains sufficient points to show a valid graphical sketch, false otherwise.
This can be used as an initial lightweight check to see if the current state of a builder produces a non-empty geometry. For example, it may be used to enable or disable functionality in an editing user interface. The exact requirements vary depending on the type of geometry produced by the builder:
- A ArcGISPointBuilder must contain non-NaN x,y coordinates
- A ArcGISMultipointBuilder must contain at least one valid ArcGISPoint
- An ArcGISEnvelopeBuilder must contain non-NaN minimum and maximum x,y coordinates
- A ArcGISPolylineBuilder must contain at least one ArcGISMutablePart. Each ArcGISMutablePart it contains must have:
- At least two valid points, or
- At least one ArcGISSegment where ArcGISSegment::IsCurve is true
- A ArcGISPolygonBuilder must contain at least one ArcGISMutablePart. Each ArcGISMutablePart it contains must have:
- At least three valid points, or
- At least one ArcGISSegment where ArcGISSegment::IsCurve is true
Note that this is not equivalent to topological simplicity, which is enforced by ArcGISGeometryEngine::Simplify and checked using ArcGISGeometryEngine::IsSimple. Geometries must be topologically simple to be successfully saved in a geodatabase or used in some service operations.
It does not check the spatial reference and returns false if an error occurs.
SpatialReference
ArcGISSpatialReference GetSpatialReference() const
The spatial reference for the geometry.
Once set, the ArcGISSpatialReference of the geometry builder cannot be changed. Ensure that all objects added to the builder have a compatible ArcGISSpatialReference.
Methods
Signature | Return Type | Summary |
---|---|---|
Create(const ArcGISGeometry&) | Creates a geometry builder with the specified geometry as a starting point for further modification. | |
Creates an empty geometry builder which builds geometries of the specified ArcGISGeometryType. | ||
ReplaceGeometry(const ArcGISGeometry&) | Replaces the geometry currently stored in the geometry builder with the new geometry. | |
Returns the geometry this geometry builder is constructing or modifying. |
Create
static ArcGISGeometryBuilder Create(const ArcGISGeometry& geometry)
Creates a geometry builder with the specified geometry as a starting point for further modification.
Since 1.0.0
Arguments
Name | Type | Const | Summary |
---|---|---|---|
geometry | Yes | The geometry to use as the starting point for further modifications. |
Returns ArcGISGeometryBuilder
A new geometry builder.
Create
static ArcGISGeometryBuilder Create(ArcGISGeometryType geometryType, const ArcGISSpatialReference& spatialReference)
Creates an empty geometry builder which builds geometries of the specified ArcGISGeometryType.
Since 1.0.0
Arguments
Name | Type | Const | Summary |
---|---|---|---|
geometry | No | The builder's geometry type. | |
spatial | Yes | The builder's spatial reference. |
Returns ArcGISGeometryBuilder
A new geometry builder.
ReplaceGeometry
void ReplaceGeometry(const ArcGISGeometry& geometry)
Replaces the geometry currently stored in the geometry builder with the new geometry.
Since 1.0.0
Arguments
Name | Type | Const | Summary |
---|---|---|---|
geometry | Yes | A geometry object. |
Returns void
ToGeometry
ArcGISGeometry ToGeometry() const
Returns the geometry this geometry builder is constructing or modifying.
Since 1.0.0
Returns ArcGISGeometry
A geometry. This is passed to geometry functions.