HorizonPath
public struct HorizonPath : Equatable
Path in the horizon.
This class represent one path in horizon. Each entry contains information allowing to determine
hierarchy of paths(parent-child relationship between paths), offset on parent path, set of horizon
elements relevant to HorizonOptions
provided by user to HorizonEngine
, and
path geometry. The length of the path as well as which types of horizon elements it contains
are determined by the horizon options.
Horizon path can be extracted from HorizonResult
, which can be obtained using
instance of HorizonEngine
, registering set of HorizonOptions
and making
call generateHorizon
.
Important
This is a Public Preview API. It may be changed or removed at any time.-
Initializes instance of
HorizonPath
.Declaration
Swift
public init( pathID: Int, parentPathID: Int, offsetOnParentPath: Measurement<UnitLength>?, horizonElements: [HorizonElementType: [HorizonElement]], pathGeometry: [PathGeometryElement] )
-
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>?
-
Map of horizon elements on the path.
Declaration
Swift
public let horizonElements: [HorizonElementType : [HorizonElement]]
-
Path geometry.
Declaration
Swift
public let pathGeometry: [PathGeometryElement]
-
Declaration
Swift
public static func == (lhs: HorizonPath, rhs: HorizonPath) -> Bool
-
Returns all the horizon elements that belong to this path. Elements of the same type are provided in increasing order of the start and end offsets.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func getElements() -> [HorizonElement]
Return Value
Array of horizon elements that belong to this path.
-
Returns all the horizon elements of the specified types that belong to this path. Elements of the same type 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(types: [HorizonElementType]) -> [HorizonElement]
Parameters
types
Types of horizon elements to return.
Return Value
Array of horizon elements of the given types 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.