Repository navigation
Expand file tree
/
Copy pathSketchModel.h
More file actions
52 lines (41 loc) · 1.41 KB
/
Copy pathSketchModel.h
File metadata and controls
52 lines (41 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// SketchModel.h
// Scribbler
//
// Created by Thomas Nägele on 20.05.10.
// Copyright 2010 xonic. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "PointModel.h"
#import "MainWindow.h"
#import "PathModel.h"
@class MainWindow;
@class PointModel;
@class SketchController;
@interface SketchModel : NSObject {
NSMutableArray * smoothedPaths;
NSMutableArray * currentPath;
MainWindow * window;
SketchController * controller;
}
@property (retain) NSMutableArray *currentPath;
@property (retain) NSMutableArray *smoothedPaths;
- (id) initWithController:(SketchController *)theController andWindow:(MainWindow *)theWindow;
// Basic adding and removing of paths and points
- (void) createNewPathAt:(NSPoint)inputPoint withColor:(NSColor *)theColor;
- (void) addPointToCurrentPath:(NSPoint)inputPoint;
- (void) saveCurrentPath;
- (void) removePathIntersectingWith:(NSPoint)inputPoint;
// Methods for adding and removing Paths to the array
// Needed for proper undo/redo implementation
- (void) insertPathModelIntoArray:(PathModel *)thePath;
- (void) removePathModelFromArray:(PathModel *)thePath;
// Smoothing path curves
- (void) smoothCurrentPath;
- (NSMutableArray *) getControlPoints:(NSMutableArray *)rhs;
// Repositioning
- (void) repositionPaths:(PointModel *)delta;
// Get stuff
- (NSArray *) getPointsOfPath:(NSMutableArray *)thePath;
- (NSColor *) getColorOfPath:(NSMutableArray *)thePath;
@end