.. | .. |
---|
2 | 2 | |
---|
3 | 3 | class Torus extends Biparam implements java.io.Serializable |
---|
4 | 4 | { |
---|
| 5 | + static final long serialVersionUID = -7637054329820073252L; // Old |
---|
| 6 | + |
---|
5 | 7 | Torus() |
---|
6 | 8 | { |
---|
7 | 9 | inPnt = new cVector(); |
---|
.. | .. |
---|
62 | 64 | v = 0; |
---|
63 | 65 | |
---|
64 | 66 | double uAng = u * 2 * Math.PI; |
---|
65 | | - double vAng = v * 2 * Math.PI; |
---|
| 67 | + double vAng = -v * 2 * Math.PI; |
---|
66 | 68 | double cosua = Math.cos(uAng); |
---|
67 | 69 | double sinua = Math.sin(uAng); |
---|
68 | 70 | double cosva = Math.cos(vAng); |
---|
.. | .. |
---|
116 | 118 | return rad2 <= minor * minor; |
---|
117 | 119 | } |
---|
118 | 120 | |
---|
119 | | - void drawEditHandles(ClickInfo info, int level) |
---|
| 121 | + void drawEditHandles(//ClickInfo info, |
---|
| 122 | + int level) |
---|
120 | 123 | { |
---|
121 | 124 | if (level == 0) |
---|
122 | 125 | { |
---|
123 | 126 | return; |
---|
124 | 127 | } else |
---|
125 | 128 | { |
---|
126 | | - super.drawEditHandles(info, level); |
---|
| 129 | + super.drawEditHandles(//info, |
---|
| 130 | + level); |
---|
127 | 131 | cVector temp = LA.newVector(0, 0, minor); |
---|
128 | 132 | LA.xformPos(temp, toParent, temp); |
---|
129 | | - Rectangle majorSpot = calcHotSpot(temp, info); |
---|
| 133 | + Rectangle majorSpot = calcHotSpot(temp); //, info); |
---|
130 | 134 | majorSpot.translate(4, 4); |
---|
131 | 135 | temp.x = major; |
---|
132 | 136 | temp.y = temp.z = 0; |
---|
133 | 137 | LA.xformPos(temp, toParent, temp); |
---|
134 | | - Rectangle minorSpot = calcHotSpot(temp, info); |
---|
| 138 | + Rectangle minorSpot = calcHotSpot(temp); //, info); |
---|
135 | 139 | minorSpot.translate(4, 4); |
---|
136 | | - info.g.setColor(Color.green); |
---|
137 | | - info.g.fillRect(majorSpot.x, majorSpot.y, majorSpot.width, majorSpot.height); |
---|
138 | | - info.g.fillRect(minorSpot.x, minorSpot.y, minorSpot.width, minorSpot.height); |
---|
| 140 | + clickInfo.g.setColor(Color.green); |
---|
| 141 | + clickInfo.g.fillRect(majorSpot.x, majorSpot.y, majorSpot.width, majorSpot.height); |
---|
| 142 | + clickInfo.g.fillRect(minorSpot.x, minorSpot.y, minorSpot.width, minorSpot.height); |
---|
139 | 143 | return; |
---|
140 | 144 | } |
---|
141 | 145 | } |
---|
142 | 146 | |
---|
143 | | - boolean doEditClick(ClickInfo info, int level) |
---|
| 147 | + boolean doEditClick(//ClickInfo info, |
---|
| 148 | + int level) |
---|
144 | 149 | { |
---|
145 | 150 | if (level == 0) |
---|
146 | 151 | return false; |
---|
147 | 152 | hitSomething = 0; |
---|
148 | | - if (super.doEditClick(info, level)) |
---|
| 153 | + if (super.doEditClick(//info, |
---|
| 154 | + level)) |
---|
149 | 155 | { |
---|
150 | 156 | hitSomething = 1; |
---|
151 | 157 | return true; |
---|
152 | 158 | } |
---|
153 | 159 | cVector temp = LA.newVector(0, 0, minor); |
---|
154 | 160 | LA.xformPos(temp, toParent, temp); |
---|
155 | | - Rectangle majorSpot = calcHotSpot(temp, info); |
---|
| 161 | + Rectangle majorSpot = calcHotSpot(temp); //, info); |
---|
156 | 162 | majorSpot.translate(4, 4); |
---|
157 | 163 | temp.x = major; |
---|
158 | 164 | temp.y = temp.z = 0; |
---|
159 | 165 | LA.xformPos(temp, toParent, temp); |
---|
160 | | - Rectangle minorSpot = calcHotSpot(temp, info); |
---|
| 166 | + Rectangle minorSpot = calcHotSpot(temp); //, info); |
---|
161 | 167 | minorSpot.translate(4, 4); |
---|
162 | | - if (majorSpot.contains(info.x, info.y)) |
---|
| 168 | + if (majorSpot.contains(clickInfo.x, clickInfo.y)) |
---|
163 | 169 | { |
---|
164 | 170 | hitSomething = 2; |
---|
165 | 171 | startRad = major; |
---|
166 | 172 | } else |
---|
167 | | - if (minorSpot.contains(info.x, info.y)) |
---|
| 173 | + if (minorSpot.contains(clickInfo.x, clickInfo.y)) |
---|
168 | 174 | { |
---|
169 | 175 | hitSomething = 3; |
---|
170 | 176 | startRad = minor; |
---|
.. | .. |
---|
172 | 178 | { |
---|
173 | 179 | return false; |
---|
174 | 180 | } |
---|
175 | | - startX = info.x; |
---|
| 181 | + startX = clickInfo.x; |
---|
176 | 182 | return true; |
---|
177 | 183 | } |
---|
178 | 184 | |
---|
179 | | - void doEditDrag(ClickInfo info, boolean opposite) |
---|
| 185 | + void doEditDrag(//ClickInfo info, |
---|
| 186 | + boolean opposite) |
---|
180 | 187 | { |
---|
181 | 188 | if (hitSomething == 0) |
---|
182 | 189 | return; |
---|
183 | 190 | if (hitSomething == 1) |
---|
184 | 191 | { |
---|
185 | | - super.doEditDrag(info, opposite); |
---|
| 192 | + super.doEditDrag(//info, |
---|
| 193 | + opposite); |
---|
186 | 194 | return; |
---|
187 | 195 | } |
---|
188 | | - double deltaR = info.x - startX; |
---|
| 196 | + double deltaR = clickInfo.x - startX; |
---|
189 | 197 | //cVector delta = LA.newVector(info.x - startX, 0, 0); |
---|
190 | 198 | //LA.xformDir(delta, info.camera.fromScreen, delta); |
---|
191 | | - deltaR /= 100 * info.camera.SCALE / info.camera.Distance(); |
---|
| 199 | + deltaR /= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance(); |
---|
192 | 200 | double newRad = startRad + deltaR; |
---|
193 | 201 | if (newRad < 0) |
---|
194 | 202 | newRad = 0; |
---|
.. | .. |
---|
197 | 205 | else |
---|
198 | 206 | minor = newRad; |
---|
199 | 207 | recalculate(); |
---|
200 | | - info.pane.repaint(); |
---|
| 208 | + clickInfo.pane.repaint(); |
---|
201 | 209 | } |
---|
202 | 210 | |
---|
203 | 211 | double major; |
---|