-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModeMakerDoc.h
100 lines (89 loc) · 3.08 KB
/
ModeMakerDoc.h
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//
// MyDocument.h
// ModeMaker
//
// Created by David Hirsch on 9/21/09.
// Copyright Western Washington University 2009 . All rights reserved.
//
// NSDocument is a Model and a Controller!
#import <Cocoa/Cocoa.h>
#import "Phase.h"
#define kModeMakerDocumentType @"ModeMaker Document"
#define kModeMakerDocumentUTI @"com.davehirsch.modemaker.document"
#define kModeMakerExtension @"modemaker"
@class ModeImageView;
@interface ModeMakerDoc : NSDocument
{
NSMutableArray *phases; // NSArray, although we know we'll only have a small number of phases; probably only 1 or 2 in general.
IBOutlet
NSArrayController *phaseController;
IBOutlet
NSProgressIndicator *progressIndicator;
IBOutlet
NSDrawer *settingsDrawer;
IBOutlet
NSButton *drawerToggleButton;
NSRect storedWindowFrame;
float canvasSizeH, canvasSizeV; // size of final canvas (in aribtrary float units). Note that particles must be
// placed on an enlarged canvas, to avoid edge effects, and that there will need to
// be tranformations applied to get this canvas drawn correctly into the view or
// other graphics context
NSColor *backgroundColor;
NSArray *shapes;
IBOutlet
ModeImageView *imageView;
BOOL imageCreated;
BOOL haveDisplayedOverlapWarning;
BOOL haveDisplayed90PercentWarning;
IBOutlet
NSTextField *modeTargetField;
IBOutlet
NSTextField *modeTargetErrorField;
IBOutlet
NSTextField *sizeField;
IBOutlet
NSTextField *sizeSDField;
IBOutlet
NSTextField *aspectRatioField;
IBOutlet
NSTextField *aspectRatioSDField;
IBOutlet
NSTextField *complexityField;
IBOutlet
NSTextField *complexitySDField;
IBOutlet
NSTextField *fabricStrengthField;
NSSize lastCanvasSize; // last-used canvas size (or the canvas size appropriate to the loaded document)
BOOL needToResizeForLoad; // whether we have loaded in a document that requires the window to be in a new size
}
- (NSSize) getCanvasSize;
- (NSColor*) backgroundColor;
- (void) setBackgroundColor: (NSColor*)input;
- (IBAction) toggleDrawer: (id) sender;
- (IBAction) exportToPDF: (id) sender;
- (void) didEndSavePDFSheet: (NSSavePanel *) savePanel
returnCode: (int) returnCode
contextInfo: (void *) contextInfo;
- (IBAction) exportToPNG: (id) sender;
- (void) didEndSavePNGSheet: (NSSavePanel *) savePanel
returnCode: (int) returnCode
contextInfo: (void *) contextInfo;
- (IBAction)addPhase:(id)sender;
- (void) addThisPhase: (Phase *) inPhase
atPosition: (short) inPos;
- (IBAction)removePhase:(id)sender;
- (void) removeThisPhase: (Phase *) inPhase;
- (IBAction)promotePhase:(id)sender;
- (IBAction)demotePhase:(id)sender;
- (BOOL) settingsAreValid;
- (IBAction)makePhases:(id)sender;
- (void)measureModesWithPoints: (long) inNumMonteCarloPoints upToPhase:(Phase *) inLimitPhase;
- (float) getRoughModeUpTo: (Phase *) inLimitPhase;
- (BOOL)areModesCorrect;
- (BOOL)adjustModesAtIteration: (int) iterationNum;
- (void)drawPhases;
- (void) closeIfEmptyAndClean;
// Accessors
- (NSArray *)phases;
- (void)setPhases:(NSMutableArray *)inPhases;
@end