diff --git a/README b/README deleted file mode 100644 index 63d26e6..0000000 --- a/README +++ /dev/null @@ -1,87 +0,0 @@ -Block OpenNI ------------- -A C++ wrapper for OpenNI - -2011-06-20: -This block is going through heavy remake and so old code/methods are mixed with new methods for the moment. -I will be changing the way things are handled at the moment when i'm finished. All for better support on multiple devices. - - - - - -Basic description ------------------ - -Support for several generators as Image, IR, Depth and User. -Skeleton tracking is also supported. - - - - -How to use ----------- - -You need to install the sensor drivers, OpenNI and NITE. -Note! PrimeSense drivers do not work with the Kinect. - - -So here's a step-by-step installationg guide: -(The links you'll find here are the latest unstable at the time of writing) -OpenNI 1.3.2.3 -Nite 1.4.1.2 -SensorKinect 5.0.3.4 - - -Windows 32bit: --------------- - -Download/Install OpenNI: -http://openni.org/downloadfiles/opennimodules/openni-binaries/latest-unstable/163-openni-unstable-build-for-windows-x86-32-bit-v1-3-2/download - -Download/Install Avin2's SensorKinect: -https://github.com/avin2/SensorKinect/blob/unstable/Bin/SensorKinect-Win-OpenSource32-5.0.3.4.msi - -Download/Install NITE: -http://openni.org/downloadfiles/opennimodules/openni-compliant-middleware-binaries/latest-unstable/177-primesense-nite-unstable-build-for-windows-x86-32-bit-v1-4-1/download - -At this moment you should now be able to run the samples in OpenNI. -Go to OpenNI's folder and browse to /Samples/Bin/Release. -Run NiViewer.exe. You should now be looking at a window with the RGB and Depth feed coming from the kinect - - - -MacOSX 32bit: -------------- - -1) Download/Install MacPorts - (Snow Leopard 10.6) https://distfiles.macports.org/MacPorts/MacPorts-2.0.0-10.5-Leopard.dmg - (Lion 10.7) https://distfiles.macports.org/MacPorts/MacPorts-2.0.0-10.7-Lion.dmg - -2) Open the terminal, install libtool/libusb. - 2.1) Type and run: sudo port install libtool - 2.2) Type and run: sudo port install libusb-devel +universal - - -3) Download/Untar OpenNI - http://openni.org/downloadfiles/opennimodules/openni-binaries/latest-unstable/162-openni-unstable-build-for-macosx-10-6-universal-x86x64-3264-bit-v1-3-2/download - 3.1) Open the terminal, goto openni's folder you just untar'ed. - 3.2) Type and run: sudo ./install.sh - -4) Download Avin2's SensorKinect - https://github.com/avin2/SensorKinect/blob/unstable/Bin/SensorKinect-Bin-MacOSX-v5.0.3.4.tar.bz2 - 4.1) Open the terminal, goto SensorKinect's folder you just untar'ed. - 4.2) Type and run: sudo ./install.sh - -5) Download NITE - http://openni.org/downloadfiles/opennimodules/openni-compliant-middleware-binaries/latest-unstable/176-primesense-nite-unstable-build-for-macosx-10-6-universal-x86x64-3264-bit-v1-4-1/download - 4.1) Open the terminal, goto NITE's folder you just untar'ed. - 4.2) Type and run: sudo ./install.sh - -At this moment you should now be able to run the samples in OpenNI. -Go to OpenNI's folder and browse to /Samples/Bin/Release (use terminal). -Run ./NiViewer. You should now be looking at a window with the RGB and Depth feed coming from the kinect - - -Linux: - Check Avin2's SensorKinect repo (@github) for more information. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..166aac8 --- /dev/null +++ b/README.md @@ -0,0 +1,108 @@ +Block OpenNI +============ +A C++ wrapper for OpenNI + +2011-06-20: +This block is going through heavy remake and so old code/methods are mixed with +new methods for the moment. I will be changing the way things are handled at +the moment when i'm finished. All for better support on multiple devices. + +Basic description +================= + +Support for several generators as Image, IR, Depth and User. +Skeleton tracking is also supported. + +Installation +============ + +You need to install the sensor drivers, OpenNI and NITE. +Note! PrimeSense drivers do not work with the Kinect. + + +So here's a step-by-step installationg guide: +(The links you'll find here are the latest unstable at the time of writing) + +- OpenNI 1.3.2.3 +- Nite 1.4.1.2 +- SensorKinect 5.0.3.4 + +Windows 32bit: +-------------- + +Download/Install OpenNI: +http://openni.org/downloadfiles/opennimodules/openni-binaries/latest-unstable/163-openni-unstable-build-for-windows-x86-32-bit-v1-3-2/download + +Download/Install Avin2's SensorKinect: +https://github.com/avin2/SensorKinect/blob/unstable/Bin/SensorKinect-Win-OpenSource32-5.0.3.4.msi + +Download/Install NITE: +http://openni.org/downloadfiles/opennimodules/openni-compliant-middleware-binaries/latest-unstable/177-primesense-nite-unstable-build-for-windows-x86-32-bit-v1-4-1/download + +At this moment you should now be able to run the samples in OpenNI. Go to +OpenNI's folder and browse to /Samples/Bin/Release. Run NiViewer.exe. You +should now be looking at a window with the RGB and Depth feed coming from the +kinect. + +MacOSX 32bit: +------------- + +### 1. Install libtool/libusb ### + +#### With MacPorts: #### + +Download/Install MacPorts +- (Snow Leopard 10.6) https://distfiles.macports.org/MacPorts/MacPorts-2.0.0-10.5-Leopard.dmg +- (Lion 10.7) https://distfiles.macports.org/MacPorts/MacPorts-2.0.0-10.7-Lion.dmg + +In the terminal: + + sudo port install libtool + sudo port install libusb-devel +universal + +#### With Hombrew: #### + +Install Homebrew: in the terminal: + + ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)" + +Install the libs from the terminal: + + brew install libtool + brew install libusb --universal + + +### 2. Download/Untar OpenNI ### + +http://openni.org/downloadfiles/opennimodules/openni-binaries/latest-unstable/162-openni-unstable-build-for-macosx-10-6-universal-x86x64-3264-bit-v1-3-2/download + +Open the terminal, goto openni's folder you just untar'ed. + + sudo ./install.sh + +### 3. Download Avin2's SensorKinect ### + +https://github.com/avin2/SensorKinect/blob/unstable/Bin/SensorKinect-Bin-MacOSX-v5.0.3.4.tar.bz2 + +Open the terminal, goto SensorKinect's folder you just untar'ed. + + sudo ./install.sh + +### 4. Download NITE ### + +http://openni.org/downloadfiles/opennimodules/openni-compliant-middleware-binaries/latest-unstable/176-primesense-nite-unstable-build-for-macosx-10-6-universal-x86x64-3264-bit-v1-4-1/download + +Open the terminal, goto NITE's folder you just untar'ed. + + sudo ./install.sh + +At this moment you should now be able to run the samples in OpenNI. Go to +OpenNI's folder and browse to /Samples/Bin/Release (use terminal). Run +./NiViewer. You should now be looking at a window with the RGB and Depth feed +coming from the kinect + + +Linux +----- + +Check Avin2's SensorKinect repo (@github) for more information. diff --git a/include/Include/MacOSX/XnPlatformMacOSX.h b/include/Include/MacOSX/XnPlatformMacOSX.h index cb46dd7..ba83342 100644 --- a/include/Include/MacOSX/XnPlatformMacOSX.h +++ b/include/Include/MacOSX/XnPlatformMacOSX.h @@ -39,5 +39,8 @@ #undef XN_THREAD_STATIC #define XN_THREAD_STATIC + +#undef XN_API_DEPRECATED +#define XN_API_DEPRECATED(msg) __attribute__((deprecated("This function is deprecated: " msg))) #endif //_XN_PLATFORM_MACOSX_H_ diff --git a/samples/BasicKinect/include/Resources.h b/samples/BasicKinect/include/Resources.h new file mode 100644 index 0000000..3bdaead --- /dev/null +++ b/samples/BasicKinect/include/Resources.h @@ -0,0 +1,4 @@ +#pragma once +#include "cinder/CinderResources.h" + +//#define RES_MY_RES CINDER_RESOURCE( ../resources/, image_name.png, 128, IMAGE ) diff --git a/samples/BasicKinect/resources/CinderApp.icns b/samples/BasicKinect/resources/CinderApp.icns new file mode 100644 index 0000000..c231c2c Binary files /dev/null and b/samples/BasicKinect/resources/CinderApp.icns differ diff --git a/samples/BasicKinect/resources/cinder_app_icon.ico b/samples/BasicKinect/resources/cinder_app_icon.ico new file mode 100644 index 0000000..b35fb85 Binary files /dev/null and b/samples/BasicKinect/resources/cinder_app_icon.ico differ diff --git a/samples/BasicKinect/src/BasicKinectApp.cpp b/samples/BasicKinect/src/BasicKinectApp.cpp new file mode 100644 index 0000000..a3dc03b --- /dev/null +++ b/samples/BasicKinect/src/BasicKinectApp.cpp @@ -0,0 +1,57 @@ +#include "cinder/app/AppBasic.h" +#include "cinder/gl/gl.h" + +#include "VKinect.h" + +using namespace ci; +using namespace ci::app; +using namespace std; +using namespace V; + +class BasicKinectApp : public AppBasic { +public: + void prepareSettings( Settings *settings ); + void setup(); + void mouseDown( MouseEvent event ); + void update(); + void draw(); + +private: + Kinect kinect; +}; + +void BasicKinectApp::prepareSettings( Settings *settings ) +{ +} + +void BasicKinectApp::setup() +{ + + try { + kinect.setup(); + } catch ( int e ) { + console() << "No kinect. Exit sadface." << endl; + quit(); + } + +} + +void BasicKinectApp::mouseDown( MouseEvent event ) +{ +} + +void BasicKinectApp::update() +{ + kinect.update(); +} + +void BasicKinectApp::draw() +{ + // clear out the window with black + gl::clear( Color( 0, 0, 0 ) ); + kinect.drawSkeletons(Rectf(0, 0, getWindowWidth(), getWindowHeight())); + +} + + +CINDER_APP_BASIC( BasicKinectApp, RendererGl ) diff --git a/samples/BasicKinect/vc10/BasicKinect.sln b/samples/BasicKinect/vc10/BasicKinect.sln new file mode 100644 index 0000000..cf19a4b --- /dev/null +++ b/samples/BasicKinect/vc10/BasicKinect.sln @@ -0,0 +1,19 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C++ Express 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BasicKinect", "BasicKinect.vcxproj", "{74202EDD-91D2-4D2A-B0B6-355CEB16E6BE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {74202EDD-91D2-4D2A-B0B6-355CEB16E6BE}.Debug|Win32.ActiveCfg = Debug|Win32 + {74202EDD-91D2-4D2A-B0B6-355CEB16E6BE}.Debug|Win32.Build.0 = Debug|Win32 + {74202EDD-91D2-4D2A-B0B6-355CEB16E6BE}.Release|Win32.ActiveCfg = Release|Win32 + {74202EDD-91D2-4D2A-B0B6-355CEB16E6BE}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/samples/BasicKinect/vc10/BasicKinect.vcxproj b/samples/BasicKinect/vc10/BasicKinect.vcxproj new file mode 100644 index 0000000..42a0355 --- /dev/null +++ b/samples/BasicKinect/vc10/BasicKinect.vcxproj @@ -0,0 +1,118 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {74202EDD-91D2-4D2A-B0B6-355CEB16E6BE} + BasicKinectApp + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + true + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + + + + Disabled + ..\include;..\..\..\..\..\include;..\..\..\..\..\boost + WIN32;_DEBUG;_WINDOWS;NOMINMAX;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + ..\..\..\..\..\include;..\include;%(AdditionalIncludeDirectories) + + + cinder_d.lib;%(AdditionalDependencies) + ..\..\..\..\..\lib;..\..\..\..\..\lib\msw;%(AdditionalLibraryDirectories) + true + Windows + false + + + MachineX86 + LIBCMT + + + + + ..\include;..\..\..\..\..\include;..\..\..\..\..\boost + WIN32;NDEBUG;_WINDOWS;NOMINMAX;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + true + + + ..\..\..\..\..\include;..\include;%(AdditionalIncludeDirectories) + + + cinder.lib;%(AdditionalDependencies) + ..\..\..\..\..\lib;..\..\..\..\..\lib\msw;%(AdditionalLibraryDirectories) + false + true + Windows + true + + + false + + + MachineX86 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/BasicKinect/vc10/BasicKinect.vcxproj.filters b/samples/BasicKinect/vc10/BasicKinect.vcxproj.filters new file mode 100644 index 0000000..e3a7859 --- /dev/null +++ b/samples/BasicKinect/vc10/BasicKinect.vcxproj.filters @@ -0,0 +1,32 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + + + Header Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/samples/BasicKinect/vc10/Resources.rc b/samples/BasicKinect/vc10/Resources.rc new file mode 100644 index 0000000..c3a27c0 --- /dev/null +++ b/samples/BasicKinect/vc10/Resources.rc @@ -0,0 +1,5 @@ +#include "Resources.h" + +ID ICON "..\\resources\\cinder_app_icon.ico" + +//RES_MY_RESOURCE diff --git a/samples/BasicKinect/vc9/BasicKinect.sln b/samples/BasicKinect/vc9/BasicKinect.sln new file mode 100644 index 0000000..7c9e0b5 --- /dev/null +++ b/samples/BasicKinect/vc9/BasicKinect.sln @@ -0,0 +1,19 @@ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C++ Express 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BasicKinect", "BasicKinect.vcproj", "{9DA00FEA-5218-413E-B762-35D91045B3B4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9DA00FEA-5218-413E-B762-35D91045B3B4}.Debug|Win32.ActiveCfg = Debug|Win32 + {9DA00FEA-5218-413E-B762-35D91045B3B4}.Debug|Win32.Build.0 = Debug|Win32 + {9DA00FEA-5218-413E-B762-35D91045B3B4}.Release|Win32.ActiveCfg = Release|Win32 + {9DA00FEA-5218-413E-B762-35D91045B3B4}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/samples/BasicKinect/vc9/BasicKinect.vcproj b/samples/BasicKinect/vc9/BasicKinect.vcproj new file mode 100644 index 0000000..0c3ee54 --- /dev/null +++ b/samples/BasicKinect/vc9/BasicKinect.vcproj @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/BasicKinect/vc9/Resources.rc b/samples/BasicKinect/vc9/Resources.rc new file mode 100644 index 0000000..14f123f --- /dev/null +++ b/samples/BasicKinect/vc9/Resources.rc @@ -0,0 +1,5 @@ +#include "Resources.h" + +ID ICON "..\\resources\\cinder_app_icon.ico" + +//RES_MY_RESOURCE diff --git a/samples/BasicKinect/xcode/BasicKinect.xcodeproj/project.pbxproj b/samples/BasicKinect/xcode/BasicKinect.xcodeproj/project.pbxproj new file mode 100644 index 0000000..b44f6f4 --- /dev/null +++ b/samples/BasicKinect/xcode/BasicKinect.xcodeproj/project.pbxproj @@ -0,0 +1,400 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 0091D8F90E81B9330029341E /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0091D8F80E81B9330029341E /* OpenGL.framework */; }; + 0097E3E50F3E9819005A4392 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0097E3E40F3E9819005A4392 /* QuickTime.framework */; }; + 00B784B30FF439BC000DE1D7 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00B784AF0FF439BC000DE1D7 /* Accelerate.framework */; }; + 00B784B40FF439BC000DE1D7 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00B784B00FF439BC000DE1D7 /* AudioToolbox.framework */; }; + 00B784B50FF439BC000DE1D7 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00B784B10FF439BC000DE1D7 /* AudioUnit.framework */; }; + 00B784B60FF439BC000DE1D7 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00B784B20FF439BC000DE1D7 /* CoreAudio.framework */; }; + 00BAE65A0E7ED9C10018A608 /* BasicKinectApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 00BAE6590E7ED9C10018A608 /* BasicKinectApp.cpp */; }; + 00CCAF15116A9FEE008396D5 /* CinderApp.icns in Resources */ = {isa = PBXBuildFile; fileRef = 00CCAF14116A9FEE008396D5 /* CinderApp.icns */; }; + 3C92D351169A602100748453 /* VKinect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C92D341169A602100748453 /* VKinect.cpp */; }; + 3C92D352169A602100748453 /* VOpenNIDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C92D345169A602100748453 /* VOpenNIDevice.cpp */; }; + 3C92D353169A602100748453 /* VOpenNIDeviceManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C92D347169A602100748453 /* VOpenNIDeviceManager.cpp */; }; + 3C92D354169A602100748453 /* VOpenNINetwork.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C92D34A169A602100748453 /* VOpenNINetwork.cpp */; }; + 3C92D355169A602100748453 /* VOpenNIRecorder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C92D34C169A602100748453 /* VOpenNIRecorder.cpp */; }; + 3C92D356169A602100748453 /* VOpenNIUser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C92D34F169A602100748453 /* VOpenNIUser.cpp */; }; + 5323E6B20EAFCA74003A9687 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5323E6B10EAFCA74003A9687 /* CoreVideo.framework */; }; + 5323E6B60EAFCA7E003A9687 /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5323E6B50EAFCA7E003A9687 /* QTKit.framework */; }; + 53E3CDFC0E86099300238D2B /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53E3CDFB0E86099300238D2B /* Carbon.framework */; }; + 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 0091D8F80E81B9330029341E /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; + 0097E3E40F3E9819005A4392 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; + 00B784AF0FF439BC000DE1D7 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; + 00B784B00FF439BC000DE1D7 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + 00B784B10FF439BC000DE1D7 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = System/Library/Frameworks/AudioUnit.framework; sourceTree = SDKROOT; }; + 00B784B20FF439BC000DE1D7 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; }; + 00BAE6590E7ED9C10018A608 /* BasicKinectApp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BasicKinectApp.cpp; path = ../src/BasicKinectApp.cpp; sourceTree = SOURCE_ROOT; }; + 00CCAF14116A9FEE008396D5 /* CinderApp.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = CinderApp.icns; path = ../resources/CinderApp.icns; sourceTree = SOURCE_ROOT; }; + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; + 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; + 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; + 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 32CA4F630368D1EE00C91783 /* BasicKinect_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BasicKinect_Prefix.pch; sourceTree = ""; }; + 3C92D340169A602100748453 /* SkeletonPoseDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SkeletonPoseDetector.h; sourceTree = ""; }; + 3C92D341169A602100748453 /* VKinect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VKinect.cpp; sourceTree = ""; }; + 3C92D342169A602100748453 /* VKinect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VKinect.h; sourceTree = ""; }; + 3C92D343169A602100748453 /* VOpenNIBone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VOpenNIBone.h; sourceTree = ""; }; + 3C92D344169A602100748453 /* VOpenNICommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VOpenNICommon.h; sourceTree = ""; }; + 3C92D345169A602100748453 /* VOpenNIDevice.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VOpenNIDevice.cpp; sourceTree = ""; }; + 3C92D346169A602100748453 /* VOpenNIDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VOpenNIDevice.h; sourceTree = ""; }; + 3C92D347169A602100748453 /* VOpenNIDeviceManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VOpenNIDeviceManager.cpp; sourceTree = ""; }; + 3C92D348169A602100748453 /* VOpenNIDeviceManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VOpenNIDeviceManager.h; sourceTree = ""; }; + 3C92D349169A602100748453 /* VOpenNIHeaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VOpenNIHeaders.h; sourceTree = ""; }; + 3C92D34A169A602100748453 /* VOpenNINetwork.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VOpenNINetwork.cpp; sourceTree = ""; }; + 3C92D34B169A602100748453 /* VOpenNINetwork.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VOpenNINetwork.h; sourceTree = ""; }; + 3C92D34C169A602100748453 /* VOpenNIRecorder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VOpenNIRecorder.cpp; sourceTree = ""; }; + 3C92D34D169A602100748453 /* VOpenNIRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VOpenNIRecorder.h; sourceTree = ""; }; + 3C92D34E169A602100748453 /* VOpenNISurface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VOpenNISurface.h; sourceTree = ""; }; + 3C92D34F169A602100748453 /* VOpenNIUser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VOpenNIUser.cpp; sourceTree = ""; }; + 3C92D350169A602100748453 /* VOpenNIUser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VOpenNIUser.h; sourceTree = ""; }; + 5323E6B10EAFCA74003A9687 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = /System/Library/Frameworks/CoreVideo.framework; sourceTree = ""; }; + 5323E6B50EAFCA7E003A9687 /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = ""; }; + 53E3CDFB0E86099300238D2B /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; + 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8D1107320486CEB800E47090 /* BasicKinect.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BasicKinect.app; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8D11072E0486CEB800E47090 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, + 0091D8F90E81B9330029341E /* OpenGL.framework in Frameworks */, + 53E3CDFC0E86099300238D2B /* Carbon.framework in Frameworks */, + 5323E6B20EAFCA74003A9687 /* CoreVideo.framework in Frameworks */, + 5323E6B60EAFCA7E003A9687 /* QTKit.framework in Frameworks */, + 0097E3E50F3E9819005A4392 /* QuickTime.framework in Frameworks */, + 00B784B30FF439BC000DE1D7 /* Accelerate.framework in Frameworks */, + 00B784B40FF439BC000DE1D7 /* AudioToolbox.framework in Frameworks */, + 00B784B50FF439BC000DE1D7 /* AudioUnit.framework in Frameworks */, + 00B784B60FF439BC000DE1D7 /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 080E96DDFE201D6D7F000001 /* Source */ = { + isa = PBXGroup; + children = ( + 00BAE6590E7ED9C10018A608 /* BasicKinectApp.cpp */, + ); + name = Source; + sourceTree = ""; + }; + 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { + isa = PBXGroup; + children = ( + 00B784AF0FF439BC000DE1D7 /* Accelerate.framework */, + 00B784B00FF439BC000DE1D7 /* AudioToolbox.framework */, + 00B784B10FF439BC000DE1D7 /* AudioUnit.framework */, + 00B784B20FF439BC000DE1D7 /* CoreAudio.framework */, + 0097E3E40F3E9819005A4392 /* QuickTime.framework */, + 5323E6B50EAFCA7E003A9687 /* QTKit.framework */, + 5323E6B10EAFCA74003A9687 /* CoreVideo.framework */, + 53E3CDFB0E86099300238D2B /* Carbon.framework */, + 0091D8F80E81B9330029341E /* OpenGL.framework */, + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, + ); + name = "Linked Frameworks"; + sourceTree = ""; + }; + 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + 29B97324FDCFA39411CA2CEA /* AppKit.framework */, + 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */, + 29B97325FDCFA39411CA2CEA /* Foundation.framework */, + ); + name = "Other Frameworks"; + sourceTree = ""; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8D1107320486CEB800E47090 /* BasicKinect.app */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* BasicKinect */ = { + isa = PBXGroup; + children = ( + 3C92D33C169A600300748453 /* Vendor */, + 29B97315FDCFA39411CA2CEA /* Headers */, + 080E96DDFE201D6D7F000001 /* Source */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = BasicKinect; + sourceTree = ""; + }; + 29B97315FDCFA39411CA2CEA /* Headers */ = { + isa = PBXGroup; + children = ( + 32CA4F630368D1EE00C91783 /* BasicKinect_Prefix.pch */, + ); + name = Headers; + sourceTree = ""; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + 8D1107310486CEB800E47090 /* Info.plist */, + 00CCAF14116A9FEE008396D5 /* CinderApp.icns */, + ); + name = Resources; + sourceTree = ""; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, + 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, + ); + name = Frameworks; + sourceTree = ""; + }; + 3C92D33C169A600300748453 /* Vendor */ = { + isa = PBXGroup; + children = ( + 3C92D33E169A600D00748453 /* openni */, + ); + name = Vendor; + sourceTree = ""; + }; + 3C92D33E169A600D00748453 /* openni */ = { + isa = PBXGroup; + children = ( + 3C92D33F169A602100748453 /* src */, + ); + name = openni; + sourceTree = ""; + }; + 3C92D33F169A602100748453 /* src */ = { + isa = PBXGroup; + children = ( + 3C92D340169A602100748453 /* SkeletonPoseDetector.h */, + 3C92D341169A602100748453 /* VKinect.cpp */, + 3C92D342169A602100748453 /* VKinect.h */, + 3C92D343169A602100748453 /* VOpenNIBone.h */, + 3C92D344169A602100748453 /* VOpenNICommon.h */, + 3C92D345169A602100748453 /* VOpenNIDevice.cpp */, + 3C92D346169A602100748453 /* VOpenNIDevice.h */, + 3C92D347169A602100748453 /* VOpenNIDeviceManager.cpp */, + 3C92D348169A602100748453 /* VOpenNIDeviceManager.h */, + 3C92D349169A602100748453 /* VOpenNIHeaders.h */, + 3C92D34A169A602100748453 /* VOpenNINetwork.cpp */, + 3C92D34B169A602100748453 /* VOpenNINetwork.h */, + 3C92D34C169A602100748453 /* VOpenNIRecorder.cpp */, + 3C92D34D169A602100748453 /* VOpenNIRecorder.h */, + 3C92D34E169A602100748453 /* VOpenNISurface.h */, + 3C92D34F169A602100748453 /* VOpenNIUser.cpp */, + 3C92D350169A602100748453 /* VOpenNIUser.h */, + ); + name = src; + path = ../../../src; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8D1107260486CEB800E47090 /* BasicKinect */ = { + isa = PBXNativeTarget; + buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "BasicKinect" */; + buildPhases = ( + 8D1107290486CEB800E47090 /* Resources */, + 8D11072C0486CEB800E47090 /* Sources */, + 8D11072E0486CEB800E47090 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = BasicKinect; + productInstallPath = "$(HOME)/Applications"; + productName = BasicKinect; + productReference = 8D1107320486CEB800E47090 /* BasicKinect.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "BasicKinect" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + en, + ); + mainGroup = 29B97314FDCFA39411CA2CEA /* BasicKinect */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8D1107260486CEB800E47090 /* BasicKinect */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D1107290486CEB800E47090 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 00CCAF15116A9FEE008396D5 /* CinderApp.icns in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D11072C0486CEB800E47090 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 00BAE65A0E7ED9C10018A608 /* BasicKinectApp.cpp in Sources */, + 3C92D351169A602100748453 /* VKinect.cpp in Sources */, + 3C92D352169A602100748453 /* VOpenNIDevice.cpp in Sources */, + 3C92D353169A602100748453 /* VOpenNIDeviceManager.cpp in Sources */, + 3C92D354169A602100748453 /* VOpenNINetwork.cpp in Sources */, + 3C92D355169A602100748453 /* VOpenNIRecorder.cpp in Sources */, + 3C92D356169A602100748453 /* VOpenNIUser.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + C01FCF4B08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = BasicKinect_Prefix.pch; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + HEADER_SEARCH_PATHS = ( + "\"$(CINDER_PATH)/boost\"", + "\"$(OPENNI_PATH)/include/Include\"", + ); + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + OTHER_LDFLAGS = ( + "\"$(CINDER_PATH)/lib/libcinder_d.a\"", + "-lcurl", + "\"$(OPENNI_PATH)/lib/macosx/libOpenNI.dylib\"", + ); + PRODUCT_NAME = BasicKinect; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + C01FCF4C08A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_FAST_MATH = YES; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 3; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = BasicKinect_Prefix.pch; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + HEADER_SEARCH_PATHS = ( + "\"$(CINDER_PATH)/boost\"", + "\"$(OPENNI_PATH)/include/Include\"", + ); + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + OTHER_LDFLAGS = ( + "\"$(CINDER_PATH)/lib/libcinder.a\"", + "-lcurl", + "\"$(OPENNI_PATH)/lib/macosx/libOpenNI.dylib\"", + ); + PRODUCT_NAME = BasicKinect; + STRIP_INSTALLED_PRODUCT = YES; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = i386; + CINDER_PATH = ../../../../..; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = "\"$(CINDER_PATH)/boost\""; + LIBRARY_SEARCH_PATHS = "$(OPENNI_PATH)/lib/macosx"; + MACOSX_DEPLOYMENT_TARGET = 10.6; + OPENNI_PATH = "$(CINDER_PATH)/blocks/BlockOpenNI"; + OTHER_LDFLAGS = "$(OPENNI_PATH)/lib/macosx/libOpenNI.dylib"; + SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = "\"$(CINDER_PATH)/include\" ../include"; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = i386; + CINDER_PATH = ../../../../..; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = "\"$(CINDER_PATH)/boost\""; + LIBRARY_SEARCH_PATHS = "$(OPENNI_PATH)/lib/macosx"; + MACOSX_DEPLOYMENT_TARGET = 10.6; + OPENNI_PATH = "$(CINDER_PATH)/blocks/BlockOpenNI"; + OTHER_LDFLAGS = "$(OPENNI_PATH)/lib/macosx/libOpenNI.dylib"; + SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = "\"$(CINDER_PATH)/include\" ../include"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "BasicKinect" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4B08A954540054247B /* Debug */, + C01FCF4C08A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "BasicKinect" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/samples/BasicKinect/xcode/BasicKinect.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/BasicKinect/xcode/BasicKinect.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..6ca1057 --- /dev/null +++ b/samples/BasicKinect/xcode/BasicKinect.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/samples/BasicKinect/xcode/BasicKinect.xcodeproj/project.xcworkspace/xcuserdata/ian.xcuserdatad/UserInterfaceState.xcuserstate b/samples/BasicKinect/xcode/BasicKinect.xcodeproj/project.xcworkspace/xcuserdata/ian.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..0f87773 Binary files /dev/null and b/samples/BasicKinect/xcode/BasicKinect.xcodeproj/project.xcworkspace/xcuserdata/ian.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/samples/BasicKinect/xcode/BasicKinect.xcodeproj/xcuserdata/ian.xcuserdatad/xcschemes/BasicKinect.xcscheme b/samples/BasicKinect/xcode/BasicKinect.xcodeproj/xcuserdata/ian.xcuserdatad/xcschemes/BasicKinect.xcscheme new file mode 100644 index 0000000..5b8130d --- /dev/null +++ b/samples/BasicKinect/xcode/BasicKinect.xcodeproj/xcuserdata/ian.xcuserdatad/xcschemes/BasicKinect.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/BasicKinect/xcode/BasicKinect.xcodeproj/xcuserdata/ian.xcuserdatad/xcschemes/xcschememanagement.plist b/samples/BasicKinect/xcode/BasicKinect.xcodeproj/xcuserdata/ian.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..cc9c2a9 --- /dev/null +++ b/samples/BasicKinect/xcode/BasicKinect.xcodeproj/xcuserdata/ian.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + BasicKinect.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8D1107260486CEB800E47090 + + primary + + + + + diff --git a/samples/BasicKinect/xcode/BasicKinect_Prefix.pch b/samples/BasicKinect/xcode/BasicKinect_Prefix.pch new file mode 100644 index 0000000..ca51059 --- /dev/null +++ b/samples/BasicKinect/xcode/BasicKinect_Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'basicApp' target in the 'basicApp' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/samples/BasicKinect/xcode/Info.plist b/samples/BasicKinect/xcode/Info.plist new file mode 100644 index 0000000..54467d3 --- /dev/null +++ b/samples/BasicKinect/xcode/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + CinderApp.icns + CFBundleIdentifier + org.libcinder.BasicKinect + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/samples/BlockOpenNISkeleton/src/BlockOpenNISkeletonApp.cpp b/samples/BlockOpenNISkeleton/src/BlockOpenNISkeletonApp.cpp index 1c01f8b..596c934 100644 --- a/samples/BlockOpenNISkeleton/src/BlockOpenNISkeletonApp.cpp +++ b/samples/BlockOpenNISkeleton/src/BlockOpenNISkeletonApp.cpp @@ -210,8 +210,8 @@ void BlockOpenNISampleAppApp::update() } // Update textures - mColorTex.update( getColorImage() ); - mDepthTex.update( getDepthImage() ); + mColorTex.update( Surface(getColorImage()) ); + mDepthTex.update( Surface(getDepthImage()) ); // Uses manager to handle users. @@ -219,7 +219,7 @@ void BlockOpenNISampleAppApp::update() it != mUsersTexMap.end(); ++it ) { - it->second.update( getUserImage( it->first ) ); + it->second.update( Surface(getUserImage( it->first )) ); } } diff --git a/src/VFakeKinect.cpp b/src/VFakeKinect.cpp new file mode 100644 index 0000000..2874804 --- /dev/null +++ b/src/VFakeKinect.cpp @@ -0,0 +1,45 @@ +#include "VFakeKinect.h" + +using namespace ci; +using namespace std; + +namespace V { + + void FakeKinect::setup(const ci::Vec2i & _depthSize, const ci::Vec2i & _colorSize, int nodeTypeFlags) + { + depthSize = _depthSize; + colorSize = _colorSize; + depthMapRealWorld = new XnPoint3D[depthSize.x * depthSize.y]; + + Surface8u colorSurface = Surface8u(colorSize.x, colorSize.y, false); + Surface::Iter it = colorSurface.getIter(); + while ( it.line() ) { + while ( it.pixel() ) { + Vec2i xy = it.getPos(); + Colorf color = hsvToRGB(Vec3f((float)xy.x / (float)colorSize.x, 1.f, 1.f)); + it.r() = color.r * 255.f; + it.g() = color.g * 255.f; + it.b() = color.b * 255.f; + } + } + + Surface8u depthSurface = Surface8u(depthSize.x, depthSize.y, false); + it = depthSurface.getIter(); + while ( it.line() ) { + while ( it.pixel() ) { + float depth = ((Vec2f)it.getPos()).distance((Vec2f)depthSize / 2.f) / ((Vec2f)depthSize).distance(Vec2f(0, 0)) * 255.f; + it.r() = depth; + it.g() = depth; + it.b() = depth; + + XnPoint3D *point = depthMapRealWorld + (it.x() + it.y() * depthSize.x); + point->X = it.x() + depthSize.x * -0.5; + point->Y = it.y() + depthSize.y * -0.5; + point->Z = (depth / 255.f) * 1000.f; // real kinect data seems to range from about 0 - 6000 + } + } + + tex_Color = gl::Texture(colorSurface); + tex_Depth = gl::Texture(depthSurface); + } +} diff --git a/src/VFakeKinect.h b/src/VFakeKinect.h new file mode 100644 index 0000000..ba57cdc --- /dev/null +++ b/src/VFakeKinect.h @@ -0,0 +1,34 @@ +#pragma once + +#include "VKinect.h" + +namespace V { + class FakeKinect : public Kinect + { + public: + FakeKinect(){}; + ~FakeKinect(){}; + + using Kinect::setup; + void setup(const ci::Vec2i & _depthSize, const ci::Vec2i & _colorSize, int nodeTypeFlags); + void update(){}; + + ci::ImageSourceRef getColorImage(){ return ci::ImageSourceRef(tex_Color); } + ci::ImageSourceRef getDepthImage(){ return ci::ImageSourceRef(tex_Depth); } + + class FakeDevice + { + public: + void setAlignWithDepthGenerator(){}; + bool isDepthDataNew(){ return true; }; + bool isColorDataNew(){ return true; }; + }; + + XnPoint3D * getDepthMapRealWorld() { return depthMapRealWorld; }; + FakeDevice * getDevice() { return &device; }; + + private: + FakeDevice device; + XnPoint3D *depthMapRealWorld; + }; +} \ No newline at end of file diff --git a/src/VKinect.cpp b/src/VKinect.cpp new file mode 100644 index 0000000..636b1d0 --- /dev/null +++ b/src/VKinect.cpp @@ -0,0 +1,197 @@ +#include "VKinect.h" +#include "cinder/app/AppBasic.h" +#include + +using namespace ci; +using namespace std; + +namespace V{ + +Kinect::Kinect() : +pixels(NULL) +{ +} + +Kinect::~Kinect() +{ + delete [] pixels; + pixels = NULL; +} + +void Kinect::setup() +{ + setup(Vec2i(640, 480)); +} + +void Kinect::setup(const Vec2i & size) +{ + setup(size, size, NODE_TYPE_IMAGE | NODE_TYPE_DEPTH | NODE_TYPE_SCENE | NODE_TYPE_USER); +} + +void Kinect::setup(const Vec2i & size, int nodeTypeFlags) +{ + setup(size, size, nodeTypeFlags); +} + + +void Kinect::setup(const Vec2i & _depthSize, const Vec2i & _colorSize, int nodeTypeFlags) +{ + depthSize = _depthSize; + colorSize = _colorSize; + + OpenNIDeviceManager::USE_THREAD = false; + + manager = OpenNIDeviceManager::InstancePtr(); + manager->createDevices(1, nodeTypeFlags); + + device = manager->getDevice(0); + if ( !device ) { + app::console() << "Can't find a kinect device" << endl; + throw 1; + } + device->setDepthShiftMul(3); + + device->addListener(this); + + pixels = new uint16_t[depthSize.x * depthSize.y]; + tex_Color = gl::Texture(colorSize.x, colorSize.y); + tex_Depth = gl::Texture(depthSize.x, depthSize.y); + + manager->start(); +} + +void Kinect::update() +{ + if ( !OpenNIDeviceManager::USE_THREAD ) { + manager->update(); + } + + if ( device->_isImageOn && device->getImageGenerator()->IsValid() && device->isImageDataNew() ) + tex_Color.update(Surface(getColorImage())); + if ( device->_isDepthOn && device->getDepthGenerator()->IsValid() && device->isDepthDataNew() ) + isDepthMapRealWorldUpdated = false; + tex_Depth.update(Surface(getDepthImage())); + + if ( device->_isUserOn && device->getUserGenerator()->IsValid() && device->isUserDataNew() ) { + BOOST_FOREACH(users_map::value_type &user, users) + { + user.second.texture.update(Surface(getUserImage(user.first))); + } + } +} + +void Kinect::drawColor( const Rectf & rect ) +{ + gl::draw(tex_Color, rect); +} + +void Kinect::drawDepth( const Rectf & rect ) +{ + gl::draw(tex_Depth, rect); +} + +void Kinect::drawUser( const int id, const Rectf & rect ) +{ + users_map::iterator it = users.find(id); + if ( it != users.end() ) { + gl::draw(it->second.texture, rect); + } else { + app::console() << "Could not draw user with id: " << id << endl; + } +} + +void Kinect::drawSkeletons( const Rectf & rect, float depth, float pointRadius, bool renderDepth ) +{ + if( !manager->hasUsers() ) return; + + gl::disable( GL_TEXTURE_2D ); + + gl::pushMatrices(); + gl::translate(Vec2f(rect.x1, rect.y1)); + manager->renderJoints(rect.getWidth(), + rect.getHeight(), + depth, + pointRadius, + renderDepth); + gl::popMatrices(); +} + +void Kinect::onNewUser( UserEvent ev ) +{ + users.insert(make_pair(ev.mId, User(*this, ev.mId))); +} + + +void Kinect::onLostUser( UserEvent ev ) +{ + users.erase(ev.mId); +} + +void Kinect::onUserExit( V::UserEvent ev ) +{ +} + +void Kinect::onUserReEnter( V::UserEvent ev ) +{ +} + + +ImageSourceRef Kinect::getColorImage() +{ + // register a reference to the active buffer + uint8_t *activeColor = device->getColorMap(); + return ImageSourceRef(new ImageSourceColor(activeColor, colorSize.x, colorSize.y)); +} + +ImageSourceRef Kinect::getUserImage( const int id ) +{ + device->getLabelMap(id, pixels); + return ImageSourceRef(new ImageSourceDepth(pixels, depthSize.x, depthSize.y)); +} + +ImageSourceRef Kinect::getDepthImage() +{ + // register a reference to the active buffer + uint16_t *activeDepth = device->getDepthMap(); + return ImageSourceRef(new ImageSourceDepth(activeDepth, depthSize.x, depthSize.y)); +} + +XnPoint3D * Kinect::getDepthMapRealWorld() +{ + if ( isDepthMapRealWorldUpdated ) { + return device->getDepthMapRealWorld(); + } else { + device->calcDepthImageRealWorld(); + isDepthMapRealWorldUpdated = true; + return device->getDepthMapRealWorld(); + } +} + +ColorA8u Kinect::getColorPixel(Vec2i pixel) +{ + uint8_t *r = device->getColorMap() + (pixel.x + pixel.y * colorSize.y); + return ColorA8u(*r, *(r + 1), *(r + 2)); +} + + +/******************************************************************************* + * Kinect::User + */ + +ImageSourceRef Kinect::User::getImage() const +{ + return kinect.getUserImage(id); +} + +OpenNIUserRef Kinect::User::getOpenNIUser() const +{ + return kinect.manager->getUser(id); +} + +Vec3f Kinect::User::getCenterOfMass( bool doProjectiveCoords ) const +{ + float * center = getOpenNIUser()->getCenterOfMass(doProjectiveCoords); + return ci::Vec3f(center[0], center[1], center[2]); +}; + +} // end namespace V \ No newline at end of file diff --git a/src/VKinect.h b/src/VKinect.h new file mode 100644 index 0000000..1ae1279 --- /dev/null +++ b/src/VKinect.h @@ -0,0 +1,148 @@ +#pragma once + +#include "cinder/gl/gl.h" +#include "cinder/gl/Texture.h" +#include "cinder/Vector.h" +#include "cinder/Surface.h" +#include "cinder/ImageIo.h" + +#include "VOpenNIHeaders.h" + +namespace V { + +class Kinect : public UserListener { +public: + Kinect(); + ~Kinect(); + + virtual void setup(); + virtual void setup(const ci::Vec2i & size); + virtual void setup(const ci::Vec2i & size, int nodeTypeFlags); + virtual void setup(const ci::Vec2i & _depthSize, const ci::Vec2i & _colorSize, int nodeTypeFlags); + void update(); + + void drawColor(const ci::Rectf &rect); + void drawDepth(const ci::Rectf &rect); + void drawUser(const int id, const ci::Rectf &rect); + void drawSkeletons(const ci::Rectf &rect, float depth=0.f, float pointRadius=3.f, bool renderDepth=false); + + void onNewUser( UserEvent ev ); + void onLostUser( UserEvent ev ); + void onUserExit( UserEvent ev ); + void onUserReEnter( UserEvent ev ); + + + ci::ImageSourceRef getColorImage(); + ci::ColorA8u getColorPixel(ci::Vec2i pixel); + ci::ImageSourceRef getUserImage(const int id); + ci::ImageSourceRef getDepthImage(); + XnPoint3D * getDepthMapRealWorld(); + + ci::gl::Texture * getColorTexture() { return &tex_Color; }; + ci::gl::Texture * getDepthTexture() { return &tex_Depth; }; + + ci::Vec2i getDepthSize() { return depthSize; }; + ci::Vec2i getColorSize() { return colorSize; }; + + OpenNIDevice::Ref getDevice() { return device; }; + + class User { + public: + User(Kinect & kinect, const int id) : + kinect(kinect), + id(id), + texture(ci::gl::Texture(kinect.depthSize.x, kinect.depthSize.y)) + {}; + + ci::ImageSourceRef getImage() const; + OpenNIUserRef getOpenNIUser() const; + ci::Vec3f getCenterOfMass( bool doProjectiveCoords=false ) const; + + int id; + Kinect & kinect; + ci::gl::Texture texture; + }; + friend class User; + + typedef std::map< int, User > users_map; + users_map users; + +protected: + OpenNIDeviceManager * manager; + OpenNIDevice::Ref device; + ci::gl::Texture tex_Color, tex_Depth; + uint16_t * pixels; + ci::Vec2i depthSize, colorSize; + bool isDepthMapRealWorldUpdated; + +public: + class ImageSourceColor : public ci::ImageSource + { + public: + ImageSourceColor( uint8_t *buffer, int width, int height ) + : ci::ImageSource(), mData( buffer ), _width(width), _height(height) + { + setSize( _width, _height ); + setColorModel( ImageIo::CM_RGB ); + setChannelOrder( ImageIo::RGB ); + setDataType( ImageIo::UINT8 ); + } + + ~ImageSourceColor() + { + // mData is actually a ref. It's released from the device. + /*if( mData ) { + delete[] mData; + mData = NULL; + }*/ + } + + virtual void load( ci::ImageTargetRef target ) + { + ImageSource::RowFunc func = setupRowFunc( target ); + + for( uint32_t row = 0; row < _height; ++row ) + ((*this).*func)( target, row, mData + row * _width * 3 ); + } + + protected: + uint32_t _width, _height; + uint8_t *mData; + }; + + + class ImageSourceDepth : public ci::ImageSource + { + public: + ImageSourceDepth( uint16_t *buffer, int width, int height ) + : ci::ImageSource(), mData( buffer ), _width(width), _height(height) + { + setSize( _width, _height ); + setColorModel( ci::ImageIo::CM_GRAY ); + setChannelOrder( ci::ImageIo::Y ); + setDataType( ci::ImageIo::UINT16 ); + } + + ~ImageSourceDepth() + { + // mData is actually a ref. It's released from the device. + /*if( mData ) { + delete[] mData; + mData = NULL; + }*/ + } + + virtual void load( ci::ImageTargetRef target ) + { + ci::ImageSource::RowFunc func = setupRowFunc( target ); + + for( uint32_t row = 0; row < _height; ++row ) + ((*this).*func)( target, row, mData + row * _width ); + } + + protected: + uint32_t _width, _height; + uint16_t *mData; + }; +}; +} // end namespace V \ No newline at end of file diff --git a/src/VOpenNICommon.h b/src/VOpenNICommon.h index 32128aa..263461a 100644 --- a/src/VOpenNICommon.h +++ b/src/VOpenNICommon.h @@ -16,6 +16,7 @@ #define DEBUG_MESSAGE( x ) printf( "%s", x ) #endif #elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) +#define BOOST_NO_CXX11_NUMERIC_LIMITS 1 #include #include #ifndef DEBUG_MESSAGE diff --git a/src/VOpenNIDevice.cpp b/src/VOpenNIDevice.cpp index 16da02d..8b85f19 100644 --- a/src/VOpenNIDevice.cpp +++ b/src/VOpenNIDevice.cpp @@ -1167,7 +1167,7 @@ namespace V // // Handle depth map // - if( _isDepthOn && _depthGen->IsValid() ) + if( _isDepthOn && _depthGen->IsValid() && _depthGen->IsDataNew() ) { _depthGen->GetMetaData( _depthMetaData ); //pDepth = _depthGen->GetDepthMap(); //_depthMetaData.Data(); @@ -1232,7 +1232,7 @@ namespace V } - if( _isImageOn && _imageGen->IsValid() ) + if( _isImageOn && _imageGen->IsValid() && _imageGen->IsDataNew() ) { _imageGen->GetMetaData( _imageMetaData ); pImage = _imageMetaData.Data(); //_imageGen->GetImageMap(); @@ -1246,7 +1246,7 @@ namespace V } - if( _isIROn && _irGen->IsValid() ) + if( _isIROn && _irGen->IsValid() && _irGen->IsDataNew() ) { _irGen->GetMetaData( _irMetaData ); pIR = _irMetaData.Data(); //_irGen->GetIRMap(); diff --git a/src/VOpenNIDevice.h b/src/VOpenNIDevice.h index efee32e..1650958 100644 --- a/src/VOpenNIDevice.h +++ b/src/VOpenNIDevice.h @@ -98,7 +98,7 @@ namespace V //void setFPS( ProductionNodeType nodeType, int fps ); //void setMapOutputMode( ProductionNodeType nodeType, int width, int height, int fps ); void readFrame(); - + void calcDepthImageRealWorld(); void calcDepthImageRealWorld( uint16_t* pixelData, XnPoint3D* worldData ); void calcDepthImageRealWorld( XnPoint3D* buffer ); @@ -184,6 +184,12 @@ namespace V xn::UserGenerator* getUserGenerator() { return _userGen; } xn::HandsGenerator* getHandsGenerator() { return _handsGen; } xn::Context* getContext() { return _context; } + + bool isImageDataNew() { return _imageGen->IsDataNew(); }; + bool isIRDataNew() { return _irGen->IsDataNew(); }; + bool isDepthDataNew() { return _depthGen->IsDataNew(); }; + bool isUserDataNew() { return _userGen->IsDataNew(); }; + bool isHandsDataNew() { return _handsGen->IsDataNew(); }; bool isOneTimeCalibration() { return _isOneTimeCalibration; } void enableOneTimeCalibration( bool value ) { _isOneTimeCalibration = value; } diff --git a/src/VOpenNIDeviceManager.cpp b/src/VOpenNIDeviceManager.cpp index 91299be..2648b3d 100644 --- a/src/VOpenNIDeviceManager.cpp +++ b/src/VOpenNIDeviceManager.cpp @@ -8,6 +8,7 @@ #include "VOpenNIDevice.h" #include "VOpenNIDeviceManager.h" #include +#include namespace V { @@ -745,7 +746,7 @@ namespace V #ifdef WIN32 _thread = std::shared_ptr( new boost::thread(&OpenNIDeviceManager::run, this) ); #else - _thread = boost::shared_ptr( new boost::thread(&OpenNIDeviceManager::run, this) ); + _thread = boost::shared_ptr( new std::thread(&OpenNIDeviceManager::run, this) ); #endif _isRunning = true; } diff --git a/src/VOpenNIDeviceManager.h b/src/VOpenNIDeviceManager.h index eb5b201..38a8386 100644 --- a/src/VOpenNIDeviceManager.h +++ b/src/VOpenNIDeviceManager.h @@ -2,6 +2,7 @@ #include "VOpenNIDevice.h" +#include namespace V @@ -86,7 +87,7 @@ namespace V #ifdef WIN32 std::shared_ptr _thread; #else - boost::shared_ptr _thread; + boost::shared_ptr _thread; #endif boost::mutex _mutex; diff --git a/src/VOpenNIHeaders.h b/src/VOpenNIHeaders.h index e6f3687..8d09dc3 100644 --- a/src/VOpenNIHeaders.h +++ b/src/VOpenNIHeaders.h @@ -1,6 +1,5 @@ #pragma once - #include "VOpenNICommon.h" // #ifdef _WIN32 // #include "VOpenNINetwork.h" diff --git a/src/VOpenNINetwork.h b/src/VOpenNINetwork.h index f2bcc94..75cdcda 100644 --- a/src/VOpenNINetwork.h +++ b/src/VOpenNINetwork.h @@ -48,7 +48,7 @@ namespace V bool mIsServer; volatile bool mIsRunning; - boost::shared_ptr _thread; + boost::shared_ptr _thread; std::string mHostName; uint16_t mHostPort;