//
//  GSPath+Primitives.h
//  GlyphsCore
//
//  Created by Georg Seifert on 16.12.16.
//  Copyright © 2016 schriftgestaltung.de. All rights reserved.
//

#import <GlyphsCore/GSPath.h>

@interface GSPath (Primitives)

/// Creates a closed rectangular path enclosing the rectangle.
///
/// Returns `nil` when the rectangle is empty or null.
+ (nullable instancetype)pathWithRect:(CGRect)rect NS_SWIFT_NAME(init(rect:));

/// Creates a closed cubic path approximating an ellipse inside the rectangle.
///
/// Returns `nil` when the rectangle is empty or null.
+ (nullable instancetype)circleWithRect:(NSRect)theRect NS_SWIFT_NAME(init(ellipseIn:));

/// Creates a closed cubic path approximating a circle.
///
/// Returns `nil` when the radius is zero.
+ (nullable instancetype)circleWithCenter:(NSPoint)center radius:(CGFloat)radius NS_SWIFT_NAME(init(circleAt:radius:));

/// Creates a closed cubic path approximating an ellipse.
///
/// The angle is measured in radians.
///
/// Returns `nil` when both radii are zero.
+ (nullable instancetype)ellipseWithCenter:(NSPoint)center radius1:(CGFloat)a radius2:(CGFloat)b angle:(CGFloat)theta NS_SWIFT_NAME(init(ellipseAt:radius1:radius2:transform:));

#pragma mark - Deprecated (Glyphs 3 compatibility)

+ (nullable instancetype)rectWithRect:(NSRect)theRect GSDeprecated("pathWithRect:");

@end
