1 /* 2 Project: Graphos 3 GRPathObject.h 4 5 Copyright (C) 2008-2018 GNUstep Application Project 6 7 Author: Ing. Riccardo Mottola 8 9 Created: 2008-03-14 10 11 This application is free software; you can redistribute it and/or 12 modify it under the terms of the GNU General Public 13 License as published by the Free Software Foundation; either 14 version 2 of the License, or (at your option) any later version. 15 16 This application is distributed in the hope that it will be useful, 17 but WITHOUT ANY WARRANTY; without even the implied warranty of 18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 Library General Public License for more details. 20 21 You should have received a copy of the GNU General Public 22 License along with this library; if not, write to the Free 23 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 24 */ 25 26 /** 27 * PathObject is a superclass for every graphics object consisting of 28 * a fillable path. It is itself a subclass of GRDrawableObject. 29 * It is abstract and created to standardize behaviour, it is not instantiatable itself. 30 * Instances are like BezierPaths and Boxes. 31 */ 32 33 #import <Foundation/Foundation.h> 34 #import <AppKit/NSBezierPath.h> 35 #import "GRDrawableObject.h" 36 #import "GRObjectControlPoint.h" 37 38 @interface GRPathObject : GRDrawableObject 39 { 40 // object bezier path 41 NSBezierPath *path; 42 43 // already zoomed bezier path for faster drawing 44 NSBezierPath *displayPath; 45 46 CGFloat linewidth; 47 CGFloat flatness; 48 CGFloat miterlimit; 49 NSLineJoinStyle linejoin; 50 NSLineCapStyle linecap; 51 GRObjectControlPoint *currentPoint; 52 } 53 54 - (void)setLineWidth:(CGFloat)width; 55 - (CGFloat)lineWidth; 56 57 - (void)setFlat:(CGFloat)flat; 58 - (CGFloat)flatness; 59 60 - (void)setLineJoin:(NSLineJoinStyle)join; 61 - (NSLineJoinStyle)lineJoin; 62 63 - (void)setLineCap:(NSLineCapStyle)cap; 64 - (NSLineCapStyle)lineCap; 65 66 - (void)setMiterLimit:(CGFloat)limit; 67 - (CGFloat)miterLimit; 68 69 /** sets the current selected control point */ 70 - (void)setCurrentPoint:(GRObjectControlPoint *)aPoint; 71 72 /** returns the currently selected control point */ 73 - (GRObjectControlPoint *)currentPoint; 74 75 /** recompute the path object based on its controlpoints */ 76 - (void)remakePath; 77 78 @end 79