HorizonPath
public struct HorizonPath : Equatable
Path in the horizon.
The length of the path as well as which types of horizon elements HorizonElement
it
contains are determined by the set of horizon options HorizonOptions
for which
horizon data was generated. For information on how to manage horizon options see
HorizonEngine
.registerHorizonOptions and HorizonEngine
.unregisterHorizonOptions.///
For more information on horizon paths see HorizonEngine
.
-
Initializes instance of
HorizonPath
.Declaration
Swift
public init( pathID: Int, parentPathID: Int, offsetOnParentPath: Measurement<UnitLength>?, horizonElements: [HorizonElementType: [HorizonElement]], pathGeometry: [PathGeometryElement] )
Parameters
pathID
Identifier of this path.
parentPathID
Identifier of the parent path (0 if there is no parent path).
offsetOnParentPath
Offset on the parent path of the stub where this path starts, nil if there is no parent path.
horizonElements
Horizon elements
HorizonElement
that belong to this path. Mapped to horizon element typesHorizonElementType
.pathGeometry
List of geometry elements
PathGeometryElement
for this path.
-
Identifier of this path.
Declaration
Swift
public let pathID: Int
-
Identifier of the parent path, 0 if there is no parent path.
Declaration
Swift
public let parentPathID: Int
-
Offset on the parent path of the stub where this path starts, nil if there is no parent path.
Declaration
Swift
public let offsetOnParentPath: Measurement<UnitLength>?
-
Horizon elements that belong to this path. Mapped to horizon element types .
Declaration
Swift
public let horizonElements: [HorizonElementType : [HorizonElement]]
-
List of geometry elements for this path.
Declaration
Swift
public let pathGeometry: [PathGeometryElement]
-
Equatable method.
Declaration
Swift
public static func == (lhs: HorizonPath, rhs: HorizonPath) -> Bool
-
Returns all the horizon elements
HorizonElement
that belong to this path. Elements of the same typeHorizonElementType
are provided in increasing order of the start offsetHorizonElement
.startOffset.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func getElements() -> [HorizonElement]
Return Value
The array of horizon elements
HorizonElement
that belong to this path. -
Returns all the horizon elements
HorizonElement
of the specified typesHorizonElementType
that belong to this path. Elements of the same type are provided in increasing order of the start offsetHorizonElement
.startOffset.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func getElements(types: [HorizonElementType]) -> [HorizonElement]
Parameters
types
The types of horizon elements
HorizonElement
to return.Return Value
The array of horizon elements
HorizonElement
of the given typesHorizonElementType
that belong to this path. -
Returns all the horizon elements of the specified type that belong to this path. The elements are provided in increasing order of the start offset and end offset.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func getElements(type: HorizonElementType) -> [HorizonElement]
Parameters
type
Type of horizon elements to return.
Return Value
Array of horizon elements of the given types that belong to this path.