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 _LIGHTBUT3D_C
37
#include "openaxiom-c-macros.h"
38
39
#include "header.h"
40
#include "cpanel.h"
41
42
#include "all_3d.H1"
43
/*****************************************************
44
* int initLightButtons (lightButtons) *
45
* *
46
* Creates the fields for each button window in the *
47
* three dimensional lighting subpanel, and returns *
48
* the number of buttons created. *
49
* *
50
*****************************************************/
51
52
int
53
initLightButtons (buttonStruct *lightButtons)
54
{
55
int ii;
56
int num = 0;
57
58
/* Not functional -- can be used to allow light window as a potentiometer */
59
ii = lightMove;
60
lightButtons[ii].buttonX = 63;
61
lightButtons[ii].buttonY = 30;
62
lightButtons[ii].buttonWidth = 171;
63
lightButtons[ii].buttonHeight = 171;
64
lightButtons[ii].buttonKey = ii;
65
lightButtons[ii].pot = yes; /* a potentiometer */
66
lightButtons[ii].mask = potMASK;
67
lightButtons[ii].textColor = 163;
68
lightButtons[ii].xHalf = lightButtons[ii].buttonWidth/2;
69
lightButtons[ii].yHalf = lightButtons[ii].buttonHeight/2;
70
++num;
71
72
/* Change x and y coordinate of light source */
73
ii = lightMoveXY;
74
lightButtons[ii].buttonX = 20;
75
lightButtons[ii].buttonY = 247;
76
lightButtons[ii].buttonWidth = 110;
77
lightButtons[ii].buttonHeight = 110;
78
lightButtons[ii].buttonKey = ii;
79
lightButtons[ii].pot = yes; /* a potentiometer */
80
lightButtons[ii].mask = potMASK;
81
lightButtons[ii].textColor = 133;
82
lightButtons[ii].xHalf = lightButtons[ii].buttonWidth/2;
83
lightButtons[ii].yHalf = lightButtons[ii].buttonHeight/2;
84
++num;
85
86
/* Change z coordinate of light source */
87
ii = lightMoveZ;
88
lightButtons[ii].buttonX = 149;
89
lightButtons[ii].buttonY = 247;
90
lightButtons[ii].buttonWidth = 58;
91
lightButtons[ii].buttonHeight = 110;
92
lightButtons[ii].buttonKey = ii;
93
lightButtons[ii].pot = yes; /* a potentiometer */
94
lightButtons[ii].mask = potMASK;
95
lightButtons[ii].textColor = 165;
96
lightButtons[ii].xHalf = lightButtons[ii].buttonWidth/2;
97
lightButtons[ii].yHalf = lightButtons[ii].buttonHeight/2;
98
++num;
99
100
/* Change intensity of light source */
101
ii = lightTranslucent;
102
lightButtons[ii].buttonX = 250;
103
lightButtons[ii].buttonY = 247;
104
lightButtons[ii].buttonWidth = 34;
105
lightButtons[ii].buttonHeight = 110;
106
lightButtons[ii].buttonKey = ii;
107
lightButtons[ii].pot = yes; /* a potentiometer */
108
lightButtons[ii].mask = potMASK;
109
lightButtons[ii].textColor = 37;
110
lightButtons[ii].xHalf = lightButtons[ii].buttonWidth/2;
111
lightButtons[ii].yHalf = lightButtons[ii].buttonHeight/2;
112
++num;
113
114
/* Leave lighting window without updating changes made. */
115
ii = lightAbort;
116
lightButtons[ii].buttonX = 36;
117
lightButtons[ii].buttonY = 370;
118
lightButtons[ii].buttonWidth = 110;
119
lightButtons[ii].buttonHeight = 24;
120
lightButtons[ii].buttonKey = ii;
121
lightButtons[ii].pot = no;
122
lightButtons[ii].mask = buttonMASK;
123
lightButtons[ii].text = "Abort";
124
lightButtons[ii].textColor = 52;
125
lightButtons[ii].xHalf = lightButtons[ii].buttonWidth/2;
126
lightButtons[ii].yHalf = lightButtons[ii].buttonHeight/2;
127
++num;
128
129
/* Leave lighting window and update changes made. */
130
ii = lightReturn;
131
lightButtons[ii].buttonX = 154;
132
lightButtons[ii].buttonY = 370;
133
lightButtons[ii].buttonWidth = 110;
134
lightButtons[ii].buttonHeight = 24;
135
lightButtons[ii].buttonKey = ii;
136
lightButtons[ii].pot = no;
137
lightButtons[ii].mask = buttonMASK;
138
lightButtons[ii].text = "Return";
139
lightButtons[ii].textColor = 28;
140
lightButtons[ii].xHalf = lightButtons[ii].buttonWidth/2;
141
lightButtons[ii].yHalf = lightButtons[ii].buttonHeight/2;
142
++num;
143
144
return(num);
145
}
146
147
148
149