# HG changeset patch # User bastiena # Date 1331301131 -3600 # Node ID 6fefd4afe506cf7838d9e3b22367ce54f5c1f010 First Import diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/LICENSE.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/LICENSE.txt Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/README.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/README.txt Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,114 @@ +TUIO JAVA LIBRARY AND EXAMPLES +------------------------------ +Copyright (c) 2005-2009 Martin Kaltenbrunner +This software is part of reacTIVision, an open source fiducial +tracking and multi-touch framework based on computer vision. + +http://reactivision.sourceforge.net/ + +Demo Applications: +------------------ +This package contains three demo applications which receive +TUIO messages from any TUIO enabled tracker or the Simulator. +All these applications show how to use the TUIO Java Library +in a simple way. + +TuioDemo graphically displays the object and cursor state, +TuioApplet is a version of TuioDemo for the web browser, +TuioDump prints the object and cursor state to the console. + +You can use these demo applications for debugging purposes, +or as a starting point for the development of your own Java +applications implementing the TUIO protocol. Please refer to +the source code of the example and the following section. + +Pressing F1 will toggle FullScreen mode with the TuioDemo, +pressing ESC or closing the Window will end the application. +Hitting the V key will print the TUIO events to the console. + +Keep in mind to make your graphics scalable for the varying +screen and window resolutions. A reasonable TUIO application +will run in fullscreen mode, although the windowed mode might +be useful for debugging purposes or working with the Simulator. + +Application Programming Interface: +---------------------------------- +First you need to create an instance of TuioClient. This class +is listening to TUIO messages on the specified port and generates +higher level messages based on the object events. + +Your application needs to implement the TuioListener interface, +and has to be added to the TuioClient in order to receive messages. + + "class MyApplication implements TuioListener" + +A simple code snippet for setting up a TUIO session: + + MyApplication app = new MyApplication(); + TuioClient client = new TuioClient(); + client.addTuioListener(app); + client.connect(); + +A TuioListener needs to implement the following methods: + +* addTuioObject(TuioObject tobj): + this is called when an object becomes visible +* removeTuioObject(TuioObject tobj): + an object was removed from the table +* updateTuioObject(TuioObject tobj): + an object was moved on the table surface +* addTuioCursor(TuioCursor tcur): + this is called when a new cursor is detected +* removeTuioCursor(TuioCursor tcur): + a cursor was removed from the table +* updateTuioCursor(TuioCursor tcur): + a cursor was moving on the table surface +* refresh(TuioTime bundleTime): + this method is called after each bundle, + use it to repaint your screen for example + +Each object or cursor is identified with a unique session ID, that is maintained +over its lifetime. Additionally each object carries symbol ID that corresponds +to its attached fiducial marker number. The cursor ID of the cursor object is always +a number in the range of all currently detected cursor blobs. + +The TuioObject and TuioCursor references are updated automatically by the TuioClient +and are always referencing the same instance over the object lifetime. +All the TuioObject and TuioCursor attributes are encapsulated and can be +accessed with methods such as getX(), getY() and getAngle() and so on. +TuioObject and TuioCursor also have some additional convenience methods +for the calculation of distances and angles between objects. The getPath() +method returns a Vector of TuioPoint representing the movement path of the object. + +Alternatively the TuioClient class contains some methods for the polling +of the current object and cursor state. There are methods which return +either a list or individual object and cursor objects. The TuioObject and +TuioCursor classes have been added as a container which also can be used +by external classes. + +* getTuioObjects() returns a Vector of all currently present TuioObjects +* getTuioCursors() returns a Vector of all currently present TuioCursors +* getTuioObject(long s_id) returns a TuioObject or NULL depending on its presence +* getTuioCursor(long s_id) returns a TuioCursor or NULL depending on its presence + +License: +-------- +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +References: +----------- +This application uses the JavaOSC OpenSound Control library. +See http://www.mat.ucsb.edu/~c.ramakr/illposed/javaosc.html +for more information and the source code. diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/TuioApplet.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/TuioApplet.html Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,15 @@ + + +TuioApplet + + +

TuioApplet

+ +

+ + + +

+ + + diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/TuioDemo.jar Binary file front_processing/extern/TUIO_JAVA/TuioDemo.jar has changed diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/doc/TUIO/TuioClient.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/doc/TUIO/TuioClient.html Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,539 @@ + + + + + + +TuioClient + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +TUIO +
+Class TuioClient

+
+java.lang.Object
+  extended by TUIO.TuioClient
+
+
+
All Implemented Interfaces:
com.illposed.osc.OSCListener
+
+
+
+
public class TuioClient
extends java.lang.Object
implements com.illposed.osc.OSCListener
+ + +

+The TuioClient class is the central TUIO protocol decoder component. It provides a simple callback infrastructure using the TuioListener interface. + In order to receive and decode TUIO messages an instance of TuioClient needs to be created. The TuioClient instance then generates TUIO events + which are broadcasted to all registered classes that implement the TuioListener interface.

+ + TuioClient client = new TuioClient();
+ client.addTuioListener(myTuioListener);
+ client.connect();
+
+

+ +

+


+ +

+ + + + + + + + + + + + + + +
+Constructor Summary
TuioClient() + +
+          The default constructor creates a client that listens to the default TUIO port 3333
TuioClient(int port) + +
+          This constructor creates a client that listens to the provided port
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidacceptMessage(java.util.Date date, + com.illposed.osc.OSCMessage message) + +
+          The OSC callback method where all TUIO messages are received and decoded + and where the TUIO event callbacks are dispatched
+ voidaddTuioListener(TuioListener listener) + +
+          Adds the provided TuioListener to the list of registered TUIO event listeners
+ voidconnect() + +
+          The TuioClient starts listening to TUIO messages on the configured UDP port + All reveived TUIO messages are decoded and the resulting TUIO events are broadcasted to all registered TuioListeners
+ voiddisconnect() + +
+          The TuioClient stops listening to TUIO messages on the configured UDP port
+ TuioCursorgetTuioCursor(long s_id) + +
+          Returns the TuioCursor corresponding to the provided Session ID + or NULL if the Session ID does not refer to an active TuioCursor
+ java.util.Vector<TuioCursor>getTuioCursors() + +
+          Returns a Vector of all currently active TuioCursors
+ TuioObjectgetTuioObject(long s_id) + +
+          Returns the TuioObject corresponding to the provided Session ID + or NULL if the Session ID does not refer to an active TuioObject
+ java.util.Vector<TuioObject>getTuioObjects() + +
+          Returns a Vector of all currently active TuioObjects
+ booleanisConnected() + +
+          Returns true if this TuioClient is currently connected.
+ voidremoveAllTuioListeners() + +
+          Removes all TuioListener from the list of registered TUIO event listeners
+ voidremoveTuioListener(TuioListener listener) + +
+          Removes the provided TuioListener from the list of registered TUIO event listeners
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+TuioClient

+
+public TuioClient()
+
+
The default constructor creates a client that listens to the default TUIO port 3333 +

+

+
+ +

+TuioClient

+
+public TuioClient(int port)
+
+
This constructor creates a client that listens to the provided port +

+

+
Parameters:
port - the listening port number
+
+ + + + + + + + +
+Method Detail
+ +

+connect

+
+public void connect()
+
+
The TuioClient starts listening to TUIO messages on the configured UDP port + All reveived TUIO messages are decoded and the resulting TUIO events are broadcasted to all registered TuioListeners +

+

+
+
+
+
+
+
+
+ +

+disconnect

+
+public void disconnect()
+
+
The TuioClient stops listening to TUIO messages on the configured UDP port +

+

+
+
+
+
+
+
+
+ +

+isConnected

+
+public boolean isConnected()
+
+
Returns true if this TuioClient is currently connected. +

+

+
+
+
+ +
Returns:
true if this TuioClient is currently connected
+
+
+
+ +

+addTuioListener

+
+public void addTuioListener(TuioListener listener)
+
+
Adds the provided TuioListener to the list of registered TUIO event listeners +

+

+
+
+
+
Parameters:
listener - the TuioListener to add
+
+
+
+ +

+removeTuioListener

+
+public void removeTuioListener(TuioListener listener)
+
+
Removes the provided TuioListener from the list of registered TUIO event listeners +

+

+
+
+
+
Parameters:
listener - the TuioListener to remove
+
+
+
+ +

+removeAllTuioListeners

+
+public void removeAllTuioListeners()
+
+
Removes all TuioListener from the list of registered TUIO event listeners +

+

+
+
+
+
+
+
+
+ +

+getTuioObjects

+
+public java.util.Vector<TuioObject> getTuioObjects()
+
+
Returns a Vector of all currently active TuioObjects +

+

+
+
+
+ +
Returns:
a Vector of all currently active TuioObjects
+
+
+
+ +

+getTuioCursors

+
+public java.util.Vector<TuioCursor> getTuioCursors()
+
+
Returns a Vector of all currently active TuioCursors +

+

+
+
+
+ +
Returns:
a Vector of all currently active TuioCursors
+
+
+
+ +

+getTuioObject

+
+public TuioObject getTuioObject(long s_id)
+
+
Returns the TuioObject corresponding to the provided Session ID + or NULL if the Session ID does not refer to an active TuioObject +

+

+
+
+
+ +
Returns:
an active TuioObject corresponding to the provided Session ID or NULL
+
+
+
+ +

+getTuioCursor

+
+public TuioCursor getTuioCursor(long s_id)
+
+
Returns the TuioCursor corresponding to the provided Session ID + or NULL if the Session ID does not refer to an active TuioCursor +

+

+
+
+
+ +
Returns:
an active TuioCursor corresponding to the provided Session ID or NULL
+
+
+
+ +

+acceptMessage

+
+public void acceptMessage(java.util.Date date,
+                          com.illposed.osc.OSCMessage message)
+
+
The OSC callback method where all TUIO messages are received and decoded + and where the TUIO event callbacks are dispatched +

+

+
Specified by:
acceptMessage in interface com.illposed.osc.OSCListener
+
+
+
Parameters:
date - the time stamp of the OSC bundle
message - the received OSC message
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/doc/TUIO/TuioCursor.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/doc/TUIO/TuioCursor.html Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,974 @@ + + + + + + +TuioCursor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +TUIO +
+Class TuioCursor

+
+java.lang.Object
+  extended by TUIO.TuioPoint
+      extended by TUIO.TuioCursor
+
+
+
+
public class TuioCursor
extends TuioPoint
+ + +

+The TuioCursor class encapsulates /tuio/2Dcur TUIO cursors. +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+protected  intcursor_id + +
+          The individual cursor ID number that is assigned to each TuioCursor.
+protected  floatmotion_accel + +
+          The motion acceleration value.
+protected  floatmotion_speed + +
+          The motion speed value.
+protected  java.util.Vector<TuioPoint>path + +
+          A Vector of TuioPoints containing all the previous positions of the TUIO component.
+protected  longsession_id + +
+          The unique session ID number that is assigned to each TUIO object or cursor.
+protected  intstate + +
+          Reflects the current state of the TuioComponent
+static intTUIO_ACCELERATING + +
+          Defines the ACCELERATING state.
+static intTUIO_ADDED + +
+          Defines the ADDED state.
+static intTUIO_DECELERATING + +
+          Defines the DECELERATING state.
+static intTUIO_REMOVED + +
+          Defines the REMOVED state.
+static intTUIO_STOPPED + +
+          Defines the STOPPED state.
+protected  floatx_speed + +
+          The X-axis velocity value.
+protected  floaty_speed + +
+          The Y-axis velocity value.
+ + + + + + + +
Fields inherited from class TUIO.TuioPoint
currentTime, startTime, xpos, ypos
+  + + + + + + + + + + + + + + + + +
+Constructor Summary
TuioCursor(long si, + int ci, + float xp, + float yp) + +
+          This constructor takes the provided Session ID, Cursor ID, X and Y coordinate + and assigs these values to the newly created TuioCursor.
TuioCursor(TuioCursor tcur) + +
+          This constructor takes the atttibutes of the provided TuioCursor + and assigs these values to the newly created TuioCursor.
TuioCursor(TuioTime ttime, + long si, + int ci, + float xp, + float yp) + +
+          This constructor takes a TuioTime argument and assigns it along with the provided + Session ID, Cursor ID, X and Y coordinate to the newly created TuioCursor.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ intgetCursorID() + +
+          Returns the Cursor ID of this TuioCursor.
+ floatgetMotionAccel() + +
+          Returns the motion acceleration of this TuioContainer.
+ floatgetMotionSpeed() + +
+          Returns the motion speed of this TuioContainer.
+ java.util.Vector<TuioPoint>getPath() + +
+          Returns the path of this TuioContainer.
+ TuioPointgetPosition() + +
+          Returns the position of this TuioContainer.
+ longgetSessionID() + +
+          Returns the Session ID of this TuioContainer.
+ intgetTuioState() + +
+          Returns the TUIO state of this TuioContainer.
+ floatgetXSpeed() + +
+          Returns the X velocity of this TuioContainer.
+ floatgetYSpeed() + +
+          Returns the Y velocity of this TuioContainer.
+ booleanisMoving() + +
+          Returns true of this TuioContainer is moving.
+ voidremove(TuioTime ttime) + +
+          Assigns the REMOVE state to this TuioContainer and sets + its TuioTime time stamp to the provided TuioTime argument.
+ voidstop(TuioTime ttime) + +
+          This method is used to calculate the speed and acceleration values of + TuioContainers with unchanged positions.
+ voidupdate(float xp, + float yp, + float xs, + float ys, + float ma) + +
+          Assigns the provided X and Y coordinate, X and Y velocity and acceleration + to the private TuioContainer attributes.
+ voidupdate(TUIO.TuioContainer tcon) + +
+          Takes the atttibutes of the provided TuioContainer + and assigs these values to this TuioContainer.
+ voidupdate(TuioTime ttime, + float xp, + float yp) + +
+          Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate to the private TuioContainer attributes.
+ voidupdate(TuioTime ttime, + float xp, + float yp, + float xs, + float ys, + float ma) + +
+          Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate, X and Y velocity and acceleration + to the private TuioContainer attributes.
+ + + + + + + +
Methods inherited from class TUIO.TuioPoint
getAngle, getAngle, getAngleDegrees, getAngleDegrees, getDistance, getDistance, getScreenX, getScreenY, getStartTime, getTuioTime, getX, getY, update, update
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+cursor_id

+
+protected int cursor_id
+
+
The individual cursor ID number that is assigned to each TuioCursor. +

+

+
+
+
+ +

+session_id

+
+protected long session_id
+
+
The unique session ID number that is assigned to each TUIO object or cursor. +

+

+
+
+
+ +

+x_speed

+
+protected float x_speed
+
+
The X-axis velocity value. +

+

+
+
+
+ +

+y_speed

+
+protected float y_speed
+
+
The Y-axis velocity value. +

+

+
+
+
+ +

+motion_speed

+
+protected float motion_speed
+
+
The motion speed value. +

+

+
+
+
+ +

+motion_accel

+
+protected float motion_accel
+
+
The motion acceleration value. +

+

+
+
+
+ +

+path

+
+protected java.util.Vector<TuioPoint> path
+
+
A Vector of TuioPoints containing all the previous positions of the TUIO component. +

+

+
+
+
+ +

+TUIO_ADDED

+
+public static final int TUIO_ADDED
+
+
Defines the ADDED state. +

+

+
See Also:
Constant Field Values
+
+
+ +

+TUIO_ACCELERATING

+
+public static final int TUIO_ACCELERATING
+
+
Defines the ACCELERATING state. +

+

+
See Also:
Constant Field Values
+
+
+ +

+TUIO_DECELERATING

+
+public static final int TUIO_DECELERATING
+
+
Defines the DECELERATING state. +

+

+
See Also:
Constant Field Values
+
+
+ +

+TUIO_STOPPED

+
+public static final int TUIO_STOPPED
+
+
Defines the STOPPED state. +

+

+
See Also:
Constant Field Values
+
+
+ +

+TUIO_REMOVED

+
+public static final int TUIO_REMOVED
+
+
Defines the REMOVED state. +

+

+
See Also:
Constant Field Values
+
+
+ +

+state

+
+protected int state
+
+
Reflects the current state of the TuioComponent +

+

+
+
+ + + + + + + + +
+Constructor Detail
+ +

+TuioCursor

+
+public TuioCursor(TuioTime ttime,
+                  long si,
+                  int ci,
+                  float xp,
+                  float yp)
+
+
This constructor takes a TuioTime argument and assigns it along with the provided + Session ID, Cursor ID, X and Y coordinate to the newly created TuioCursor. +

+

+
Parameters:
ttime - the TuioTime to assign
si - the Session ID to assign
ci - the Cursor ID to assign
xp - the X coordinate to assign
yp - the Y coordinate to assign
+
+
+ +

+TuioCursor

+
+public TuioCursor(long si,
+                  int ci,
+                  float xp,
+                  float yp)
+
+
This constructor takes the provided Session ID, Cursor ID, X and Y coordinate + and assigs these values to the newly created TuioCursor. +

+

+
Parameters:
si - the Session ID to assign
ci - the Cursor ID to assign
xp - the X coordinate to assign
yp - the Y coordinate to assign
+
+
+ +

+TuioCursor

+
+public TuioCursor(TuioCursor tcur)
+
+
This constructor takes the atttibutes of the provided TuioCursor + and assigs these values to the newly created TuioCursor. +

+

+
Parameters:
tcur - the TuioCursor to assign
+
+ + + + + + + + +
+Method Detail
+ +

+getCursorID

+
+public int getCursorID()
+
+
Returns the Cursor ID of this TuioCursor. +

+

+ +
Returns:
the Cursor ID of this TuioCursor
+
+
+
+ +

+update

+
+public void update(TuioTime ttime,
+                   float xp,
+                   float yp)
+
+
Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate to the private TuioContainer attributes. + The speed and accleration values are calculated accordingly. +

+

+
Overrides:
update in class TuioPoint
+
+
+
Parameters:
ttime - the TuioTime to assign
xp - the X coordinate to assign
yp - the Y coordinate to assign
+
+
+
+ +

+stop

+
+public void stop(TuioTime ttime)
+
+
This method is used to calculate the speed and acceleration values of + TuioContainers with unchanged positions. +

+

+
+
+
+
+ +

+update

+
+public void update(TuioTime ttime,
+                   float xp,
+                   float yp,
+                   float xs,
+                   float ys,
+                   float ma)
+
+
Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate, X and Y velocity and acceleration + to the private TuioContainer attributes. +

+

+
Parameters:
ttime - the TuioTime to assign
xp - the X coordinate to assign
yp - the Y coordinate to assign
xs - the X velocity to assign
ys - the Y velocity to assign
ma - the acceleration to assign
+
+
+
+ +

+update

+
+public void update(float xp,
+                   float yp,
+                   float xs,
+                   float ys,
+                   float ma)
+
+
Assigns the provided X and Y coordinate, X and Y velocity and acceleration + to the private TuioContainer attributes. The TuioTime time stamp remains unchanged. +

+

+
Parameters:
xp - the X coordinate to assign
yp - the Y coordinate to assign
xs - the X velocity to assign
ys - the Y velocity to assign
ma - the acceleration to assign
+
+
+
+ +

+update

+
+public void update(TUIO.TuioContainer tcon)
+
+
Takes the atttibutes of the provided TuioContainer + and assigs these values to this TuioContainer. + The TuioTime time stamp of this TuioContainer remains unchanged. +

+

+
Parameters:
tcon - the TuioContainer to assign
+
+
+
+ +

+remove

+
+public void remove(TuioTime ttime)
+
+
Assigns the REMOVE state to this TuioContainer and sets + its TuioTime time stamp to the provided TuioTime argument. +

+

+
Parameters:
ttime - the TuioTime to assign
+
+
+
+ +

+getSessionID

+
+public long getSessionID()
+
+
Returns the Session ID of this TuioContainer. +

+

+ +
Returns:
the Session ID of this TuioContainer
+
+
+
+ +

+getXSpeed

+
+public float getXSpeed()
+
+
Returns the X velocity of this TuioContainer. +

+

+ +
Returns:
the X velocity of this TuioContainer
+
+
+
+ +

+getYSpeed

+
+public float getYSpeed()
+
+
Returns the Y velocity of this TuioContainer. +

+

+ +
Returns:
the Y velocity of this TuioContainer
+
+
+
+ +

+getPosition

+
+public TuioPoint getPosition()
+
+
Returns the position of this TuioContainer. +

+

+ +
Returns:
the position of this TuioContainer
+
+
+
+ +

+getPath

+
+public java.util.Vector<TuioPoint> getPath()
+
+
Returns the path of this TuioContainer. +

+

+ +
Returns:
the path of this TuioContainer
+
+
+
+ +

+getMotionSpeed

+
+public float getMotionSpeed()
+
+
Returns the motion speed of this TuioContainer. +

+

+ +
Returns:
the motion speed of this TuioContainer
+
+
+
+ +

+getMotionAccel

+
+public float getMotionAccel()
+
+
Returns the motion acceleration of this TuioContainer. +

+

+ +
Returns:
the motion acceleration of this TuioContainer
+
+
+
+ +

+getTuioState

+
+public int getTuioState()
+
+
Returns the TUIO state of this TuioContainer. +

+

+ +
Returns:
the TUIO state of this TuioContainer
+
+
+
+ +

+isMoving

+
+public boolean isMoving()
+
+
Returns true of this TuioContainer is moving. +

+

+ +
Returns:
true of this TuioContainer is moving
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/doc/TUIO/TuioListener.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/doc/TUIO/TuioListener.html Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,342 @@ + + + + + + +TuioListener + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +TUIO +
+Interface TuioListener

+
+
+
public interface TuioListener
+ + +

+The TuioListener interface provides a simple callback infrastructure which is used by the TuioClient class + to dispatch TUIO events to all registered instances of classes that implement the TuioListener interface defined here.

+ Any class that implements the TuioListener interface is required to implement all of the callback methods defined here. + The TuioClient makes use of these interface methods in order to dispatch TUIO events to all registered TuioListener implementations.

+ + public class MyTuioListener implements TuioListener
+ ...

+ MyTuioListener listener = new MyTuioListener();
+ TuioClient client = new TuioClient();
+ client.addTuioListener(listener);
+ client.start();
+
+

+ +

+


+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidaddTuioCursor(TuioCursor tcur) + +
+          This callback method is invoked by the TuioClient when a new TuioCursor is added to the session.
+ voidaddTuioObject(TuioObject tobj) + +
+          This callback method is invoked by the TuioClient when a new TuioObject is added to the session.
+ voidrefresh(TuioTime ftime) + +
+          This callback method is invoked by the TuioClient to mark the end of a received TUIO message bundle.
+ voidremoveTuioCursor(TuioCursor tcur) + +
+          This callback method is invoked by the TuioClient when an existing TuioCursor is removed from the session.
+ voidremoveTuioObject(TuioObject tobj) + +
+          This callback method is invoked by the TuioClient when an existing TuioObject is removed from the session.
+ voidupdateTuioCursor(TuioCursor tcur) + +
+          This callback method is invoked by the TuioClient when an existing TuioCursor is updated during the session.
+ voidupdateTuioObject(TuioObject tobj) + +
+          This callback method is invoked by the TuioClient when an existing TuioObject is updated during the session.
+  +

+ + + + + + + + +
+Method Detail
+ +

+addTuioObject

+
+void addTuioObject(TuioObject tobj)
+
+
This callback method is invoked by the TuioClient when a new TuioObject is added to the session. +

+

+
Parameters:
tobj - the TuioObject reference associated to the addTuioObject event
+
+
+
+ +

+updateTuioObject

+
+void updateTuioObject(TuioObject tobj)
+
+
This callback method is invoked by the TuioClient when an existing TuioObject is updated during the session. +

