Current Projects
Software Engineering Abstractions for the Multi-Touch Revolution
2010-01-05, by Lode Hoste - Language: Rule language
Multi-touch interfaces are inherently concurrent and provide a continuously stream of events,
which makes it very hard to implement advanced and collaborative gestures using traditional event handlers.
We propose a rule based language extended with spatio-temporal operators that allows a high-level approach for describing gestures.
(defrule Drag
(declare (salience 5))
?eventList[] <- (setof Cursor (same: tuioId) (tWithin: 500)
(min: 2) (retract: all_but_one))
?image <- (Image)
(test (inside ?eventList[0].x ?eventList[0].y
?image.x ?image.y ?image.width ?image.height))
(not
(and (Cursor (x ?x) (y ?y) {(tuioId <> ?eventList[0].tuioId)})
(test (inside ?x ?y ?image.x ?image.y ?image.width ?image.height))))
=>
(printout t "drag detected!")
(assert (Drag (events ?eventList[]) (image ?image))))
(defrule DoubleTap
(declare (salience 6))
?a1 <- (Tap (tuio_id ?aId) (objectFact ?cId))
?a2 <- (Tap (tuio_id ?aId) (objectFact ?cId) {on < (+ ?a1.time 1200)})
(test (approxEqualDistance ?a1.x ?a1.y ?a2.x ?a2.y))
=>
(printout t "DoubleTap" crlf)
(retract ?a1)
(retract ?a2)
(assert (DoubleTap (id ?a1.UID) (tuioId ?aId)
(x ?a1.x) (y ?a1.y) (on ?a2.time)
(objectFact ?cId))))
(defrule CircleMerge
(declare (salience 7))
?a1 <- (Gesture (type "CircleCW"))
?a2 <- (Gesture (type "CircleCCW"))
?c1 <- (Image)
?c2 <- (Image)
(test (approxEqualTime ?a1.time ?a2.time))
(test (< ?a1.xl ?a2.xl))
(test (inside ?a1.xl ?a1.yl ?c1.x ?c1.y ?c1.w ?c1.h))
(test (inside ?a2.xl ?a2.yl ?c2.x ?c2.y ?c2.w ?c2.h))
=>
(printout t "CircleMerge (" ?a1.xl ", "?a1.yl")
("?c1.x ","?c1.y ")" crlf)
(retract ?a1)
(retract ?a2)
(?c1.OBJECT merge ?c2.OBJECT))
Older engine and syntax:
(defrule myTap
(declare (salience 100))
(SetOf
(TUIO_Event ?fingerID,_,_,Within: 300),
?eventList),
?eventList[0].state == BIRTH,
(isListOf ?eventList[1..-2].state, MOVE),
?eventList[-1].state == DEATH,
(veryNearPosition ?eventList)
=>
(assert (Tap ?fingerID, ?eventList[0].position, ?eventList[-1].time)))
% Tap event with: fingerID, position and time
(defrule myDoubleTap
(declare (salience 110))
% Higher priority than Tap, which means the behaviour of
% http://msdn.microsoft.com/en-us/library/ms171543%28VS.80%29.aspx
% in 1 line
(Tap ?fingerID, ?position1, ?time1)
(Tap ?fingerID, ?position2, ?time2)
% one ?fingerID variable, which means it should be the same finger.
(< (- ?time2 ?time1) 550)
% 550 milliseconds as default double tap (or double click) timeout
(veryNearPosition ?position1 ?position2)
=>
(assert (DoubleTap ?fingerID, ?position1, ?time2)))
% DoubleTap event with: fingerID, position and time
(defrule myCircleDrag
(declare (salience 80))
(SetOf
(TUIO_Event ?fingerID,_,_,Within: 200),
?eventList),
(isListOf ?eventList[1..-2].state, MOVE),
% We ignore the state of event[0] and event[-1] as it is allowed to be
% a BIRTH (New Drag), MOVE (Drag was matched before) or
% DEATH (will be filtered out as event[1] will not a a move)
% This allows us to have multiple "drags" without the user notices it,
% as it will be observed as one smooth gesture.
(Circle ?circleID, ?circlePosition, ?circleRadius)
% Circle as a fact in the database. This provides a clean symbiosis
% between the GUI elements and the Gestures
(< (distance ?eventList[0].position ?circlePosition)
?circleRadius)
=>
(assert (Drag ?fingerID, ?circleID,
?eventList[0].position,
?eventList[-1].position)))
Ambigraffle
2007-12-10, by Lode Hoste - Language: Ambienttalk
This project consists of implementing a distributed white-board for mobile ad-hoc networks. You can read more info about it here.
Publication management system
2007-10-02, by Thierry Coppens, Elke Durwael, Nicolas Greant, Yuri Herman, Lode Hoste and Ben Maene - Language: Ruby
The system should maintain a database with various information about publications (including bibliography, references, authors, ...). You can view our project website here.