From 6e0e6869a5ee1e4963071a18f24aa4dfdd442689 Mon Sep 17 00:00:00 2001 From: rcoh Date: Sun, 13 Feb 2011 16:03:39 -0500 Subject: Added a circle behavior to make circles. Added ContinuousCenterInput to do what it says. Modified SimpleMapper a bit. --- pixelmappers/SimpleMapper.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'pixelmappers') diff --git a/pixelmappers/SimpleMapper.py b/pixelmappers/SimpleMapper.py index 1568de3..6603c98 100644 --- a/pixelmappers/SimpleMapper.py +++ b/pixelmappers/SimpleMapper.py @@ -1,11 +1,13 @@ from operationscore.PixelMapper import * import util.Geo as Geo +import math import sys class SimpleMapper(PixelMapper): """SimpleMapper is a PixelMapper which maps events to the nearest Pixel. It also supports strings of the form: - {x}>5, {y}<10, {x}*{y}<{x}, etc. (Conditons, separated by commas. and and or may also be - used).""" + {x}>5, {y}<10, {x}*{y}<{x}, etc. (Conditions, separated by commas. Standard python syntax such + as and and or may also be + used). You may use 'math.' functions such as math.sqrt, etc. It also accepts lists of strings""" def mappingFunction(self, eventLocation, screen): if type(eventLocation) == type(tuple()): bestDist = sys.maxint @@ -24,10 +26,14 @@ class SimpleMapper(PixelMapper): else: #{x}>5,{y}