//
//  GSRoundCorner.h
//  GlyphsCore
//
//  Created by Georg Seifert on 15.09.24.
//  Copyright © 2024 schriftgestaltung.de. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <GlyphsCore/GSNode.h>

@class GSPathSegment;

NS_ASSUME_NONNULL_BEGIN

@interface GSRoundCorner : NSObject

+ (void)makeCornerAtNode:(GSNode *)node andRadius:(CGFloat)radius selected:(BOOL)selected visualCorrect:(BOOL)visualCorrect forceCompatibility:(BOOL)compatible curveType:(GSNodeType)curveType grid:(GSGridSettings)grid;

+ (CGFloat)angle:(GSNode *)node withRadius:(CGFloat)radius;

+ (CGFloat)anchorFactor:(CGFloat *)angle curveType:(GSNodeType)curveType radius:(CGFloat *)radius visualCorrect:(BOOL)visualCorrect;

+ (CGFloat)tForNextSegment:(GSPathSegment *)segment radius:(CGFloat)radius otherNodeSelected:(BOOL)otherNodeSelected reachesOverStartNode:(BOOL)reachesOverStartNode removeNode:(BOOL *)removeNode roundInnerCorner:(BOOL)roundInnerCorner selected:(BOOL)selected;

+ (CGFloat)tForPrevSegment:(GSPathSegment *)segment radius:(CGFloat)radius otherNodeSelected:(BOOL)otherNodeSelected reachesOverStartNode:(BOOL)reachesOverStartNode removeNode:(BOOL *)removeNode otherOnCurveIdx:(NSUInteger)otherOnCurveIdx roundInnerCorner:(BOOL)roundInnerCorner path:(GSPath *)path;

@end

NS_ASSUME_NONNULL_END
