EILOrientedPoint Class Reference

Inherits from EILPoint : NSObject
Conforms to NSCoding
Declared in EILOrientedPoint.h
EILOrientedPoint.m

Overview

Represents a geometrical point with additional information about orientation. Object is immutable.

Properties

  orientation

Orientation of the point. If not defined takes EIL_ORIENTATION_UNDEFINED value. Value is in degrees, counted clockwise.

@property (nonatomic, assign) double orientation

Declared In

EILOrientedPoint.h

Creating and Initializing Points

– initWithX:y:orientation:

Returns a new oriented point object.

- (instancetype)initWithX:(double)x y:(double)y orientation:(double)orientation

Parameters

x

Coordinate on X axis.

y

Coordinate on Y axis.

orientation

Orientation of the point.

Return Value

An oriented point initialized with (x, y, orientation).

Declared In

EILOrientedPoint.h

+ pointWithX:y:orientation:

Returns a new oriented point object.

+ (instancetype)pointWithX:(double)x y:(double)y orientation:(double)orientation

Parameters

x

Coordinate on X axis.

y

Coordinate on Y axis.

orientation

Orientation of the point.

Return Value

An oriented point initialized with (x, y, orientation).

Declared In

EILOrientedPoint.h

– initWithX:y:

Returns a new oriented point object with orientation set to EIL_ORIENTATION_UNDEFINED

- (instancetype)initWithX:(double)x y:(double)y

Parameters

x

Coordinate on X axis.

y

Coordinate on Y axis.

Return Value

An oriented point initialized with (x, y, EIL_ORIENTATION_UNDEFINED).

Declared In

EILOrientedPoint.h

+ pointWithX:y:

Returns a new oriented point object with orientation set to EIL_ORIENTATION_UNDEFINED

+ (instancetype)pointWithX:(double)x y:(double)y

Parameters

x

Coordinate on X axis.

y

Coordinate on Y axis.

Return Value

An oriented point initialized with (x, y, EIL_ORIENTATION_UNDEFINED).

Declared In

EILOrientedPoint.h

+ pointWithOrientedPoint:

Returns a new oriented point object based on the given oriented point.

+ (instancetype)pointWithOrientedPoint:(EILOrientedPoint *)point

Parameters

point

An oriented point.

Return Value

An oriented point initialized with (point.x, point.y, point.orientation).

Declared In

EILOrientedPoint.h

+ pointWithPoint:orientation:

Returns a new oriented point object based on the given point and orientation.

+ (instancetype)pointWithPoint:(EILPoint *)point orientation:(double)orientation

Parameters

point

A point.

orientation

Orientation of the point.

Return Value

An oriented point initialized with (point.x, point.y, orientation).

Declared In

EILOrientedPoint.h

Operations on point

– pointTranslatedBydX:dY:

Translates the oriented point by a given vector (dX, dY) and returns a new oriented point.

- (instancetype)pointTranslatedBydX:(double)dX dY:(double)dY

Parameters

dX

Value of translation on X axis.

dY

Value of translation on Y axis.

Return Value

A new oriented point translated by (dX, dY).

Declared In

EILOrientedPoint.h

Serialization

+ pointFromDictionary:

Deserializes an oriented point from NSDictionary.

+ (nullable EILOrientedPoint *)pointFromDictionary:(NSDictionary *)dict

Parameters

dict

NSDictionary to deserialize from.

Return Value

An oriented point created from NSDictionary.

Declared In

EILOrientedPoint.h

– toDictionary

Serializes the oriented point to NSDictionary.

- (NSDictionary *)toDictionary

Return Value

An oriented point representation in NSDictionary.

Declared In

EILOrientedPoint.h

Identifying and Comparing Objects

– isEqual:

Returns a boolean value that indicates whether given oriented point is equal to this one.

- (BOOL)isEqual:(nullable id)other

Parameters

other

The object to be compared to this oriented point. May be nil.

Return Value

YES if oriented points are equal, otherwise NO.

Declared In

EILOrientedPoint.h

– isEqualToOrientedPoint:

- (BOOL)isEqualToOrientedPoint:(nullable EILOrientedPoint *)point

See Also

Declared In

EILOrientedPoint.h

– hash

Returns an integer that can be used as a table address in a hash table structure.

- (NSUInteger)hash

Declared In

EILOrientedPoint.h

Describing Objects

– description

Returns a string representation of the receiver.

- (NSString *)description

Return Value

A string representation of the point in form of (x,y, orientation)

Declared In

EILOrientedPoint.h

Encoding and Decoding

– initWithCoder:

Returns an oriented point initialized from data in a given unarchiver.

- (nullable instancetype)initWithCoder:(NSCoder *)decoder

Parameters

decoder

An unarchiver object.

Return Value

A new oriented point initialized using the data in decoder.

Declared In

EILOrientedPoint.h

– encodeWithCoder:

Encodes the oriented point using a given archiver.

- (void)encodeWithCoder:(NSCoder *)coder

Parameters

An

archiver object.

Declared In

EILOrientedPoint.h

Other Methods

+ pointWithPoint:

Returns a new point object based on the given point.

+ (instancetype)pointWithPoint:(EILPoint *)point

Parameters

point

A point.

Return Value

A point initialized with (point.x, point.y).

Declared In

EILPoint.h