+

+
Parameters:
tobj - the TuioObject reference associated to the updateTuioObject event
+
+
+
+ +

+removeTuioObject

+
+void removeTuioObject(TuioObject tobj)
+
+
This callback method is invoked by the TuioClient when an existing TuioObject is removed from the session. +

+

+
Parameters:
tobj - the TuioObject reference associated to the removeTuioObject event
+
+
+
+ +

+addTuioCursor

+
+void addTuioCursor(TuioCursor tcur)
+
+
This callback method is invoked by the TuioClient when a new TuioCursor is added to the session. +

+

+
Parameters:
tcur - the TuioCursor reference associated to the addTuioCursor event
+
+
+
+ +

+updateTuioCursor

+
+void updateTuioCursor(TuioCursor tcur)
+
+
This callback method is invoked by the TuioClient when an existing TuioCursor is updated during the session. +

+

+
Parameters:
tcur - the TuioCursor reference associated to the updateTuioCursor event
+
+
+
+ +

+removeTuioCursor

+
+void removeTuioCursor(TuioCursor tcur)
+
+
This callback method is invoked by the TuioClient when an existing TuioCursor is removed from the session. +

+

+
Parameters:
tcur - the TuioCursor reference associated to the removeTuioCursor event
+
+
+
+ +

+refresh

+
+void refresh(TuioTime ftime)
+
+
This callback method is invoked by the TuioClient to mark the end of a received TUIO message bundle. +

+

+
Parameters:
ftime - the TuioTime associated to the current TUIO message bundle
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/doc/TUIO/TuioObject.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/doc/TUIO/TuioObject.html Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,1285 @@ + + + + + + +TuioObject + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +TUIO +
+Class TuioObject

+
+java.lang.Object
+  extended by TUIO.TuioPoint
+      extended by TUIO.TuioObject
+
+
+
+
public class TuioObject
extends TuioPoint
+ + +

+The TuioObject class encapsulates /tuio/2Dobj TUIO objects. +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+protected  floatangle + +
+          The rotation angle value.
+protected  floatmotion_accel + +
+          The motion acceleration value.
+protected  floatmotion_speed + +
+          The motion speed value.
+protected  java.util.Vector<TuioPoint>path + +
+          A Vector of TuioPoints containing all the previous positions of the TUIO component.
+protected  floatrotation_accel + +
+          The rotation acceleration value.
+protected  floatrotation_speed + +
+          The rotation speed value.
+protected  longsession_id + +
+          The unique session ID number that is assigned to each TUIO object or cursor.
+protected  intstate + +
+          Reflects the current state of the TuioComponent
+protected  intsymbol_id + +
+          The individual symbol ID number that is assigned to each TuioObject.
+static intTUIO_ACCELERATING + +
+          Defines the ACCELERATING state.
+static intTUIO_ADDED + +
+          Defines the ADDED state.
+static intTUIO_DECELERATING + +
+          Defines the DECELERATING state.
+static intTUIO_REMOVED + +
+          Defines the REMOVED state.
+static intTUIO_ROTATING + +
+          Defines the ROTATING state.
+static intTUIO_STOPPED + +
+          Defines the STOPPED state.
+protected  floatx_speed + +
+          The X-axis velocity value.
+protected  floaty_speed + +
+          The Y-axis velocity value.
+ + + + + + + +
Fields inherited from class TUIO.TuioPoint
currentTime, startTime, xpos, ypos
+  + + + + + + + + + + + + + + + + +
+Constructor Summary
TuioObject(long si, + int sym, + float xp, + float yp, + float a) + +
+          This constructor takes the provided Session ID, Symbol ID, X and Y coordinate + and angle, and assigs these values to the newly created TuioObject.
TuioObject(TuioObject tobj) + +
+          This constructor takes the atttibutes of the provided TuioObject + and assigs these values to the newly created TuioObject.
TuioObject(TuioTime ttime, + long si, + int sym, + float xp, + float yp, + float a) + +
+          This constructor takes a TuioTime argument and assigns it along with the provided + Session ID, Symbol ID, X and Y coordinate and angle to the newly created TuioObject.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ floatgetAngle() + +
+          Returns the rotation angle of this TuioObject.
+ floatgetAngleDegrees() + +
+          Returns the rotation angle in degrees of this TuioObject.
+ floatgetMotionAccel() + +
+          Returns the motion acceleration of this TuioContainer.
+ floatgetMotionSpeed() + +
+          Returns the motion speed of this TuioContainer.
+ java.util.Vector<TuioPoint>getPath() + +
+          Returns the path of this TuioContainer.
+ TuioPointgetPosition() + +
+          Returns the position of this TuioContainer.
+ floatgetRotationAccel() + +
+          Returns the rotation acceleration of this TuioObject.
+ floatgetRotationSpeed() + +
+          Returns the rotation speed of this TuioObject.
+ longgetSessionID() + +
+          Returns the Session ID of this TuioContainer.
+ intgetSymbolID() + +
+          Returns the symbol ID of this TuioObject.
+ intgetTuioState() + +
+          Returns the TUIO state of this TuioContainer.
+ floatgetXSpeed() + +
+          Returns the X velocity of this TuioContainer.
+ floatgetYSpeed() + +
+          Returns the Y velocity of this TuioContainer.
+ booleanisMoving() + +
+          Returns true of this TuioObject is moving.
+ voidremove(TuioTime ttime) + +
+          Assigns the REMOVE state to this TuioContainer and sets + its TuioTime time stamp to the provided TuioTime argument.
+ voidstop(TuioTime ttime) + +
+          This method is used to calculate the speed and acceleration values of a + TuioObject with unchanged position and angle.
+ voidupdate(float xp, + float yp, + float xs, + float ys, + float ma) + +
+          Assigns the provided X and Y coordinate, X and Y velocity and acceleration + to the private TuioContainer attributes.
+ voidupdate(float xp, + float yp, + float a, + float xs, + float ys, + float rs, + float ma, + float ra) + +
+          Assigns the provided X and Y coordinate, angle, X and Y velocity, motion acceleration + rotation velocity and rotation acceleration to the private TuioContainer attributes.
+ voidupdate(TUIO.TuioContainer tcon) + +
+          Takes the atttibutes of the provided TuioContainer + and assigs these values to this TuioContainer.
+ voidupdate(TuioObject tobj) + +
+          Takes the atttibutes of the provided TuioObject + and assigs these values to this TuioObject.
+ voidupdate(TuioTime ttime, + float xp, + float yp) + +
+          Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate to the private TuioContainer attributes.
+ voidupdate(TuioTime ttime, + float xp, + float yp, + float a) + +
+          Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate and angle to the private TuioObject attributes.
+ voidupdate(TuioTime ttime, + float xp, + float yp, + float xs, + float ys, + float ma) + +
+          Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate, X and Y velocity and acceleration + to the private TuioContainer attributes.
+ voidupdate(TuioTime ttime, + float xp, + float yp, + float a, + float xs, + float ys, + float rs, + float ma, + float ra) + +
+          Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate, angle, X and Y velocity, motion acceleration, + rotation speed and rotation acceleration to the private TuioObject attributes.
+ + + + + + + +
Methods inherited from class TUIO.TuioPoint
getAngle, getAngle, getAngleDegrees, getAngleDegrees, getDistance, getDistance, getScreenX, getScreenY, getStartTime, getTuioTime, getX, getY, update, update
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+symbol_id

+
+protected int symbol_id
+
+
The individual symbol ID number that is assigned to each TuioObject. +

+

+
+
+
+ +

+angle

+
+protected float angle
+
+
The rotation angle value. +

+

+
+
+
+ +

+rotation_speed

+
+protected float rotation_speed
+
+
The rotation speed value. +

+

+
+
+
+ +

+rotation_accel

+
+protected float rotation_accel
+
+
The rotation acceleration value. +

+

+
+
+
+ +

+TUIO_ROTATING

+
+public static final int TUIO_ROTATING
+
+
Defines the ROTATING state. +

+

+
See Also:
Constant Field Values
+
+
+ +

+session_id

+
+protected long session_id
+
+
The unique session ID number that is assigned to each TUIO object or cursor. +

+

+
+
+
+ +

+x_speed

+
+protected float x_speed
+
+
The X-axis velocity value. +

+

+
+
+
+ +

+y_speed

+
+protected float y_speed
+
+
The Y-axis velocity value. +

+

+
+
+
+ +

+motion_speed

+
+protected float motion_speed
+
+
The motion speed value. +

+

+
+
+
+ +

+motion_accel

+
+protected float motion_accel
+
+
The motion acceleration value. +

+

+
+
+
+ +

+path

+
+protected java.util.Vector<TuioPoint> path
+
+
A Vector of TuioPoints containing all the previous positions of the TUIO component. +

+

+
+
+
+ +

+TUIO_ADDED

+
+public static final int TUIO_ADDED
+
+
Defines the ADDED state. +

+

+
See Also:
Constant Field Values
+
+
+ +

+TUIO_ACCELERATING

+
+public static final int TUIO_ACCELERATING
+
+
Defines the ACCELERATING state. +

+

+
See Also:
Constant Field Values
+
+
+ +

+TUIO_DECELERATING

+
+public static final int TUIO_DECELERATING
+
+
Defines the DECELERATING state. +

+

+
See Also:
Constant Field Values
+
+
+ +

+TUIO_STOPPED

+
+public static final int TUIO_STOPPED
+
+
Defines the STOPPED state. +

+

+
See Also:
Constant Field Values
+
+
+ +

+TUIO_REMOVED

+
+public static final int TUIO_REMOVED
+
+
Defines the REMOVED state. +

+

+
See Also:
Constant Field Values
+
+
+ +

+state

+
+protected int state
+
+
Reflects the current state of the TuioComponent +

+

+
+
+ + + + + + + + +
+Constructor Detail
+ +

+TuioObject

+
+public TuioObject(TuioTime ttime,
+                  long si,
+                  int sym,
+                  float xp,
+                  float yp,
+                  float a)
+
+
This constructor takes a TuioTime argument and assigns it along with the provided + Session ID, Symbol ID, X and Y coordinate and angle to the newly created TuioObject. +

+

+
Parameters:
ttime - the TuioTime to assign
si - the Session ID to assign
sym - the Symbol ID to assign
xp - the X coordinate to assign
yp - the Y coordinate to assign
a - the angle to assign
+
+
+ +

+TuioObject

+
+public TuioObject(long si,
+                  int sym,
+                  float xp,
+                  float yp,
+                  float a)
+
+
This constructor takes the provided Session ID, Symbol ID, X and Y coordinate + and angle, and assigs these values to the newly created TuioObject. +

+

+
Parameters:
si - the Session ID to assign
sym - the Symbol ID to assign
xp - the X coordinate to assign
yp - the Y coordinate to assign
a - the angle to assign
+
+
+ +

+TuioObject

+
+public TuioObject(TuioObject tobj)
+
+
This constructor takes the atttibutes of the provided TuioObject + and assigs these values to the newly created TuioObject. +

+

+
Parameters:
tobj - the TuioObject to assign
+
+ + + + + + + + +
+Method Detail
+ +

+update

+
+public void update(TuioTime ttime,
+                   float xp,
+                   float yp,
+                   float a,
+                   float xs,
+                   float ys,
+                   float rs,
+                   float ma,
+                   float ra)
+
+
Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate, angle, X and Y velocity, motion acceleration, + rotation speed and rotation acceleration to the private TuioObject attributes. +

+

+
Parameters:
ttime - the TuioTime to assign
xp - the X coordinate to assign
yp - the Y coordinate to assign
a - the angle coordinate to assign
xs - the X velocity to assign
ys - the Y velocity to assign
rs - the rotation velocity to assign
ma - the motion acceleration to assign
ra - the rotation acceleration to assign
+
+
+
+ +

+update

+
+public void update(float xp,
+                   float yp,
+                   float a,
+                   float xs,
+                   float ys,
+                   float rs,
+                   float ma,
+                   float ra)
+
+
Assigns the provided X and Y coordinate, angle, X and Y velocity, motion acceleration + rotation velocity and rotation acceleration to the private TuioContainer attributes. + The TuioTime time stamp remains unchanged. +

+

+
Parameters:
xp - the X coordinate to assign
yp - the Y coordinate to assign
a - the angle coordinate to assign
xs - the X velocity to assign
ys - the Y velocity to assign
rs - the rotation velocity to assign
ma - the motion acceleration to assign
ra - the rotation acceleration to assign
+
+
+
+ +

+update

+
+public void update(TuioTime ttime,
+                   float xp,
+                   float yp,
+                   float a)
+
+
Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate and angle to the private TuioObject attributes. + The speed and accleration values are calculated accordingly. +

+

+
Parameters:
ttime - the TuioTime to assign
xp - the X coordinate to assign
yp - the Y coordinate to assign
a - the angle coordinate to assign
+
+
+
+ +

+update

+
+public void update(TuioObject tobj)
+
+
Takes the atttibutes of the provided TuioObject + and assigs these values to this TuioObject. + The TuioTime time stamp of this TuioContainer remains unchanged. +

+

+
Parameters:
tobj - the TuioContainer to assign
+
+
+
+ +

+stop

+
+public void stop(TuioTime ttime)
+
+
This method is used to calculate the speed and acceleration values of a + TuioObject with unchanged position and angle. +

+

+
+
+
+
Parameters:
ttime - the TuioTime to assign
+
+
+
+ +

+getSymbolID

+
+public int getSymbolID()
+
+
Returns the symbol ID of this TuioObject. +

+

+ +
Returns:
the symbol ID of this TuioObject
+
+
+
+ +

+getAngle

+
+public float getAngle()
+
+
Returns the rotation angle of this TuioObject. +

+

+ +
Returns:
the rotation angle of this TuioObject
+
+
+
+ +

+getAngleDegrees

+
+public float getAngleDegrees()
+
+
Returns the rotation angle in degrees of this TuioObject. +

+

+ +
Returns:
the rotation angle in degrees of this TuioObject
+
+
+
+ +

+getRotationSpeed

+
+public float getRotationSpeed()
+
+
Returns the rotation speed of this TuioObject. +

+

+ +
Returns:
the rotation speed of this TuioObject
+
+
+
+ +

+getRotationAccel

+
+public float getRotationAccel()
+
+
Returns the rotation acceleration of this TuioObject. +

+

+ +
Returns:
the rotation acceleration of this TuioObject
+
+
+
+ +

+isMoving

+
+public boolean isMoving()
+
+
Returns true of this TuioObject is moving. +

+

+
+
+
+ +
Returns:
true of this TuioObject is moving
+
+
+
+ +

+update

+
+public void update(TuioTime ttime,
+                   float xp,
+                   float yp)
+
+
Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate to the private TuioContainer attributes. + The speed and accleration values are calculated accordingly. +

+

+
Overrides:
update in class TuioPoint
+
+
+
Parameters:
ttime - the TuioTime to assign
xp - the X coordinate to assign
yp - the Y coordinate to assign
+
+
+
+ +

+update

+
+public void update(TuioTime ttime,
+                   float xp,
+                   float yp,
+                   float xs,
+                   float ys,
+                   float ma)
+
+
Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate, X and Y velocity and acceleration + to the private TuioContainer attributes. +

+

+
Parameters:
ttime - the TuioTime to assign
xp - the X coordinate to assign
yp - the Y coordinate to assign
xs - the X velocity to assign
ys - the Y velocity to assign
ma - the acceleration to assign
+
+
+
+ +

+update

+
+public void update(float xp,
+                   float yp,
+                   float xs,
+                   float ys,
+                   float ma)
+
+
Assigns the provided X and Y coordinate, X and Y velocity and acceleration + to the private TuioContainer attributes. The TuioTime time stamp remains unchanged. +

+

+
Parameters:
xp - the X coordinate to assign
yp - the Y coordinate to assign
xs - the X velocity to assign
ys - the Y velocity to assign
ma - the acceleration to assign
+
+
+
+ +

+update

+
+public void update(TUIO.TuioContainer tcon)
+
+
Takes the atttibutes of the provided TuioContainer + and assigs these values to this TuioContainer. + The TuioTime time stamp of this TuioContainer remains unchanged. +

+

+
Parameters:
tcon - the TuioContainer to assign
+
+
+
+ +

+remove

+
+public void remove(TuioTime ttime)
+
+
Assigns the REMOVE state to this TuioContainer and sets + its TuioTime time stamp to the provided TuioTime argument. +

+

+
Parameters:
ttime - the TuioTime to assign
+
+
+
+ +

+getSessionID

+
+public long getSessionID()
+
+
Returns the Session ID of this TuioContainer. +

+

+ +
Returns:
the Session ID of this TuioContainer
+
+
+
+ +

+getXSpeed

+
+public float getXSpeed()
+
+
Returns the X velocity of this TuioContainer. +

+

+ +
Returns:
the X velocity of this TuioContainer
+
+
+
+ +

+getYSpeed

+
+public float getYSpeed()
+
+
Returns the Y velocity of this TuioContainer. +

+

+ +
Returns:
the Y velocity of this TuioContainer
+
+
+
+ +

+getPosition

+
+public TuioPoint getPosition()
+
+
Returns the position of this TuioContainer. +

+

+ +
Returns:
the position of this TuioContainer
+
+
+
+ +

+getPath

+
+public java.util.Vector<TuioPoint> getPath()
+
+
Returns the path of this TuioContainer. +

+

+ +
Returns:
the path of this TuioContainer
+
+
+
+ +

+getMotionSpeed

+
+public float getMotionSpeed()
+
+
Returns the motion speed of this TuioContainer. +

+

+ +
Returns:
the motion speed of this TuioContainer
+
+
+
+ +

+getMotionAccel

+
+public float getMotionAccel()
+
+
Returns the motion acceleration of this TuioContainer. +

+

+ +
Returns:
the motion acceleration of this TuioContainer
+
+
+
+ +

+getTuioState

+
+public int getTuioState()
+
+
Returns the TUIO state of this TuioContainer. +

+

+ +
Returns:
the TUIO state of this TuioContainer
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/doc/TUIO/TuioPoint.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/doc/TUIO/TuioPoint.html Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,747 @@ + + + + + + +TuioPoint + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +TUIO +
+Class TuioPoint

+
+java.lang.Object
+  extended by TUIO.TuioPoint
+
+
+
Direct Known Subclasses:
TuioCursor, TuioObject
+
+
+
+
public class TuioPoint
extends java.lang.Object
+ + +

+The TuioPoint class on the one hand is a simple container and utility class to handle TUIO positions in general, + on the other hand the TuioPoint is the base class for the TuioCursor and TuioObject classes. +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+protected  TuioTimecurrentTime + +
+          The time stamp of the last update represented as TuioTime (time since session start)
+protected  TuioTimestartTime + +
+          The creation time of this TuioPoint represented as TuioTime (time since session start)
+protected  floatxpos + +
+          X coordinate, representated as a floating point value in a range of 0..1
+protected  floatypos + +
+          Y coordinate, representated as a floating point value in a range of 0..1
+  + + + + + + + + + + + + + + + + + + + +
+Constructor Summary
TuioPoint() + +
+          The default constructor takes no arguments and sets + its coordinate attributes to zero and its time stamp to the current session time.
TuioPoint(float xp, + float yp) + +
+          This constructor takes two floating point coordinate arguments and sets + its coordinate attributes to these values and its time stamp to the current session time.
TuioPoint(TuioPoint tpoint) + +
+          This constructor takes a TuioPoint argument and sets its coordinate attributes + to the coordinates of the provided TuioPoint and its time stamp to the current session time.
TuioPoint(TuioTime ttime, + float xp, + float yp) + +
+          This constructor takes a TuioTime object and two floating point coordinate arguments and sets + its coordinate attributes to these values and its time stamp to the provided TUIO time object.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ floatgetAngle(float xp, + float yp) + +
+          Returns the angle to the provided coordinates
+ floatgetAngle(TuioPoint tpoint) + +
+          Returns the angle to the provided TuioPoint
+ floatgetAngleDegrees(float xp, + float yp) + +
+          Returns the angle in degrees to the provided coordinates
+ floatgetAngleDegrees(TuioPoint tpoint) + +
+          Returns the angle in degrees to the provided TuioPoint
+ floatgetDistance(float xp, + float yp) + +
+          Returns the distance to the provided coordinates
+ floatgetDistance(TuioPoint tpoint) + +
+          Returns the distance to the provided TuioPoint
+ intgetScreenX(int width) + +
+          Returns the X coordinate in pixels relative to the provided screen width.
+ intgetScreenY(int height) + +
+          Returns the Y coordinate in pixels relative to the provided screen height.
+ TuioTimegetStartTime() + +
+          Returns the start time of this TuioPoint as TuioTime.
+ TuioTimegetTuioTime() + +
+          Returns the time stamp of this TuioPoint as TuioTime.
+ floatgetX() + +
+          Returns the X coordinate of this TuioPoint.
+ floatgetY() + +
+          Returns the Y coordinate of this TuioPoint.
+ voidupdate(float xp, + float yp) + +
+          Takes two floating point coordinate arguments and updates its coordinate attributes + to the coordinates of the provided TuioPoint and leaves its time stamp unchanged.
+ voidupdate(TuioPoint tpoint) + +
+          Takes a TuioPoint argument and updates its coordinate attributes + to the coordinates of the provided TuioPoint and leaves its time stamp unchanged.
+ voidupdate(TuioTime ttime, + float xp, + float yp) + +
+          Takes a TuioTime object and two floating point coordinate arguments and updates its coordinate attributes + to the coordinates of the provided TuioPoint and its time stamp to the provided TUIO time object.
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+xpos

+
+protected float xpos
+
+
X coordinate, representated as a floating point value in a range of 0..1 +

+

+
+
+
+ +

+ypos

+
+protected float ypos
+
+
Y coordinate, representated as a floating point value in a range of 0..1 +

+

+
+
+
+ +

+currentTime

+
+protected TuioTime currentTime
+
+
The time stamp of the last update represented as TuioTime (time since session start) +

+

+
+
+
+ +

+startTime

+
+protected TuioTime startTime
+
+
The creation time of this TuioPoint represented as TuioTime (time since session start) +

+

+
+
+ + + + + + + + +
+Constructor Detail
+ +

+TuioPoint

+
+public TuioPoint()
+
+
The default constructor takes no arguments and sets + its coordinate attributes to zero and its time stamp to the current session time. +

+

+
+ +

+TuioPoint

+
+public TuioPoint(float xp,
+                 float yp)
+
+
This constructor takes two floating point coordinate arguments and sets + its coordinate attributes to these values and its time stamp to the current session time. +

+

+
Parameters:
xp - the X coordinate to assign
yp - the Y coordinate to assign
+
+
+ +

+TuioPoint

+
+public TuioPoint(TuioPoint tpoint)
+
+
This constructor takes a TuioPoint argument and sets its coordinate attributes + to the coordinates of the provided TuioPoint and its time stamp to the current session time. +

+

+
Parameters:
tpoint - the TuioPoint to assign
+
+
+ +

+TuioPoint

+
+public TuioPoint(TuioTime ttime,
+                 float xp,
+                 float yp)
+
+
This constructor takes a TuioTime object and two floating point coordinate arguments and sets + its coordinate attributes to these values and its time stamp to the provided TUIO time object. +

+

+
Parameters:
ttime - the TuioTime to assign
xp - the X coordinate to assign
yp - the Y coordinate to assign
+
+ + + + + + + + +
+Method Detail
+ +

+update

+
+public void update(TuioPoint tpoint)
+
+
Takes a TuioPoint argument and updates its coordinate attributes + to the coordinates of the provided TuioPoint and leaves its time stamp unchanged. +

+

+
Parameters:
tpoint - the TuioPoint to assign
+
+
+
+ +

