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