A segment represents an edge of a multipart geometry, connecting a start to an end point. More...
Header: | #include <Segment.h> |
Since: | Esri::ArcGISRuntime 100.0 |
Inherited By: | Esri::ArcGISRuntime::CubicBezierSegment, Esri::ArcGISRuntime::EllipticArcSegment, and Esri::ArcGISRuntime::LineSegment |
Public Functions
Segment() | |
Segment(const Esri::ArcGISRuntime::Segment &other) | |
Segment(Esri::ArcGISRuntime::Segment &&other) | |
~Segment() | |
Esri::ArcGISRuntime::Point | endPoint() const |
bool | isClosed() const |
bool | isCurve() const |
bool | isEmpty() const |
Esri::ArcGISRuntime::SegmentType | segmentType() const |
Esri::ArcGISRuntime::SpatialReference | spatialReference() const |
Esri::ArcGISRuntime::Point | startPoint() const |
bool | operator!=(const Esri::ArcGISRuntime::Segment &other) const |
Esri::ArcGISRuntime::Segment & | operator=(const Esri::ArcGISRuntime::Segment &other) |
Esri::ArcGISRuntime::Segment & | operator=(Esri::ArcGISRuntime::Segment &&other) |
bool | operator==(const Esri::ArcGISRuntime::Segment &other) const |
Detailed Description
A segment describes a continuous line between a start location and an end location. Every ImmutablePart in a Multipart geometry is a collection of Segment instances, where the end of one segment is at exactly the same location as the start of the following segment.
Because a single location is shared by adjacent segments, a single Point object is used to represent the shared location when you iterate through the points in a part (ImmutablePart::points). As a result, when iterating through the points in a part of a polyline or polygon, there is one more point than the number of segments in that same part.
Segments are immutable so you cannot change a segment's shape once it is created. For workflows that involve geometry editing, create a new segment with the properties you require.
Both linear segments (represented by LineSegment) and curve segments (represented by CubicBezierSegment or EllipticArcSegment) are supported. Curve and linear segments can be mixed together in the same geometry. GeometryEngine::densify(const Esri::ArcGISRuntime::Geometry&, double) can be used to produce a polygon or polyline without curves (Geometry::hasCurves = false
) from one that does have curves, by translating curve segments into multiple LineSegment instances to approximate the curve.
See also CubicBezierSegment, EllipticArcSegment, and LineSegment.
Member Function Documentation
Segment::Segment()
Default constructor.
Note: This is provided for convenience and produces an empty object.
See also isEmpty.
Segment::Segment(const Esri::ArcGISRuntime::Segment &other)
Copy constructor from other Segment.
Segment::Segment(Esri::ArcGISRuntime::Segment &&other)
Move constructor from other Segment.
Segment::~Segment()
Destructor.
Esri::ArcGISRuntime::Point Segment::endPoint () const
Gets the end point.
Returns the end point of this segment.
bool Segment::isClosed () const
Gets whether this segment is closed.
Returns whether this segment has a start point and end point at the same location.
[since Esri::ArcGISRuntime 100.12]
bool Segment::isCurve () const
Returns true
if the segment is a CubicBezierSegment or EllipticArcSegment, false
otherwise.
You can add curve segments (CubicBezierSegment, EllipticArcSegment) when using a MultipartBuilder, and get them back from an existing Multipart geometry when Geometry::hasCurves is true
.
This function was introduced in Esri::ArcGISRuntime 100.12.
See also GeometryBuilder::hasCurves, ImmutablePart::hasCurves, CubicBezierSegment, and EllipticArcSegment.
[since Esri::ArcGISRuntime 100.12]
bool Segment::isEmpty () const
Returns true
if the object is empty true
otherwise.
An empty object is invalid and cannot be used.
This function was introduced in Esri::ArcGISRuntime 100.12.
Esri::ArcGISRuntime::SegmentType Segment::segmentType () const
Gets the segment type.
Returns the type of this Segment.
Esri::ArcGISRuntime::SpatialReference Segment::spatialReference () const
Gets the SpatialReference.
Returns the spatial reference of this segment.
Esri::ArcGISRuntime::Point Segment::startPoint () const
Gets the start point.
Returns the start point of this segment.
[since Esri::ArcGISRuntime 200.2]
bool Segment::operator!=(const Esri::ArcGISRuntime::Segment &other) const
Inequality operator. Returns true
if this object and other are not equal.
This function was introduced in Esri::ArcGISRuntime 200.2.
See also Segment::operator==.
Esri::ArcGISRuntime::Segment &Segment::operator=(const Esri::ArcGISRuntime::Segment &other)
Assignment operator from other Segment.
Esri::ArcGISRuntime::Segment &Segment::operator=(Esri::ArcGISRuntime::Segment &&other)
Move operator from other Segment.
bool Segment::operator==(const Esri::ArcGISRuntime::Segment &other) const
Equivalency operator.
Returns whether this object and other are equivalent.