Loading...
Searching...
No Matches

A polygon with specified list of points. More...

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

Inherits NSObject.

Instance Methods

(nonnull instancetype) - initWithPoints:
 Default constructor for class NCPolygon.
 

Class Methods

(nonnull instancetype) + polygonWithPoints:
 Factory method for class NCPolygon.
 

Properties

NSArray< NCPoint * > * points
 Ring specifying the area.
 

Detailed Description

A polygon with specified list of points.

Swift code snippet:

// Create polygon
let polygon = Polygon(points: polygonPoints)
print("Created polygon with \‍(polygon.points.count) points")

Objective C code snippet:

// Create polygon
NCPolygon *polygon = [[NCPolygon alloc] initWithPoints:polygonPoints];
NSLog(@"Created polygon with %lu points", (unsigned long)polygon.points.count);

Definition at line 25 of file NCPolygon.h.

Method Documentation

◆ initWithPoints:

- (nonnull instancetype) initWithPoints: (nonnull NSArray< NCPoint * > *) points

Default constructor for class NCPolygon.

◆ polygonWithPoints:

+ (nonnull instancetype) polygonWithPoints: (nonnull NSArray< NCPoint * > *) points

Factory method for class NCPolygon.

Property Documentation

◆ points

- (NSArray<NCPoint *>*) points
readnonatomicassign

Ring specifying the area.

Swift code snippet:

// Get polygon points
let points = polygon.points
let pointsString = points.map { "(\‍($0.x), \‍($0.y))" }.joined(separator: ", ")
print("Polygon points: \‍(pointsString)")

Objective C code snippet:

// Get polygon points
NSArray<NCPoint *> *points = polygon.points;
NSMutableString *pointsString = [NSMutableString string];
for (NCPoint *point in points) {
if (pointsString.length > 0) {
[pointsString appendString:@", "];
}
[pointsString appendFormat:@"(%.1f, %.1f)", point.x, point.y];
}
NSLog(@"Polygon points: %@", pointsString);

Definition at line 49 of file NCPolygon.h.


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