+update

+
+public void update(float xp,
+                   float yp)
+
+
Takes two floating point coordinate arguments and updates its coordinate attributes + to the coordinates of the provided TuioPoint and leaves its time stamp unchanged. +

+

+
Parameters:
xp - the X coordinate to assign
yp - the Y coordinate to assign
+
+
+
+ +

+update

+
+public void update(TuioTime ttime,
+                   float xp,
+                   float yp)
+
+
Takes a TuioTime object and two floating point coordinate arguments and updates its coordinate attributes + to the coordinates of the provided TuioPoint and its time stamp to the provided TUIO time object. +

+

+
Parameters:
ttime - the TuioTime to assign
xp - the X coordinate to assign
yp - the Y coordinate to assign
+
+
+
+ +

+getX

+
+public float getX()
+
+
Returns the X coordinate of this TuioPoint. +

+

+ +
Returns:
the X coordinate of this TuioPoint
+
+
+
+ +

+getY

+
+public float getY()
+
+
Returns the Y coordinate of this TuioPoint. +

+

+ +
Returns:
the Y coordinate of this TuioPoint
+
+
+
+ +

+getDistance

+
+public float getDistance(float xp,
+                         float yp)
+
+
Returns the distance to the provided coordinates +

+

+
Parameters:
xp - the X coordinate of the distant point
yp - the Y coordinate of the distant point +
Returns:
the distance to the provided coordinates
+
+
+
+ +

+getDistance

+
+public float getDistance(TuioPoint tpoint)
+
+
Returns the distance to the provided TuioPoint +

+

+
Parameters:
tpoint - the distant TuioPoint +
Returns:
the distance to the provided TuioPoint
+
+
+
+ +

+getAngle

+
+public float getAngle(float xp,
+                      float yp)
+
+
Returns the angle to the provided coordinates +

+

+
Parameters:
xp - the X coordinate of the distant point
yp - the Y coordinate of the distant point +
Returns:
the angle to the provided coordinates
+
+
+
+ +

+getAngle

+
+public float getAngle(TuioPoint tpoint)
+
+
Returns the angle to the provided TuioPoint +

+

+
Parameters:
tpoint - the distant TuioPoint +
Returns:
the angle to the provided TuioPoint
+
+
+
+ +

+getAngleDegrees

+
+public float getAngleDegrees(float xp,
+                             float yp)
+
+
Returns the angle in degrees to the provided coordinates +

+

+
Parameters:
xp - the X coordinate of the distant point
yp - the Y coordinate of the distant point +
Returns:
the angle in degrees to the provided TuioPoint
+
+
+
+ +

+getAngleDegrees

+
+public float getAngleDegrees(TuioPoint tpoint)
+
+
Returns the angle in degrees to the provided TuioPoint +

+

+
Parameters:
tpoint - the distant TuioPoint +
Returns:
the angle in degrees to the provided TuioPoint
+
+
+
+ +

+getScreenX

+
+public int getScreenX(int width)
+
+
Returns the X coordinate in pixels relative to the provided screen width. +

+

+
Parameters:
width - the screen width +
Returns:
the X coordinate of this TuioPoint in pixels relative to the provided screen width
+
+
+
+ +

+getScreenY

+
+public int getScreenY(int height)
+
+
Returns the Y coordinate in pixels relative to the provided screen height. +

+

+
Parameters:
height - the screen height +
Returns:
the Y coordinate of this TuioPoint in pixels relative to the provided screen height
+
+
+
+ +

+getTuioTime

+
+public TuioTime getTuioTime()
+
+
Returns the time stamp of this TuioPoint as TuioTime. +

+

+ +
Returns:
the time stamp of this TuioPoint as TuioTime
+
+
+
+ +

+getStartTime

+
+public TuioTime getStartTime()
+
+
Returns the start time of this TuioPoint as TuioTime. +

+

+ +
Returns:
the start time of this TuioPoint as TuioTime
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/doc/TUIO/TuioTime.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/doc/TUIO/TuioTime.html Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,584 @@ + + + + + + +TuioTime + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +TUIO +
+Class TuioTime

+
+java.lang.Object
+  extended by TUIO.TuioTime
+
+
+
+
public class TuioTime
extends java.lang.Object
+ + +

+The TuioTime class is a simple structure that is used to reprent the time that has elapsed since the session start. + The time is internally represented as seconds and fractions of microseconds which should be more than sufficient for gesture related timing requirements. + Therefore at the beginning of a typical TUIO session the static method initSession() will set the reference time for the session. + Another important static method getSessionTime will return a TuioTime object representing the time elapsed since the session start. + The class also provides various addtional convience method, which allow some simple time arithmetics. +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + + + + +
+Constructor Summary
TuioTime() + +
+          The default constructor takes no arguments and sets + the Seconds and Microseconds attributes of the newly created TuioTime both to zero.
TuioTime(long msec) + +
+          This constructor takes the provided time represented in total Milliseconds + and assigs this value to the newly created TuioTime.
TuioTime(long sec, + long usec) + +
+          This constructor takes the provided time represented in Seconds and Microseconds + and assigs these value to the newly created TuioTime.
TuioTime(TuioTime ttime) + +
+          This constructor takes the provided TuioTime + and assigs its Seconds and Microseconds values to the newly created TuioTime.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ TuioTimeadd(long us) + +
+          Sums the provided time value represented in total Microseconds to this TuioTime.
+ TuioTimeadd(TuioTime ttime) + +
+          Sums the provided TuioTime to the private Seconds and Microseconds attributes.
+ booleanequals(TuioTime ttime) + +
+          Takes a TuioTime argument and compares the provided TuioTime to the private Seconds and Microseconds attributes.
+ longgetMicroseconds() + +
+          Returns the TuioTime Microseconds component.
+ longgetSeconds() + +
+          Returns the TuioTime Seconds component.
+static TuioTimegetSessionTime() + +
+          Returns the present TuioTime representing the time since session start.
+static TuioTimegetStartTime() + +
+          Returns the absolut TuioTime representing the session start.
+static TuioTimegetSystemTime() + +
+          Returns the absolut TuioTime representing the current system time.
+ longgetTotalMilliseconds() + +
+          Returns the total TuioTime in Milliseconds.
+static voidinitSession() + +
+          This static method globally resets the TUIO session time.
+ voidreset() + +
+          Resets the seconds and micro_seconds attributes to zero.
+ TuioTimesubtract(long us) + +
+          Subtracts the provided time represented in Microseconds from the private Seconds and Microseconds attributes.
+ TuioTimesubtract(TuioTime ttime) + +
+          Subtracts the provided TuioTime from the private Seconds and Microseconds attributes.
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+TuioTime

+
+public TuioTime()
+
+
The default constructor takes no arguments and sets + the Seconds and Microseconds attributes of the newly created TuioTime both to zero. +

+

+
+ +

+TuioTime

+
+public TuioTime(long msec)
+
+
This constructor takes the provided time represented in total Milliseconds + and assigs this value to the newly created TuioTime. +

+

+
Parameters:
msec - the total time in Millseconds
+
+
+ +

+TuioTime

+
+public TuioTime(long sec,
+                long usec)
+
+
This constructor takes the provided time represented in Seconds and Microseconds + and assigs these value to the newly created TuioTime. +

+

+
Parameters:
sec - the total time in seconds
usec - the microseconds time component
+
+
+ +

+TuioTime

+
+public TuioTime(TuioTime ttime)
+
+
This constructor takes the provided TuioTime + and assigs its Seconds and Microseconds values to the newly created TuioTime. +

+

+
Parameters:
ttime - the TuioTime used to copy
+
+ + + + + + + + +
+Method Detail
+ +

+add

+
+public TuioTime add(long us)
+
+
Sums the provided time value represented in total Microseconds to this TuioTime. +

+

+
Parameters:
us - the total time to add in Microseconds +
Returns:
the sum of this TuioTime with the provided argument in microseconds
+
+
+
+ +

+add

+
+public TuioTime add(TuioTime ttime)
+
+
Sums the provided TuioTime to the private Seconds and Microseconds attributes. +

+

+
Parameters:
ttime - the TuioTime to add +
Returns:
the sum of this TuioTime with the provided TuioTime argument
+
+
+
+ +

+subtract

+
+public TuioTime subtract(long us)
+
+
Subtracts the provided time represented in Microseconds from the private Seconds and Microseconds attributes. +

+

+
Parameters:
us - the total time to subtract in Microseconds +
Returns:
the subtraction result of this TuioTime minus the provided time in Microseconds
+
+
+
+ +

+subtract

+
+public TuioTime subtract(TuioTime ttime)
+
+
Subtracts the provided TuioTime from the private Seconds and Microseconds attributes. +

+

+
Parameters:
ttime - the TuioTime to subtract +
Returns:
the subtraction result of this TuioTime minus the provided TuioTime
+
+
+
+ +

+equals

+
+public boolean equals(TuioTime ttime)
+
+
Takes a TuioTime argument and compares the provided TuioTime to the private Seconds and Microseconds attributes. +

+

+
Parameters:
ttime - the TuioTime to compare +
Returns:
true if the two TuioTime have equal Seconds and Microseconds attributes
+
+
+
+ +

+reset

+
+public void reset()
+
+
Resets the seconds and micro_seconds attributes to zero. +

+

+
+
+
+
+ +

+getSeconds

+
+public long getSeconds()
+
+
Returns the TuioTime Seconds component. +

+

+ +
Returns:
the TuioTime Seconds component
+
+
+
+ +

+getMicroseconds

+
+public long getMicroseconds()
+
+
Returns the TuioTime Microseconds component. +

+

+ +
Returns:
the TuioTime Microseconds component
+
+
+
+ +

+getTotalMilliseconds

+
+public long getTotalMilliseconds()
+
+
Returns the total TuioTime in Milliseconds. +

+

+ +
Returns:
the total TuioTime in Milliseconds
+
+
+
+ +

+initSession

+
+public static void initSession()
+
+
This static method globally resets the TUIO session time. +

+

+
+
+
+
+ +

+getSessionTime

+
+public static TuioTime getSessionTime()
+
+
Returns the present TuioTime representing the time since session start. +

+

+ +
Returns:
the present TuioTime representing the time since session start
+
+
+
+ +

+getStartTime

+
+public static TuioTime getStartTime()
+
+
Returns the absolut TuioTime representing the session start. +

+

+ +
Returns:
the absolut TuioTime representing the session start
+
+
+
+ +

+getSystemTime

+
+public static TuioTime getSystemTime()
+
+
Returns the absolut TuioTime representing the current system time. +

+

+ +
Returns:
the absolut TuioTime representing the current system time
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/doc/TUIO/package-frame.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/doc/TUIO/package-frame.html Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,51 @@ + + + + + + +TUIO + + + + + + + + + + + +TUIO + + + + +
+Interfaces  + +
+TuioListener
+ + + + + + +
+Classes  + +
+TuioClient +
+TuioCursor +
+TuioObject +
+TuioPoint +
+TuioTime
+ + + + diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/doc/TUIO/package-summary.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/doc/TUIO/package-summary.html Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,182 @@ + + + + + + +TUIO + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package TUIO +

+ + + + + + + + + +
+Interface Summary
TuioListenerThe TuioListener interface provides a simple callback infrastructure which is used by the TuioClient class + to dispatch TUIO events to all registered instances of classes that implement the TuioListener interface defined here.
+  + +

+ + + + + + + + + + + + + + + + + + + + + + + + + +
+Class Summary
TuioClientThe TuioClient class is the central TUIO protocol decoder component.
TuioCursorThe TuioCursor class encapsulates /tuio/2Dcur TUIO cursors.
TuioObjectThe TuioObject class encapsulates /tuio/2Dobj TUIO objects.
TuioPointThe TuioPoint class on the one hand is a simple container and utility class to handle TUIO positions in general, + on the other hand the TuioPoint is the base class for the TuioCursor and TuioObject classes.
TuioTimeThe TuioTime class is a simple structure that is used to reprent the time that has elapsed since the session start.
+  + +

+

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/doc/TUIO/package-tree.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/doc/TUIO/package-tree.html Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,150 @@ + + + + + + +TUIO Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package TUIO +

+
+

+Class Hierarchy +

+ +

+Interface Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/doc/allclasses-frame.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/doc/allclasses-frame.html Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,40 @@ + + + + + + +All Classes + + + + + + + + + + +All Classes +
+ + + + + +
TuioClient +
+TuioCursor +
+TuioListener +
+TuioObject +
+TuioPoint +
+TuioTime +
+
+ + + diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/doc/allclasses-noframe.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/doc/allclasses-noframe.html Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,40 @@ + + + + + + +All Classes + + + + + + + + + + +All Classes +
+ + + + + +
TuioClient +
+TuioCursor +
+TuioListener +
+TuioObject +
+TuioPoint +
+TuioTime +
+
+ + + diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/doc/constant-values.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/doc/constant-values.html Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,238 @@ + + + + + + +Constant Field Values + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Constant Field Values

+
+
+Contents + + + + + + +
+TUIO.*
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TUIO.TuioCursor
+public static final intTUIO_ACCELERATING1
+public static final intTUIO_ADDED0
+public static final intTUIO_DECELERATING2
+public static final intTUIO_REMOVED4
+public static final intTUIO_STOPPED3
+ +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TUIO.TuioObject
+public static final intTUIO_ACCELERATING1
+public static final intTUIO_ADDED0
+public static final intTUIO_DECELERATING2
+public static final intTUIO_REMOVED4
+public static final intTUIO_ROTATING5
+public static final intTUIO_STOPPED3
+ +

+ +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/doc/deprecated-list.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/doc/deprecated-list.html Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,138 @@ + + + + + + +Deprecated List + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Deprecated API

+
+
+Contents
    +
+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/doc/help-doc.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/doc/help-doc.html Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,205 @@ + + + + + + +API Help + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+How This API Document Is Organized

+
+This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

+Package

+
+ +

+Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

    +
  • Interfaces (italic)
  • Classes
  • Enums
  • Exceptions
  • Errors
  • Annotation Types
+
+

+Class/Interface

+
+ +

+Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
  • Class inheritance diagram
  • Direct Subclasses
  • All Known Subinterfaces
  • All Known Implementing Classes
  • Class/interface declaration
  • Class/interface description +

    +

  • Nested Class Summary
  • Field Summary
  • Constructor Summary
  • Method Summary +

    +

  • Field Detail
  • Constructor Detail
  • Method Detail
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+ +

+Annotation Type

+
+ +

+Each annotation type has its own separate page with the following sections:

    +
  • Annotation Type declaration
  • Annotation Type description
  • Required Element Summary
  • Optional Element Summary
  • Element Detail
+
+ +

+Enum

+
+ +

+Each enum has its own separate page with the following sections:

    +
  • Enum declaration
  • Enum description
  • Enum Constant Summary
  • Enum Constant Detail
+
+

+Tree (Class Hierarchy)

+
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
    +
  • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
  • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
+
+

+Deprecated API

+
+The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+

+Index

+
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+

+Prev/Next

+These links take you to the next or previous class, interface, package, or related page.

+Frames/No Frames

+These links show and hide the HTML frames. All pages are available with or without frames. +

+

+Serialized Form

+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. +

+

+Constant Field Values

+The Constant Field Values page lists the static final fields and their values. +

+ + +This help file applies to API documentation generated using the standard doclet. + +
+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/doc/index-all.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/doc/index-all.html Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,470 @@ + + + + + + +Index + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +A C D E G I R S T U X Y
+

+A

+
+
acceptMessage(Date, OSCMessage) - +Method in class TUIO.TuioClient +
The OSC callback method where all TUIO messages are received and decoded + and where the TUIO event callbacks are dispatched +
add(long) - +Method in class TUIO.TuioTime +
Sums the provided time value represented in total Microseconds to this TuioTime. +
add(TuioTime) - +Method in class TUIO.TuioTime +
Sums the provided TuioTime to the private Seconds and Microseconds attributes. +
addTuioCursor(TuioCursor) - +Method in interface TUIO.TuioListener +
This callback method is invoked by the TuioClient when a new TuioCursor is added to the session. +
addTuioListener(TuioListener) - +Method in class TUIO.TuioClient +
Adds the provided TuioListener to the list of registered TUIO event listeners +
addTuioObject(TuioObject) - +Method in interface TUIO.TuioListener +
This callback method is invoked by the TuioClient when a new TuioObject is added to the session. +
angle - +Variable in class TUIO.TuioObject +
The rotation angle value. +
+
+

+C

+
+
connect() - +Method in class TUIO.TuioClient +
The TuioClient starts listening to TUIO messages on the configured UDP port + All reveived TUIO messages are decoded and the resulting TUIO events are broadcasted to all registered TuioListeners +
currentTime - +Variable in class TUIO.TuioPoint +
The time stamp of the last update represented as TuioTime (time since session start) +
cursor_id - +Variable in class TUIO.TuioCursor +
The individual cursor ID number that is assigned to each TuioCursor. +
+
+

+D

+
+
disconnect() - +Method in class TUIO.TuioClient +
The TuioClient stops listening to TUIO messages on the configured UDP port +
+
+

+E

+
+
equals(TuioTime) - +Method in class TUIO.TuioTime +
Takes a TuioTime argument and compares the provided TuioTime to the private Seconds and Microseconds attributes. +
+
+

+G

+
+
getAngle() - +Method in class TUIO.TuioObject +
Returns the rotation angle of this TuioObject. +
getAngle(float, float) - +Method in class TUIO.TuioPoint +
Returns the angle to the provided coordinates +
getAngle(TuioPoint) - +Method in class TUIO.TuioPoint +
Returns the angle to the provided TuioPoint +
getAngleDegrees() - +Method in class TUIO.TuioObject +
Returns the rotation angle in degrees of this TuioObject. +
getAngleDegrees(float, float) - +Method in class TUIO.TuioPoint +
Returns the angle in degrees to the provided coordinates +
getAngleDegrees(TuioPoint) - +Method in class TUIO.TuioPoint +
Returns the angle in degrees to the provided TuioPoint +
getCursorID() - +Method in class TUIO.TuioCursor +
Returns the Cursor ID of this TuioCursor. +
getDistance(float, float) - +Method in class TUIO.TuioPoint +
Returns the distance to the provided coordinates +
getDistance(TuioPoint) - +Method in class TUIO.TuioPoint +
Returns the distance to the provided TuioPoint +
getMicroseconds() - +Method in class TUIO.TuioTime +
Returns the TuioTime Microseconds component. +
getRotationAccel() - +Method in class TUIO.TuioObject +
Returns the rotation acceleration of this TuioObject. +
getRotationSpeed() - +Method in class TUIO.TuioObject +
Returns the rotation speed of this TuioObject. +
getScreenX(int) - +Method in class TUIO.TuioPoint +
Returns the X coordinate in pixels relative to the provided screen width. +
getScreenY(int) - +Method in class TUIO.TuioPoint +
Returns the Y coordinate in pixels relative to the provided screen height. +
getSeconds() - +Method in class TUIO.TuioTime +
Returns the TuioTime Seconds component. +
getSessionTime() - +Static method in class TUIO.TuioTime +
Returns the present TuioTime representing the time since session start. +
getStartTime() - +Method in class TUIO.TuioPoint +
Returns the start time of this TuioPoint as TuioTime. +
getStartTime() - +Static method in class TUIO.TuioTime +
Returns the absolut TuioTime representing the session start. +
getSymbolID() - +Method in class TUIO.TuioObject +
Returns the symbol ID of this TuioObject. +
getSystemTime() - +Static method in class TUIO.TuioTime +
Returns the absolut TuioTime representing the current system time. +
getTotalMilliseconds() - +Method in class TUIO.TuioTime +
Returns the total TuioTime in Milliseconds. +
getTuioCursor(long) - +Method in class TUIO.TuioClient +
Returns the TuioCursor corresponding to the provided Session ID + or NULL if the Session ID does not refer to an active TuioCursor +
getTuioCursors() - +Method in class TUIO.TuioClient +
Returns a Vector of all currently active TuioCursors +
getTuioObject(long) - +Method in class TUIO.TuioClient +
Returns the TuioObject corresponding to the provided Session ID + or NULL if the Session ID does not refer to an active TuioObject +
getTuioObjects() - +Method in class TUIO.TuioClient +
Returns a Vector of all currently active TuioObjects +
getTuioTime() - +Method in class TUIO.TuioPoint +
Returns the time stamp of this TuioPoint as TuioTime. +
getX() - +Method in class TUIO.TuioPoint +
Returns the X coordinate of this TuioPoint. +
getY() - +Method in class TUIO.TuioPoint +
Returns the Y coordinate of this TuioPoint. +
+
+

+I

+
+
initSession() - +Static method in class TUIO.TuioTime +
This static method globally resets the TUIO session time. +
isConnected() - +Method in class TUIO.TuioClient +
Returns true if this TuioClient is currently connected. +
isMoving() - +Method in class TUIO.TuioObject +
Returns true of this TuioObject is moving. +
+
+

+R

+
+
refresh(TuioTime) - +Method in interface TUIO.TuioListener +
This callback method is invoked by the TuioClient to mark the end of a received TUIO message bundle. +
removeAllTuioListeners() - +Method in class TUIO.TuioClient +
Removes all TuioListener from the list of registered TUIO event listeners +
removeTuioCursor(TuioCursor) - +Method in interface TUIO.TuioListener +
This callback method is invoked by the TuioClient when an existing TuioCursor is removed from the session. +
removeTuioListener(TuioListener) - +Method in class TUIO.TuioClient +
Removes the provided TuioListener from the list of registered TUIO event listeners +
removeTuioObject(TuioObject) - +Method in interface TUIO.TuioListener +
This callback method is invoked by the TuioClient when an existing TuioObject is removed from the session. +
reset() - +Method in class TUIO.TuioTime +
Resets the seconds and micro_seconds attributes to zero. +
rotation_accel - +Variable in class TUIO.TuioObject +
The rotation acceleration value. +
rotation_speed - +Variable in class TUIO.TuioObject +
The rotation speed value. +
+
+

+S

+
+
startTime - +Variable in class TUIO.TuioPoint +
The creation time of this TuioPoint represented as TuioTime (time since session start) +
stop(TuioTime) - +Method in class TUIO.TuioObject +
This method is used to calculate the speed and acceleration values of a + TuioObject with unchanged position and angle. +
subtract(long) - +Method in class TUIO.TuioTime +
Subtracts the provided time represented in Microseconds from the private Seconds and Microseconds attributes. +
subtract(TuioTime) - +Method in class TUIO.TuioTime +
Subtracts the provided TuioTime from the private Seconds and Microseconds attributes. +
symbol_id - +Variable in class TUIO.TuioObject +
The individual symbol ID number that is assigned to each TuioObject. +
+
+

+T

+
+
TUIO - package TUIO
 
