Revision 38
| SketchupMT Plugin/TuioSuDump.cpp (revision 38) | ||
|---|---|---|
| 1 |
/* |
|
| 2 |
TUIO C++ Example - part of the reacTIVision project |
|
| 3 |
http://reactivision.sourceforge.net/ |
|
| 4 |
|
|
| 5 |
Copyright (c) 2005-2009 Martin Kaltenbrunner <[email protected]> |
|
| 6 |
|
|
| 7 |
Permission is hereby granted, free of charge, to any person obtaining |
|
| 8 |
a copy of this software and associated documentation files |
|
| 9 |
(the "Software"), to deal in the Software without restriction, |
|
| 10 |
including without limitation the rights to use, copy, modify, merge, |
|
| 11 |
publish, distribute, sublicense, and/or sell copies of the Software, |
|
| 12 |
and to permit persons to whom the Software is furnished to do so, |
|
| 13 |
subject to the following conditions: |
|
| 14 |
|
|
| 15 |
The above copyright notice and this permission notice shall be |
|
| 16 |
included in all copies or substantial portions of the Software. |
|
| 17 |
|
|
| 18 |
Any person wishing to distribute modifications to the Software is |
|
| 19 |
requested to send the modifications to the original developer so that |
|
| 20 |
they can be incorporated into the canonical version. |
|
| 21 |
|
|
| 22 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|
| 23 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|
| 24 |
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
|
| 25 |
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR |
|
| 26 |
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF |
|
| 27 |
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
|
| 28 |
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
| 29 |
*/ |
|
| 30 |
|
|
| 31 |
#include <wx/string.h> |
|
| 32 |
#include "TuioSuDump.h" |
|
| 33 |
#include "debugging.h" |
|
| 34 |
#include "MultitouchSu.h" |
|
| 35 |
#include "RubyClass.h" |
|
| 36 |
|
|
| 37 |
extern wxString g_wxStringMsg; |
|
| 38 |
extern HWND g_hWndSketchUp; |
|
| 39 |
|
|
| 40 |
// ---------------------------------------------------------------------------- |
|
| 41 |
void TuioDump::addTuioObject(TuioObject *tobj) {
|
|
| 42 |
// ---------------------------------------------------------------------------- |
|
| 43 |
//std::cout << "add obj " << tobj->getSymbolID() << " (" << tobj->getSessionID() << ") "<< tobj->getX() << " " << tobj->getY() << " " << tobj->getAngle() << std::endl;
|
|
| 44 |
wxString msg = _T("");
|
|
| 45 |
msg << _T("add obj ") << tobj->getSymbolID() << _T(" (") << tobj->getSessionID() << _T(") ")<< tobj->getX() << _T(" ") << tobj->getY() << _T(" ") << tobj->getAngle() ; //_T("\n");
|
|
| 46 |
#if defined(LOGGING) |
|
| 47 |
//LOGIT( _T("[%s]"), msg.c_str());
|
|
| 48 |
#endif |
|
| 49 |
// Post the data to SketchUp to allowing synchronous entry into embeded Ruby |
|
| 50 |
g_wxStringMsg = msg; |
|
| 51 |
WORD wParam = 0; |
|
| 52 |
LPARAM lParam = (LPARAM)&g_wxStringMsg; |
|
| 53 |
long lresult = ::SendMessage( g_hWndSketchUp, WM_USER+0x8001, wParam, lParam); |
|
| 54 |
if (lresult) ; |
|
| 55 |
|
|
| 56 |
} |
|
| 57 |
|
|
| 58 |
// ---------------------------------------------------------------------------- |
|
| 59 |
void TuioDump::updateTuioObject(TuioObject *tobj) {
|
|
| 60 |
// ---------------------------------------------------------------------------- |
|
| 61 |
//std::cout << "set obj " << tobj->getSymbolID() << " (" << tobj->getSessionID() << ") "<< tobj->getX() << " " << tobj->getY() << " " << tobj->getAngle()
|
|
| 62 |
// << " " << tobj->getMotionSpeed() << " " << tobj->getRotationSpeed() << " " << tobj->getMotionAccel() << " " << tobj->getRotationAccel() << std::endl; |
|
| 63 |
wxString msg = _T("");
|
|
| 64 |
msg << _T("set obj ") << tobj->getSymbolID() << _T(" (") << tobj->getSessionID() << _T(") ")<< tobj->getX() << _T(" ") << tobj->getY() << _T(" ") << tobj->getAngle()
|
|
| 65 |
<< _T(" ") << tobj->getMotionSpeed() << _T(" ") << tobj->getRotationSpeed() << _T(" ") << tobj->getMotionAccel() << _T(" ") << tobj->getRotationAccel() ; //_T("\n");
|
|
| 66 |
#if defined(LOGGING) |
|
| 67 |
//LOGIT( _T("[%s]"), msg.c_str());
|
|
| 68 |
#endif |
|
| 69 |
// Post the data to SketchUp to allowing synchronous entry into embeded Ruby |
|
| 70 |
g_wxStringMsg = msg; |
|
| 71 |
WORD wParam = 0; |
|
| 72 |
LPARAM lParam = (LPARAM)&g_wxStringMsg; |
|
| 73 |
long lresult = ::SendMessage( g_hWndSketchUp, WM_USER+0x8001, wParam, lParam); |
|
| 74 |
if (lresult) ; |
|
| 75 |
} |
|
| 76 |
|
|
| 77 |
// ---------------------------------------------------------------------------- |
|
| 78 |
void TuioDump::removeTuioObject(TuioObject *tobj) {
|
|
| 79 |
// ---------------------------------------------------------------------------- |
|
| 80 |
//std::cout << "del obj " << tobj->getSymbolID() << " (" << tobj->getSessionID() << ")" << std::endl;
|
|
| 81 |
wxString msg = _T("");
|
|
| 82 |
msg << _T("del obj ") << tobj->getSymbolID() << _T(" (") << tobj->getSessionID() << _T(")") ; //_T("\n");
|
|
| 83 |
#if defined(LOGGING) |
|
| 84 |
//LOGIT( _T("[%s]"), msg.c_str());
|
|
| 85 |
#endif |
|
| 86 |
// Post the data to SketchUp to allowing synchronous entry into embeded Ruby |
|
| 87 |
g_wxStringMsg = msg; |
|
| 88 |
WORD wParam = 0; |
|
| 89 |
LPARAM lParam = (LPARAM)&g_wxStringMsg; |
|
| 90 |
long lresult = ::SendMessage( g_hWndSketchUp, WM_USER+0x8001, wParam, lParam); |
|
| 91 |
if (lresult) ; |
|
| 92 |
} |
|
| 93 |
|
|
| 94 |
// ---------------------------------------------------------------------------- |
|
| 95 |
void TuioDump::addTuioCursor(TuioCursor *tcur) {
|
|
| 96 |
// ---------------------------------------------------------------------------- |
|
| 97 |
//std::cout << "add cur " << tcur->getCursorID() << " (" << tcur->getSessionID() << ") " << tcur->getX() << " " << tcur->getY() << std::endl;
|
|
| 98 |
wxString msg = _T("");
|
|
| 99 |
msg << _T("add cur ") << tcur->getCursorID() << _T(" (") << tcur->getSessionID() << _T(") ") << tcur->getX() << _T(" ") << tcur->getY() ; //_T("\n");
|
|
| 100 |
#if defined(LOGGING) |
|
| 101 |
//LOGIT( _T("[%s]"), msg.c_str());
|
|
| 102 |
#endif |
|
| 103 |
// Post the data to SketchUp to allowing synchronous entry into embeded Ruby |
|
| 104 |
g_wxStringMsg = msg; |
|
| 105 |
WORD wParam = 0; |
|
| 106 |
LPARAM lParam = (LPARAM)&g_wxStringMsg; |
|
| 107 |
long lresult = ::SendMessage( g_hWndSketchUp, WM_USER+0x8001, wParam, lParam); |
|
| 108 |
if (lresult) ; |
|
| 109 |
} |
|
| 110 |
|
|
| 111 |
// ---------------------------------------------------------------------------- |
|
| 112 |
void TuioDump::updateTuioCursor(TuioCursor *tcur) {
|
|
| 113 |
// ---------------------------------------------------------------------------- |
|
| 114 |
//std::cout << "set cur " << tcur->getCursorID() << " (" << tcur->getSessionID() << ") " << tcur->getX() << " " << tcur->getY()
|
|
| 115 |
// << " " << tcur->getMotionSpeed() << " " << tcur->getMotionAccel() << " " << std::endl; |
|
| 116 |
wxString msg = _T("");
|
|
| 117 |
msg << _T("set cur ") << tcur->getCursorID() << _T(" (") << tcur->getSessionID() << _T(") ") << tcur->getX() << _T(" ") << tcur->getY()
|
|
| 118 |
<< _T(" ") << tcur->getMotionSpeed() << _T(" ") << tcur->getMotionAccel() << _T(" ") ; //_T("\n");
|
|
| 119 |
#if defined(LOGGING) |
|
| 120 |
//LOGIT( _T("[%s]"), msg.c_str());
|
|
| 121 |
#endif |
|
| 122 |
// Post the data to SketchUp to allowing synchronous entry into embeded Ruby |
|
| 123 |
g_wxStringMsg = msg; |
|
| 124 |
WORD wParam = 0; |
|
| 125 |
LPARAM lParam = (LPARAM)&g_wxStringMsg; |
|
| 126 |
long lresult = ::SendMessage( g_hWndSketchUp, WM_USER+0x8001, wParam, lParam); |
|
| 127 |
if (lresult) ; |
|
| 128 |
} |
|
| 129 |
|
|
| 130 |
// ---------------------------------------------------------------------------- |
|
| 131 |
void TuioDump::removeTuioCursor(TuioCursor *tcur) {
|
|
| 132 |
// ---------------------------------------------------------------------------- |
|
| 133 |
//std::cout << "del cur " << tcur->getCursorID() << " (" << tcur->getSessionID() << ")" << std::endl;
|
|
| 134 |
wxString msg = _T("");
|
|
| 135 |
msg << _T("del cur ") << tcur->getCursorID() << _T(" (") << tcur->getSessionID() << _T(")") ; //_T("\n");
|
|
| 136 |
#if defined(LOGGING) |
|
| 137 |
//LOGIT( _T("[%s]"), msg.c_str());
|
|
| 138 |
#endif |
|
| 139 |
// Post the data to SketchUp to allowing synchronous entry into embeded Ruby |
|
| 140 |
g_wxStringMsg = msg; |
|
| 141 |
WORD wParam = 0; |
|
| 142 |
LPARAM lParam = (LPARAM)&g_wxStringMsg; |
|
| 143 |
long lresult = ::SendMessage( g_hWndSketchUp, WM_USER+0x8001, wParam, lParam); |
|
| 144 |
if (lresult) ; |
|
| 145 |
} |
|
| 146 |
// ---------------------------------------------------------------------------- |
|
| 147 |
void TuioDump::refresh(TuioTime frameTime) {
|
|
| 148 |
// ---------------------------------------------------------------------------- |
|
| 149 |
//std::cout << "refresh " << frameTime.getTotalMilliseconds() << std::endl; |
|
| 150 |
//wxString msg = _T("");
|
|
| 151 |
//msg << _T("refresh ") << frameTime.getTotalMilliseconds() ; //_T("\n");
|
|
| 152 |
//#if defined(LOGGING) |
|
| 153 |
//LOGIT( _T("[%s]"), msg.c_str());
|
|
| 154 |
//#endif |
|
| 155 |
//if( MultitouchSUApp::pRubyClassHandler ) |
|
| 156 |
// MultitouchSUApp::pRubyClassHandler->Call_Ruby_OnTuioDataMethod(msg); |
|
| 157 |
} |
|
| 158 |
|
|
| 159 |
//// ---------------------------------------------------------------------------- |
|
| 160 |
//int TuioDump::main(int argc, char* argv[]) |
|
| 161 |
//// ---------------------------------------------------------------------------- |
|
| 162 |
//{
|
|
| 163 |
// if( argc >= 2 && strcmp( argv[1], "-h" ) == 0 ){
|
|
| 164 |
// std::cout << "usage: TuioDump [port]\n"; |
|
| 165 |
// return 0; |
|
| 166 |
// } |
|
| 167 |
// |
|
| 168 |
// int port = 3333; |
|
| 169 |
// if( argc >= 2 ) port = atoi( argv[1] ); |
|
| 170 |
// |
|
| 171 |
// TuioDump dump; |
|
| 172 |
// TuioClient client(port); |
|
| 173 |
// client.addTuioListener(&dump); |
|
| 174 |
// client.addTuioListener(this); |
|
| 175 |
// client.connect(true); // blocking I/O |
|
| 176 |
// |
|
| 177 |
// return 0; |
|
| 178 |
//} |
|
| 179 |
|
|
| SketchupMT Plugin/MtSuGlobals.h (revision 38) | ||
|---|---|---|
| 1 |
/*** |
|
| 2 |
Spaced out for Comments and developer Credits and license info |
|
| 3 |
*/ |
|
| 4 |
|
|
| 5 |
#ifndef MTSUGLOBALS_H_INCLUDED |
|
| 6 |
#define MTSUGLOBALS_H_INCLUDED |
|
| 7 |
// ---------------------------------------------------------------------------- |
|
| 8 |
// Globals |
|
| 9 |
// ---------------------------------------------------------------------------- |
|
| 10 |
extern int g_DllIsInitialized; //guard while initializing |
|
| 11 |
extern char* g_lpszTitleToFind; //Title of window to find |
|
| 12 |
extern char* g_lpszClassToFind; //Class of View window |
|
| 13 |
extern HWND g_hWndSketchUp; //handle of SketchUp window |
|
| 14 |
extern HWND g_hWndSketchUpView; //handle of SketchUp View subwindow |
|
| 15 |
extern HWND g_hWndSketchUpStatusBar; //handle of SketchUp StatusBar |
|
| 16 |
extern DWORD g_dwCurrentProcessId; //PID of SketchUp process |
|
| 17 |
extern LONG OldWndProc; //Main windoww proc that we subclassed |
|
| 18 |
//enum {g_enumMtSuUserMsgNum = WM_USER+0x8001}; //MultiTouchSu WM_USER message id
|
|
| 19 |
extern UINT g_MtSuUserMsgNum; //variable of above |
|
| 20 |
struct structMtSuTuioData |
|
| 21 |
{
|
|
| 22 |
int sessionID; |
|
| 23 |
int symbolID; |
|
| 24 |
float positionX; |
|
| 25 |
float positionY; |
|
| 26 |
//float positionZ; |
|
| 27 |
float angle; |
|
| 28 |
//float angleA; |
|
| 29 |
//float angleB; |
|
| 30 |
//float angleC; |
|
| 31 |
//float motionSpeedX; |
|
| 32 |
//float motionSpeedY; |
|
| 33 |
//float motionSpeedZ; |
|
| 34 |
float motionSpeed; |
|
| 35 |
//float rotatonSpeedA; |
|
| 36 |
//float rotatonSpeedB; |
|
| 37 |
//float rotatonSpeedC; |
|
| 38 |
float rotationSpeed; |
|
| 39 |
float motionAccel; |
|
| 40 |
float rotationAccel; |
|
| 41 |
wxString packetMsg; |
|
| 42 |
|
|
| 43 |
void clear() |
|
| 44 |
{
|
|
| 45 |
sessionID = 0; |
|
| 46 |
symbolID = 0; |
|
| 47 |
positionX = 0; |
|
| 48 |
positionY = 0; |
|
| 49 |
angle = 0; |
|
| 50 |
motionSpeed = 0; |
|
| 51 |
rotationSpeed = 0; |
|
| 52 |
motionAccel = 0; |
|
| 53 |
rotationAccel = 0; |
|
| 54 |
packetMsg = wxEmptyString; |
|
| 55 |
} |
|
| 56 |
}; |
|
| 57 |
extern structMtSuTuioData g_MtSuTuioData; |
|
| 58 |
|
|
| 59 |
#define ZEROMEMORY(obj) ::ZeroMemory(&obj, sizeof(obj)) |
|
| 60 |
|
|
| 61 |
#endif // MTSUGLOBALS_H_INCLUDED |
|
| SketchupMT Plugin/MultitouchSU/TuioSuDump.cpp (revision 38) | ||
|---|---|---|
| 1 |
/* |
|
| 2 |
TUIO C++ Example - part of the reacTIVision project |
|
| 3 |
http://reactivision.sourceforge.net/ |
|
| 4 |
|
|
| 5 |
Copyright (c) 2005-2009 Martin Kaltenbrunner <[email protected]> |
|
| 6 |
|
|
| 7 |
Permission is hereby granted, free of charge, to any person obtaining |
|
| 8 |
a copy of this software and associated documentation files |
|
| 9 |
(the "Software"), to deal in the Software without restriction, |
|
| 10 |
including without limitation the rights to use, copy, modify, merge, |
|
| 11 |
publish, distribute, sublicense, and/or sell copies of the Software, |
|
| 12 |
and to permit persons to whom the Software is furnished to do so, |
|
| 13 |
subject to the following conditions: |
|
| 14 |
|
|
| 15 |
The above copyright notice and this permission notice shall be |
|
| 16 |
included in all copies or substantial portions of the Software. |
|
| 17 |
|
|
| 18 |
Any person wishing to distribute modifications to the Software is |
|
| 19 |
requested to send the modifications to the original developer so that |
|
| 20 |
they can be incorporated into the canonical version. |
|
| 21 |
|
|
| 22 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|
| 23 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|
| 24 |
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
|
| 25 |
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR |
|
| 26 |
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF |
|
| 27 |
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
|
| 28 |
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
| 29 |
*/ |
|
| 30 |
|
|
| 31 |
#include <wx/string.h> |
|
| 32 |
#include "TuioSuDump.h" |
|
| 33 |
#include "debugging.h" |
|
| 34 |
#include "MultitouchSu.h" |
|
| 35 |
#include "RubyClass.h" |
|
| 36 |
#include "MtSuGlobals.h" |
|
| 37 |
////extern wxString g_wxStringMsg; |
|
| 38 |
////extern HWND g_hWndSketchUp; |
|
| 39 |
////extern UINT g_MtSuUserMsgNum; |
|
| 40 |
////extern structMtSuTuioData g_MtSuTuioData; |
|
| 41 |
// ---------------------------------------------------------------------------- |
|
| 42 |
void TuioDump::addTuioObject(TuioObject *tobj) |
|
| 43 |
// ---------------------------------------------------------------------------- |
|
| 44 |
{
|
|
| 45 |
//std::cout << "add obj " << tobj->getSymbolID() << " (" << tobj->getSessionID() << ") "<< tobj->getX() << " " << tobj->getY() << " " << tobj->getAngle() << std::endl;
|
|
| 46 |
wxString msg = _T("");
|
|
| 47 |
msg << _T("add obj ") << tobj->getSymbolID() << _T(" (") << tobj->getSessionID() << _T(") ")<< tobj->getX() << _T(" ") << tobj->getY() << _T(" ") << tobj->getAngle() ; //_T("\n");
|
|
| 48 |
|
|
| 49 |
#if defined(LOGGING_TUIO) |
|
| 50 |
LOGIT( _T("[%s]"), msg.c_str());
|
|
| 51 |
#endif |
|
| 52 |
|
|
| 53 |
// Post the data to SketchUp to allowing synchronous entry into embeded Ruby |
|
| 54 |
g_MtSuTuioData.clear(); |
|
| 55 |
g_MtSuTuioData.symbolID = tobj->getSymbolID(); |
|
| 56 |
g_MtSuTuioData.sessionID = tobj->getSessionID(); |
|
| 57 |
g_MtSuTuioData.positionX = tobj->getX(); |
|
| 58 |
g_MtSuTuioData.positionY = tobj->getY(); |
|
| 59 |
g_MtSuTuioData.angle = tobj->getAngle() ; |
|
| 60 |
g_MtSuTuioData.packetMsg = msg; |
|
| 61 |
WORD wParam = 0; |
|
| 62 |
LPARAM lParam = (LPARAM)tobj; |
|
| 63 |
long lresult = ::SendMessage( g_hWndSketchUp, g_MtSuUserMsgNum, wParam, lParam); |
|
| 64 |
if (lresult) ; //shush unused warning |
|
| 65 |
} |
|
| 66 |
// ---------------------------------------------------------------------------- |
|
| 67 |
void TuioDump::updateTuioObject(TuioObject *tobj) |
|
| 68 |
// ---------------------------------------------------------------------------- |
|
| 69 |
{
|
|
| 70 |
//std::cout << "set obj " << tobj->getSymbolID() << " (" << tobj->getSessionID() << ") "<< tobj->getX() << " " << tobj->getY() << " " << tobj->getAngle()
|
|
| 71 |
// << " " << tobj->getMotionSpeed() << " " << tobj->getRotationSpeed() << " " << tobj->getMotionAccel() << " " << tobj->getRotationAccel() << std::endl; |
|
| 72 |
wxString msg = _T("");
|
|
| 73 |
msg << _T("set obj ") << tobj->getSymbolID() << _T(" (") << tobj->getSessionID() << _T(") ")<< tobj->getX() << _T(" ") << tobj->getY() << _T(" ") << tobj->getAngle()
|
|
| 74 |
<< _T(" ") << tobj->getMotionSpeed() << _T(" ") << tobj->getRotationSpeed() << _T(" ") << tobj->getMotionAccel() << _T(" ") << tobj->getRotationAccel() ; //_T("\n");
|
|
| 75 |
|
|
| 76 |
#if defined(LOGGING_TUIO) |
|
| 77 |
LOGIT( _T("[%s]"), msg.c_str());
|
|
| 78 |
#endif |
|
| 79 |
|
|
| 80 |
// Post the data to SketchUp to allowing synchronous entry into embeded Ruby |
|
| 81 |
g_MtSuTuioData.clear(); |
|
| 82 |
|
|
| 83 |
g_MtSuTuioData.symbolID = tobj->getSymbolID(); |
|
| 84 |
g_MtSuTuioData.sessionID = tobj->getSessionID(); |
|
| 85 |
g_MtSuTuioData.positionX = tobj->getX(); |
|
| 86 |
g_MtSuTuioData.positionY = tobj->getY(); |
|
| 87 |
g_MtSuTuioData.angle = tobj->getAngle() ; |
|
| 88 |
|
|
| 89 |
g_MtSuTuioData.motionSpeed = tobj->getMotionSpeed(); |
|
| 90 |
g_MtSuTuioData.rotationSpeed = tobj->getRotationSpeed(); |
|
| 91 |
g_MtSuTuioData.motionAccel = tobj->getMotionAccel(); |
|
| 92 |
g_MtSuTuioData.rotationAccel = tobj->getRotationAccel(); |
|
| 93 |
|
|
| 94 |
g_MtSuTuioData.packetMsg = msg; |
|
| 95 |
WORD wParam = 0; |
|
| 96 |
LPARAM lParam = (LPARAM)tobj; |
|
| 97 |
|
|
| 98 |
long lresult = ::SendMessage( g_hWndSketchUp, g_MtSuUserMsgNum, wParam, lParam); |
|
| 99 |
if (lresult) ; |
|
| 100 |
} |
|
| 101 |
// ---------------------------------------------------------------------------- |
|
| 102 |
void TuioDump::removeTuioObject(TuioObject *tobj) |
|
| 103 |
// ---------------------------------------------------------------------------- |
|
| 104 |
{
|
|
| 105 |
//std::cout << "del obj " << tobj->getSymbolID() << " (" << tobj->getSessionID() << ")" << std::endl;
|
|
| 106 |
wxString msg = _T("");
|
|
| 107 |
msg << _T("del obj ") << tobj->getSymbolID() << _T(" (") << tobj->getSessionID() << _T(")") ; //_T("\n");
|
|
| 108 |
|
|
| 109 |
#if defined(LOGGING_TUIO) |
|
| 110 |
LOGIT( _T("[%s]"), msg.c_str());
|
|
| 111 |
#endif |
|
| 112 |
|
|
| 113 |
// Post the data to SketchUp to allowing synchronous entry into embeded Ruby |
|
| 114 |
g_MtSuTuioData.clear(); |
|
| 115 |
|
|
| 116 |
g_MtSuTuioData.symbolID = tobj->getSymbolID(); |
|
| 117 |
g_MtSuTuioData.sessionID = tobj->getSessionID(); |
|
| 118 |
|
|
| 119 |
g_MtSuTuioData.packetMsg = msg; |
|
| 120 |
WORD wParam = 0; |
|
| 121 |
LPARAM lParam = (LPARAM)tobj; |
|
| 122 |
|
|
| 123 |
long lresult = ::SendMessage( g_hWndSketchUp, g_MtSuUserMsgNum, wParam, lParam); |
|
| 124 |
if (lresult) ;//shush unused compiler warning msg |
|
| 125 |
} |
|
| 126 |
// ---------------------------------------------------------------------------- |
|
| 127 |
void TuioDump::addTuioCursor(TuioCursor *tcur) |
|
| 128 |
// ---------------------------------------------------------------------------- |
|
| 129 |
{
|
|
| 130 |
//std::cout << "add cur " << tcur->getCursorID() << " (" << tcur->getSessionID() << ") " << tcur->getX() << " " << tcur->getY() << std::endl;
|
|
| 131 |
wxString msg = _T("");
|
|
| 132 |
msg << _T("add cur ") << tcur->getCursorID() << _T(" (") << tcur->getSessionID() << _T(") ") << tcur->getX() << _T(" ") << tcur->getY() ; //_T("\n");
|
|
| 133 |
|
|
| 134 |
#if defined(LOGGING_TUIO) |
|
| 135 |
LOGIT( _T("[%s]"), msg.c_str());
|
|
| 136 |
#endif |
|
| 137 |
// Post the data to SketchUp to allowing synchronous entry into embeded Ruby |
|
| 138 |
g_MtSuTuioData.clear(); |
|
| 139 |
|
|
| 140 |
g_MtSuTuioData.symbolID = tcur->getCursorID(); |
|
| 141 |
g_MtSuTuioData.sessionID = tcur->getSessionID(); |
|
| 142 |
g_MtSuTuioData.positionX = tcur->getX(); |
|
| 143 |
g_MtSuTuioData.positionY = tcur->getY(); |
|
| 144 |
|
|
| 145 |
g_MtSuTuioData.packetMsg = msg; |
|
| 146 |
WORD wParam = 0; |
|
| 147 |
LPARAM lParam = (LPARAM)tcur; |
|
| 148 |
long lresult = ::SendMessage( g_hWndSketchUp, g_MtSuUserMsgNum, wParam, lParam); |
|
| 149 |
if (lresult) ; |
|
| 150 |
} |
|
| 151 |
// ---------------------------------------------------------------------------- |
|
| 152 |
void TuioDump::updateTuioCursor(TuioCursor *tcur) |
|
| 153 |
// ---------------------------------------------------------------------------- |
|
| 154 |
{
|
|
| 155 |
//std::cout << "set cur " << tcur->getCursorID() << " (" << tcur->getSessionID() << ") " << tcur->getX() << " " << tcur->getY()
|
|
| 156 |
// << " " << tcur->getMotionSpeed() << " " << tcur->getMotionAccel() << " " << std::endl; |
|
| 157 |
wxString msg = _T("");
|
|
| 158 |
msg << _T("set cur ") << tcur->getCursorID() << _T(" (") << tcur->getSessionID() << _T(") ") << tcur->getX() << _T(" ") << tcur->getY()
|
|
| 159 |
<< _T(" ") << tcur->getMotionSpeed() << _T(" ") << tcur->getMotionAccel() << _T(" ") ; //_T("\n");
|
|
| 160 |
#if defined(LOGGING_TUIO) |
|
| 161 |
LOGIT( _T("[%s]"), msg.c_str());
|
|
| 162 |
#endif |
|
| 163 |
// Post the data to SketchUp to allowing synchronous entry into embeded Ruby |
|
| 164 |
g_MtSuTuioData.clear(); |
|
| 165 |
|
|
| 166 |
g_MtSuTuioData.symbolID = tcur->getCursorID(); |
|
| 167 |
g_MtSuTuioData.sessionID = tcur->getSessionID(); |
|
| 168 |
g_MtSuTuioData.positionX = tcur->getX(); |
|
| 169 |
g_MtSuTuioData.positionY = tcur->getY(); |
|
| 170 |
g_MtSuTuioData.motionSpeed = tcur->getMotionSpeed();; |
|
| 171 |
g_MtSuTuioData.motionAccel = tcur->getMotionAccel(); |
|
| 172 |
|
|
| 173 |
g_MtSuTuioData.packetMsg = msg; |
|
| 174 |
WORD wParam = 0; |
|
| 175 |
LPARAM lParam = (LPARAM)tcur; |
|
| 176 |
|
|
| 177 |
long lresult = ::SendMessage( g_hWndSketchUp, g_MtSuUserMsgNum, wParam, lParam); |
|
| 178 |
if (lresult) ; |
|
| 179 |
} |
|
| 180 |
// ---------------------------------------------------------------------------- |
|
| 181 |
void TuioDump::removeTuioCursor(TuioCursor *tcur) |
|
| 182 |
// ---------------------------------------------------------------------------- |
|
| 183 |
{
|
|
| 184 |
//std::cout << "del cur " << tcur->getCursorID() << " (" << tcur->getSessionID() << ")" << std::endl;
|
|
| 185 |
wxString msg = _T("");
|
|
| 186 |
msg << _T("del cur ") << tcur->getCursorID() << _T(" (") << tcur->getSessionID() << _T(")") ; //_T("\n");
|
|
| 187 |
|
|
| 188 |
#if defined(LOGGING_TUIO) |
|
| 189 |
LOGIT( _T("[%s]"), msg.c_str());
|
|
| 190 |
#endif |
|
| 191 |
|
|
| 192 |
// Post the data to SketchUp to allowing synchronous entry into embeded Ruby |
|
| 193 |
g_MtSuTuioData.clear(); |
|
| 194 |
|
|
| 195 |
g_MtSuTuioData.symbolID = tcur->getCursorID(); |
|
| 196 |
g_MtSuTuioData.sessionID = tcur->getSessionID(); |
|
| 197 |
|
|
| 198 |
g_MtSuTuioData.packetMsg = msg; |
|
| 199 |
WORD wParam = 0; |
|
| 200 |
LPARAM lParam = (LPARAM)tcur; |
|
| 201 |
|
|
| 202 |
long lresult = ::SendMessage( g_hWndSketchUp, g_MtSuUserMsgNum, wParam, lParam); |
|
| 203 |
if (lresult) ; |
|
| 204 |
} |
|
| 205 |
// ---------------------------------------------------------------------------- |
|
| 206 |
void TuioDump::refresh(TuioTime frameTime) |
|
| 207 |
// ---------------------------------------------------------------------------- |
|
| 208 |
{
|
|
| 209 |
//std::cout << "refresh " << frameTime.getTotalMilliseconds() << std::endl; |
|
| 210 |
//wxString msg = _T("");
|
|
| 211 |
//msg << _T("refresh ") << frameTime.getTotalMilliseconds() ; //_T("\n");
|
|
| 212 |
//#if defined(LOGGING) |
|
| 213 |
//LOGIT( _T("[%s]"), msg.c_str());
|
|
| 214 |
//#endif |
|
| 215 |
//if( MultitouchSUApp::pRubyClassHandler ) |
|
| 216 |
// MultitouchSUApp::pRubyClassHandler->Call_Ruby_OnTuioDataMethod(msg); |
|
| 217 |
//g_MtSuTuioData.packetMsg |
|
| 218 |
} |
|
| 219 |
|
|
| 220 |
//// ---------------------------------------------------------------------------- |
|
| 221 |
//int TuioDump::main(int argc, char* argv[]) |
|
| 222 |
//// ---------------------------------------------------------------------------- |
|
| 223 |
//{
|
|
| 224 |
// if( argc >= 2 && strcmp( argv[1], "-h" ) == 0 ){
|
|
| 225 |
// std::cout << "usage: TuioDump [port]\n"; |
|
| 226 |
// return 0; |
|
| 227 |
// } |
|
| 228 |
// |
|
| 229 |
// int port = 3333; |
|
| 230 |
// if( argc >= 2 ) port = atoi( argv[1] ); |
|
| 231 |
// |
|
| 232 |
// TuioDump dump; |
|
| 233 |
// TuioClient client(port); |
|
| 234 |
// client.addTuioListener(&dump); |
|
| 235 |
// client.addTuioListener(this); |
|
| 236 |
// client.connect(true); // blocking I/O |
|
| 237 |
// |
|
| 238 |
// return 0; |
|
| 239 |
//} |
|
| 240 |
|
|
| 241 |
|
|
| SketchupMT Plugin/MultitouchSU/MtSuGlobals.h (revision 38) | ||
|---|---|---|
| 1 |
/*** |
|
| 2 |
Spaced out for Comments and developer Credits and license info |
|
| 3 |
*/ |
|
| 4 |
|
|
| 5 |
#ifndef MTSUGLOBALS_H_INCLUDED |
|
| 6 |
#define MTSUGLOBALS_H_INCLUDED |
|
| 7 |
// ---------------------------------------------------------------------------- |
|
| 8 |
// Globals |
|
| 9 |
// ---------------------------------------------------------------------------- |
|
| 10 |
extern int g_DllIsInitialized; //guard while initializing |
|
| 11 |
extern char* g_lpszTitleToFind; //Title of window to find |
|
| 12 |
extern char* g_lpszClassToFind; //Class of View window |
|
| 13 |
extern HWND g_hWndSketchUp; //handle of SketchUp window |
|
| 14 |
extern HWND g_hWndSketchUpView; //handle of SketchUp View subwindow |
|
| 15 |
extern HWND g_hWndSketchUpStatusBar; //handle of SketchUp StatusBar |
|
| 16 |
extern DWORD g_dwCurrentProcessId; //PID of SketchUp process |
|
| 17 |
extern LONG OldWndProc; //Main windoww proc that we subclassed |
|
| 18 |
//enum {g_enumMtSuUserMsgNum = WM_USER+0x8001}; //MultiTouchSu WM_USER message id
|
|
| 19 |
extern UINT g_MtSuUserMsgNum; //variable of above |
|
| 20 |
struct structMtSuTuioData |
|
| 21 |
{
|
|
| 22 |
int sessionID; |
|
| 23 |
int symbolID; |
|
| 24 |
float positionX; |
|
| 25 |
float positionY; |
|
| 26 |
//float positionZ; |
|
| 27 |
float angle; |
|
| 28 |
//float angleA; |
|
| 29 |
//float angleB; |
|
| 30 |
//float angleC; |
|
| 31 |
//float motionSpeedX; |
|
| 32 |
//float motionSpeedY; |
|
| 33 |
//float motionSpeedZ; |
|
| 34 |
float motionSpeed; |
|
| 35 |
//float rotatonSpeedA; |
|
| 36 |
//float rotatonSpeedB; |
|
| 37 |
//float rotatonSpeedC; |
|
| 38 |
float rotationSpeed; |
|
| 39 |
float motionAccel; |
|
| 40 |
float rotationAccel; |
|
| 41 |
wxString packetMsg; |
|
| 42 |
|
|
| 43 |
void clear() |
|
| 44 |
{
|
|
| 45 |
sessionID = 0; |
|
| 46 |
symbolID = 0; |
|
| 47 |
positionX = 0; |
|
| 48 |
positionY = 0; |
|
| 49 |
angle = 0; |
|
| 50 |
motionSpeed = 0; |
|
| 51 |
rotationSpeed = 0; |
|
| 52 |
motionAccel = 0; |
|
| 53 |
rotationAccel = 0; |
|
| 54 |
packetMsg = wxEmptyString; |
|
| 55 |
} |
|
| 56 |
}; |
|
| 57 |
extern structMtSuTuioData g_MtSuTuioData; |
|
| 58 |
|
|
| 59 |
#define ZEROMEMORY(obj) ::ZeroMemory(&obj, sizeof(obj)) |
|
| 60 |
|
|
| 61 |
#endif // MTSUGLOBALS_H_INCLUDED |
|
| SketchupMT Plugin/MultitouchSU/TuioSuDump.h (revision 38) | ||
|---|---|---|
| 1 |
/* |
|
| 2 |
TUIO C++ Example - part of the reacTIVision project |
|
| 3 |
http://reactivision.sourceforge.net/ |
|
| 4 |
|
|
| 5 |
Copyright (c) 2005-2009 Martin Kaltenbrunner <[email protected]> |
|
| 6 |
|
|
| 7 |
Permission is hereby granted, free of charge, to any person obtaining |
|
| 8 |
a copy of this software and associated documentation files |
|
| 9 |
(the "Software"), to deal in the Software without restriction, |
|
| 10 |
including without limitation the rights to use, copy, modify, merge, |
|
| 11 |
publish, distribute, sublicense, and/or sell copies of the Software, |
|
| 12 |
and to permit persons to whom the Software is furnished to do so, |
|
| 13 |
subject to the following conditions: |
|
| 14 |
|
|
| 15 |
The above copyright notice and this permission notice shall be |
|
| 16 |
included in all copies or substantial portions of the Software. |
|
| 17 |
|
|
| 18 |
Any person wishing to distribute modifications to the Software is |
|
| 19 |
requested to send the modifications to the original developer so that |
|
| 20 |
they can be incorporated into the canonical version. |
|
| 21 |
|
|
| 22 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|
| 23 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|
| 24 |
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
|
| 25 |
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR |
|
| 26 |
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF |
|
| 27 |
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
|
| 28 |
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
| 29 |
*/ |
|
| 30 |
|
|
| 31 |
#ifndef INCLUDED_TUIODUMP_H |
|
| 32 |
#define INCLUDED_TUIODUMP_H |
|
| 33 |
|
|
| 34 |
#include "TuioListener.h" |
|
| 35 |
#include "TuioClient.h" |
|
| 36 |
#include <math.h> |
|
| 37 |
|
|
| 38 |
using namespace TUIO; |
|
| 39 |
|
|
| 40 |
class TuioDump : public TuioListener {
|
|
| 41 |
|
|
| 42 |
public: |
|
| 43 |
//-TuioDump::TuioDump(); |
|
| 44 |
void addTuioObject(TuioObject *tobj); |
|
| 45 |
void updateTuioObject(TuioObject *tobj); |
|
| 46 |
void removeTuioObject(TuioObject *tobj); |
|
| 47 |
|
|
| 48 |
void addTuioCursor(TuioCursor *tcur); |
|
| 49 |
void updateTuioCursor(TuioCursor *tcur); |
|
| 50 |
void removeTuioCursor(TuioCursor *tcur); |
|
| 51 |
|
|
| 52 |
void refresh(TuioTime frameTime); |
|
| 53 |
private: |
|
| 54 |
int main(int argc, char* argv[]); |
|
| 55 |
}; |
|
| 56 |
|
|
| 57 |
#endif /* INCLUDED_TUIODUMP_H */ |
|
| SketchupMT Plugin/MultitouchSU/MultitouchSu.cpp (revision 38) | ||
|---|---|---|
| 1 |
/*************************************************************** |
|
| 2 |
credits info etc. |
|
| 3 |
**************************************************************/ |
|
| 1 | 4 |
/* |
| 2 |
This file is part of MultitouchSU, an extension for SketchUp |
|
| 3 |
|
|
| 4 |
This program is free software; you can redistribute it and/or |
|
| 5 |
modify it under the terms of the GNU General Public License |
|
| 6 |
as published by the Free Software Foundation; either version 2 |
|
| 7 |
of the License, or (at your option) any later version. |
|
| 8 |
|
|
| 9 |
This program is distributed in the hope that it will be useful, |
|
| 10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 12 |
GNU General Public License for more details. |
|
| 13 |
|
|
| 14 |
You should have received a copy of the GNU General Public License |
|
| 15 |
along with this program; if not, write to the Free Software |
|
| 16 |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
| 5 |
Lincense tbd |
|
| 17 | 6 |
*/ |
| 18 | 7 |
|
| 19 | 8 |
// ---------------------------------------------------------------------------- |
| ... | ... | |
| 46 | 35 |
#include "HiddenFrame.h" |
| 47 | 36 |
#include "Debugging.h" |
| 48 | 37 |
#include "TuioSuDump.h" |
| 38 |
#include "MtSuGlobals.h" |
|
| 49 | 39 |
|
| 50 | 40 |
// ---------------------------------------------------------------------------- |
| 51 | 41 |
// Prototypes and definitions |
| ... | ... | |
| 56 | 46 |
// ---------------------------------------------------------------------------- |
| 57 | 47 |
// Globals |
| 58 | 48 |
// ---------------------------------------------------------------------------- |
| 59 |
int g_DllIsInitialized = 0; //guard while initializing |
|
| 60 |
char* g_lpszTitleToFind = " - SketchUp"; //Title of window to find |
|
| 61 |
char* g_lpszClassToFind = "AfxFrameOrView"; //Class of View window |
|
| 62 |
HWND g_hWndSketchUp = 0; //handle of SketchUp window |
|
| 63 |
HWND g_hWndSketchUpView = 0; //handle of SketchUp View subwindow |
|
| 64 |
HWND g_hWndSketchUpStatusBar = 0; //handle of SketchUp StatusBar |
|
| 65 |
DWORD g_dwCurrentProcessId = 0; //PID of SketchUp process |
|
| 66 |
LONG OldWndProc = 0; //Main windoww proc that we subclassed |
|
| 67 |
wxString g_wxStringMsg; // global string storage |
|
| 49 |
int g_DllIsInitialized = 0; //guard while initializing |
|
| 50 |
char* g_lpszTitleToFind = " - SketchUp"; //Title of window to find |
|
| 51 |
char* g_lpszClassToFind = "AfxFrameOrView"; //Class of View window |
|
| 52 |
HWND g_hWndSketchUp = 0; //handle of SketchUp window |
|
| 53 |
HWND g_hWndSketchUpView = 0; //handle of SketchUp View subwindow |
|
| 54 |
HWND g_hWndSketchUpStatusBar = 0; //handle of SketchUp StatusBar |
|
| 55 |
DWORD g_dwCurrentProcessId = 0; //PID of SketchUp process |
|
| 56 |
LONG OldWndProc = 0; //Main windoww proc that we subclassed |
|
| 57 |
//-wxString g_wxStringMsg; //global string storage |
|
| 58 |
enum {g_enumMtSuUserMsgNum = WM_USER+0x8001};//MultiTouchSu WM_USER message id
|
|
| 59 |
UINT g_MtSuUserMsgNum = g_enumMtSuUserMsgNum;//variable of above |
|
| 68 | 60 |
|
| 61 |
structMtSuTuioData g_MtSuTuioData; |
|
| 62 |
|
|
| 69 | 63 |
// ---------------------------------------------------------------------------- |
| 70 | 64 |
// pointers to instantiations of classes used by Dll |
| 71 | 65 |
// ---------------------------------------------------------------------------- |
| ... | ... | |
| 79 | 73 |
Debugging* pVersion = 0; //access to version string |
| 80 | 74 |
|
| 81 | 75 |
int port = 3333; |
| 82 |
TuioDump dump; |
|
| 83 |
TuioClient client(port); |
|
| 76 |
TuioDump dump; |
|
| 77 |
TuioClient client(port); |
|
| 84 | 78 |
|
| 85 | 79 |
// ---------------------------------------------------------------------------- |
| 86 | 80 |
// We use IMPLEMENT_APP_NO_MAIN so we can start the app from DllMain |
| ... | ... | |
| 194 | 188 |
// (Ruby calls it an extension). |
| 195 | 189 |
// as.../SketchUp/Plugins/MultitouchSU.dll |
| 196 | 190 |
|
| 197 |
|
|
| 198 | 191 |
// A simple MultitouchSU.rb contains a 'require "MultitouchSU.dll"' statement |
| 199 | 192 |
|
| 200 | 193 |
// This function is invoked *after* DLL initialization DLL_PROCESS_ATTACH |
| ... | ... | |
| 209 | 202 |
// Set some globals needed by the RubyClassHandler |
| 210 | 203 |
MultitouchSUApp::pRubyClassHandler = new RubyClassHandler; |
| 211 | 204 |
|
| 212 |
((HiddenFrame*)pHiddenFrame)->SetRubyClassHandler(MultitouchSUApp::pRubyClassHandler); |
|
| 205 |
if (pHiddenFrame) |
|
| 206 |
((HiddenFrame*)pHiddenFrame)->SetRubyClassHandler(MultitouchSUApp::pRubyClassHandler); |
|
| 213 | 207 |
|
| 214 | 208 |
if(MultitouchSUApp::pRubyClassHandler) |
| 215 | 209 |
{
|
| ... | ... | |
| 290 | 284 |
// Startup TUIO client to listen for touch data |
| 291 | 285 |
|
| 292 | 286 |
//int port = 3333; |
| 293 |
//TuioDump dump; |
|
| 294 |
//TuioClient client(port); |
|
| 287 |
//TuioDump dump; |
|
| 288 |
//TuioClient client(port); |
|
| 295 | 289 |
client.addTuioListener(&dump); |
| 296 |
client.connect(false); //non-blocking connection |
|
| 290 |
client.connect(false); //non-blocking connection |
|
| 297 | 291 |
return true; |
| 298 | 292 |
} |
| 299 | 293 |
|
| ... | ... | |
| 316 | 310 |
|
| 317 | 311 |
switch(message) |
| 318 | 312 |
{
|
| 319 |
case WM_USER+0x8001: |
|
| 313 |
case g_enumMtSuUserMsgNum: //WM_USER message |
|
| 320 | 314 |
{
|
| 321 | 315 |
rc = true; |
| 322 | 316 |
if( MultitouchSUApp::pRubyClassHandler ) |
| 323 |
MultitouchSUApp::pRubyClassHandler->Call_Ruby_OnTuioDataMethod(g_wxStringMsg); |
|
| 317 |
{
|
|
| 318 |
MultitouchSUApp::pRubyClassHandler->Call_Ruby_OnTuioDataString(g_MtSuTuioData.packetMsg); |
|
| 319 |
MultitouchSUApp::pRubyClassHandler->Call_Ruby_OnTuioData(g_MtSuTuioData); |
|
| 320 |
} |
|
| 324 | 321 |
break; |
| 325 | 322 |
} |
| 326 | 323 |
default: break; |
| ... | ... | |
| 328 | 325 |
|
| 329 | 326 |
if (rc) |
| 330 | 327 |
{
|
| 331 |
#if defined(LOGGING) |
|
| 332 |
LOGIT( _T("NewWndProc PROCCESSED[%s]"), g_wxStringMsg.c_str());
|
|
| 328 |
#if defined(LOGGING_TUIO) |
|
| 329 |
LOGIT( _T("NewWndProc PROCCESSED[%s]"), g_MtSuTuioData.packetMsg.c_str());
|
|
| 333 | 330 |
#endif |
| 334 | 331 |
return true; //message was processed |
| 335 | 332 |
} |
| ... | ... | |
| 339 | 336 |
} |
| 340 | 337 |
//Doc: WM_COMMAND |
| 341 | 338 |
// Message wParam wParam lParam |
| 342 |
// Source high word) (low word) |
|
| 339 |
// Source high word) (low word) |
|
| 343 | 340 |
// --------- ---------- ----------------------- ------------- |
| 344 |
// Menu 0 Menu identifier (IDM_*) 0 |
|
| 345 |
// Accelerator 1 Accelerator identifier (IDM_*) 0 |
|
| 346 |
// Control Control- Control Handle to the |
|
| 341 |
// Menu 0 Menu identifier (IDM_*) 0 |
|
| 342 |
// Accelerator 1 Accelerator identifier (IDM_*) 0 |
|
| 343 |
// Control Control- Control Handle to the |
|
| 347 | 344 |
// defined identifier control window |
| 348 | 345 |
// notification |
| 349 | 346 |
// code |
| ... | ... | |
| 397 | 394 |
// will be the users drawing window and the one needed to |
| 398 | 395 |
// translate screen coordinates to client coordinates. |
| 399 | 396 |
|
| 400 |
|
|
| 401 | 397 |
// Look for a window with class name in g_lpszClassToFind. |
| 402 | 398 |
// It must share our Pid, ie., be in the same process as this |
| 403 | 399 |
// routine. This is how we find the correct SketchUp window when |
| ... | ... | |
| 502 | 498 |
return 0; |
| 503 | 499 |
} |
| 504 | 500 |
|
| 505 |
return pHiddenFrame; |
|
| 501 |
return pHiddenFrame; |
|
| 506 | 502 |
} |
| 507 | 503 |
// ---------------------------------------------------------------------------- |
| 508 | 504 |
bool MultitouchSUApp::CreateDebuggingLog() |
| ... | ... | |
| 515 | 511 |
pMyLog = new Debugging(_T("MultitouchSU Dll Log"));
|
| 516 | 512 |
#if defined(LOGGING) |
| 517 | 513 |
LOGIT( "DLL Debug Logging initialized."); |
| 518 |
#endif |
|
| 514 |
#endif |
|
| 519 | 515 |
|
| 520 |
return TRUE; |
|
| 516 |
return TRUE; |
|
| 521 | 517 |
} |
| 522 | 518 |
//// ---------------------------------------------------------------------------- |
| 523 | 519 |
//UINT MultitouchSUApp::PostWxEvent( const UINT Message, const WPARAM wParam, const LPARAM lParam) |
| ... | ... | |
| 664 | 660 |
{
|
| 665 | 661 |
// Get label from MS window menu item (not wxWindow menu) |
| 666 | 662 |
|
| 667 |
|
|
| 668 | 663 |
wxString menuLabel("");
|
| 669 | 664 |
HMENU hMenu = GetMenu(g_hWndSketchUp); |
| 670 | 665 |
int iMenuItemCount = GetMenuItemCount( hMenu ); |
| SketchupMT Plugin/MultitouchSu.cbp (revision 38) | ||
|---|---|---|
| 2 | 2 |
<CodeBlocks_project_file> |
| 3 | 3 |
<FileVersion major="1" minor="6" /> |
| 4 | 4 |
<Project> |
| 5 |
<Option title="MultitouchSu" /> |
|
| 5 |
<Option title="MultitouchSU" /> |
|
| 6 | 6 |
<Option pch_mode="2" /> |
| 7 | 7 |
<Option compiler="gcc" /> |
| 8 | 8 |
<Build> |
| 9 | 9 |
<Target title="Debug"> |
| 10 |
<Option output="bin\Debug\MultitouchSu" prefix_auto="1" extension_auto="1" /> |
|
| 11 |
<Option object_output="obj\Debug\" /> |
|
| 10 |
<Option output=".\Debug\MultitouchSU" prefix_auto="1" extension_auto="1" /> |
|
| 11 |
<Option object_output=".\Debug\" /> |
|
| 12 | 12 |
<Option type="3" /> |
| 13 | 13 |
<Option compiler="gcc" /> |
| 14 |
<Option host_application="MultitouchSu\debug\MultitouchsuTest.exe" /> |
|
| 14 | 15 |
<Option createDefFile="1" /> |
| 15 | 16 |
<Option createStaticLib="1" /> |
| 16 | 17 |
<Compiler> |
| 17 | 18 |
<Add option="-Wall" /> |
| 19 |
<Add option="-g" /> |
|
| 18 | 20 |
<Add option="-DBUILD_DLL" /> |
| 19 |
<Add option="-g" /> |
|
| 21 |
<Add option="-DDLLFUNCTIONS_EXPORTS" /> |
|
| 22 |
<Add option="-DWIN32" /> |
|
| 23 |
<Add option="-D_WINDOWS" /> |
|
| 24 |
<Add option="-D__WXMSW__" /> |
|
| 25 |
<Add option="-DwxUSE_GUI=1" /> |
|
| 26 |
<Add option="-DHAVE_ISINF" /> |
|
| 27 |
<Add option="-DENDIANESS=OSC_HOST_LITTLE_ENDIAN" /> |
|
| 28 |
<Add option="-DLOGGING" /> |
|
| 29 |
<Add option="-DNO_LOGGING_TUIO" /> |
|
| 30 |
<Add directory="$(#wx)\include" /> |
|
| 31 |
<Add directory="$(#WX)\lib\gcc_lib\msw" /> |
|
| 32 |
<Add directory="c:\User\Programs\ruby\lib\ruby\1.8\i386-mswin32" /> |
|
| 33 |
<Add directory="..\TUIO_CPP\TUIO" /> |
|
| 34 |
<Add directory="..\TUIO_CPP\oscpack" /> |
|
| 20 | 35 |
</Compiler> |
| 21 | 36 |
<Linker> |
| 37 |
<Add library="wxmsw28" /> |
|
| 38 |
<Add library="c:\Program Files\Google\Google SketchUp 7\msvcrt-ruby18.dll" /> |
|
| 22 | 39 |
<Add library="user32" /> |
| 40 |
<Add library="comctl32" /> |
|
| 41 |
<Add library="uuid" /> |
|
| 42 |
<Add library="oleaut32" /> |
|
| 43 |
<Add library="ole32" /> |
|
| 44 |
<Add library="shell32" /> |
|
| 45 |
<Add library="comdlg32" /> |
|
| 46 |
<Add library="ctl3d32" /> |
|
| 47 |
<Add library="advapi32" /> |
|
| 48 |
<Add library="gdi32" /> |
|
| 49 |
<Add library="ws2_32" /> |
|
| 50 |
<Add library="winmm" /> |
|
| 51 |
<Add directory="$(#WX)\lib\gcc_lib\msw" /> |
|
| 52 |
<Add directory="$(#wx)\lib\gcc_lib" /> |
|
| 23 | 53 |
</Linker> |
| 24 | 54 |
</Target> |
| 25 | 55 |
<Target title="Release"> |
| 26 |
<Option output="bin\Release\MultitouchSu" prefix_auto="1" extension_auto="1" /> |
|
| 27 |
<Option object_output="obj\Release\" /> |
|
| 56 |
<Option output=".\Release\MultitouchSU" prefix_auto="1" extension_auto="1" /> |
|
| 57 |
<Option object_output=".\Release\" /> |
|
| 28 | 58 |
<Option type="3" /> |
| 29 | 59 |
<Option compiler="gcc" /> |
| 60 |
<Option host_application="MultitouchSu\debug\MultitouchsuTest.exe" /> |
|
| 30 | 61 |
<Option createDefFile="1" /> |
| 31 | 62 |
<Option createStaticLib="1" /> |
| 32 | 63 |
<Compiler> |
| 64 |
<Add option="-O2" /> |
|
| 33 | 65 |
<Add option="-Wall" /> |
| 34 | 66 |
<Add option="-DBUILD_DLL" /> |
| 35 |
<Add option="-O2" /> |
|
| 67 |
<Add option="-DDLLFUNCTIONS_EXPORTS" /> |
|
| 68 |
<Add option="-DWIN32" /> |
|
| 69 |
<Add option="-D_WINDOWS" /> |
|
| 70 |
<Add option="-D__WXMSW__" /> |
|
| 71 |
<Add option="-DwxUSE_GUI=1" /> |
|
| 72 |
<Add option="-DHAVE_ISINF" /> |
|
| 73 |
<Add option="-DENDIANESS=OSC_HOST_LITTLE_ENDIAN" /> |
|
| 74 |
<Add option="-DNO_LOGGING" /> |
|
| 75 |
<Add option="-DNO_LOGGING_TUIO" /> |
|
| 76 |
<Add directory="$(#wx)\include" /> |
|
| 77 |
<Add directory="$(#WX)\lib\gcc_lib\msw" /> |
|
| 78 |
<Add directory="c:\User\Programs\ruby\lib\ruby\1.8\i386-mswin32" /> |
|
| 79 |
<Add directory="..\TUIO_CPP\TUIO" /> |
|
| 80 |
<Add directory="..\TUIO_CPP\oscpack" /> |
|
| 36 | 81 |
</Compiler> |
| 37 | 82 |
<Linker> |
| 38 | 83 |
<Add option="-s" /> |
| 84 |
<Add library="wxmsw28" /> |
|
| 85 |
<Add library="c:\Program Files\Google\Google SketchUp 7\msvcrt-ruby18.dll" /> |
|
| 39 | 86 |
<Add library="user32" /> |
| 87 |
<Add library="comctl32" /> |
|
| 88 |
<Add library="uuid" /> |
|
| 89 |
<Add library="oleaut32" /> |
|
| 90 |
<Add library="ole32" /> |
|
| 91 |
<Add library="shell32" /> |
|
| 92 |
<Add library="comdlg32" /> |
|
| 93 |
<Add library="ctl3d32" /> |
|
| 94 |
<Add library="advapi32" /> |
|
| 95 |
<Add library="gdi32" /> |
|
| 96 |
<Add library="ws2_32" /> |
|
| 97 |
<Add library="winmm" /> |
|
| 98 |
<Add directory="$(#WX)\lib\gcc_lib\msw" /> |
|
| 99 |
<Add directory="$(#wx)\lib\gcc_lib" /> |
|
| 40 | 100 |
</Linker> |
| 101 |
<ExtraCommands> |
|
| 102 |
<Add after="cmd /c @echo Running upx.exe" /> |
|
| 103 |
<Add after="cmd /c c:\Usr\bin\upx.exe release\MultitouchSu.dll" /> |
|
| 104 |
</ExtraCommands> |
|
| 41 | 105 |
</Target> |
| 42 | 106 |
</Build> |
| 43 |
<Unit filename="main.cpp" /> |
|
| 44 |
<Unit filename="main.h" /> |
|
| 107 |
<Unit filename="HiddenFrame.cpp" /> |
|
| 108 |
<Unit filename="HiddenFrame.h" /> |
|
| 109 |
<Unit filename="MSWrunmacro.cpp" /> |
|
| 110 |
<Unit filename="MSWrunmacro.h" /> |
|
| 111 |
<Unit filename="MtSuGlobals.h" /> |
|
| 112 |
<Unit filename="MultitouchSU.h" /> |
|
| 113 |
<Unit filename="MultitouchSu.cpp" /> |
|
| 114 |
<Unit filename="MultitouchSuTestFrame.cpp"> |
|
| 115 |
<Option target="<{~None~}>" />
|
|
| 116 |
</Unit> |
|
| 117 |
<Unit filename="MultitouchSuTestFrame.h"> |
|
| 118 |
<Option target="<{~None~}>" />
|
|
| 119 |
</Unit> |
|
| 120 |
<Unit filename="MultitouchsuPlgn.rb" /> |
|
| 121 |
<Unit filename="RubyClass.cpp" /> |
|
| 122 |
<Unit filename="RubyClass.h" /> |
|
| 123 |
<Unit filename="RubyEval.cpp"> |
|
| 124 |
<Option target="<{~None~}>" />
|
|
| 125 |
</Unit> |
|
| 126 |
<Unit filename="RubyEval.h"> |
|
| 127 |
<Option target="<{~None~}>" />
|
|
| 128 |
</Unit> |
|
| 129 |
<Unit filename="TuioSuDump.cpp" /> |
|
| 130 |
<Unit filename="TuioSuDump.h" /> |
|
| 131 |
<Unit filename="debugging.cpp" /> |
|
| 132 |
<Unit filename="debugging.h" /> |
|
| 133 |
<Unit filename="keytables.cpp" /> |
|
| 134 |
<Unit filename="keytables.h" /> |
|
| 135 |
<Unit filename="..\TUIO_CPP\TUIO\TuioClient.cpp" /> |
|
| 136 |
<Unit filename="..\TUIO_CPP\TUIO\TuioClient.h" /> |
|
| 137 |
<Unit filename="..\TUIO_CPP\TUIO\TuioContainer.h" /> |
|
| 138 |
<Unit filename="..\TUIO_CPP\TUIO\TuioCursor.h" /> |
|
| 139 |
<Unit filename="..\TUIO_CPP\TUIO\TuioListener.h" /> |
|
| 140 |
<Unit filename="..\TUIO_CPP\TUIO\TuioObject.h" /> |
|
| 141 |
<Unit filename="..\TUIO_CPP\TUIO\TuioPoint.h" /> |
|
| 142 |
<Unit filename="..\TUIO_CPP\TUIO\TuioServer.h" /> |
|
| 143 |
<Unit filename="..\TUIO_CPP\TUIO\TuioTime.cpp" /> |
|
| 144 |
<Unit filename="..\TUIO_CPP\oscpack\ip\NetworkingUtils.h" /> |
|
| 145 |
<Unit filename="..\TUIO_CPP\oscpack\ip\PacketListener.h" /> |
|
| 146 |
<Unit filename="..\TUIO_CPP\oscpack\ip\TimerListener.h" /> |
|
| 147 |
<Unit filename="..\TUIO_CPP\oscpack\ip\UdpSocket.h" /> |
|
| 148 |
<Unit filename="..\TUIO_CPP\oscpack\ip\win32\NetworkingUtils.cpp" /> |
|
| 149 |
<Unit filename="..\TUIO_CPP\oscpack\ip\win32\UdpSocket.cpp" /> |
|
| 150 |
<Unit filename="..\TUIO_CPP\oscpack\osc\OscException.h" /> |
|
| 151 |
<Unit filename="..\TUIO_CPP\oscpack\osc\OscHostEndianness.h" /> |
|
| 152 |
<Unit filename="..\TUIO_CPP\oscpack\osc\OscPacketListener.h" /> |
|
| 153 |
<Unit filename="..\TUIO_CPP\oscpack\osc\OscPrintReceivedElements.cpp" /> |
|
| 154 |
<Unit filename="..\TUIO_CPP\oscpack\osc\OscReceivedElements.cpp" /> |
|
| 155 |
<Unit filename="..\TUIO_CPP\oscpack\osc\OscTypes.cpp" /> |
|
| 156 |
<Unit filename="..\TUIO_CPP\oscpack\osc\OscTypes.h" /> |
|
| 45 | 157 |
<Extensions> |
| 158 |
<debugger /> |
|
| 46 | 159 |
<code_completion /> |
| 47 |
<debugger /> |
|
| 48 | 160 |
</Extensions> |
| 49 | 161 |
</Project> |
| 50 | 162 |
</CodeBlocks_project_file> |
| SketchupMT Plugin/RubyEval.cpp (revision 38) | ||
|---|---|---|
| 19 | 19 |
// |
| 20 | 20 |
// Pirmin Kalberer <[email protected]> |
| 21 | 21 |
// http://www.sourcepole.ch/sources/software/c++ruby/ |
| 22 |
// http://www.sourcepole.ch/2004/1/21/embedding-ruby-in-c |
|
| 22 | 23 |
// ---------------------------------------------------------------------------- |
| 23 | 24 |
/* $Id: rubyeval.h,v 1.6 2002/12/13 20:25:11 pi Exp $ |
| 24 | 25 |
* |
| ... | ... | |
| 250 | 251 |
} |
| 251 | 252 |
}//if |
| 252 | 253 |
errout.flush(); |
| 253 |
// Need pointer to EventRealyTestFrame -> m_pLogging->Flush(); |
|
| 254 |
Debugging::pLog->Flush(); |
|
| 254 |
// Need pointer to EventRelayTestFrame -> m_pLogging->Flush(); |
|
| 255 |
if (Debugging::pLog) Debugging::pLog->Flush(); |
|
| 255 | 256 |
} |
| 256 | 257 |
// ---------------------------------------------------------------------------- |
| 257 | 258 |
VALUE RubyEval::eval(const char* code) |
Also available in: Unified diff
