from geometry import AcceleratedPositionable class TouchPoint(AcceleratedPositionable): """ Representation of an object touching the screen. The simplest form of a touch object is a 'point', represented by an (x, y) position and a TUIO session id (sid). All dimensions are in pixels. """ def __init__(self, x, y, sid): super(TouchPoint, self).__init__(x, y) self.sid = sid # List of all windows this point is located in self.windows = [] def __str__(self): return '<%s at (%s, %s) sid=%d>' \ % (self.__class__.__name__, self.x, self.y, self.sid) def add_window(self, window): self.windows.append(window) def remove_window(self, window): self.windows.remove(window) def update_window_trackers(self, event_type): for window in self.windows: window.update_trackers(event_type, self) # TODO: Extend with more complex touch object, e.g.: #class TouchFiducial(TouchPoint): ...