00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OpenSpace3D 00004 For the latest info, see http://www.openspace3d.com 00005 00006 Copyright (c) 2010 I-maginer 00007 00008 This program is free software; you can redistribute it and/or modify it under 00009 the terms of the GNU Lesser General Public License as published by the Free Software 00010 Foundation; either version 2 of the License, or (at your option) any later 00011 version. 00012 00013 This program is distributed in the hope that it will be useful, but WITHOUT 00014 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00015 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public License along with 00018 this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00019 Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00020 http://www.gnu.org/copyleft/lesser.txt 00021 00022 You may alternatively use this source under the terms of a specific version of 00023 the OpenSpace3D Unrestricted License provided you have obtained such a license from 00024 I-maginer. 00025 ----------------------------------------------------------------------------- 00026 */ 00027 00035 #ifndef __DeviceManager_H__ 00036 #define __DeviceManager_H__ 00037 00038 #include "lib/common.h" 00039 #include "core/Singleton.h" 00040 #include "generator/Image.h" 00041 #include "generator/Depth.h" 00042 00043 00044 namespace NIDevice 00045 { 00046 class DeviceManager : public Core::Singleton<DeviceManager> // Device manager inherits from Singleton 00047 { 00048 public: 00049 // Get singleton instance 00050 static DeviceManager& GetSingleton(); 00051 static DeviceManager* GetSingletonPtr(); 00052 00053 // Constructor and Destructor 00054 DeviceManager(); 00055 ~DeviceManager(); 00056 00060 NIDEVICE_GET_OBJECT_TYPE_AS_STRING(DeviceManager); 00061 NIDEVICE_GET_ERROR_MESSAGE(nRetVal,description); 00062 00063 // Create and destroy Kinect Device 00064 NIDevice::Objects::KinectDevice* CreateKinectDevice(); 00065 void DestroyKinectDevice(NIDevice::Objects::KinectDevice* existingKinectDevice); 00066 NIDevice::Objects::KinectDevice* GetKinectDevice(unsigned int id); 00067 00068 private: 00069 00070 XnStatus nRetVal; 00071 std::string description; 00072 00073 KinectDeviceMap listOfKinectDevice; 00074 00075 unsigned int createId(); 00076 00077 void close(); 00078 00079 void addKinectDevice(NIDevice::Objects::KinectDevice* existingKinectDevice); 00080 00081 protected: 00082 }; 00083 } 00084 00085 00086 #endif
1.7.2