TUIO_ROTATING - +Static variable in class TUIO.TuioObject +
Defines the ROTATING state. +
TuioClient - Class in TUIO
The TuioClient class is the central TUIO protocol decoder component.
TuioClient() - +Constructor for class TUIO.TuioClient +
The default constructor creates a client that listens to the default TUIO port 3333 +
TuioClient(int) - +Constructor for class TUIO.TuioClient +
This constructor creates a client that listens to the provided port +
TuioCursor - Class in TUIO
The TuioCursor class encapsulates /tuio/2Dcur TUIO cursors.
TuioCursor(TuioTime, long, int, float, float) - +Constructor for class TUIO.TuioCursor +
This constructor takes a TuioTime argument and assigns it along with the provided + Session ID, Cursor ID, X and Y coordinate to the newly created TuioCursor. +
TuioCursor(long, int, float, float) - +Constructor for class TUIO.TuioCursor +
This constructor takes the provided Session ID, Cursor ID, X and Y coordinate + and assigs these values to the newly created TuioCursor. +
TuioCursor(TuioCursor) - +Constructor for class TUIO.TuioCursor +
This constructor takes the atttibutes of the provided TuioCursor + and assigs these values to the newly created TuioCursor. +
TuioListener - Interface in TUIO
The TuioListener interface provides a simple callback infrastructure which is used by the TuioClient class + to dispatch TUIO events to all registered instances of classes that implement the TuioListener interface defined here.
TuioObject - Class in TUIO
The TuioObject class encapsulates /tuio/2Dobj TUIO objects.
TuioObject(TuioTime, long, int, float, float, float) - +Constructor for class TUIO.TuioObject +
This constructor takes a TuioTime argument and assigns it along with the provided + Session ID, Symbol ID, X and Y coordinate and angle to the newly created TuioObject. +
TuioObject(long, int, float, float, float) - +Constructor for class TUIO.TuioObject +
This constructor takes the provided Session ID, Symbol ID, X and Y coordinate + and angle, and assigs these values to the newly created TuioObject. +
TuioObject(TuioObject) - +Constructor for class TUIO.TuioObject +
This constructor takes the atttibutes of the provided TuioObject + and assigs these values to the newly created TuioObject. +
TuioPoint - Class in TUIO
The TuioPoint class on the one hand is a simple container and utility class to handle TUIO positions in general, + on the other hand the TuioPoint is the base class for the TuioCursor and TuioObject classes.
TuioPoint() - +Constructor for class TUIO.TuioPoint +
The default constructor takes no arguments and sets + its coordinate attributes to zero and its time stamp to the current session time. +
TuioPoint(float, float) - +Constructor for class TUIO.TuioPoint +
This constructor takes two floating point coordinate arguments and sets + its coordinate attributes to these values and its time stamp to the current session time. +
TuioPoint(TuioPoint) - +Constructor for class TUIO.TuioPoint +
This constructor takes a TuioPoint argument and sets its coordinate attributes + to the coordinates of the provided TuioPoint and its time stamp to the current session time. +
TuioPoint(TuioTime, float, float) - +Constructor for class TUIO.TuioPoint +
This constructor takes a TuioTime object and two floating point coordinate arguments and sets + its coordinate attributes to these values and its time stamp to the provided TUIO time object. +
TuioTime - Class in TUIO
The TuioTime class is a simple structure that is used to reprent the time that has elapsed since the session start.
TuioTime() - +Constructor for class TUIO.TuioTime +
The default constructor takes no arguments and sets + the Seconds and Microseconds attributes of the newly created TuioTime both to zero. +
TuioTime(long) - +Constructor for class TUIO.TuioTime +
This constructor takes the provided time represented in total Milliseconds + and assigs this value to the newly created TuioTime. +
TuioTime(long, long) - +Constructor for class TUIO.TuioTime +
This constructor takes the provided time represented in Seconds and Microseconds + and assigs these value to the newly created TuioTime. +
TuioTime(TuioTime) - +Constructor for class TUIO.TuioTime +
This constructor takes the provided TuioTime + and assigs its Seconds and Microseconds values to the newly created TuioTime. +
+
+

+U

+
+
update(TuioTime, float, float, float, float, float, float, float, float) - +Method in class TUIO.TuioObject +
Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate, angle, X and Y velocity, motion acceleration, + rotation speed and rotation acceleration to the private TuioObject attributes. +
update(float, float, float, float, float, float, float, float) - +Method in class TUIO.TuioObject +
Assigns the provided X and Y coordinate, angle, X and Y velocity, motion acceleration + rotation velocity and rotation acceleration to the private TuioContainer attributes. +
update(TuioTime, float, float, float) - +Method in class TUIO.TuioObject +
Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate and angle to the private TuioObject attributes. +
update(TuioObject) - +Method in class TUIO.TuioObject +
Takes the atttibutes of the provided TuioObject + and assigs these values to this TuioObject. +
update(TuioPoint) - +Method in class TUIO.TuioPoint +
Takes a TuioPoint argument and updates its coordinate attributes + to the coordinates of the provided TuioPoint and leaves its time stamp unchanged. +
update(float, float) - +Method in class TUIO.TuioPoint +
Takes two floating point coordinate arguments and updates its coordinate attributes + to the coordinates of the provided TuioPoint and leaves its time stamp unchanged. +
update(TuioTime, float, float) - +Method in class TUIO.TuioPoint +
Takes a TuioTime object and two floating point coordinate arguments and updates its coordinate attributes + to the coordinates of the provided TuioPoint and its time stamp to the provided TUIO time object. +
updateTuioCursor(TuioCursor) - +Method in interface TUIO.TuioListener +
This callback method is invoked by the TuioClient when an existing TuioCursor is updated during the session. +
updateTuioObject(TuioObject) - +Method in interface TUIO.TuioListener +
This callback method is invoked by the TuioClient when an existing TuioObject is updated during the session. +
+
+

+X

+
+
xpos - +Variable in class TUIO.TuioPoint +
X coordinate, representated as a floating point value in a range of 0..1 +
+
+

+Y

+
+
ypos - +Variable in class TUIO.TuioPoint +
Y coordinate, representated as a floating point value in a range of 0..1 +
+
+A C D E G I R S T U X Y + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/doc/index.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/doc/index.html Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,36 @@ + + + + + + +Generated Documentation (Untitled) + + + + + + + + +<H2> +Frame Alert</H2> + +<P> +This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. +<BR> +Link to<A HREF="TUIO/package-summary.html">Non-frame version.</A> + + + diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/doc/overview-tree.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/doc/overview-tree.html Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,152 @@ + + + + + + +Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For All Packages

+
+
+
Package Hierarchies:
TUIO
+
+

+Class Hierarchy +

+ +

