EILLocationLinearObject Class Reference

Inherits from NSObject
Conforms to NSCoding
Declared in EILLocationLinearObject.h
EILLocationLinearObject.m

Overview

Represents an object in a location which position can be described by a line segment. Typical examples are doors, windows, internal partition walls etc. Object is immutable.

Properties

  type

Type of the object.

@property (nonatomic, assign, readonly) EILLocationLinearObjectType type

Declared In

EILLocationLinearObject.h

  position

Coordinates of the object in form of an oriented line segment. Orientation typically represent direction toward center of the location, perpendicular to the line segment.

@property (nonatomic, strong, readonly) EILOrientedLineSegment *position

Declared In

EILLocationLinearObject.h

Creating and Initializing Linear Objects

– initWithType:position:

Returns a new linear object.

- (instancetype)initWithType:(EILLocationLinearObjectType)type position:(EILOrientedLineSegment *)position

Parameters

type

A type of the linear object.

position

Coordinates of the object in form of an oriented line segment

Return Value

A linear object initialized with position and type.

Declared In

EILLocationLinearObject.h

+ linearObjectWithLinearObject:

Returns a new linear object based on the given linear object.

+ (instancetype)linearObjectWithLinearObject:(EILLocationLinearObject *)linearObject

Parameters

point

A linear object.

Return Value

An linear object initialized with linearObject.type and linearObject.position

Declared In

EILLocationLinearObject.h

Operations on linear object

– linearObjectTranslatedByDX:dY:

Translates the linear object by a given vector (dX, dY) and returns a new linear object.

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

Parameters

dX

Value of translation on X axis.

dY

Value of translation on Y axis.

Return Value

A new linear object translated by (dX, dY).

Declared In

EILLocationLinearObject.h

Serialization

+ linearObjectFromDictionary:

Deserializes a linear object from NSDictionary.

+ (nullable EILLocationLinearObject *)linearObjectFromDictionary:(NSDictionary *)dict

Parameters

dict

NSDictionary to deserialize from.

Return Value

A linear object created from NSDictionary.

Declared In

EILLocationLinearObject.h

– toDictionary

Serializes the linear object to NSDictionary.

- (NSDictionary *)toDictionary

Return Value

A linear object representation in NSDictionary.

Declared In

EILLocationLinearObject.h

Identifying and Comparing Objects

– isEqual:

Returns a boolean value that indicates whether given linear object is equal to this one.

- (BOOL)isEqual:(nullable id)other

Parameters

other

The object to be compared to this linear object. May be nil.

Return Value

YES if linear objects are equal, otherwise NO.

Declared In

EILLocationLinearObject.h

– isEqualToLinearObject:

- (BOOL)isEqualToLinearObject:(nullable EILLocationLinearObject *)object

See Also

Declared In

EILLocationLinearObject.h

– hash

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

- (NSUInteger)hash

Declared In

EILLocationLinearObject.h

Describing Objects

– description

Returns a string representation of the location linear object.

- (NSString *)description

Return Value

A string representation of the location linear object.

Declared In

EILLocationLinearObject.h

Encoding and Decoding

– initWithCoder:

Returns a location linear object initialized from data in a given unarchiver.

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

Parameters

decoder

An unarchiver object.

Return Value

A new location linear object initialized using the data in decoder.

Declared In

EILLocationLinearObject.h

– encodeWithCoder:

Encodes the location linear object using a given archiver.

- (void)encodeWithCoder:(NSCoder *)coder

Parameters

An

archiver object.

Declared In

EILLocationLinearObject.h