Segment Class

  • Segment
  • class Esri::ArcGISRuntime::Segment

    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. ArcGIS software supports both linear segments (represented by LineSegment) and curve segments (represented by CubicBezierSegment and EllipticArcSegment).

    GeometryEngine::densify(const Esri::ArcGISRuntime::Geometry&, double) can translate curve segments into multiple LineSegment instances to approximate the curve.

    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. Multipart geometries can be composed from and decomposed into their constituent segments if required.

    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. 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 can not change a segment's shape once it is created. For workflows that involve geometry editing, create a new segment with the properties you require.

    From Esri::ArcGISRuntime 100.12, curve segments are supported in geometry editing workflows. You can add curve segments to a MultipartBuilder, and if a geometry has curves (Geometry::hasCurves is true) then curve segments will be returned where applicable from the ImmutablePart collections that comprise the multipart geometry. Curve and linear segments can be mixed together in the same geometry.

    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 false if the object is a LineSegment; true otherwise.

    Prior to Esri::ArcGISRuntime 100.12, only LineSegment instances were supported when creating new geometries using a MultipartBuilder or iterating the Segment instances in an existing Multipart geometry.

    From Esri::ArcGISRuntime 100.12, 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, Part::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.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.