Loading...
Searching...
No Matches
NCRoutePath Class Reference

Class is used for storing the route path between two points in location. More...

#include <com/navigine/idl/objc/NCRoutePath.h>

Inherits NSObject.

Instance Methods

(nullable NCRoutePath *) - head:
 Returns the leading segment of the route up to advance meters.
 
(nullable NCRoutePath *) - tail:
 Returns the route segment after advance meters.
 
(nonnull NSArray< NCRouteNode * > *) - nodes
 Returns route nodes with points and events.
 

Properties

float length
 Total route length in meters.
 
float weight
 Total route weight/cost.
 

Detailed Description

Class is used for storing the route path between two points in location.

Referenced from: AsyncRouteListener, AsyncRouteManager, Location, RouteListener, RouteManager

Definition at line 20 of file NCRoutePath.h.

Method Documentation

◆ head:

- (nullable NCRoutePath *) head: (float) advance

Returns the leading segment of the route up to advance meters.

Parameters
advancedistance along route (meters).
Returns
route head segment.

Swift code snippet:

// Get head of route (first 10 meters)
if let headPath = path.head(10.0) {
print("Head path length: \‍(headPath.getLength()) meters")
}

Objective C code snippet:

// Get head of route (first 10 meters)
NCRoutePath *headPath = [path head:10.0];
if (headPath != nil) {
NSLog(@"Head path length: %f meters", [headPath getLength]);
}

◆ nodes

- (nonnull NSArray< NCRouteNode * > *) nodes

Returns route nodes with points and events.

Swift code snippet:

// Get route nodes
let nodes = path.getNodes()
print("Route has \‍(nodes.count) nodes")
for node in nodes {
demonstrateRouteNodeUsage(node)
}

Objective C code snippet:

// Get route nodes
NSArray<NCRouteNode *> *nodes = [path getNodes];
NSLog(@"Route has %lu nodes", (unsigned long)nodes.count);
for (int j = 0; j < nodes.count; j++) {
[self demonstrateRouteNodeUsage:nodes[j]];
}

◆ tail:

- (nullable NCRoutePath *) tail: (float) advance

Returns the route segment after advance meters.

Parameters
advancedistance along route (meters).
Returns
route tail segment.

Swift code snippet:

// Get tail of route (remaining after 10 meters)
if let tailPath = path.tail(10.0) {
print("Tail path length: \‍(tailPath.getLength()) meters")
}

Objective C code snippet:

// Get tail of route (remaining after 10 meters)
NCRoutePath *tailPath = [path tail:10.0];
if (tailPath != nil) {
NSLog(@"Tail path length: %f meters", [tailPath getLength]);
}

Property Documentation

◆ length

- (float) length
readnonatomicassign

Total route length in meters.

Swift code snippet:

// Get route length
let length = path.getLength()
print("Route length: \‍(length) meters")

Objective C code snippet:

// Get route length
double length = [path getLength];
NSLog(@"Route length: %f meters", length);

Definition at line 84 of file NCRoutePath.h.

◆ weight

- (float) weight
readnonatomicassign

Total route weight/cost.

Swift code snippet:

// Get total route weight
let weight = path.getWeight()
print("Route weight: \‍(weight)")

Objective C code snippet:

// Get total route weight
double weight = [path getWeight];
NSLog(@"Route weight: %f", weight);

Definition at line 99 of file NCRoutePath.h.


The documentation for this class was generated from the following file: