1/* 2 Project: Graphos 3 GRBezierPath.h 4 5 Copyright (C) 2000-2018 GNUstep Application Project 6 7 Author: Enrico Sersale (original implementation) 8 Author: Ing. Riccardo Mottola 9 10 This application is free software; you can redistribute it and/or 11 modify it under the terms of the GNU General Public 12 License as published by the Free Software Foundation; either 13 version 2 of the License, or (at your option) any later version. 14 15 This application is distributed in the hope that it will be useful, 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 Library General Public License for more details. 19 20 You should have received a copy of the GNU General Public 21 License along with this library; if not, write to the Free 22 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 23 */ 24 25#import <Foundation/Foundation.h> 26#import <AppKit/AppKit.h> 27#import "GRPathObject.h" 28#import "GRBezierControlPoint.h" 29 30 31typedef struct 32{ 33 GRBezierControlPoint *cp; 34 NSPoint p; 35 double t; 36} hitData; 37 38@interface GRBezierPath : GRPathObject 39{ 40 BOOL calculatingHandles; 41 NSMutableArray *controlPoints; 42} 43 44- (void)addControlAtPoint:(NSPoint)aPoint; 45- (void)addLineToPoint:(NSPoint)aPoint; 46- (void)addCurveWithBezierHandlePosition:(NSPoint)handlePos; 47 48- (void)subdividePathAtPoint:(NSPoint)p splitIt:(BOOL)split; 49 50- (NSMutableArray *)controlPoints; 51- (BOOL)isPoint:(GRBezierControlPoint *)cp1 onPoint:(GRBezierControlPoint *)cp2; 52- (GRBezierControlPoint *)pointOnPoint:(GRBezierControlPoint *)aPoint; 53- (void)confirmNewCurve; 54 55- (hitData)hitDataOfPathSegmentOwningPoint:(NSPoint)pt; 56 57- (void)moveAddingCoordsOfPoint:(NSPoint)p; 58 59- (void)setZoomFactor:(CGFloat)f; 60 61- (BOOL)onControlPoint:(NSPoint)p; 62- (BOOL)onPathBorder:(NSPoint)p; 63 64- (GRBezierControlPoint *)firstPoint; 65- (GRBezierControlPoint *)lastPoint; 66 67- (NSUInteger)indexOfPoint:(GRBezierControlPoint *)aPoint; 68 69 70@end 71 72