Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
multitouch
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
multitouch
Commits
36348281
Commit
36348281
authored
Jun 04, 2012
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed class variable name format.
parent
dc48af59
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
src/tracker.py
src/tracker.py
+5
-5
src/tuio_server.py
src/tuio_server.py
+2
-2
No files found.
src/tracker.py
View file @
36348281
...
@@ -7,10 +7,10 @@ class GestureTracker(Logger):
...
@@ -7,10 +7,10 @@ class GestureTracker(Logger):
changing the state of touch points.
changing the state of touch points.
"""
"""
# Supported gesture types
# Supported gesture types
__gesture_types__
=
[]
gesture_types
=
[]
# Configurable properties (see configure() method)
# Configurable properties (see configure() method)
__configurable__
=
[]
configurable
=
[]
def
__init__
(
self
,
window
=
None
):
def
__init__
(
self
,
window
=
None
):
# Hashmap of gesture types
# Hashmap of gesture types
...
@@ -25,7 +25,7 @@ class GestureTracker(Logger):
...
@@ -25,7 +25,7 @@ class GestureTracker(Logger):
single gesture type. Optionally, (keyword) arguments that will be
single gesture type. Optionally, (keyword) arguments that will be
passed to the handler along with a Gesture object can be specified.
passed to the handler along with a Gesture object can be specified.
"""
"""
if
gesture_type
not
in
self
.
__gesture_types__
:
if
gesture_type
not
in
self
.
gesture_types
:
raise
ValueError
(
'Unsupported gesture type "%s".'
%
gesture_type
)
raise
ValueError
(
'Unsupported gesture type "%s".'
%
gesture_type
)
h
=
handler
,
args
,
kwargs
h
=
handler
,
args
,
kwargs
...
@@ -60,7 +60,7 @@ class GestureTracker(Logger):
...
@@ -60,7 +60,7 @@ class GestureTracker(Logger):
def
configure
(
self
,
**
kwargs
):
def
configure
(
self
,
**
kwargs
):
for
name
,
value
in
kwargs
.
iteritems
():
for
name
,
value
in
kwargs
.
iteritems
():
if
name
not
in
self
.
__configurable__
:
if
name
not
in
self
.
configurable
:
raise
ValueError
(
'%s.%s is not a configurable property.'
raise
ValueError
(
'%s.%s is not a configurable property.'
%
(
self
.
__class__
.
__name__
,
name
))
%
(
self
.
__class__
.
__name__
,
name
))
...
@@ -73,7 +73,7 @@ class GestureTracker(Logger):
...
@@ -73,7 +73,7 @@ class GestureTracker(Logger):
instead of:
instead of:
tracker.bind('gesture', ...)
tracker.bind('gesture', ...)
"""
"""
if
name
not
in
self
.
__gesture_types__
:
if
name
not
in
self
.
gesture_types
:
raise
AttributeError
(
"'%s' has no attribute '%s'"
raise
AttributeError
(
"'%s' has no attribute '%s'"
%
(
self
.
__class__
.
__name__
,
name
))
%
(
self
.
__class__
.
__name__
,
name
))
...
...
src/tuio_server.py
View file @
36348281
...
@@ -6,13 +6,13 @@ from screen import pixel_coords
...
@@ -6,13 +6,13 @@ from screen import pixel_coords
class
TuioServer2D
(
InputServer
):
class
TuioServer2D
(
InputServer
):
__tuio_address__
=
'localhost'
,
3333
tuio_address
=
'localhost'
,
3333
def
__init__
(
self
,
handler_obj
):
def
__init__
(
self
,
handler_obj
):
super
(
TuioServer2D
,
self
).
__init__
(
handler_obj
)
super
(
TuioServer2D
,
self
).
__init__
(
handler_obj
)
# OSC server that listens to incoming TUIO events
# OSC server that listens to incoming TUIO events
self
.
server
=
OSCServer
(
self
.
__tuio_address__
)
self
.
server
=
OSCServer
(
self
.
tuio_address
)
self
.
server
.
addDefaultHandlers
()
self
.
server
.
addDefaultHandlers
()
self
.
server
.
addMsgHandler
(
'/tuio/2Dobj'
,
self
.
_receive
)
self
.
server
.
addMsgHandler
(
'/tuio/2Dobj'
,
self
.
_receive
)
self
.
server
.
addMsgHandler
(
'/tuio/2Dcur'
,
self
.
_receive
)
self
.
server
.
addMsgHandler
(
'/tuio/2Dcur'
,
self
.
_receive
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment