From cb69d2e1c7ced951cbf7a31ee286b0ed92cab8a8 Mon Sep 17 00:00:00 2001 From: rcoh Date: Fri, 18 Feb 2011 16:56:43 -0500 Subject: Adding Epydoc generated docs. --- html/SmootLight.behaviors.Oval-pysrc.html | 150 ++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 html/SmootLight.behaviors.Oval-pysrc.html (limited to 'html/SmootLight.behaviors.Oval-pysrc.html') diff --git a/html/SmootLight.behaviors.Oval-pysrc.html b/html/SmootLight.behaviors.Oval-pysrc.html new file mode 100644 index 0000000..95bc7f0 --- /dev/null +++ b/html/SmootLight.behaviors.Oval-pysrc.html @@ -0,0 +1,150 @@ + + + + + SmootLight.behaviors.Oval + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package SmootLight :: + Package behaviors :: + Module Oval + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module SmootLight.behaviors.Oval

+
+ 1  from operationscore.Behavior import * 
+
2 -class Oval(Behavior): +
3 - def processResponse(self, sensors, recurs): +
4 ret = [] + 5 for data in sensors: + 6 #import pdb; pdb.set_trace() + 7 height = width = 1 + 8 if 'Height' in self: + 9 height = 1/float(self['Height']) +10 if 'Width' in self: +11 width = 1/float(self['Width']) +12 if 'CenterLoc' in data: +13 xLoc = data['CenterLoc'][0] +14 yLoc = data['CenterLoc'][1] +15 else: +16 data['CenterLoc'] = tuple(data['Location']) +17 xLoc = data['Location'][0] +18 yLoc = data['Location'][1] +19 if not self['Id']+'Radius' in data: +20 data[self['Id']+'Radius'] = self['Radius'] +21 rad = data[self['Id']+'Radius'] +22 cond = '>=' if self['Outside'] else '<=' +23 circleStr = \ +24 'math.sqrt((({x}-%(xLoc)d))**2*%(width)d+(({y}-%(yLoc)d)**2)*%(height)d)%(cond)s%(rad)d' % \ +25 locals() +26 if self['Combine']: +27 data['Location'] += ',' + circleStr +28 else: +29 data['Location'] = circleStr +30 ret.append(data) +31 return (ret, []) +
32 - def setLastOutput(self, output): +
33 coutput = Behavior.deepCopyPacket(output) +34 for data in coutput: +35 data['Location'] = data['CenterLoc'] +36 return coutput +
37 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + -- cgit v1.2.3