forked from nickzman/fieldlines
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FieldLinesView.h
129 lines (96 loc) · 2.47 KB
/
FieldLinesView.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
//
// FieldLinesView.h
// FieldLines
//
// Created by pecos on Tue Oct 02 2001.
// Copyright (c) 2001 __CompanyName__. All rights reserved.
//
#import <AppKit/AppKit.h>
#import <ScreenSaver/ScreenSaver.h>
#include <time.h>
#import <OpenGL/gl.h>
#import <OpenGL/glu.h>
/* each drawn line is represented as a LineSegment */
typedef struct xpoint_s
{
int x;
int y;
} XPoint;
typedef struct {
float red;
float green;
float blue;
} RGBcolor;
class ion{
public:
float charge;
float xyz[3];
float vel[3];
float angle;
float anglevel;
inline ion(int dSpeed, int min, int max);
inline ~ion();
inline void update(int dSpeed);
};
@interface FieldLinesView : ScreenSaverView {
BOOL mainMonitorOnly;
BOOL thisScreenIsOn;
NSOpenGLView *_view;
BOOL _viewAllocated;
BOOL _initedGL;
BOOL initialized;
time_t targetTime;
/****** non-user-modifiable immutable definitions */
/* width and height of the window */
int windowWidth;
int windowHeight;
/* center position of the window */
int centerX;
int centerY;
RGBcolor *gcs; /* array of colors */
ion* ions;
/* parameters that are user configurable */
int dIons, ionsNo;
IBOutlet id IBdIons;
IBOutlet id IBdIonsTxt;
int minCharge, maxCharge;
IBOutlet id IBminCharge;
IBOutlet id IBmaxCharge;
IBOutlet id IBChargeTxt;
int dSpeed;
IBOutlet id IBdSpeed;
IBOutlet id IBdSpeedTxt;
BOOL dConstwidth;
IBOutlet id IBdConstwidth;
int dWidth;
IBOutlet id IBdWidth;
IBOutlet id IBdWidthTxt;
int dStepSize;
IBOutlet id IBdStepSize;
IBOutlet id IBdStepSizeTxt;
int dMaxSteps;
IBOutlet id IBdMaxSteps;
IBOutlet id IBdMaxStepsTxt;
BOOL dElectric;
IBOutlet id IBdElectric;
int updateDelay;
IBOutlet id IBupdateDelay;
IBOutlet id IBupdateDelayTxt;
int colorMode;
IBOutlet id IBColorsTxt;
IBOutlet id IBColors;
// int maxcharge; // max charge in the system;
// float minRep, maxRep;
IBOutlet id configureSheet;
IBOutlet id IBversionNumberField;
IBOutlet id IBmainMonitorOnly;
IBOutlet id IBCancel;
IBOutlet id IBSave;
}
- (IBAction) closeSheet_save:(id) sender;
- (IBAction) closeSheet_cancel:(id) sender;
- (IBAction) sheet_update:(id) sender;
- (GLvoid) InitGL;
- (void) drawfieldline:(int) source the_x:(float) x the_y:(float) y the_z:(float) z;
- (void) setup_all;
@end