Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

open-axiom repository from github

24005 views
1
/*
2
Copyright (C) 1991-2002, The Numerical ALgorithms Group Ltd.
3
All rights reserved.
4
Copyright (C) 2007-2008, Gabriel Dos Reis.
5
All rights reserved.
6
7
Redistribution and use in source and binary forms, with or without
8
modification, are permitted provided that the following conditions are
9
met:
10
11
- Redistributions of source code must retain the above copyright
12
notice, this list of conditions and the following disclaimer.
13
14
- Redistributions in binary form must reproduce the above copyright
15
notice, this list of conditions and the following disclaimer in
16
the documentation and/or other materials provided with the
17
distribution.
18
19
- Neither the name of The Numerical ALgorithms Group Ltd. nor the
20
names of its contributors may be used to endorse or promote products
21
derived from this software without specific prior written permission.
22
23
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
24
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
25
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
26
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
27
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
*/
35
36
/*#define rightLeft*/
37
#define leftRight
38
#define newStuff
39
40
/******* Define's ********/
41
/*** box colors ***/
42
#define boxInline monoColor(140)
43
#define boxOutline monoColor(140)
44
#define clipBoxInline monoColor(148)
45
#define clipBoxOutline monoColor(148)
46
47
#define lightB 205
48
#define lightPotA (control->buttonQueue[lightMoveZ].buttonY - 15)
49
#define lightPotB (control->buttonQueue[lightMoveZ].buttonY +\
50
control->buttonQueue[lightMoveZ].buttonHeight + 7)
51
#define lightTransL (control->buttonQueue[lightTranslucent].buttonX - 20)
52
53
#define volumeTitleColor monoColor(77)
54
#define volumeTitleA 190
55
#define volumeTitleB 217
56
57
#define volumeMASK ExposureMask
58
59
#define frustrumColor monoColor(147)
60
#define frustrumX 30
61
#define frustrumY 20
62
#define frustrumLength 100
63
#define frustrumMidY 70 /* frustrumY + frustrumLength/2 */
64
#define frustrumBotY (frustrumY + frustrumLength)
65
#ifdef newStuff
66
#define frustrumMin (control->buttonQueue[frustrumBut].xHalf)
67
#define frustrumMax (frustrumMin + \
68
(control->buttonQueue[frustrumBut].xHalf))
69
#endif
70
71
#define hitherColor monoColor(68) /* clipping plane */
72
#define hitherMinX (frustrumX + 5)
73
#define hitherMaxX (frustrumMin - 30)
74
#define hitherWinX (hitherMinX - 5)
75
#define hitherWinY (frustrumBotY + 10)
76
#define hitherWidth (hitherMaxX - hitherMinX + 10)
77
#define hitherHeight 20
78
#define hitherBarY (hitherWinY + 10) /* hitherWinY + hitherHeight/2 */
79
80
#ifdef newStuff
81
#define eyeColor monoColor(131)
82
#define eyeMinX frustrumMin
83
#define eyeMaxX frustrumMax
84
#define eyeWinX (eyeMinX - 5)
85
#define eyeWinY hitherWinY
86
#define eyeWidth (eyeMaxX - eyeMinX + 10)
87
#define eyeHeight hitherHeight
88
#define eyeBarY hitherBarY
89
#endif
90
91
#define volumeButtonColor monoColor(157)
92
93
#define frustrumWindowX 30
94
#define frustrumWindowY 28
95
#define frustrumWindowWidth (controlWidth - 60)
96
#define frustrumWindowHeight (frustrumBotY + 40)
97
98
/**** clip volume ****/
99
#define lengthFace 80
100
#ifdef rightLeft
101
#define backFaceX 190
102
#endif
103
#ifdef leftRight
104
#define backFaceX 33
105
#endif
106
#define backFaceY 255
107
#define deltaFace 25
108
#define zLength 35.355 /* sqrt(2*deltaFace^2) */
109
#ifdef rightLeft
110
#define frontFaceX (backFaceX - deltaFace)
111
#endif
112
#ifdef leftRight
113
#define frontFaceX (backFaceX + deltaFace)
114
#endif
115
#define frontFaceY (backFaceY + deltaFace)
116
117
118
#define majorAxis lengthFace /* size of the potentiometers */
119
#define minorAxis 20
120
#define midAxis 40
121
122
#define clipXButX backFaceX
123
#define clipXButY (backFaceY-30)
124
125
#ifdef rightLeft
126
#define clipYButX (frontFaceX - minorAxis - 10)
127
#endif
128
#ifdef leftRight
129
#define clipYButX (frontFaceX + lengthFace + 10)
130
#endif
131
#define clipYButY frontFaceY
132
133
#ifdef rightLeft
134
#define clipZButX clipYButX /* align left side */
135
#endif
136
#ifdef leftRight
137
#define clipZButX (clipYButX+minorAxis-midAxis) /* align right side */
138
#endif
139
#define clipZButY clipXButY
140
141
#define zFactor 0.6 /* ratio of clipZBut box & actual input area */
142
#define minDistXY 0.1 /* min distance between normalized clip faces */
143
#define minDistZ 0.06 /* 2/3 of XY */
144
145
146
#ifdef rightLeft
147
#define AA (clipZButX + midAxis)
148
#define BB clipZButY
149
#define CC backFaceX
150
#define DD backFaceY
151
#define EE frontFaceX
152
#define FF frontFaceY
153
#define clipZButTopEndX ((AA+BB+CC-DD)/2)
154
#define clipZButTopEndY ((AA+BB-CC+DD)/2)
155
#define clipZButBotEndX ((AA+BB+EE-FF)/2)
156
#define clipZButBotEndY ((AA+BB-EE+FF)/2)
157
#endif
158
159
#ifdef leftRight
160
#define AA clipZButX
161
#define BB clipZButY
162
#define CC (backFaceX + majorAxis)
163
#define DD backFaceY
164
#define EE (frontFaceX + majorAxis)
165
#define FF frontFaceY
166
167
#define clipZButTopEndX ((AA-BB+CC+DD)/2)
168
#define clipZButTopEndY ((BB-AA+CC+DD)/2)
169
#define clipZButBotEndX ((AA-BB+EE+FF)/2)
170
#define clipZButBotEndY ((BB-AA+EE+FF)/2)
171
#endif
172
173