157 |
|
|
158 |
|
|
159 |
class DoubleGeometer: |
class DoubleGeometer: |
160 |
def place(self, vs): |
def __init__(self): |
161 |
ctrx = vs.size.width / 2 |
self.split = .5 |
162 |
ctry = vs.size.height * .485 # A *little* above real ctr |
self.height = 100 |
163 |
|
self.width = 100 |
164 |
|
def _doset(self, vs): |
165 |
|
|
166 |
|
h0 = self.split * self.height |
167 |
|
h1 = (1-self.split) * self.height |
168 |
|
|
169 |
mainsize = vs.size.width * .6 |
mainsize = vs.size.width * .6 |
170 |
|
w0 = (self.split ** 0.5) * mainsize |
171 |
|
w1 = ((1-self.split) ** 0.5) * mainsize |
172 |
|
|
173 |
buoywidth = vs.size.width * .5 |
s0 = self.split ** .5 |
174 |
buoyheight = vs.size.height * .8 |
s1 = (1-self.split) ** .5 |
175 |
|
|
176 |
|
ctrx = self.width / 2 |
177 |
|
|
178 |
|
buoywidth0 = w0 * 1.4 |
179 |
|
buoyheight0 = h0 * 1.2 |
180 |
|
|
181 |
|
buoywidth1 = w1 * 1.4 |
182 |
|
buoyheight1 = h1 * 1.2 |
183 |
|
|
184 |
|
print "SET DOUBLE ", h0, h1, w0, w1, s0, s1, buoywidth0, buoywidth1 |
185 |
|
|
186 |
|
vs.coords.setOrthoBoxParams(self.into1, 0, |
187 |
|
ctrx - .5*w0, 0, |
188 |
|
s0, s0, |
189 |
|
w0, h0) |
190 |
|
|
191 |
|
vs.coords.setOrthoBoxParams(self.into2, 0, |
192 |
|
ctrx - .5*w1, 0+h0, |
193 |
|
s1, s1, |
194 |
|
w1, h1) |
195 |
|
|
196 |
|
vs.coords.setOrthoBoxParams(self.buoyinto1, 0, |
197 |
|
ctrx - .5*buoywidth0, 0 + .5*h0 - .5*buoyheight0, |
198 |
|
s0, s0, |
199 |
|
buoywidth0, buoyheight0) |
200 |
|
|
201 |
|
vs.coords.setOrthoBoxParams(self.buoyinto2, 0, |
202 |
|
ctrx - .5*buoywidth0, 0 + h0 + .5*h1 - .5*buoyheight1, |
203 |
|
s1, s1, |
204 |
|
buoywidth1, buoyheight1) |
205 |
|
|
206 |
into1 = vs.orthoBoxCS(0, "FocusFrame1", 0, |
|
207 |
ctrx -.5*mainsize, .5 * ctry -.25*mainsize, |
def place(self, vs): |
208 |
1, 1, mainsize, .5*mainsize) |
self.height = vs.size.height |
209 |
|
self.width = vs.size.width |
210 |
into2 = vs.orthoBoxCS(0, "FocusFrame2", 0, |
self.into1 = vs.orthoBoxCS(0, "FocusFrame1", 0, 0, 0, 0, 0, 0, 0) |
211 |
ctrx -.5*mainsize, 1.5 * ctry -.25*mainsize, |
self.into2 = vs.orthoBoxCS(0, "FocusFrame2", 0, 0, 0, 0, 0, 0, 0) |
212 |
1, 1, mainsize, .5*mainsize) |
|
213 |
|
self.buoyinto1 = vs.orthoBoxCS(0, "BuoyFrame1", 0, 0, 0, 0, 0, 0, 0) |
214 |
buoyinto1 = vs.orthoBoxCS(0, "BuoyFrame1", 0, |
self.buoyinto2 = vs.orthoBoxCS(0, "BuoyFrame2", 0, 0, 0, 0, 0, 0, 0) |
215 |
ctrx -buoywidth/2, .5 * ctry -buoyheight/2, 1, 1, |
|
216 |
buoywidth, buoyheight) |
self._doset(vs) |
217 |
|
|
218 |
buoyinto2 = vs.orthoBoxCS(0, "BuoyFrame2", 0, |
return [(self.into1, self.buoyinto1), (self.into2, self.buoyinto2)] |
219 |
ctrx -buoywidth/2, 1.5 * ctry -buoyheight/2, 1, 1, |
|
220 |
buoywidth, buoyheight) |
def mouse(self, ev, oldvs): |
221 |
|
print ev |
222 |
|
if ev.getID() == ev.MOUSE_WHEEL: |
223 |
|
print "WHEEL" |
224 |
|
r = ev.getWheelRotation() |
225 |
|
self.split -= .03 * r |
226 |
|
self._doset(oldvs) |
227 |
|
vob.AbstractUpdateManager.setNoAnimation() |
228 |
|
vob.AbstractUpdateManager.chg() |
229 |
|
return 1 |
230 |
|
|
231 |
return [(into1, buoyinto1), (into2, buoyinto2)] |
return 0 |
232 |
|
|
233 |
|
|
234 |
class Scene(vob.buoy.buoymanager.MultiBuoyManager): |
class Scene(vob.buoy.buoymanager.MultiBuoyManager): |