+Interface Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/doc/package-list --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/doc/package-list Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,1 @@ +TUIO diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/doc/resources/inherit.gif Binary file front_processing/extern/TUIO_JAVA/doc/resources/inherit.gif has changed diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/doc/stylesheet.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/doc/stylesheet.css Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,29 @@ +/* Javadoc style sheet */ + +/* Define colors, fonts and other style attributes here to override the defaults */ + +/* Page background color */ +body { background-color: #FFFFFF } + +/* Headings */ +h1 { font-size: 145% } + +/* Table colors */ +.TableHeadingColor { background: #CCCCFF } /* Dark mauve */ +.TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ +.TableRowColor { background: #FFFFFF } /* White */ + +/* Font used in left-hand frame lists */ +.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif } +.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } +.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } + +/* Navigation bar fonts and colors */ +.NavBarCell1 { background-color:#EEEEFF;} /* Light mauve */ +.NavBarCell1Rev { background-color:#00008B;} /* Dark Blue */ +.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} +.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} + +.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} +.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} + diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/libTUIO.jar Binary file front_processing/extern/TUIO_JAVA/libTUIO.jar has changed diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/TUIO/TuioClient.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/TUIO/TuioClient.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,463 @@ +/* + TUIO Java backend - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +package TUIO; + +import com.illposed.osc.*; +import java.util.*; + +/** + * The TuioClient class is the central TUIO protocol decoder component. It provides a simple callback infrastructure using the {@link TuioListener} interface. + * In order to receive and decode TUIO messages an instance of TuioClient needs to be created. The TuioClient instance then generates TUIO events + * which are broadcasted to all registered classes that implement the {@link TuioListener} interface.

+ * + * TuioClient client = new TuioClient();
+ * client.addTuioListener(myTuioListener);
+ * client.connect();
+ *
+ * + * @author Martin Kaltenbrunner + * @version 1.4 + */ +public class TuioClient implements OSCListener { + + private int port = 3333; + private OSCPortIn oscPort; + private boolean connected = false; + private Hashtable objectList = new Hashtable(); + private Vector aliveObjectList = new Vector(); + private Vector newObjectList = new Vector(); + private Hashtable cursorList = new Hashtable(); + private Vector aliveCursorList = new Vector(); + private Vector newCursorList = new Vector(); + + private Vector frameObjects = new Vector(); + private Vector frameCursors = new Vector(); + + private Vector freeCursorList = new Vector(); + private int maxCursorID = -1; + + private long currentFrame = 0; + private TuioTime currentTime; + + private Vector listenerList = new Vector(); + + /** + * The default constructor creates a client that listens to the default TUIO port 3333 + */ + public TuioClient() {} + + /** + * This constructor creates a client that listens to the provided port + * + * @param port the listening port number + */ + public TuioClient(int port) { + this.port = port; + } + + /** + * The TuioClient starts listening to TUIO messages on the configured UDP port + * All reveived TUIO messages are decoded and the resulting TUIO events are broadcasted to all registered TuioListeners + */ + public void connect() { + + TuioTime.initSession(); + currentTime = new TuioTime(); + currentTime.reset(); + + try { + oscPort = new OSCPortIn(port); + oscPort.addListener("/tuio/2Dobj",this); + oscPort.addListener("/tuio/2Dcur",this); + oscPort.startListening(); + connected = true; + } catch (Exception e) { + System.out.println("TuioClient: failed to connect to port "+port); + connected = false; + } + } + + /** + * The TuioClient stops listening to TUIO messages on the configured UDP port + */ + public void disconnect() { + oscPort.stopListening(); + try { Thread.sleep(100); } + catch (Exception e) {}; + oscPort.close(); + connected = false; + } + + /** + * Returns true if this TuioClient is currently connected. + * @return true if this TuioClient is currently connected + */ + public boolean isConnected() { return connected; } + + /** + * Adds the provided TuioListener to the list of registered TUIO event listeners + * + * @param listener the TuioListener to add + */ + public void addTuioListener(TuioListener listener) { + listenerList.addElement(listener); + } + + /** + * Removes the provided TuioListener from the list of registered TUIO event listeners + * + * @param listener the TuioListener to remove + */ + public void removeTuioListener(TuioListener listener) { + listenerList.removeElement(listener); + } + + /** + * Removes all TuioListener from the list of registered TUIO event listeners + */ + public void removeAllTuioListeners() { + listenerList.clear(); + } + + /** + * Returns a Vector of all currently active TuioObjects + * + * @return a Vector of all currently active TuioObjects + */ + public Vector getTuioObjects() { + return new Vector(objectList.values()); + } + + /** + * Returns a Vector of all currently active TuioCursors + * + * @return a Vector of all currently active TuioCursors + */ + public Vector getTuioCursors() { + return new Vector(cursorList.values()); + } + + /** + * Returns the TuioObject corresponding to the provided Session ID + * or NULL if the Session ID does not refer to an active TuioObject + * + * @return an active TuioObject corresponding to the provided Session ID or NULL + */ + public TuioObject getTuioObject(long s_id) { + return objectList.get(s_id); + } + + /** + * Returns the TuioCursor corresponding to the provided Session ID + * or NULL if the Session ID does not refer to an active TuioCursor + * + * @return an active TuioCursor corresponding to the provided Session ID or NULL + */ + public TuioCursor getTuioCursor(long s_id) { + return cursorList.get(s_id); + } + + /** + * The OSC callback method where all TUIO messages are received and decoded + * and where the TUIO event callbacks are dispatched + * + * @param date the time stamp of the OSC bundle + * @param message the received OSC message + */ + public void acceptMessage(Date date, OSCMessage message) { + + Object[] args = message.getArguments(); + String command = (String)args[0]; + String address = message.getAddress(); + + if (address.equals("/tuio/2Dobj")) { + + if (command.equals("set")) { + + long s_id = ((Integer)args[1]).longValue(); + int c_id = ((Integer)args[2]).intValue(); + float xpos = ((Float)args[3]).floatValue(); + float ypos = ((Float)args[4]).floatValue(); + float angle = ((Float)args[5]).floatValue(); + float xspeed = ((Float)args[6]).floatValue(); + float yspeed = ((Float)args[7]).floatValue(); + float rspeed = ((Float)args[8]).floatValue(); + float maccel = ((Float)args[9]).floatValue(); + float raccel = ((Float)args[10]).floatValue(); + + if (objectList.get(s_id) == null) { + + TuioObject addObject = new TuioObject(s_id,c_id,xpos,ypos,angle); + frameObjects.addElement(addObject); + + } else { + + TuioObject tobj = objectList.get(s_id); + if (tobj==null) return; + if ((tobj.xpos!=xpos) || (tobj.ypos!=ypos) || (tobj.angle!=angle) || (tobj.x_speed!=xspeed) || (tobj.y_speed!=yspeed) || (tobj.rotation_speed!=rspeed) || (tobj.motion_accel!=maccel) || (tobj.rotation_accel!=raccel)) { + + TuioObject updateObject = new TuioObject(s_id,c_id,xpos,ypos,angle); + updateObject.update(xpos,ypos,angle,xspeed,yspeed,rspeed,maccel,raccel); + frameObjects.addElement(updateObject); + } + + } + + } else if (command.equals("alive")) { + + newObjectList.clear(); + for (int i=1;i0) { + if (fseq>currentFrame) currentTime = TuioTime.getSessionTime(); + if ((fseq>=currentFrame) || ((currentFrame-fseq)>100)) currentFrame=fseq; + else lateFrame = true; + } else if (TuioTime.getSessionTime().subtract(currentTime).getTotalMilliseconds()>100) { + currentTime = TuioTime.getSessionTime(); + } + + if (!lateFrame) { + Enumeration frameEnum = frameObjects.elements(); + while(frameEnum.hasMoreElements()) { + TuioObject tobj = frameEnum.nextElement(); + + switch (tobj.getTuioState()) { + case TuioObject.TUIO_REMOVED: + TuioObject removeObject = tobj; + removeObject.remove(currentTime); + for (int i=0;i buffer = aliveObjectList; + aliveObjectList = newObjectList; + // recycling the vector + newObjectList = buffer; + } + frameObjects.clear(); + } + } else if (address.equals("/tuio/2Dcur")) { + + if (command.equals("set")) { + + long s_id = ((Integer)args[1]).longValue(); + float xpos = ((Float)args[2]).floatValue(); + float ypos = ((Float)args[3]).floatValue(); + float xspeed = ((Float)args[4]).floatValue(); + float yspeed = ((Float)args[5]).floatValue(); + float maccel = ((Float)args[6]).floatValue(); + + if (cursorList.get(s_id) == null) { + + TuioCursor addCursor = new TuioCursor(s_id, -1 ,xpos,ypos); + frameCursors.addElement(addCursor); + + } else { + + TuioCursor tcur = cursorList.get(s_id); + if (tcur==null) return; + if ((tcur.xpos!=xpos) || (tcur.ypos!=ypos) || (tcur.x_speed!=xspeed) || (tcur.y_speed!=yspeed) || (tcur.motion_accel!=maccel)) { + + TuioCursor updateCursor = new TuioCursor(s_id,tcur.getCursorID(),xpos,ypos); + updateCursor.update(xpos,ypos,xspeed,yspeed,maccel); + frameCursors.addElement(updateCursor); + } + } + + //System.out.println("set cur " + s_id+" "+xpos+" "+ypos+" "+xspeed+" "+yspeed+" "+maccel); + + } else if (command.equals("alive")) { + + newCursorList.clear(); + for (int i=1;i0) { + if (fseq>currentFrame) currentTime = TuioTime.getSessionTime(); + if ((fseq>=currentFrame) || ((currentFrame-fseq)>100)) currentFrame = fseq; + else lateFrame = true; + } else if (TuioTime.getSessionTime().subtract(currentTime).getTotalMilliseconds()>100) { + currentTime = TuioTime.getSessionTime(); + } + if (!lateFrame) { + + Enumeration frameEnum = frameCursors.elements(); + while(frameEnum.hasMoreElements()) { + TuioCursor tcur = frameEnum.nextElement(); + + switch (tcur.getTuioState()) { + case TuioCursor.TUIO_REMOVED: + + TuioCursor removeCursor = tcur; + removeCursor.remove(currentTime); + + for (int i=0;i0) { + Enumeration clist = cursorList.elements(); + while (clist.hasMoreElements()) { + int c_id = clist.nextElement().getCursorID(); + if (c_id>maxCursorID) maxCursorID=c_id; + } + + Enumeration flist = freeCursorList.elements(); + while (flist.hasMoreElements()) { + int c_id = flist.nextElement().getCursorID(); + if (c_id>=maxCursorID) freeCursorList.removeElement(c_id); + } + } else freeCursorList.clear(); + } else if (removeCursor.getCursorID()0)) { + TuioCursor closestCursor = freeCursorList.firstElement(); + Enumeration testList = freeCursorList.elements(); + while (testList.hasMoreElements()) { + TuioCursor testCursor = testList.nextElement(); + if (testCursor.getDistance(tcur) buffer = aliveCursorList; + aliveCursorList = newCursorList; + // recycling the vector + newCursorList = buffer; + } + + frameCursors.clear(); + } + + } + } +} diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/TUIO/TuioContainer.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/TUIO/TuioContainer.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,335 @@ +/* + TUIO Java backend - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +package TUIO; + +import java.util.*; + +/** + * The abstract TuioContainer class defines common attributes that apply to both subclasses {@link TuioObject} and {@link TuioCursor}. + * + * @author Martin Kaltenbrunner + * @version 1.4 + */ +abstract class TuioContainer extends TuioPoint { + + /** + * The unique session ID number that is assigned to each TUIO object or cursor. + */ + protected long session_id; + /** + * The X-axis velocity value. + */ + protected float x_speed; + /** + * The Y-axis velocity value. + */ + protected float y_speed; + /** + * The motion speed value. + */ + protected float motion_speed; + /** + * The motion acceleration value. + */ + protected float motion_accel; + /** + * A Vector of TuioPoints containing all the previous positions of the TUIO component. + */ + protected Vector path; + /** + * Defines the ADDED state. + */ + public static final int TUIO_ADDED = 0; + /** + * Defines the ACCELERATING state. + */ + public static final int TUIO_ACCELERATING = 1; + /** + * Defines the DECELERATING state. + */ + public static final int TUIO_DECELERATING = 2; + /** + * Defines the STOPPED state. + */ + public static final int TUIO_STOPPED = 3; + /** + * Defines the REMOVED state. + */ + public static final int TUIO_REMOVED = 4; + /** + * Reflects the current state of the TuioComponent + */ + protected int state; + + /** + * This constructor takes a TuioTime argument and assigns it along with the provided + * Session ID, X and Y coordinate to the newly created TuioContainer. + * + * @param ttime the TuioTime to assign + * @param si the Session ID to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + */ + TuioContainer(TuioTime ttime, long si, float xp, float yp) { + super(ttime,xp,yp); + + session_id = si; + x_speed = 0.0f; + y_speed = 0.0f; + motion_speed = 0.0f; + motion_accel = 0.0f; + + path = new Vector(); + path.addElement(new TuioPoint(currentTime,xpos,ypos)); + state = TUIO_ADDED; + } + + /** + * This constructor takes the provided Session ID, X and Y coordinate + * and assigs these values to the newly created TuioContainer. + * + * @param si the Session ID to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + */ + TuioContainer(long si, float xp, float yp) { + super(xp,yp); + + session_id = si; + x_speed = 0.0f; + y_speed = 0.0f; + motion_speed = 0.0f; + motion_accel = 0.0f; + + path = new Vector(); + path.addElement(new TuioPoint(currentTime,xpos,ypos)); + state = TUIO_ADDED; + } + + /** + * This constructor takes the atttibutes of the provided TuioContainer + * and assigs these values to the newly created TuioContainer. + * + * @param tcon the TuioContainer to assign + */ + TuioContainer(TuioContainer tcon) { + super(tcon); + + session_id = tcon.getSessionID(); + x_speed = 0.0f; + y_speed = 0.0f; + motion_speed = 0.0f; + motion_accel = 0.0f; + + path = new Vector(); + path.addElement(new TuioPoint(currentTime,xpos,ypos)); + state = TUIO_ADDED; + } + + /** + * Takes a TuioTime argument and assigns it along with the provided + * X and Y coordinate to the private TuioContainer attributes. + * The speed and accleration values are calculated accordingly. + * + * @param ttime the TuioTime to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + */ + public void update(TuioTime ttime, float xp, float yp) { + TuioPoint lastPoint = path.lastElement(); + super.update(ttime,xp,yp); + + TuioTime diffTime = currentTime.subtract(lastPoint.getTuioTime()); + float dt = diffTime.getTotalMilliseconds()/1000.0f; + float dx = this.xpos - lastPoint.getX(); + float dy = this.ypos - lastPoint.getY(); + float dist = (float)Math.sqrt(dx*dx+dy*dy); + float last_motion_speed = this.motion_speed; + + this.x_speed = dx/dt; + this.y_speed = dy/dt; + this.motion_speed = dist/dt; + this.motion_accel = (motion_speed - last_motion_speed)/dt; + + path.addElement(new TuioPoint(currentTime,xpos,ypos)); + if (motion_accel>0) state = TUIO_ACCELERATING; + else if (motion_accel<0) state = TUIO_DECELERATING; + else state = TUIO_STOPPED; + } + + /** + * This method is used to calculate the speed and acceleration values of + * TuioContainers with unchanged positions. + */ + public void stop(TuioTime ttime) { + update(ttime,xpos,ypos); + } + + /** + * Takes a TuioTime argument and assigns it along with the provided + * X and Y coordinate, X and Y velocity and acceleration + * to the private TuioContainer attributes. + * + * @param ttime the TuioTime to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param xs the X velocity to assign + * @param ys the Y velocity to assign + * @param ma the acceleration to assign + */ + public void update(TuioTime ttime, float xp, float yp , float xs, float ys, float ma) { + super.update(ttime,xp,yp); + x_speed = xs; + y_speed = ys; + motion_speed = (float)Math.sqrt(x_speed*x_speed+y_speed*y_speed); + motion_accel = ma; + path.addElement(new TuioPoint(currentTime,xpos,ypos)); + if (motion_accel>0) state = TUIO_ACCELERATING; + else if (motion_accel<0) state = TUIO_DECELERATING; + else state = TUIO_STOPPED; + } + + /** + * Assigns the provided X and Y coordinate, X and Y velocity and acceleration + * to the private TuioContainer attributes. The TuioTime time stamp remains unchanged. + * + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param xs the X velocity to assign + * @param ys the Y velocity to assign + * @param ma the acceleration to assign + */ + public void update(float xp, float yp,float xs,float ys,float ma) { + super.update(xp,yp); + x_speed = xs; + y_speed = ys; + motion_speed = (float)Math.sqrt(x_speed*x_speed+y_speed*y_speed); + motion_accel = ma; + path.addElement(new TuioPoint(currentTime,xpos,ypos)); + if (motion_accel>0) state = TUIO_ACCELERATING; + else if (motion_accel<0) state = TUIO_DECELERATING; + else state = TUIO_STOPPED; + } + + /** + * Takes the atttibutes of the provided TuioContainer + * and assigs these values to this TuioContainer. + * The TuioTime time stamp of this TuioContainer remains unchanged. + * + * @param tcon the TuioContainer to assign + */ + public void update (TuioContainer tcon) { + super.update(tcon); + x_speed = tcon.getXSpeed(); + y_speed = tcon.getYSpeed(); + motion_speed = tcon.getMotionSpeed(); + motion_accel = tcon.getMotionAccel(); + path.addElement(new TuioPoint(currentTime,xpos,ypos)); + if (motion_accel>0) state = TUIO_ACCELERATING; + else if (motion_accel<0) state = TUIO_DECELERATING; + else state = TUIO_STOPPED; + } + + /** + * Assigns the REMOVE state to this TuioContainer and sets + * its TuioTime time stamp to the provided TuioTime argument. + * + * @param ttime the TuioTime to assign + */ + public void remove(TuioTime ttime) { + currentTime = new TuioTime(ttime); + state = TUIO_REMOVED; + } + + /** + * Returns the Session ID of this TuioContainer. + * @return the Session ID of this TuioContainer + */ + public long getSessionID() { + return session_id; + } + + /** + * Returns the X velocity of this TuioContainer. + * @return the X velocity of this TuioContainer + */ + public float getXSpeed() { + return x_speed; + } + + /** + * Returns the Y velocity of this TuioContainer. + * @return the Y velocity of this TuioContainer + */ + public float getYSpeed() { + return y_speed; + } + + /** + * Returns the position of this TuioContainer. + * @return the position of this TuioContainer + */ + public TuioPoint getPosition() { + return new TuioPoint(xpos,ypos); + } + + /** + * Returns the path of this TuioContainer. + * @return the path of this TuioContainer + */ + public Vector getPath() { + return path; + } + + /** + * Returns the motion speed of this TuioContainer. + * @return the motion speed of this TuioContainer + */ + public float getMotionSpeed() { + return motion_speed; + } + + /** + * Returns the motion acceleration of this TuioContainer. + * @return the motion acceleration of this TuioContainer + */ + public float getMotionAccel() { + return motion_accel; + } + + /** + * Returns the TUIO state of this TuioContainer. + * @return the TUIO state of this TuioContainer + */ + public int getTuioState() { + return state; + } + + /** + * Returns true of this TuioContainer is moving. + * @return true of this TuioContainer is moving + */ + public boolean isMoving() { + if ((state==TUIO_ACCELERATING) || (state==TUIO_DECELERATING)) return true; + else return false; + } + +} diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/TUIO/TuioCursor.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/TUIO/TuioCursor.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,84 @@ +/* + TUIO Java backend - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +package TUIO; + +/** + * The TuioCursor class encapsulates /tuio/2Dcur TUIO cursors. + * + * @author Martin Kaltenbrunner + * @version 1.4 + */ +public class TuioCursor extends TuioContainer { + + /** + * The individual cursor ID number that is assigned to each TuioCursor. + */ + protected int cursor_id; + + /** + * This constructor takes a TuioTime argument and assigns it along with the provided + * Session ID, Cursor ID, X and Y coordinate to the newly created TuioCursor. + * + * @param ttime the TuioTime to assign + * @param si the Session ID to assign + * @param ci the Cursor ID to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + */ + public TuioCursor (TuioTime ttime, long si, int ci, float xp, float yp) { + super(ttime, si,xp,yp); + this.cursor_id = ci; + } + + /** + * This constructor takes the provided Session ID, Cursor ID, X and Y coordinate + * and assigs these values to the newly created TuioCursor. + * + * @param si the Session ID to assign + * @param ci the Cursor ID to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + */ + public TuioCursor (long si, int ci, float xp, float yp) { + super(si,xp,yp); + this.cursor_id = ci; + } + + /** + * This constructor takes the atttibutes of the provided TuioCursor + * and assigs these values to the newly created TuioCursor. + * + * @param tcur the TuioCursor to assign + */ + public TuioCursor (TuioCursor tcur) { + super(tcur); + this.cursor_id = tcur.getCursorID(); + } + + /** + * Returns the Cursor ID of this TuioCursor. + * @return the Cursor ID of this TuioCursor + */ + public int getCursorID() { + return cursor_id; + } + +} diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/TUIO/TuioListener.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/TUIO/TuioListener.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,90 @@ +/* + TUIO Java backend - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +package TUIO; + +/** + * The TuioListener interface provides a simple callback infrastructure which is used by the {@link TuioClient} class + * to dispatch TUIO events to all registered instances of classes that implement the TuioListener interface defined here.

+ * Any class that implements the TuioListener interface is required to implement all of the callback methods defined here. + * The {@link TuioClient} makes use of these interface methods in order to dispatch TUIO events to all registered TuioListener implementations.

+ * + * public class MyTuioListener implements TuioListener
+ * ...

+ * MyTuioListener listener = new MyTuioListener();
+ * TuioClient client = new TuioClient();
+ * client.addTuioListener(listener);
+ * client.start();
+ *
+ * + * @author Martin Kaltenbrunner + * @version 1.4 + */ +public interface TuioListener { + + /** + * This callback method is invoked by the TuioClient when a new TuioObject is added to the session. + * + * @param tobj the TuioObject reference associated to the addTuioObject event + */ + public void addTuioObject(TuioObject tobj); + + /** + * This callback method is invoked by the TuioClient when an existing TuioObject is updated during the session. + * + * @param tobj the TuioObject reference associated to the updateTuioObject event + */ + public void updateTuioObject(TuioObject tobj); + + /** + * This callback method is invoked by the TuioClient when an existing TuioObject is removed from the session. + * + * @param tobj the TuioObject reference associated to the removeTuioObject event + */ + public void removeTuioObject(TuioObject tobj); + + /** + * This callback method is invoked by the TuioClient when a new TuioCursor is added to the session. + * + * @param tcur the TuioCursor reference associated to the addTuioCursor event + */ + public void addTuioCursor(TuioCursor tcur); + + /** + * This callback method is invoked by the TuioClient when an existing TuioCursor is updated during the session. + * + * @param tcur the TuioCursor reference associated to the updateTuioCursor event + */ + public void updateTuioCursor(TuioCursor tcur); + + /** + * This callback method is invoked by the TuioClient when an existing TuioCursor is removed from the session. + * + * @param tcur the TuioCursor reference associated to the removeTuioCursor event + */ + public void removeTuioCursor(TuioCursor tcur); + + /** + * This callback method is invoked by the TuioClient to mark the end of a received TUIO message bundle. + * + * @param ftime the TuioTime associated to the current TUIO message bundle + */ + public void refresh(TuioTime ftime); +} diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/TUIO/TuioObject.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/TUIO/TuioObject.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,251 @@ +/* + TUIO Java backend - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +package TUIO; + +/** + * The TuioObject class encapsulates /tuio/2Dobj TUIO objects. + * + * @author Martin Kaltenbrunner + * @version 1.4 + */ +public class TuioObject extends TuioContainer { + + /** + * The individual symbol ID number that is assigned to each TuioObject. + */ + protected int symbol_id; + /** + * The rotation angle value. + */ + protected float angle; + /** + * The rotation speed value. + */ + protected float rotation_speed; + /** + * The rotation acceleration value. + */ + protected float rotation_accel; + /** + * Defines the ROTATING state. + */ + public static final int TUIO_ROTATING = 5; + + /** + * This constructor takes a TuioTime argument and assigns it along with the provided + * Session ID, Symbol ID, X and Y coordinate and angle to the newly created TuioObject. + * + * @param ttime the TuioTime to assign + * @param si the Session ID to assign + * @param sym the Symbol ID to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param a the angle to assign + */ + public TuioObject (TuioTime ttime, long si, int sym, float xp, float yp, float a) { + super(ttime, si,xp,yp); + symbol_id = sym; + angle = a; + rotation_speed = 0.0f; + rotation_accel = 0.0f; + } + + /** + * This constructor takes the provided Session ID, Symbol ID, X and Y coordinate + * and angle, and assigs these values to the newly created TuioObject. + * + * @param si the Session ID to assign + * @param sym the Symbol ID to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param a the angle to assign + */ + public TuioObject (long si, int sym, float xp, float yp, float a) { + super(si,xp,yp); + symbol_id = sym; + angle = angle; + rotation_speed = 0.0f; + rotation_accel = 0.0f; + } + + /** + * This constructor takes the atttibutes of the provided TuioObject + * and assigs these values to the newly created TuioObject. + * + * @param tobj the TuioObject to assign + */ + public TuioObject (TuioObject tobj) { + super(tobj); + symbol_id = tobj.getSymbolID(); + angle = tobj.getAngle(); + rotation_speed = 0.0f; + rotation_accel = 0.0f; + } + + /** + * Takes a TuioTime argument and assigns it along with the provided + * X and Y coordinate, angle, X and Y velocity, motion acceleration, + * rotation speed and rotation acceleration to the private TuioObject attributes. + * + * @param ttime the TuioTime to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param a the angle coordinate to assign + * @param xs the X velocity to assign + * @param ys the Y velocity to assign + * @param rs the rotation velocity to assign + * @param ma the motion acceleration to assign + * @param ra the rotation acceleration to assign + */ + public void update (TuioTime ttime, float xp, float yp, float a, float xs, float ys, float rs, float ma, float ra) { + super.update(ttime,xp,yp,xs,ys,ma); + angle = a; + rotation_speed = rs; + rotation_accel = ra; + if ((rotation_accel!=0) && (state!=TUIO_STOPPED)) state = TUIO_ROTATING; + } + + /** + * Assigns the provided X and Y coordinate, angle, X and Y velocity, motion acceleration + * rotation velocity and rotation acceleration to the private TuioContainer attributes. + * The TuioTime time stamp remains unchanged. + * + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param a the angle coordinate to assign + * @param xs the X velocity to assign + * @param ys the Y velocity to assign + * @param rs the rotation velocity to assign + * @param ma the motion acceleration to assign + * @param ra the rotation acceleration to assign + */ + public void update (float xp, float yp, float a, float xs, float ys, float rs, float ma, float ra) { + super.update(xp,yp,xs,ys,ma); + angle = a; + rotation_speed = rs; + rotation_accel = ra; + if ((rotation_accel!=0) && (state!=TUIO_STOPPED)) state = TUIO_ROTATING; + } + + /** + * Takes a TuioTime argument and assigns it along with the provided + * X and Y coordinate and angle to the private TuioObject attributes. + * The speed and accleration values are calculated accordingly. + * + * @param ttime the TuioTime to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + * @param a the angle coordinate to assign + */ + public void update (TuioTime ttime, float xp, float yp, float a) { + TuioPoint lastPoint = path.lastElement(); + super.update(ttime,xp,yp); + + TuioTime diffTime = currentTime.subtract(lastPoint.getTuioTime()); + float dt = diffTime.getTotalMilliseconds()/1000.0f; + float last_angle = angle; + float last_rotation_speed = rotation_speed; + angle = a; + + float da = (this.angle-last_angle)/(2.0f*(float)Math.PI); + if (da>0.75f) da-=1.0f; + else if (da<-0.75f) da+=1.0f; + + rotation_speed = da/dt; + rotation_accel = (rotation_speed - last_rotation_speed)/dt; + if ((rotation_accel!=0) && (state!=TUIO_STOPPED)) state = TUIO_ROTATING; + } + + /** + * Takes the atttibutes of the provided TuioObject + * and assigs these values to this TuioObject. + * The TuioTime time stamp of this TuioContainer remains unchanged. + * + * @param tobj the TuioContainer to assign + */ + public void update (TuioObject tobj) { + super.update(tobj); + angle = tobj.getAngle(); + rotation_speed = tobj.getRotationSpeed(); + rotation_accel = tobj.getRotationAccel(); + if ((rotation_accel!=0) && (state!=TUIO_STOPPED)) state = TUIO_ROTATING; + } + + /** + * This method is used to calculate the speed and acceleration values of a + * TuioObject with unchanged position and angle. + * + * @param ttime the TuioTime to assign + */ + public void stop (TuioTime ttime) { + update(ttime,xpos,ypos, angle); + } + + /** + * Returns the symbol ID of this TuioObject. + * @return the symbol ID of this TuioObject + */ + public int getSymbolID() { + return symbol_id; + } + + /** + * Returns the rotation angle of this TuioObject. + * @return the rotation angle of this TuioObject + */ + public float getAngle() { + return angle; + } + + /** + * Returns the rotation angle in degrees of this TuioObject. + * @return the rotation angle in degrees of this TuioObject + */ + public float getAngleDegrees() { + return angle/(float)Math.PI*180.0f; + } + + /** + * Returns the rotation speed of this TuioObject. + * @return the rotation speed of this TuioObject + */ + public float getRotationSpeed() { + return rotation_speed; + } + + /** + * Returns the rotation acceleration of this TuioObject. + * @return the rotation acceleration of this TuioObject + */ + public float getRotationAccel() { + return rotation_accel; + } + + /** + * Returns true of this TuioObject is moving. + * @return true of this TuioObject is moving + */ + public boolean isMoving() { + if ((state==TUIO_ACCELERATING) || (state==TUIO_DECELERATING) || (state==TUIO_ROTATING)) return true; + else return false; + } + +} diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/TUIO/TuioPoint.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/TUIO/TuioPoint.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,266 @@ +/* + TUIO Java backend - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package TUIO; + +/** + * The TuioPoint class on the one hand is a simple container and utility class to handle TUIO positions in general, + * on the other hand the TuioPoint is the base class for the TuioCursor and TuioObject classes. + * + * @author Martin Kaltenbrunner + * @version 1.4 + */ +public class TuioPoint { + + /** + * X coordinate, representated as a floating point value in a range of 0..1 + */ + protected float xpos; + /** + * Y coordinate, representated as a floating point value in a range of 0..1 + */ + protected float ypos; + /** + * The time stamp of the last update represented as TuioTime (time since session start) + */ + protected TuioTime currentTime; + /** + * The creation time of this TuioPoint represented as TuioTime (time since session start) + */ + protected TuioTime startTime; + + /** + * The default constructor takes no arguments and sets + * its coordinate attributes to zero and its time stamp to the current session time. + */ + public TuioPoint() { + xpos = 0.0f; + ypos = 0.0f; + currentTime = TuioTime.getSessionTime(); + startTime = new TuioTime(currentTime); + } + + /** + * This constructor takes two floating point coordinate arguments and sets + * its coordinate attributes to these values and its time stamp to the current session time. + * + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + */ + public TuioPoint(float xp, float yp) { + xpos = xp; + ypos = yp; + currentTime = TuioTime.getSessionTime(); + startTime = new TuioTime(currentTime); + } + + /** + * This constructor takes a TuioPoint argument and sets its coordinate attributes + * to the coordinates of the provided TuioPoint and its time stamp to the current session time. + * + * @param tpoint the TuioPoint to assign + */ + public TuioPoint(TuioPoint tpoint) { + xpos = tpoint.getX(); + ypos = tpoint.getY(); + currentTime = TuioTime.getSessionTime(); + startTime = new TuioTime(currentTime); + } + + /** + * This constructor takes a TuioTime object and two floating point coordinate arguments and sets + * its coordinate attributes to these values and its time stamp to the provided TUIO time object. + * + * @param ttime the TuioTime to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + */ + public TuioPoint(TuioTime ttime, float xp, float yp) { + xpos = xp; + ypos = yp; + currentTime = new TuioTime(ttime); + startTime = new TuioTime(currentTime); + } + + /** + * Takes a TuioPoint argument and updates its coordinate attributes + * to the coordinates of the provided TuioPoint and leaves its time stamp unchanged. + * + * @param tpoint the TuioPoint to assign + */ + public void update(TuioPoint tpoint) { + xpos = tpoint.getX(); + ypos = tpoint.getY(); + } + + /** + * Takes two floating point coordinate arguments and updates its coordinate attributes + * to the coordinates of the provided TuioPoint and leaves its time stamp unchanged. + * + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + */ + public void update(float xp, float yp) { + xpos = xp; + ypos = yp; + } + + /** + * Takes a TuioTime object and two floating point coordinate arguments and updates its coordinate attributes + * to the coordinates of the provided TuioPoint and its time stamp to the provided TUIO time object. + * + * @param ttime the TuioTime to assign + * @param xp the X coordinate to assign + * @param yp the Y coordinate to assign + */ + public void update(TuioTime ttime, float xp, float yp) { + xpos = xp; + ypos = yp; + currentTime = new TuioTime(ttime); + } + + /** + * Returns the X coordinate of this TuioPoint. + * @return the X coordinate of this TuioPoint + */ + public float getX() { + return xpos; + } + + /** + * Returns the Y coordinate of this TuioPoint. + * @return the Y coordinate of this TuioPoint + */ + public float getY() { + return ypos; + } + + /** + * Returns the distance to the provided coordinates + * + * @param xp the X coordinate of the distant point + * @param yp the Y coordinate of the distant point + * @return the distance to the provided coordinates + */ + public float getDistance(float xp, float yp) { + float dx = xpos-xp; + float dy = ypos-yp; + return (float)Math.sqrt(dx*dx+dy*dy); + } + + /** + * Returns the distance to the provided TuioPoint + * + * @param tpoint the distant TuioPoint + * @return the distance to the provided TuioPoint + */ + public float getDistance(TuioPoint tpoint) { + return getDistance(tpoint.getX(),tpoint.getY()); + } + + /** + * Returns the angle to the provided coordinates + * + * @param xp the X coordinate of the distant point + * @param yp the Y coordinate of the distant point + * @return the angle to the provided coordinates + */ + public float getAngle(float xp, float yp) { + + float side = xpos-xp; + float height = ypos-yp; + float distance = getDistance(xp,yp); + + float angle = (float)(Math.asin(side/distance)+Math.PI/2); + if (height<0) angle = 2.0f*(float)Math.PI-angle; + + return angle; + } + + /** + * Returns the angle to the provided TuioPoint + * + * @param tpoint the distant TuioPoint + * @return the angle to the provided TuioPoint + */ + public float getAngle(TuioPoint tpoint) { + return getAngle(tpoint.getX(),tpoint.getY()); + } + + /** + * Returns the angle in degrees to the provided coordinates + * + * @param xp the X coordinate of the distant point + * @param yp the Y coordinate of the distant point + * @return the angle in degrees to the provided TuioPoint + */ + public float getAngleDegrees(float xp, float yp) { + return (getAngle(xp,yp)/(float)Math.PI)*180.0f; + } + + /** + * Returns the angle in degrees to the provided TuioPoint + * + * @param tpoint the distant TuioPoint + * @return the angle in degrees to the provided TuioPoint + */ + public float getAngleDegrees(TuioPoint tpoint) { + return (getAngle(tpoint)/(float)Math.PI)*180.0f; + } + + /** + * Returns the X coordinate in pixels relative to the provided screen width. + * + * @param width the screen width + * @return the X coordinate of this TuioPoint in pixels relative to the provided screen width + */ + public int getScreenX(int width) { + return (int)Math.round(xpos*width); + } + + /** + * Returns the Y coordinate in pixels relative to the provided screen height. + * + * @param height the screen height + * @return the Y coordinate of this TuioPoint in pixels relative to the provided screen height + */ + public int getScreenY(int height) { + return (int)Math.round(ypos*height); + } + + /** + * Returns the time stamp of this TuioPoint as TuioTime. + * + * @return the time stamp of this TuioPoint as TuioTime + */ + public TuioTime getTuioTime() { + return new TuioTime(currentTime); + } + + /** + * Returns the start time of this TuioPoint as TuioTime. + * + * @return the start time of this TuioPoint as TuioTime + */ + public TuioTime getStartTime() { + return new TuioTime(startTime); + } +} diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/TUIO/TuioTime.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/TUIO/TuioTime.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,236 @@ +/* + TUIO Java backend - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package TUIO; + +/** + * The TuioTime class is a simple structure that is used to reprent the time that has elapsed since the session start. + * The time is internally represented as seconds and fractions of microseconds which should be more than sufficient for gesture related timing requirements. + * Therefore at the beginning of a typical TUIO session the static method initSession() will set the reference time for the session. + * Another important static method getSessionTime will return a TuioTime object representing the time elapsed since the session start. + * The class also provides various addtional convience method, which allow some simple time arithmetics. + * + * @author Martin Kaltenbrunner + * @version 1.4 + */ +public class TuioTime { + + /** + * the time since session start in seconds + */ + private long seconds = 0; + /** + * time fraction in microseconds + */ + private long micro_seconds = 0; + /** + * the session start time in seconds + */ + private static long start_seconds = 0; + /** + * start time fraction in microseconds + */ + private static long start_micro_seconds = 0; + + /** + * The default constructor takes no arguments and sets + * the Seconds and Microseconds attributes of the newly created TuioTime both to zero. + */ + public TuioTime () { + this.seconds = 0; + this.micro_seconds = 0; + } + + /** + * This constructor takes the provided time represented in total Milliseconds + * and assigs this value to the newly created TuioTime. + * + * @param msec the total time in Millseconds + */ + public TuioTime (long msec) { + this.seconds = msec/1000; + this.micro_seconds = 1000*(msec%1000); + } + + /** + * This constructor takes the provided time represented in Seconds and Microseconds + * and assigs these value to the newly created TuioTime. + * + * @param sec the total time in seconds + * @param usec the microseconds time component + */ + public TuioTime (long sec, long usec) { + this.seconds = sec; + this.micro_seconds = usec; + } + + /** + * This constructor takes the provided TuioTime + * and assigs its Seconds and Microseconds values to the newly created TuioTime. + * + * @param ttime the TuioTime used to copy + */ + public TuioTime (TuioTime ttime) { + this.seconds = ttime.getSeconds(); + this.micro_seconds = ttime.getMicroseconds(); + } + + /** + * Sums the provided time value represented in total Microseconds to this TuioTime. + * + * @param us the total time to add in Microseconds + * @return the sum of this TuioTime with the provided argument in microseconds + */ + public TuioTime add(long us) { + long sec = seconds + us/1000000; + long usec = micro_seconds + us%1000000; + return new TuioTime(sec,usec); + } + + /** + * Sums the provided TuioTime to the private Seconds and Microseconds attributes. + * + * @param ttime the TuioTime to add + * @return the sum of this TuioTime with the provided TuioTime argument + */ + public TuioTime add(TuioTime ttime) { + long sec = seconds + ttime.getSeconds(); + long usec = micro_seconds + ttime.getMicroseconds(); + sec += usec/1000000; + usec = usec%1000000; + return new TuioTime(sec,usec); + } + + /** + * Subtracts the provided time represented in Microseconds from the private Seconds and Microseconds attributes. + * + * @param us the total time to subtract in Microseconds + * @return the subtraction result of this TuioTime minus the provided time in Microseconds + */ + public TuioTime subtract(long us) { + long sec = seconds - us/1000000; + long usec = micro_seconds - us%1000000; + + if (usec<0) { + usec += 1000000; + sec--; + } + + return new TuioTime(sec,usec); + } + + /** + * Subtracts the provided TuioTime from the private Seconds and Microseconds attributes. + * + * @param ttime the TuioTime to subtract + * @return the subtraction result of this TuioTime minus the provided TuioTime + */ + public TuioTime subtract(TuioTime ttime) { + long sec = seconds - ttime.getSeconds(); + long usec = micro_seconds - ttime.getMicroseconds(); + + if (usec<0) { + usec += 1000000; + sec--; + } + + return new TuioTime(sec,usec); + } + + /** + * Takes a TuioTime argument and compares the provided TuioTime to the private Seconds and Microseconds attributes. + * + * @param ttime the TuioTime to compare + * @return true if the two TuioTime have equal Seconds and Microseconds attributes + */ + public boolean equals(TuioTime ttime) { + if ((seconds==ttime.getSeconds()) && (micro_seconds==ttime.getMicroseconds())) return true; + else return false; + } + + /** + * Resets the seconds and micro_seconds attributes to zero. + */ + public void reset() { + seconds = 0; + micro_seconds = 0; + } + + /** + * Returns the TuioTime Seconds component. + * @return the TuioTime Seconds component + */ + public long getSeconds() { + return seconds; + } + + /** + * Returns the TuioTime Microseconds component. + * @return the TuioTime Microseconds component + */ + public long getMicroseconds() { + return micro_seconds; + } + + /** + * Returns the total TuioTime in Milliseconds. + * @return the total TuioTime in Milliseconds + */ + public long getTotalMilliseconds() { + return seconds*1000+micro_seconds/1000; + } + + /** + * This static method globally resets the TUIO session time. + */ + public static void initSession() { + TuioTime startTime = getSystemTime(); + start_seconds = startTime.getSeconds(); + start_micro_seconds = startTime.getMicroseconds(); + } + + /** + * Returns the present TuioTime representing the time since session start. + * @return the present TuioTime representing the time since session start + */ + public static TuioTime getSessionTime() { + TuioTime sessionTime = getSystemTime().subtract(getStartTime()); + return sessionTime; + + } + + /** + * Returns the absolut TuioTime representing the session start. + * @return the absolut TuioTime representing the session start + */ + public static TuioTime getStartTime() { + return new TuioTime(start_seconds,start_micro_seconds); + } + + /** + * Returns the absolut TuioTime representing the current system time. + * @return the absolut TuioTime representing the current system time + */ + public static TuioTime getSystemTime() { + long usec = System.nanoTime()/1000; + return new TuioTime(usec/1000000,usec%1000000); + } +} diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/TuioApplet.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/TuioApplet.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,67 @@ +/* + TUIO Java Demo - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +import java.applet.*; +import java.awt.*; +import javax.swing.*; +import java.io.*; +import java.net.*; +import TUIO.*; + +public class TuioApplet extends JApplet { + + TuioDemoComponent demo; + TuioClient client; + int port = 3333; + + public void init() { + try { + port = Integer.parseInt(getParameter("port")); + } catch (Exception e) {} + + Dimension size = this.getSize(); + + TuioDemoComponent demo = new TuioDemoComponent(); + demo.setSize(size.width,size.height); + + client = new TuioClient(); + client.addTuioListener(demo); + + add(demo); + repaint(); + } + + public void start() { + if (!client.isConnected()) client.connect(); + } + + public void stop() { + if (client.isConnected()) client.disconnect(); + } + + public void destroy() { + if (client.isConnected()) client.disconnect(); + client = null; + } + + public void paint( Graphics g ) { + } +} diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/TuioDemo.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/TuioDemo.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,143 @@ +/* + TUIO Java Demo - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +import java.awt.*; +import java.awt.geom.*; +import java.awt.event.*; +import java.awt.image.*; +import java.util.*; +import javax.swing.*; +import TUIO.*; + +public class TuioDemo { + + private final int window_width = 640; + private final int window_height = 480; + + private boolean fullscreen = false; + + private TuioDemoComponent demo; + private JFrame frame; + private GraphicsDevice device; + + public TuioDemo() { + demo = new TuioDemoComponent(); + device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); + setupWindow(); + showWindow(); + } + + public TuioListener getTuioListener() { + return demo; + } + + public void setupWindow() { + + frame = new JFrame(); + frame.add(demo); + + frame.setTitle("TuioDemo"); + frame.setResizable(false); + + frame.addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent evt) { + System.exit(0); + } }); + + frame.addKeyListener( new KeyAdapter() { public void keyPressed(KeyEvent evt) { + if (evt.getKeyCode()==KeyEvent.VK_ESCAPE) System.exit(0); + else if (evt.getKeyCode()==KeyEvent.VK_F1) { + destroyWindow(); + setupWindow(); + fullscreen = !fullscreen; + showWindow(); + } + else if (evt.getKeyCode()==KeyEvent.VK_V) demo.verbose=!demo.verbose; + } }); + } + + public void destroyWindow() { + + frame.setVisible(false); + if (fullscreen) { + device.setFullScreenWindow(null); + } + frame = null; + } + + public void showWindow() { + + if (fullscreen) { + int width = (int)Toolkit.getDefaultToolkit().getScreenSize().getWidth(); + int height = (int)Toolkit.getDefaultToolkit().getScreenSize().getHeight(); + demo.setSize(width,height); + + frame.setSize(width,height); + frame.setUndecorated(true); + device.setFullScreenWindow(frame); + } else { + int width = window_width; + int height = window_height; + demo.setSize(width,height); + + frame.pack(); + Insets insets = frame.getInsets(); + frame.setSize(width,height +insets.top); + + } + + frame.setVisible(true); + frame.repaint(); + + } + + public static void main(String argv[]) { + + TuioDemo demo = new TuioDemo(); + TuioClient client = null; + + switch (argv.length) { + case 1: + try { + client = new TuioClient( Integer.parseInt(argv[0])); + } catch (Exception e) { + System.out.println("usage: java TuioDemo [port]"); + System.exit(0); + } + break; + case 0: + client = new TuioClient(); + break; + default: + System.out.println("usage: java TuioDemo [port]"); + System.exit(0); + break; + } + + if (client!=null) { + client.addTuioListener(demo.getTuioListener()); + client.connect(); + } else { + System.out.println("usage: java TuioDemo [port]"); + System.exit(0); + } + } + +} diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/TuioDemoComponent.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/TuioDemoComponent.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,153 @@ +/* + TUIO Java Demo - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +import java.awt.*; +import java.awt.geom.*; +import java.awt.event.*; +import java.awt.image.*; +import java.util.*; +import javax.swing.*; +import TUIO.*; + +public class TuioDemoComponent extends JComponent implements TuioListener { + + private Hashtable objectList = new Hashtable(); + private Hashtable cursorList = new Hashtable(); + + public static final int finger_size = 15; + public static final int object_size = 60; + public static final int table_size = 760; + + public static int width, height; + private float scale = 1.0f; + public boolean verbose = false; + + public void setSize(int w, int h) { + super.setSize(w,h); + width = w; + height = h; + scale = height/(float)TuioDemoComponent.table_size; + } + + public void addTuioObject(TuioObject tobj) { + TuioDemoObject demo = new TuioDemoObject(tobj); + objectList.put(tobj.getSessionID(),demo); + + if (verbose) + System.out.println("add obj "+tobj.getSymbolID()+" ("+tobj.getSessionID()+") "+tobj.getX()+" "+tobj.getY()+" "+tobj.getAngle()); + } + + public void updateTuioObject(TuioObject tobj) { + + TuioDemoObject demo = (TuioDemoObject)objectList.get(tobj.getSessionID()); + demo.update(tobj); + + if (verbose) + System.out.println("set obj "+tobj.getSymbolID()+" ("+tobj.getSessionID()+") "+tobj.getX()+" "+tobj.getY()+" "+tobj.getAngle()+" "+tobj.getMotionSpeed()+" "+tobj.getRotationSpeed()+" "+tobj.getMotionAccel()+" "+tobj.getRotationAccel()); + } + + public void removeTuioObject(TuioObject tobj) { + objectList.remove(tobj.getSessionID()); + + if (verbose) + System.out.println("del obj "+tobj.getSymbolID()+" ("+tobj.getSessionID()+")"); + } + + public void addTuioCursor(TuioCursor tcur) { + + if (!cursorList.containsKey(tcur.getSessionID())) { + cursorList.put(tcur.getSessionID(), tcur); + repaint(); + } + + if (verbose) + System.out.println("add cur "+tcur.getCursorID()+" ("+tcur.getSessionID()+") "+tcur.getX()+" "+tcur.getY()); + } + + public void updateTuioCursor(TuioCursor tcur) { + + repaint(); + + if (verbose) + System.out.println("set cur "+tcur.getCursorID()+" ("+tcur.getSessionID()+") "+tcur.getX()+" "+tcur.getY()+" "+tcur.getMotionSpeed()+" "+tcur.getMotionAccel()); + } + + public void removeTuioCursor(TuioCursor tcur) { + + cursorList.remove(tcur.getSessionID()); + repaint(); + + if (verbose) + System.out.println("del cur "+tcur.getCursorID()+" ("+tcur.getSessionID()+")"); + } + + public void refresh(TuioTime frameTime) { + repaint(); + } + + public void paint(Graphics g) { + update(g); + } + + public void update(Graphics g) { + + Graphics2D g2 = (Graphics2D)g; + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); + + g2.setColor(Color.white); + g2.fillRect(0,0,width,height); + + int w = (int)Math.round(width-scale*finger_size/2.0f); + int h = (int)Math.round(height-scale*finger_size/2.0f); + + Enumeration cursors = cursorList.elements(); + while (cursors.hasMoreElements()) { + TuioCursor tcur = cursors.nextElement(); + if (tcur==null) continue; + Vector path = tcur.getPath(); + TuioPoint current_point = path.elementAt(0); + if (current_point!=null) { + // draw the cursor path + g2.setPaint(Color.blue); + for (int i=0;i objects = objectList.elements(); + while (objects.hasMoreElements()) { + TuioDemoObject tobj = objects.nextElement(); + if (tobj!=null) tobj.paint(g2, width,height); + } + } +} diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/TuioDemoObject.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/TuioDemoObject.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,81 @@ +/* + TUIO Java Demo - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +import javax.swing.*; +import java.awt.geom.*; +import java.awt.*; +import java.awt.event.*; +import java.util.*; +import TUIO.*; + +public class TuioDemoObject extends TuioObject { + + private Shape square; + + public TuioDemoObject(TuioObject tobj) { + super(tobj); + int size = TuioDemoComponent.object_size; + square = new Rectangle2D.Float(-size/2,-size/2,size,size); + + AffineTransform transform = new AffineTransform(); + transform.translate(xpos,ypos); + transform.rotate(angle,xpos,ypos); + square = transform.createTransformedShape(square); + } + + public void paint(Graphics2D g, int width, int height) { + + float Xpos = xpos*width; + float Ypos = ypos*height; + float scale = height/(float)TuioDemoComponent.table_size; + + AffineTransform trans = new AffineTransform(); + trans.translate(-xpos,-ypos); + trans.translate(Xpos,Ypos); + trans.scale(scale,scale); + Shape s = trans.createTransformedShape(square); + + g.setPaint(Color.black); + g.fill(s); + g.setPaint(Color.white); + g.drawString(symbol_id+"",Xpos-10,Ypos); + } + + public void update(TuioObject tobj) { + + float dx = tobj.getX() - xpos; + float dy = tobj.getY() - ypos; + float da = tobj.getAngle() - angle; + + if ((dx!=0) || (dy!=0)) { + AffineTransform trans = AffineTransform.getTranslateInstance(dx,dy); + square = trans.createTransformedShape(square); + } + + if (da!=0) { + AffineTransform trans = AffineTransform.getRotateInstance(da,tobj.getX(),tobj.getY()); + square = trans.createTransformedShape(square); + } + + super.update(tobj); + } + +} diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/TuioDump.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/TuioDump.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,74 @@ +/* + TUIO Java Example - part of the reacTIVision project + http://reactivision.sourceforge.net/ + + Copyright (c) 2005-2009 Martin Kaltenbrunner + + This program is free software;you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation;either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY;without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program;if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +import javax.swing.*; +import java.awt.geom.*; +import java.awt.*; +import java.awt.event.*; +import TUIO.*; + +public class TuioDump implements TuioListener { + + public void addTuioObject(TuioObject tobj) { + System.out.println("add obj "+tobj.getSymbolID()+" ("+tobj.getSessionID()+") "+tobj.getX()+" "+tobj.getY()+" "+tobj.getAngle()); + } + + public void updateTuioObject(TuioObject tobj) { + System.out.println("set obj "+tobj.getSymbolID()+" ("+tobj.getSessionID()+") "+tobj.getX()+" "+tobj.getY()+" "+tobj.getAngle()+" "+tobj.getMotionSpeed()+" "+tobj.getRotationSpeed()+" "+tobj.getMotionAccel()+" "+tobj.getRotationAccel()); + } + + public void removeTuioObject(TuioObject tobj) { + System.out.println("del obj "+tobj.getSymbolID()+" ("+tobj.getSessionID()+")"); + } + + public void addTuioCursor(TuioCursor tcur) { + System.out.println("add cur "+tcur.getCursorID()+" ("+tcur.getSessionID()+") "+tcur.getX()+" "+tcur.getY()); + } + + public void updateTuioCursor(TuioCursor tcur) { + System.out.println("set cur "+tcur.getCursorID()+" ("+tcur.getSessionID()+") "+tcur.getX()+" "+tcur.getY()+" "+tcur.getMotionSpeed()+" "+tcur.getMotionAccel()); + } + + public void removeTuioCursor(TuioCursor tcur) { + System.out.println("del cur "+tcur.getCursorID()+" ("+tcur.getSessionID()+")"); + } + + public void refresh(TuioTime frameTime) { + //System.out.println("refresh "+frameTime.getTotalMilliseconds()); + } + + public static void main(String argv[]) { + + int port = 3333; + + if (argv.length==1) { + try { port = Integer.parseInt(argv[0]); } + catch (Exception e) { System.out.println("usage: java TuioDump [port]"); } + } + + TuioDump demo = new TuioDump(); + TuioClient client = new TuioClient(port); + + System.out.println("listening to TUIO messages at port "+port); + client.addTuioListener(demo); + client.connect(); + } +} diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCBundle.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCBundle.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,140 @@ + +/** + * @author cramakrishnan + * + * Copyright (C) 2003, C. Ramakrishnan / Illposed Software + * All rights reserved. + * + * See license.txt (or license.rtf) for license information. + * + * + * OscBundle represents a collection of OscPackets. + * + * Use this when you want to send a bunch of OscPackets + * in one go. + * + * Internally, I use Vector to maintain jdk1.1 compatability + */ + +package com.illposed.osc; +import java.math.BigInteger; +import java.util.Date; +import java.util.Enumeration; +import java.util.GregorianCalendar; +import java.util.Vector; + +import com.illposed.osc.utility.*; + +public class OSCBundle extends OSCPacket { + + protected Date timestamp; + // protected OSCPacket[] packets; + protected Vector packets; + public static final BigInteger SECONDS_FROM_1900_to_1970 = + new BigInteger("2208988800"); + // 17 leap years + + /** + * Create a new OSCBundle, with a timestamp of now. + * You can add packets to the bundle with addPacket() + */ + public OSCBundle() { + this(null, GregorianCalendar.getInstance().getTime()); + } + + /** + * Create an OSCBundle with the specified timestamp + * @param timestamp + */ + public OSCBundle(Date timestamp) { + this(null, timestamp); + } + + /** + * @param newPackets Array of OSCPackets to initialize this object with + */ + public OSCBundle(OSCPacket[] newPackets) { + this(newPackets, GregorianCalendar.getInstance().getTime()); + } + + /** + * @param newPackets OscPacket[] + * @param time java.lang.Time + */ + public OSCBundle(OSCPacket[] newPackets, Date newTimestamp) { + super(); + if (null != newPackets) { + packets = new Vector(newPackets.length); + for (int i = 0; i < newPackets.length; i++) { + packets.add(newPackets[i]); + } + } else + packets = new Vector(); + timestamp = newTimestamp; + init(); + } + + /** + * Return the timestamp for this bundle + * @return a Date + */ + public Date getTimestamp() { + return timestamp; + } + + /** + * Set the timestamp for this bundle + * @param timestamp + */ + public void setTimestamp(Date timestamp) { + this.timestamp = timestamp; + } + + /** + * Add a packet to the list of packets in this bundle + * @param packet + */ + public void addPacket(OSCPacket packet) { + packets.add(packet); + } + + /** + * Get the packets contained in this bundle + * @return an array of packets + */ + public OSCPacket[] getPackets() { + OSCPacket[] packetArray = new OSCPacket[packets.size()]; + packets.toArray(packetArray); + return packetArray; + } + + protected void computeTimeTagByteArray(OSCJavaToByteArrayConverter stream) { + long millisecs = timestamp.getTime(); + long secsSince1970 = (long) (millisecs / 1000); + long secs = secsSince1970 + SECONDS_FROM_1900_to_1970.longValue(); + long picosecs = (long) (millisecs - (secsSince1970 * 1000)) * 1000; + + stream.write((int) secs); + stream.write((int) picosecs); + + } + + /** + * @param stream OscPacketByteArrayConverter + */ + protected void computeByteArray(OSCJavaToByteArrayConverter stream) { + stream.write("#bundle"); + computeTimeTagByteArray(stream); + Enumeration enm = packets.elements(); + OSCPacket nextElement; + byte[] packetBytes; + while (enm.hasMoreElements()) { + nextElement = (OSCPacket) enm.nextElement(); + packetBytes = nextElement.getByteArray(); + stream.write(packetBytes.length); + stream.write(packetBytes); + } + byteArray = stream.toByteArray(); + } + +} \ No newline at end of file diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCCanNotListenException.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCCanNotListenException.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,49 @@ +/* $Id: OSCCanNotListenException.java,v 1.1.1.1 2006/11/13 14:47:21 modin Exp $ + * Created on 21.02.2004 + */ +package com.illposed.osc; + +/** + * @author cramakrishnan + * + * Copyright (C) 2004, C. Ramakrishnan / Auracle + * All rights reserved. + * + * See license.txt (or license.rtf) for license information. + */ +public class OSCCanNotListenException extends Exception { + + /** + * + */ + public OSCCanNotListenException() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @param message + */ + public OSCCanNotListenException(String message) { + super(message); + // TODO Auto-generated constructor stub + } + + /** + * @param message + * @param cause + */ +/* public OSCCanNotListenException(String message, Throwable cause) { + super(message, cause); + // TODO Auto-generated constructor stub + } +*/ + /** + * @param cause + */ +/* public OSCCanNotListenException(Throwable cause) { + super(cause); + // TODO Auto-generated constructor stub + } +*/ +} diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCListener.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCListener.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,27 @@ +/* $Id: OSCListener.java,v 1.1.1.1 2006/11/13 14:47:21 modin Exp $ + * Created on 28.10.2003 + */ +package com.illposed.osc; + +import java.util.Date; + +/** + * @author cramakrishnan + * + * Copyright (C) 2003, C. Ramakrishnan / Auracle + * All rights reserved. + * + * See license.txt (or license.rtf) for license information. + * + * Interface for things that listen for incoming OSC Messages + */ +public interface OSCListener { + + /** + * Accept an incoming OSCMessage + * @param time the time this message is to be executed. null means execute now + * @param message the message + */ + public void acceptMessage(Date time, OSCMessage message); + +} diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCMessage.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCMessage.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,118 @@ +/** + * @author cramakrishnan + * + * Copyright (C) 2003, C. Ramakrishnan / Illposed Software + * All rights reserved. + * + * See license.txt (or license.rtf) for license information. + * + * + * An simple (non-bundle) OSC message. An OSC message is made up of + * an address (who is this message sent to) + * and arguments (what is the contents of this message). + */ + +package com.illposed.osc; + +import java.util.Enumeration; +import java.util.Vector; + +import com.illposed.osc.utility.*; + +public class OSCMessage extends OSCPacket { + + protected String address; + protected Vector arguments; + + /** + * Create an empty OSC Message + * In order to send this osc message, you need to set the address + * and, perhaps, some arguments. + */ + public OSCMessage() { + super(); + arguments = new Vector(); + } + + /** + * Create an OSCMessage with an address already initialized + * @param newAddress The recepient of this OSC message + */ + public OSCMessage(String newAddress) { + this(newAddress, null); + } + + /** + * Create an OSCMessage with an address and arguments already initialized + * @param newAddress The recepient of this OSC message + * @param newArguments The data sent to the receiver + */ + public OSCMessage(String newAddress, Object[] newArguments) { + super(); + address = newAddress; + if (null != newArguments) { + arguments = new Vector(newArguments.length); + for (int i = 0; i < newArguments.length; i++) { + arguments.add(newArguments[i]); + } + } else + arguments = new Vector(); + init(); + } + + /** + * @return the address of this OSC Message + */ + public String getAddress() { + return address; + } + + /** + * Set the address of this messsage + * @param anAddress + */ + public void setAddress(String anAddress) { + address = anAddress; + } + + public void addArgument(Object argument) { + arguments.add(argument); + } + + public Object[] getArguments() { + return arguments.toArray(); + } + + /** + * @param stream OscPacketByteArrayConverter + */ + protected void computeAddressByteArray(OSCJavaToByteArrayConverter stream) { + stream.write(address); + } + + /** + * @param stream OscPacketByteArrayConverter + */ + protected void computeArgumentsByteArray(OSCJavaToByteArrayConverter stream) { + // SC starting at version 2.2.10 wants a comma at the beginning + // of the arguments array. + stream.write(','); + if (null == arguments) + return; + stream.writeTypes(arguments); + Enumeration enm = arguments.elements(); + while (enm.hasMoreElements()) { + stream.write(enm.nextElement()); + } + } + + /** + * @param stream OscPacketByteArrayConverter + */ + protected void computeByteArray(OSCJavaToByteArrayConverter stream) { + computeAddressByteArray(stream); + computeArgumentsByteArray(stream); + byteArray = stream.toByteArray(); + } + +} \ No newline at end of file diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPacket.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPacket.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,60 @@ +/** + * @author cramakrishnan + * + * Copyright (C) 2003, C. Ramakrishnan / Illposed Software + * All rights reserved. + * + * See license.txt (or license.rtf) for license information. + * + * + * OscPacket is the abstract superclass for the various + * kinds of OSC Messages. Its direct subclasses are: + * OscMessage, OscBundle + * + * Subclasses need to know how to produce a byte array + * in the format specified by the OSC spec (or SuperCollider + * documentation, as the case may be). + * + * This implementation is based on Markus Gaelli and + * Iannis Zannos' OSC implementation in Squeak: + * http://www.emergent.de/Goodies/ + */ + +package com.illposed.osc; + +import com.illposed.osc.utility.*; + +public abstract class OSCPacket { + + protected byte[] byteArray; + + public OSCPacket() { + super(); + } + + protected void computeByteArray() { + OSCJavaToByteArrayConverter stream = new OSCJavaToByteArrayConverter(); + computeByteArray(stream); + } + + /** + * @param stream OscPacketByteArrayConverter + * + * Subclasses should implement this method to product a byte array + * formatted according to the OSC/SuperCollider specification. + */ + protected abstract void computeByteArray(OSCJavaToByteArrayConverter stream); + + /** + * @return byte[] + */ + public byte[] getByteArray() { + computeByteArray(); + return byteArray; + } + + protected void init() { + + } + +} \ No newline at end of file diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPort.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPort.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,51 @@ +/** + * @author cramakrishnan + * + * Copyright (C) 2004, C. Ramakrishnan / Illposed Software + * All rights reserved. + * + * See license.txt (or license.rtf) for license information. + * + * + * OSCPort is an abstract superclass. To send OSC messages, use OSCPortOut. + * To listen for OSC messages, use OSCPortIn. + * + */ + +package com.illposed.osc; + +import java.net.*; +import java.io.IOException; + +public abstract class OSCPort { + + protected DatagramSocket socket; + protected int port; + + /** + * The port that the SuperCollider synth engine ususally listens too + */ + public static final int defaultSCOSCPort = 57110; + + /** + * The port that the SuperCollider language engine ususally listens too + */ + public static final int defaultSCLangOSCPort = 57120; + + /** + * @see java.lang.Object#finalize() + */ + protected void finalize() throws Throwable { + super.finalize(); + socket.close(); + } + + /** + * Close the socket and free-up resources. It's recommended that clients call + * this when they are done with the port. + */ + public void close() { + socket.close(); + } + +} diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPortIn.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPortIn.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,114 @@ +/** + * @author cramakrishnan + * + * Copyright (C) 2004, C. Ramakrishnan / Illposed Software + * All rights reserved. + * + * See license.txt (or license.rtf) for license information. + * + * + * OSCPortIn is the class that listens for OSC messages. + * + * To receive OSC, you need to construct the OSCPort with a + * + * An example based on com.illposed.osc.test.OSCPortTest::testReceiving() : + + receiver = new OSCPort(OSCPort.defaultSCOSCPort()); + OSCListener listener = new OSCListener() { + public void acceptMessage(java.util.Date time, OSCMessage message) { + System.out.println("Message received!"); + } + }; + receiver.addListener("/message/receiving", listener); + receiver.startListening(); + + * Then, using a program such as SuperCollider or sendOSC, send a message + * to this computer, port 57110 (defaultSCOSCPort), with the address /message/receiving + */ + +package com.illposed.osc; + +import java.net.*; +import java.io.IOException; +import com.illposed.osc.utility.OSCByteArrayToJavaConverter; +import com.illposed.osc.utility.OSCPacketDispatcher; + +public class OSCPortIn extends OSCPort implements Runnable { + + // state for listening + protected boolean isListening; + protected OSCByteArrayToJavaConverter converter = new OSCByteArrayToJavaConverter(); + protected OSCPacketDispatcher dispatcher = new OSCPacketDispatcher(); + + /** + * Create an OSCPort that listens on port + * @param port + * @throws SocketException + */ + public OSCPortIn(int port) throws SocketException { + socket = new DatagramSocket(port); + this.port = port; + } + + /** + * @see java.lang.Runnable#run() + */ + public void run() { + //maximum UDP packet size + byte[] buffer = new byte[65536]; + DatagramPacket packet = new DatagramPacket(buffer, 65536); + while (isListening) { + try { + packet.setLength(65536); + socket.receive(packet); + OSCPacket oscPacket = converter.convert(buffer, packet.getLength()); + dispatcher.dispatchPacket(oscPacket); + } catch (java.net.SocketException e) { + if (isListening) e.printStackTrace(); + } catch (IOException e) { + if (isListening) e.printStackTrace(); + } + } + } + + /** + * Start listening for incoming OSCPackets + */ + public void startListening() { + isListening = true; + Thread thread = new Thread(this); + thread.start(); + } + + /** + * Stop listening for incoming OSCPackets + */ + public void stopListening() { + isListening = false; + } + + /** + * Am I listening for packets? + */ + public boolean isListening() { + return isListening; + } + + /** + * Register the listener for incoming OSCPackets addressed to an Address + * @param anAddress the address to listen for + * @param listener the object to invoke when a message comes in + */ + public void addListener(String anAddress, OSCListener listener) { + dispatcher.addListener(anAddress, listener); + } + + /** + * Close the socket and free-up resources. It's recommended that clients call + * this when they are done with the port. + */ + public void close() { + socket.close(); + } + +} diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPortOut.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/OSCPortOut.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,79 @@ +/** + * @author cramakrishnan + * + * Copyright (C) 2004, C. Ramakrishnan / Illposed Software + * All rights reserved. + * + * See license.txt (or license.rtf) for license information. + * + * + * OSCPortOut is the class that sends OSC messages. + * + * To send OSC, in your code you should instantiate and hold onto an OSCPort + * pointing at the address and port number for the receiver. + * + * When you want to send an OSC message, call send(). + * + * An example based on com.illposed.osc.test.OSCPortTest::testMessageWithArgs() : + OSCPort sender = new OSCPort(); + Object args[] = new Object[2]; + args[0] = new Integer(3); + args[1] = "hello"; + OSCMessage msg = new OSCMessage("/sayhello", args); + try { + sender.send(msg); + } catch (Exception e) { + showError("Couldn't send"); + } + */ + +package com.illposed.osc; + +import java.net.*; +import java.io.IOException; +import com.illposed.osc.utility.OSCByteArrayToJavaConverter; + +public class OSCPortOut extends OSCPort { + + protected InetAddress address; + + /** + * Create an OSCPort that sends to newAddress, newPort + * @param newAddress InetAddress + * @param newPort int + */ + public OSCPortOut(InetAddress newAddress, int newPort) throws SocketException { + socket = new DatagramSocket(); + address = newAddress; + port = newPort; + } + + /** + * Create an OSCPort that sends to newAddress, on the standard SuperCollider port + * @param newAddress InetAddress + * + * Default the port to the standard one for SuperCollider + */ + public OSCPortOut(InetAddress newAddress) throws SocketException { + this(newAddress, defaultSCOSCPort); + } + + /** + * Create an OSCPort that sends to localhost, on the standard SuperCollider port + * Default the address to localhost + * Default the port to the standard one for SuperCollider + */ + public OSCPortOut() throws UnknownHostException, SocketException { + this(InetAddress.getLocalHost(), defaultSCOSCPort); + } + + /** + * @param aPacket OSCPacket + */ + public void send(OSCPacket aPacket) throws IOException { + byte[] byteArray = aPacket.getByteArray(); + DatagramPacket packet = + new DatagramPacket(byteArray, byteArray.length,address,port); + socket.send(packet); + } +} diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/com/illposed/osc/utility/OSCByteArrayToJavaConverter.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/utility/OSCByteArrayToJavaConverter.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,280 @@ +/* $Id: OSCByteArrayToJavaConverter.java,v 1.1.1.1 2006/11/13 14:47:22 modin Exp $ + * Created on 28.10.2003 + */ +package com.illposed.osc.utility; + +import java.math.BigInteger; +import java.util.Date; + +import com.illposed.osc.*; + +/** + * @author cramakrishnan + * + * Copyright (C) 2003, C. Ramakrishnan / Auracle + * All rights reserved. + * + * See license.txt (or license.rtf) for license information. + */ +public class OSCByteArrayToJavaConverter { + + byte[] bytes; + int bytesLength; + int streamPosition; + + private byte[] intBytes = new byte[4]; + private byte[] floatBytes = new byte[4]; + + private byte[] secondBytes = new byte[8]; + private byte[] picosecBytes = new byte[8]; + + /** + * Helper object for converting from a byte array to Java objects + */ + /*public OSCByteArrayToJavaConverter() { + super(); + }*/ + + public OSCPacket convert(byte[] byteArray, int bytesLength) { + bytes = byteArray; + this.bytesLength = bytesLength; + streamPosition = 0; + if (isBundle()) + return convertBundle(); + else + return convertMessage(); + } + + private boolean isBundle() { + // only need the first 7 to check if it is a bundle + String bytesAsString = new String(bytes, 0, 7); + return bytesAsString.startsWith("#bundle"); + } + + private OSCBundle convertBundle() { + // skip the "#bundle " stuff + streamPosition = 8; + Date timestamp = readTimeTag(); + OSCBundle bundle = new OSCBundle(timestamp); + OSCByteArrayToJavaConverter myConverter = new OSCByteArrayToJavaConverter(); + while (streamPosition < bytesLength) { + // recursively read through the stream and convert packets you find + int packetLength = ((Integer) readInteger()).intValue(); + byte[] packetBytes = new byte[packetLength]; + //streamPosition++; + System.arraycopy(bytes,streamPosition,packetBytes,0,packetLength); + streamPosition+=packetLength; + //for (int i = 0; i < packetLength; i++) + // packetBytes[i] = bytes[streamPosition++]; + OSCPacket packet = myConverter.convert(packetBytes, packetLength); + bundle.addPacket(packet); + } + return bundle; + } + + private OSCMessage convertMessage() { + OSCMessage message = new OSCMessage(); + message.setAddress(readString()); + char[] types = readTypes(); + if (null == types) { + // we are done + return message; + } + moveToFourByteBoundry(); + for (int i = 0; i < types.length; i++) { + if ('[' == types[i]) { + // we're looking at an array -- read it in + message.addArgument(readArray(types, i)); + // then increment i to the end of the array + while (']' != types[i]) + i++; + } else + message.addArgument(readArgument(types[i])); + } + return message; + } + + private String readString() { + int strLen = lengthOfCurrentString(); + char[] stringChars = new char[strLen]; + //System.arraycopy(bytes,streamPosition,stringChars,0,strLen); + //streamPosition+=strLen; + for (int i = 0; i < strLen; i++) + stringChars[i] = (char) bytes[streamPosition++]; + moveToFourByteBoundry(); + return new String(stringChars); + } + + /** + * @return a char array with the types of the arguments + */ + private char[] readTypes() { + // the next byte should be a "," + if (bytes[streamPosition] != 0x2C) + return null; + streamPosition++; + // find out how long the list of types is + int typesLen = lengthOfCurrentString(); + if (0 == typesLen) { + return null; + } + // read in the types + char[] typesChars = new char[typesLen]; + for (int i = 0; i < typesLen; i++) { + typesChars[i] = (char) bytes[streamPosition++]; + } + return typesChars; + } + + /** + * @param c type of argument + * @return a Java representation of the argument + */ + private Object readArgument(char c) { + switch (c) { + case 'i' : + return readInteger(); + case 'h' : + return readBigInteger(); + case 'f' : + return readFloat(); + case 'd' : + return readDouble(); + case 's' : + return readString(); + case 'c' : + return readChar(); + case 'T' : + return Boolean.TRUE; + case 'F' : + return Boolean.FALSE; + } + + return null; + } + + /** + * @return a Character + */ + private Object readChar() { + return new Character((char) bytes[streamPosition++]); + } + + /** + * @return a Double + */ + private Object readDouble() { + return readFloat(); + } + + /** + * @return a Float + */ + private Object readFloat() { + //byte[] floatBytes = new byte[4]; + floatBytes[0] = bytes[streamPosition++]; + floatBytes[1] = bytes[streamPosition++]; + floatBytes[2] = bytes[streamPosition++]; + floatBytes[3] = bytes[streamPosition++]; + + int floatBits = + ((floatBytes[3] & 0xFF) ) + + ((floatBytes[2] & 0xFF) << 8) + + ((floatBytes[1] & 0xFF) << 16) + + ((floatBytes[0] & 0xFF) << 24); + + return new Float(Float.intBitsToFloat(floatBits)); + } + + /** + * @return a BigInteger + */ + private Object readBigInteger() { + //byte[] intBytes = new byte[4]; + intBytes[0] = bytes[streamPosition++]; + intBytes[1] = bytes[streamPosition++]; + intBytes[2] = bytes[streamPosition++]; + intBytes[3] = bytes[streamPosition++]; + + int intBits = + ((intBytes[3] & 0xFF) ) + + ((intBytes[2] & 0xFF) << 8) + + ((intBytes[1] & 0xFF) << 16) + + ((intBytes[0] & 0xFF) << 24); + + return new Integer(intBits); + } + + /** + * @return an Integer + */ + private Object readInteger() { + //byte[] intBytes = new byte[4]; + intBytes[0] = bytes[streamPosition++]; + intBytes[1] = bytes[streamPosition++]; + intBytes[2] = bytes[streamPosition++]; + intBytes[3] = bytes[streamPosition++]; + + int intBits = + ((intBytes[3] & 0xFF) ) + + ((intBytes[2] & 0xFF) << 8) + + ((intBytes[1] & 0xFF) << 16) + + ((intBytes[0] & 0xFF) << 24); + + return new Integer(intBits); + } + + /** + * @return a Date + */ + private Date readTimeTag() { + //byte[] secondBytes = new byte[8]; + //byte[] picosecBytes = new byte[8]; + /*for (int i = 4; i < 8; i++) + secondBytes[i] = bytes[streamPosition++]; + for (int i = 4; i < 8; i++) + picosecBytes[i] = bytes[streamPosition++];*/ + System.arraycopy(bytes,streamPosition,secondBytes,4,4); + streamPosition+=4; + System.arraycopy(bytes,streamPosition,picosecBytes,4,4); + streamPosition+=4; + + BigInteger secsSince1900 = new BigInteger(secondBytes); + long secsSince1970 = secsSince1900.longValue() - OSCBundle.SECONDS_FROM_1900_to_1970.longValue(); + if (secsSince1970 < 0) secsSince1970 = 0; // no point maintaining times in the distant past + BigInteger picosecs = new BigInteger(picosecBytes); + long millisecs = (secsSince1970 * 1000) + (picosecs.longValue() / 1000); + return new Date(millisecs); + } + + /** + * @param types + * @param i + * @return an Array + */ + private Object[] readArray(char[] types, int i) { + int arrayLen = 0; + while (types[i + arrayLen] != ']') + arrayLen++; + Object[] array = new Object[arrayLen]; + for (int j = 0; i < arrayLen; j++) { + array[j] = readArgument(types[i + j]); + } + return array; + } + + private int lengthOfCurrentString() { + int i = 0; + while (bytes[streamPosition + i] != 0) + i++; + return i; + } + + private void moveToFourByteBoundry() { + // If i'm already at a 4 byte boundry, I need to move to the next one + int mod = streamPosition % 4; + streamPosition += (4 - mod); + } + +} + diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/com/illposed/osc/utility/OSCJavaToByteArrayConverter.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/utility/OSCJavaToByteArrayConverter.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,310 @@ +/** + * @author cramakrishnan + * + * Copyright (C) 2003, C. Ramakrishnan / Illposed Software + * All rights reserved. + * + * See license.txt (or license.rtf) for license information. + * + * + * OSCJavaToByteArrayConverter is a helper class that translates + * from Java types to the format the OSC spec specifies for those + * types. + * + * This implementation is based on Markus Gaelli and + * Iannis Zannos' OSC implementation in Squeak: + * http://www.emergent.de/Goodies/ + */ + +package com.illposed.osc.utility; + +import java.io.IOException; +import java.io.ByteArrayOutputStream; +import java.math.BigInteger; +import java.util.Enumeration; +import java.util.Vector; + + +public class OSCJavaToByteArrayConverter { + + protected ByteArrayOutputStream stream = new ByteArrayOutputStream(); + private byte[] intBytes = new byte[4]; + + /*public OSCJavaToByteArrayConverter() { + super(); + }*/ + + /** + * Creation date: (2/23/2001 2:43:25 AM) + * @param anArray java.lang.Object[] + * + */ + public void appendNullCharToAlignStream() { + int mod = stream.size() % 4; + int pad = 4 - mod; + for (int i = 0; i < pad; i++) + stream.write(0); + } + + /** + * Creation date: (2/23/2001 2:21:53 AM) + * @return byte[] + */ + public byte[] toByteArray() { + return stream.toByteArray(); + } + + /** + * Creation date: (2/23/2001 2:14:23 AM) + * @param bytes byte[] + */ + public void write(byte[] bytes) { + writeBigEndToFourByteBoundry(bytes); + } + + /** + * Creation date: (2/23/2001 2:21:04 AM) + * @param i int + */ + public void write(int i) { + writeIntegerToByteArray(i); + } + + /** + * Creation date: (2/23/2001 2:03:57 AM) + * @param f java.lang.Float + */ + public void write(Float f) { + writeIntegerToByteArray(Float.floatToIntBits(f.floatValue())); + } + + /** + * Creation date: (2/23/2001 2:08:36 AM) + * @param i java.lang.Integer + */ + public void write(Integer i) { + writeIntegerToByteArray(i.intValue()); + } + + /** + * Creation date: (2/23/2001 1:57:35 AM) + * @param str java.lang.String + */ + public void write(String str) { + writeLittleEndToFourByteBoundry(str.getBytes()); + } + + /** + * Creation date: (2/23/2001 2:08:36 AM) + * @param c char + */ + public void write(char c) { + stream.write(c); + } + + /** + * Creation date: (2/23/2001 2:02:54 AM) + * @param anObject java.lang.Object + */ + public void write(Object anObject) { + // Can't do switch on class + if (null == anObject) + return; + if (anObject instanceof Float) { + write((Float) anObject); + return; + } + if (anObject instanceof String) { + write((String) anObject); + return; + } + if (anObject instanceof Integer) { + write((Integer) anObject); + return; + } + } + + /** + * Creation date: (2/23/2001 2:43:25 AM) + * @param aClass Class + */ + public void writeType(Class c) { + // A big ol' case statement -- what's polymorphism mean, again? + // I really wish I could extend the base classes! + + // use the appropriate flags to tell SuperCollider what kind of + // thing it is looking at + + if (Integer.class.equals(c)) { + stream.write('i'); + return; + } + if (java.math.BigInteger.class.equals(c)) { + stream.write('h'); + return; + } + if (Float.class.equals(c)) { + stream.write('f'); + return; + } + if (Double.class.equals(c)) { + stream.write('d'); + return; + } + if (String.class.equals(c)) { + stream.write('s'); + return; + } + if (Character.class.equals(c)) { + stream.write('c'); + return; + } + } + + /** + * Creation date: (2/23/2001 2:43:25 AM) + * @param anArray java.lang.Object[] + */ + public void writeTypesArray(Object[] array) { + // A big ol' case statement in a for loop -- what's polymorphism mean, again? + // I really wish I could extend the base classes! + + for (int i = 0; i < array.length; i++) { + if (null == array[i]) + continue; + // if the array at i is a type of array write a [ + // This is used for nested arguments + if (array[i].getClass().isArray()) { + stream.write('['); + // fill the [] with the SuperCollider types corresponding to the object + // (i.e. Object of type String needs -s). + writeTypesArray((Object[]) array[i]); + // close the array + stream.write(']'); + continue; + } + // Create a way to deal with Boolean type objects + if (Boolean.TRUE.equals(array[i])) { + stream.write('T'); + continue; + } + if (Boolean.FALSE.equals(array[i])) { + stream.write('F'); + continue; + } + // go through the array and write the superCollider types as shown in the + // above method. the Classes derived here are used as the arg to the above method + writeType(array[i].getClass()); + } + // align the stream with padded bytes + appendNullCharToAlignStream(); + } + + /** + * Same as writeSuperColliderTypes(Object[]), just that it takes a vector (for jdk1.1 + * compatibility), rather than an array. + * @param vector the collection I am to write out types for + */ + public void writeTypes(Vector vector) { + // A big ol' case statement in a for loop -- what's polymorphism mean, again? + // I really wish I could extend the base classes! + + Enumeration enm = vector.elements(); + Object nextObject; + while (enm.hasMoreElements()) { + nextObject = enm.nextElement(); + if (null == nextObject) + continue; + // if the array at i is a type of array write a [ + // This is used for nested arguments + if (nextObject.getClass().isArray()) { + stream.write('['); + // fill the [] with the SuperCollider types corresponding to the object + // (e.g., Object of type String needs -s). + writeTypesArray((Object[]) nextObject); + // close the array + stream.write(']'); + continue; + } + // Create a way to deal with Boolean type objects + if (Boolean.TRUE.equals(nextObject)) { + stream.write('T'); + continue; + } + if (Boolean.FALSE.equals(nextObject)) { + stream.write('F'); + continue; + } + // go through the array and write the superCollider types as shown in the + // above method. the Classes derived here are used as the arg to the above method + writeType(nextObject.getClass()); + } + // align the stream with padded bytes + appendNullCharToAlignStream(); + } + + /** + * convert an integer to byte array + * + * @param value int + */ + private void writeIntegerToByteArray(int value) { + byte[] intBytes = new byte[4]; + + intBytes[3] = (byte)value; value>>>=8; + intBytes[2] = (byte)value; value>>>=8; + intBytes[1] = (byte)value; value>>>=8; + intBytes[0] = (byte)value; + + try { + stream.write(intBytes); + } catch (IOException e) { + throw new RuntimeException("You're screwed: IOException writing to a ByteArrayOutputStream"); + } + } + + /** + * Line up the BigEnd of the bytes to a 4 byte boundry + * + * @param bytes byte[] + */ + private void writeBigEndToFourByteBoundry(byte[] bytes) { + int mod = bytes.length % 4; + // if the remainder == 0 write the bytes + if (mod == 0) { + try { stream.write(bytes); } catch (IOException e) + { throw new RuntimeException("You're screwed: IOException writing to a ByteArrayOutputStream"); } + return; + } + // pad the bytes to lineup correctly + int pad = 4 - mod; + byte[] newBytes = new byte[pad + bytes.length]; + System.arraycopy(bytes,0,newBytes,pad,bytes.length); + + try { stream.write(newBytes); } catch (IOException e) + { throw new RuntimeException("You're screwed: IOException writing to a ByteArrayOutputStream"); } + } + + /** + * Line up the LittleEnd of the bytes to a 4 byte boundry + * + * @param bytes byte[] + */ + private void writeLittleEndToFourByteBoundry(byte[] bytes) { + int mod = bytes.length % 4; + // if the remainder == 0 write the bytes + if (mod == 4) { + try { stream.write(bytes); } catch (IOException e) + { throw new RuntimeException("You're screwed: IOException writing to a ByteArrayOutputStream"); } + return; + } + // pad the bytes to lineup correctly + int pad = 4 - mod; + byte[] newBytes = new byte[pad + bytes.length]; + System.arraycopy(bytes,0,newBytes,0,bytes.length); + + try { stream.write(newBytes); } catch (IOException e) + { throw new RuntimeException("You're screwed: IOException writing to a ByteArrayOutputStream"); } + } + +} diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/com/illposed/osc/utility/OSCPacketDispatcher.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/com/illposed/osc/utility/OSCPacketDispatcher.java Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,77 @@ +/* $Id: OSCPacketDispatcher.java,v 1.2 2008/07/01 15:29:46 modin Exp $ + * Created on 28.10.2003 + */ +package com.illposed.osc.utility; + +import com.illposed.osc.*; + +import java.util.Date; +import java.util.Enumeration; +import java.util.Hashtable; + +/** + * @author cramakrishnan + * + * Copyright (C) 2003, C. Ramakrishnan / Auracle + * All rights reserved. + * + * See license.txt (or license.rtf) for license information. + * + * Dispatches OSCMessages to registered listeners. + * + */ + +public class OSCPacketDispatcher { + private Hashtable addressToClassTable = new Hashtable(); + + /** + * + */ + public OSCPacketDispatcher() { + super(); + } + + public void addListener(String address, OSCListener listener) { + addressToClassTable.put(address, listener); + } + + public void dispatchPacket(OSCPacket packet) { + if (packet instanceof OSCBundle) + dispatchBundle((OSCBundle) packet); + else + dispatchMessage((OSCMessage) packet); + } + + public void dispatchPacket(OSCPacket packet, Date timestamp) { + if (packet instanceof OSCBundle) + dispatchBundle((OSCBundle) packet); + else + dispatchMessage((OSCMessage) packet, timestamp); + } + + private void dispatchBundle(OSCBundle bundle) { + Date timestamp = bundle.getTimestamp(); + OSCPacket[] packets = bundle.getPackets(); + for (int i = 0; i < packets.length; i++) { + dispatchPacket(packets[i], timestamp); + } + } + + private void dispatchMessage(OSCMessage message) { + dispatchMessage(message, null); + } + + private void dispatchMessage(OSCMessage message, Date time) { + Enumeration keys = addressToClassTable.keys(); + while (keys.hasMoreElements()) { + String key = (String) keys.nextElement(); + // this supports the OSC regexp facility, but it + // only works in JDK 1.4, so don't support it right now + // if (key.matches(message.getAddress())) { + if (key.equals(message.getAddress())) { + OSCListener listener = (OSCListener) addressToClassTable.get(key); + listener.acceptMessage(time, message); + } + } + } +} diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/compile.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/compile.bat Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,6 @@ +cd src +javac -O -source 1.5 -target 1.5 -cp . *.java TUIO\*.java com\illposed\osc\*.java +jar cfm ..\TuioDemo.jar manifest.inc *.class TUIO\*.class com\illposed\osc\*.class com\illposed\osc\utility\*.class +jar cf ..\libTUIO.jar TUIO\*.class com\illposed\osc\*.class com\illposed\osc\utility\*.class +del *.class TUIO\*.class com\illposed\osc\*.class com\illposed\osc\utility\*.class +cd .. diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/compile.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/compile.sh Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,7 @@ +#!/bin/sh +cd src +javac -Xlint:unchecked -O -source 1.5 -target 1.5 -cp . *.java TUIO/*.java com/illposed/osc/*.java +jar cfm ../TuioDemo.jar manifest.inc *.class TUIO/*.class com/illposed/osc/*.class com/illposed/osc/utility/*.class +jar cf ../libTUIO.jar TUIO/*.class com/illposed/osc/*.class com/illposed/osc/utility/*.class +rm -f *.class TUIO/*.class com/illposed/osc/*.class com/illposed/osc/utility/*.class +cd .. diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/doc.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/doc.sh Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,3 @@ +#!/bin/sh +javadoc -d doc -sourcepath src TUIO + diff -r 000000000000 -r 6fefd4afe506 front_processing/extern/TUIO_JAVA/src/manifest.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/extern/TUIO_JAVA/src/manifest.inc Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,3 @@ +Main-Class: TuioDemo + + diff -r 000000000000 -r 6fefd4afe506 front_processing/src/Trakers/Trakers.pde --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/front_processing/src/Trakers/Trakers.pde Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,117 @@ +import TUIO.*; +TuioProcessing tuioClient; +boolean oneHandLeft; + +/*FONCTION D'INITIALISATION +Entrée : +Sortie : Création de la fenêtre et du client TUIO*/ +void setup() +{ + size (640, 480); + background(255); + tuioClient = new TuioProcessing(this, 80); + textAlign(CENTER); + imageMode(CENTER); + smooth(); +} + +/*FONCTION DE DESSIN +Entrée : +Sortie : Appel à la fonction de traitement d'input du serveur toutes les n millisecondes*/ +void draw() +{ + fill(0); + tuioInput(); + noStroke(); +} + +/*FONCTION DE RECEPTION DES MESSAGES OSC +Entrée : +Sortie : Appel aux différentes fonctions de dessin si un message est reçu*/ +void tuioInput() +{ + noFill(); + rect(0, 0, 50, 50); + + Vector tuioCursorList = tuioClient.getTuioCursors(); + + if(tuioCursorList.size() == 1) + handleOneHand((TuioCursor)tuioCursorList.elementAt(0)); + else if(tuioCursorList.size() == 2) + handleBothHands(tuioCursorList); +} + +/*FONCTION DE GESTION DES COURBES POUR UNE MAIN DETECTEE +Entrée : Un curseur TUIO +Sortie : Appel aux différentes fonctions de dessin si un message est reçu*/ +void handleOneHand(TuioCursor handCursor) +{ + fill(0, 0, 255); + rect(0, 0, 50, 50); + + Vector pointList = handCursor.getPath(); + for (int j=0;j + + + + diff -r 000000000000 -r 6fefd4afe506 middleware/extern/TuioServer/Tuio.Test/App.xaml.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/middleware/extern/TuioServer/Tuio.Test/App.xaml.cs Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Windows; + +namespace Tuio.Test +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff -r 000000000000 -r 6fefd4afe506 middleware/extern/TuioServer/Tuio.Test/MainWindow.xaml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/middleware/extern/TuioServer/Tuio.Test/MainWindow.xaml Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,9 @@ + + + + + diff -r 000000000000 -r 6fefd4afe506 middleware/extern/TuioServer/Tuio.Test/MainWindow.xaml.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/middleware/extern/TuioServer/Tuio.Test/MainWindow.xaml.cs Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +using Tuio; + +namespace Tuio.Test +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + private TuioServer _server; + + public MainWindow() + { + InitializeComponent(); + _server = new TuioServer(); + ThreadPool.QueueUserWorkItem(ThreadPoolCallback); + } + + private void Window_MouseDown(object sender, MouseButtonEventArgs e) + { + _server.AddTuioCursor(0, AbsoluteToRelativePosition(e.GetPosition(this))); + } + + private void Window_MouseMove(object sender, MouseEventArgs e) + { + _server.UpdateTuioCursor(0, AbsoluteToRelativePosition(e.GetPosition(this))); + } + + private void Window_MouseUp(object sender, MouseButtonEventArgs e) + { + _server.DeleteTuioCursor(0); + } + + private System.Drawing.PointF AbsoluteToRelativePosition(Point p) + { + return new System.Drawing.PointF( + (float)(p.X / Width), + (float)(p.Y / Height)); + } + + private void ThreadPoolCallback(Object threadContext) + { + while (true) + { + _server.InitFrame(); + _server.CommitFrame(); + Thread.Sleep(25); + } + } + } +} diff -r 000000000000 -r 6fefd4afe506 middleware/extern/TuioServer/Tuio.Test/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/middleware/extern/TuioServer/Tuio.Test/Properties/AssemblyInfo.cs Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Tuio.Test")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Tuio.Test")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff -r 000000000000 -r 6fefd4afe506 middleware/extern/TuioServer/Tuio.Test/Properties/Resources.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/middleware/extern/TuioServer/Tuio.Test/Properties/Resources.Designer.cs Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.1 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tuio.Test.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tuio.Test.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff -r 000000000000 -r 6fefd4afe506 middleware/extern/TuioServer/Tuio.Test/Properties/Resources.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/middleware/extern/TuioServer/Tuio.Test/Properties/Resources.resx Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff -r 000000000000 -r 6fefd4afe506 middleware/extern/TuioServer/Tuio.Test/Properties/Settings.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/middleware/extern/TuioServer/Tuio.Test/Properties/Settings.Designer.cs Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.1 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tuio.Test.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff -r 000000000000 -r 6fefd4afe506 middleware/extern/TuioServer/Tuio.Test/Properties/Settings.settings --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/middleware/extern/TuioServer/Tuio.Test/Properties/Settings.settings Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 000000000000 -r 6fefd4afe506 middleware/extern/TuioServer/Tuio.Test/Tuio.Test.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/middleware/extern/TuioServer/Tuio.Test/Tuio.Test.csproj Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,110 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {9DE22EEA-1230-4A72-B356-714ACB5CEF78} + WinExe + Properties + Tuio.Test + Tuio.Test + v4.0 + Client + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + {A86F5BCA-F196-40D0-967B-FD8C63AE85CE} + Tuio + + + + + \ No newline at end of file diff -r 000000000000 -r 6fefd4afe506 middleware/extern/TuioServer/TuioServer.sln --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/middleware/extern/TuioServer/TuioServer.sln Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,42 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tuio", "TuioServer\Tuio.csproj", "{A86F5BCA-F196-40D0-967B-FD8C63AE85CE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tuio.Test", "Tuio.Test\Tuio.Test.csproj", "{9DE22EEA-1230-4A72-B356-714ACB5CEF78}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A86F5BCA-F196-40D0-967B-FD8C63AE85CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A86F5BCA-F196-40D0-967B-FD8C63AE85CE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A86F5BCA-F196-40D0-967B-FD8C63AE85CE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A86F5BCA-F196-40D0-967B-FD8C63AE85CE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A86F5BCA-F196-40D0-967B-FD8C63AE85CE}.Debug|x86.ActiveCfg = Debug|Any CPU + {A86F5BCA-F196-40D0-967B-FD8C63AE85CE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A86F5BCA-F196-40D0-967B-FD8C63AE85CE}.Release|Any CPU.Build.0 = Release|Any CPU + {A86F5BCA-F196-40D0-967B-FD8C63AE85CE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {A86F5BCA-F196-40D0-967B-FD8C63AE85CE}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A86F5BCA-F196-40D0-967B-FD8C63AE85CE}.Release|x86.ActiveCfg = Release|Any CPU + {9DE22EEA-1230-4A72-B356-714ACB5CEF78}.Debug|Any CPU.ActiveCfg = Debug|x86 + {9DE22EEA-1230-4A72-B356-714ACB5CEF78}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {9DE22EEA-1230-4A72-B356-714ACB5CEF78}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {9DE22EEA-1230-4A72-B356-714ACB5CEF78}.Debug|x86.ActiveCfg = Debug|x86 + {9DE22EEA-1230-4A72-B356-714ACB5CEF78}.Debug|x86.Build.0 = Debug|x86 + {9DE22EEA-1230-4A72-B356-714ACB5CEF78}.Release|Any CPU.ActiveCfg = Release|x86 + {9DE22EEA-1230-4A72-B356-714ACB5CEF78}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {9DE22EEA-1230-4A72-B356-714ACB5CEF78}.Release|Mixed Platforms.Build.0 = Release|x86 + {9DE22EEA-1230-4A72-B356-714ACB5CEF78}.Release|x86.ActiveCfg = Release|x86 + {9DE22EEA-1230-4A72-B356-714ACB5CEF78}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff -r 000000000000 -r 6fefd4afe506 middleware/extern/TuioServer/TuioServer.suo Binary file middleware/extern/TuioServer/TuioServer.suo has changed diff -r 000000000000 -r 6fefd4afe506 middleware/extern/TuioServer/TuioServer/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/middleware/extern/TuioServer/TuioServer/Properties/AssemblyInfo.cs Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("TuioServer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("TuioServer")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("218d7cf4-1caa-48da-b5a6-6ede92db690d")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff -r 000000000000 -r 6fefd4afe506 middleware/extern/TuioServer/TuioServer/Tuio.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/middleware/extern/TuioServer/TuioServer/Tuio.csproj Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,59 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {A86F5BCA-F196-40D0-967B-FD8C63AE85CE} + Library + Properties + TuioServer + TuioServer + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\Libraries\Bespoke.Common.Osc\Bespoke.Common.Osc.dll + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 6fefd4afe506 middleware/extern/TuioServer/TuioServer/TuioCursor.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/middleware/extern/TuioServer/TuioServer/TuioCursor.cs Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; + +namespace Tuio +{ + /// + /// TUIO cursor. + /// + /// (c) 2010 by Dominik Schmidt (schmidtd@comp.lancs.ac.uk) + /// + public class TuioCursor + { + #region properties + + public int Id { get; private set; } + + public PointF Location { get; set; } + + public PointF Speed { get; set; } + + public float MotionAcceleration { get; set; } + + #endregion + + #region constructors + + public TuioCursor(int id, PointF location) + { + Id = id; + Location = location; + } + + #endregion + + } +} diff -r 000000000000 -r 6fefd4afe506 middleware/extern/TuioServer/TuioServer/TuioServer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/middleware/extern/TuioServer/TuioServer/TuioServer.cs Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,186 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Net; +using System.Text; + +using Bespoke.Common.Osc; + +namespace Tuio +{ + /// + /// Simple, still uncomplete implementation of a TUIO server in C#. + /// + /// Current shortcomings: + /// Object support missing. + /// Does not implement frame times. + /// Only supports external TUIO cursors. + /// Allways commits all cursors. + /// + /// (c) 2010 by Dominik Schmidt (schmidtd@comp.lancs.ac.uk) + /// + public class TuioServer + { + #region constants + + private const string _cursorAddressPattern = "/tuio/2Dcur"; + + private const string _objectAddressPattern = "/tuio/2Dobj"; + + #endregion + + #region fields + + private IPEndPoint _ipEndPoint; + + private Dictionary _cursors; + + private int _currentFrame; + + #endregion + + #region constructors + + /// + /// Creates a new server with and endpoint at localhost, port 3333. + /// + public TuioServer() : this("127.0.0.1", 3333) { } + + /// + /// Creates a new server. + /// + /// Endpoint host + /// Endpoint port + public TuioServer(string host, int port) + { + _cursors = new Dictionary(); + _ipEndPoint = new IPEndPoint(IPAddress.Parse(host), port); + _currentFrame = 0; + } + + #endregion + + #region frame related methods + + /// + /// Initialized a new frame and increases the frame counter. + /// + public void InitFrame() + { + _currentFrame++; + } + + /// + /// Commits the current frame. + /// + public void CommitFrame() + { + GetFrameBundle().Send(_ipEndPoint); + } + + #endregion + + #region cursor related methods + + /// + /// Adds a TUIO cursor. A new id, not used before, must be provided. + /// + /// New id + /// Location + public void AddTuioCursor(int id, PointF location) + { + lock(_cursors) + if(!_cursors.ContainsKey(id)) + _cursors.Add(id, new TuioCursor(id, location)); + } + + /// + /// Updates a TUIO cursor. An id of an existing cursor must be provided. + /// + /// Id + /// Location + public void UpdateTuioCursor(int id, PointF location) + { + TuioCursor cursor; + if(_cursors.TryGetValue(id, out cursor)) + cursor.Location = location; + } + + /// + /// Deletes a TUIO cursor. An id of an existing cursor must be provided. + /// + /// Id + public void DeleteTuioCursor(int id) + { + lock (_cursors) + _cursors.Remove(id); + } + + #endregion + + #region osc message assembly + + private OscBundle GetFrameBundle() + { + OscBundle bundle = new OscBundle(_ipEndPoint); + + bundle.Append(GetAliveMessage()); + foreach (OscMessage msg in GetCursorMessages()) + bundle.Append(msg); + bundle.Append(GetSequenceMessage()); + + return bundle; + } + + private OscMessage GetAliveMessage() + { + OscMessage msg = new OscMessage(_ipEndPoint, _cursorAddressPattern); + + msg.Append("alive"); + lock (_cursors) + foreach (TuioCursor cursor in _cursors.Values) + msg.Append((Int32)cursor.Id); + + return msg; + } + + private OscMessage GetSequenceMessage() + { + OscMessage msg = new OscMessage(_ipEndPoint, _cursorAddressPattern); + + msg.Append("fseq"); + msg.Append((Int32)_currentFrame); + + return msg; + } + + private OscMessage GetCursorMessage(TuioCursor cursor) + { + OscMessage msg = new OscMessage(_ipEndPoint, _cursorAddressPattern); + + msg.Append("set"); + msg.Append((Int32)cursor.Id); + msg.Append(cursor.Location.X); + msg.Append(cursor.Location.Y); + msg.Append(cursor.Speed.X); + msg.Append(cursor.Speed.Y); + msg.Append(cursor.MotionAcceleration); + + return msg; + } + + private IEnumerable GetCursorMessages() + { + List msgs = new List(); + + lock (_cursors) + foreach (TuioCursor cursor in _cursors.Values) + msgs.Add(GetCursorMessage(cursor)); + + return msgs.AsEnumerable(); + } + + #endregion + } +} diff -r 000000000000 -r 6fefd4afe506 middleware/lib/Bespoke.Common.Osc.dll Binary file middleware/lib/Bespoke.Common.Osc.dll has changed diff -r 000000000000 -r 6fefd4afe506 middleware/lib/Bespoke.Common.dll Binary file middleware/lib/Bespoke.Common.dll has changed diff -r 000000000000 -r 6fefd4afe506 middleware/lib/Coding4Fun.Kinect.Wpf.dll Binary file middleware/lib/Coding4Fun.Kinect.Wpf.dll has changed diff -r 000000000000 -r 6fefd4afe506 middleware/lib/Kinect.Toolbox.dll Binary file middleware/lib/Kinect.Toolbox.dll has changed diff -r 000000000000 -r 6fefd4afe506 middleware/lib/Microsoft.Kinect.dll Binary file middleware/lib/Microsoft.Kinect.dll has changed diff -r 000000000000 -r 6fefd4afe506 middleware/src/App.config --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/middleware/src/App.config Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 000000000000 -r 6fefd4afe506 middleware/src/Communication/Server.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/middleware/src/Communication/Server.cs Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,150 @@ +/* + * Projet : KINECT PROJECTS + * Module : MIDDLEWARE + * Sous-Module : Communication + * Classe : Server + * + * Auteur : alexandre.bastien@iri.centrepompidou.fr + * + * Fonctionnalités : Reçoit des notifications du module sous-module Tracking. + * Traduit les notifications sous forme de messages OSC et les envoie au Front Atelier. + * Forme des messages : + * - Notification de main dans le champ de recherche : Point3D indiquant la position de la main dans l'espace. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.IO; +using System.Net; +using System.Net.Sockets; +using System.Threading; +using Tuio; +using System.Windows; +using Microsoft.Kinect; +using Trakers.Tracking; +using System.Windows.Media.Media3D; +using Trakers.Tracking.Events; + +namespace Trakers.Communication +{ + public class Server + { + //Serveur TUIO, provenant de la DLL TuioServer créé par Bespoke. + private TuioServer server; + + //Permet de savoir si un curseur pour la main gauche/droite a été créé. + private bool leftHandCursorCreated; + private bool rightHandCursorCreated; + + /* + * Constructeur : On initialise le serveur avec une adresse et un port, au début les curseurs + * ne sont pas créés et on indique au ThreadPool une fonction de callback de manière à vérifier + * s'il reçoit des notifications. + */ + public Server(String host, int port) + { + server = new TuioServer(host, port); + leftHandCursorCreated = false; + rightHandCursorCreated = false; + ThreadPool.QueueUserWorkItem(ThreadPoolCallback); + } + + /* + * Getter du serveur. + */ + public TuioServer getServer() + { + return server; + } + + /* + * Méthode appelée lors d'une notification de type : main gauche entrée dans le champ. + */ + public void LeftHandTracked(object sender, LeftHandTrackedEventArgs e) + { + //Si le curseur de la main gauche n'est pas créé, alors on le crée. + if (!leftHandCursorCreated) + { + server.AddTuioCursor(0, SkeletonPointToPoint3D(e.handJoint.Position)); + leftHandCursorCreated = true; + } + //S'il existe, on le met simplement à jour. + else + { + server.UpdateTuioCursor(0, SkeletonPointToPoint3D(e.handJoint.Position)); + } + } + + /* + * Méthode appelée lors d'une notification de type : main droite entrée dans le champ. + */ + public void RightHandTracked(object sender, RightHandTrackedEventArgs e) + { + //Si le curseur de la main droite n'est pas créé, alors on le crée. + if (!rightHandCursorCreated) + { + server.AddTuioCursor(1, SkeletonPointToPoint3D(e.handJoint.Position)); + rightHandCursorCreated = true; + } + //S'il existe, on le met simplement à jour. + else + { + server.UpdateTuioCursor(1, SkeletonPointToPoint3D(e.handJoint.Position)); + } + } + + /* + * Méthode appelée lors d'une notification de type : main gauche sortie du champ. + */ + public void LeftHandQuit(object sender, LeftHandQuitEventArgs e) + { + //Si le curseur de la main gauche existe, alors on le supprime. + if (leftHandCursorCreated) + { + server.DeleteTuioCursor(0); + leftHandCursorCreated = false; + } + } + + /* + * Méthode appelée lors d'une notification de type : main droite sortie du champ. + */ + public void RightHandQuit(object sender, RightHandQuitEventArgs e) + { + //Si le curseur de la main droite existe, alors on le supprime. + if (rightHandCursorCreated) + { + server.DeleteTuioCursor(1); + rightHandCursorCreated = false; + } + } + + /* + * Permet de convertir un point de position de noeud en Point3D. + */ + private Point3D SkeletonPointToPoint3D(SkeletonPoint p) + { + return new Point3D((double)p.X, (double)p.Y, (double)p.Z); + } + + /* + * Méthode de callback vérifiant toutes les 25 ms les nouvelles notifications. + * Il est à noter que si le temps de rafraîchissement des trop rapide, les messages n'ont pas + * le temps d'être envoyés. + */ + private void ThreadPoolCallback(Object threadContext) + { + while (true) + { + //On initialise le message OSC. + server.InitFrame(); + //On l'envoie au client (au host et au port spécifiés dans le constructeur). + server.CommitFrame(); + //On attend 25 ms. + Thread.Sleep(25); + } + } + } +} diff -r 000000000000 -r 6fefd4afe506 middleware/src/Communication/TuioCursor.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/middleware/src/Communication/TuioCursor.cs Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; + +namespace Tuio +{ + /// + /// TUIO cursor. + /// + /// (c) 2010 by Dominik Schmidt (schmidtd@comp.lancs.ac.uk) + /// + public class TuioCursor + { + #region properties + + public int Id { get; private set; } + + public PointF Location { get; set; } + + public PointF Speed { get; set; } + + public float MotionAcceleration { get; set; } + + #endregion + + #region constructors + + public TuioCursor(int id, PointF location) + { + Id = id; + Location = location; + } + + #endregion + + } +} diff -r 000000000000 -r 6fefd4afe506 middleware/src/Communication/TuioServer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/middleware/src/Communication/TuioServer.cs Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,186 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Net; +using System.Text; + +using Bespoke.Common.Osc; + +namespace Tuio +{ + /// + /// Simple, still uncomplete implementation of a TUIO server in C#. + /// + /// Current shortcomings: + /// Object support missing. + /// Does not implement frame times. + /// Only supports external TUIO cursors. + /// Allways commits all cursors. + /// + /// (c) 2010 by Dominik Schmidt (schmidtd@comp.lancs.ac.uk) + /// + public class TuioServer + { + #region constants + + private const string _cursorAddressPattern = "/tuio/2Dcur"; + + private const string _objectAddressPattern = "/tuio/2Dobj"; + + #endregion + + #region fields + + private IPEndPoint _ipEndPoint; + + private Dictionary _cursors; + + private int _currentFrame; + + #endregion + + #region constructors + + /// + /// Creates a new server with and endpoint at localhost, port 3333. + /// + public TuioServer() : this("127.0.0.1", 3333) { } + + /// + /// Creates a new server. + /// + /// Endpoint host + /// Endpoint port + public TuioServer(string host, int port) + { + _cursors = new Dictionary(); + _ipEndPoint = new IPEndPoint(IPAddress.Parse(host), port); + _currentFrame = 0; + } + + #endregion + + #region frame related methods + + /// + /// Initialized a new frame and increases the frame counter. + /// + public void InitFrame() + { + _currentFrame++; + } + + /// + /// Commits the current frame. + /// + public void CommitFrame() + { + GetFrameBundle().Send(_ipEndPoint); + } + + #endregion + + #region cursor related methods + + /// + /// Adds a TUIO cursor. A new id, not used before, must be provided. + /// + /// New id + /// Location + public void AddTuioCursor(int id, PointF location) + { + lock(_cursors) + if(!_cursors.ContainsKey(id)) + _cursors.Add(id, new TuioCursor(id, location)); + } + + /// + /// Updates a TUIO cursor. An id of an existing cursor must be provided. + /// + /// Id + /// Location + public void UpdateTuioCursor(int id, PointF location) + { + TuioCursor cursor; + if(_cursors.TryGetValue(id, out cursor)) + cursor.Location = location; + } + + /// + /// Deletes a TUIO cursor. An id of an existing cursor must be provided. + /// + /// Id + public void DeleteTuioCursor(int id) + { + lock (_cursors) + _cursors.Remove(id); + } + + #endregion + + #region osc message assembly + + private OscBundle GetFrameBundle() + { + OscBundle bundle = new OscBundle(_ipEndPoint); + + bundle.Append(GetAliveMessage()); + foreach (OscMessage msg in GetCursorMessages()) + bundle.Append(msg); + bundle.Append(GetSequenceMessage()); + + return bundle; + } + + private OscMessage GetAliveMessage() + { + OscMessage msg = new OscMessage(_ipEndPoint, _cursorAddressPattern); + + msg.Append("alive"); + lock (_cursors) + foreach (TuioCursor cursor in _cursors.Values) + msg.Append((Int32)cursor.Id); + + return msg; + } + + private OscMessage GetSequenceMessage() + { + OscMessage msg = new OscMessage(_ipEndPoint, _cursorAddressPattern); + + msg.Append("fseq"); + msg.Append((Int32)_currentFrame); + + return msg; + } + + private OscMessage GetCursorMessage(TuioCursor cursor) + { + OscMessage msg = new OscMessage(_ipEndPoint, _cursorAddressPattern); + + msg.Append("set"); + msg.Append((Int32)cursor.Id); + msg.Append(cursor.Location.X); + msg.Append(cursor.Location.Y); + msg.Append(cursor.Speed.X); + msg.Append(cursor.Speed.Y); + msg.Append(cursor.MotionAcceleration); + + return msg; + } + + private IEnumerable GetCursorMessages() + { + List msgs = new List(); + + lock (_cursors) + foreach (TuioCursor cursor in _cursors.Values) + msgs.Add(GetCursorMessage(cursor)); + + return msgs.AsEnumerable(); + } + + #endregion + } +} diff -r 000000000000 -r 6fefd4afe506 middleware/src/Debug/DebugWindow.xaml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/middleware/src/Debug/DebugWindow.xaml Fri Mar 09 14:52:11 2012 +0100 @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +