53 |
def pa(*s): |
def pa(*s): |
54 |
print 'buoymanager::',s |
print 'buoymanager::',s |
55 |
|
|
|
class DummyGeometryConfiguration(BuoyGeometryConfiguration): |
|
|
"""A dummy constant geometry. |
|
|
""" |
|
|
def __init__(self): |
|
|
self.buoyMainViewGeometer = vob.buoy.impl.RatioMainGeometer( |
|
|
.21, .25, .6, .5) |
|
|
self.buoySizer = vob.buoy.impl.AspectBuoySizer(400, 400, 1.5) |
|
|
self.buoyGeometer = vob.buoy.impl.RatioBuoyOnCircleGeometer( |
|
|
.1, .1, .8, .8) |
|
|
def getMainViewGeometer(self, node): |
|
|
return self.buoyMainViewGeometer |
|
|
def getSizer(self, node, connector): |
|
|
return self.buoySizer |
|
|
def getGeometer(self, node, connector): |
|
|
return self.buoyGeometer |
|
|
def getGeometers(self, node): |
|
|
return [self.buoyGeometer] |
|
|
|
|
56 |
pa("LOADING BUOYMANAGER") |
pa("LOADING BUOYMANAGER") |
57 |
class SingleFocusManager(BuoyLinkListener): |
class SingleFocusManager(BuoyLinkListener): |
58 |
"""Manage buoys through the new APIs |
"""Manage buoys through the new APIs |
205 |
|
|
206 |
class MultiBuoyManager: |
class MultiBuoyManager: |
207 |
def __init__(self, mainNodes, connectors, eventHandler, |
def __init__(self, mainNodes, connectors, eventHandler, |
208 |
geometer, buoyGeometryConfiguration = DummyGeometryConfiguration()): |
geometer, buoyGeometryConfiguration): |
209 |
self.singles = [ |
self.singles = [ |
210 |
SingleFocusManager(i, connectors, buoyGeometryConfiguration) for i in mainNodes] |
SingleFocusManager(i, connectors, buoyGeometryConfiguration) for i in mainNodes] |
211 |
self.buoyGeometryConfiguration = buoyGeometryConfiguration |
self.buoyGeometryConfiguration = buoyGeometryConfiguration |
312 |
return 0 |
return 0 |
313 |
|
|
314 |
vob.impl.gl.GLScreen.dbg = 0 |
vob.impl.gl.GLScreen.dbg = 0 |
|
|
|
|
class SingleGeometer: |
|
|
def place(self, vs): |
|
|
ctrx = vs.size.width / 2 |
|
|
ctry = vs.size.height * .485 # A *little* above real ctr |
|
|
|
|
|
center = vs.translateCS(0, "FocusCenter", ctrx, ctry) |
|
|
|
|
|
mainbox = vs.orthoBoxCS(center, "MainFrame", 0, |
|
|
-vs.size.width * .5, -vs.size.height * .5, |
|
|
1, 1, |
|
|
vs.size.width, vs.size.height); |
|
|
|
|
|
return [(mainbox, None, None)] |
|
|
|
|
|
|
|