00001 //=========================================================================== 00002 /* 00003 This file is part of the CHAI 3D visualization and haptics libraries. 00004 Copyright (C) 2003-2009 by CHAI 3D. All rights reserved. 00005 00006 This library is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License("GPL") version 2 00008 as published by the Free Software Foundation. 00009 00010 For using the CHAI 3D libraries with software that can not be combined 00011 with the GNU GPL, and for taking advantage of the additional benefits 00012 of our support services, please contact CHAI 3D about acquiring a 00013 Professional Edition License. 00014 00015 \author <http://www.chai3d.org> 00016 \author Francois Conti 00017 \version 2.0.0 $Rev: 251 $ 00018 */ 00019 //=========================================================================== 00020 00021 //--------------------------------------------------------------------------- 00022 #ifndef CHapticDeviceHandlerH 00023 #define CHapticDeviceHandlerH 00024 //--------------------------------------------------------------------------- 00025 00026 //=========================================================================== 00034 //=========================================================================== 00035 00036 #include "devices/CGenericHapticDevice.h" 00037 00038 #if defined(_ENABLE_VIRTUAL_DEVICE_SUPPORT) 00039 #include "devices/CVirtualDevice.h" 00040 #endif 00041 00042 #if defined(_ENABLE_DELTA_DEVICE_SUPPORT) 00043 #include "devices/CDeltaDevices.h" 00044 #endif 00045 00046 #if defined(_ENABLE_FALCON_DEVICE_SUPPORT) 00047 #include "devices/CFalconDevice.h" 00048 #endif 00049 00050 #if defined(_ENABLE_MPB_DEVICE_SUPPORT) 00051 #include "devices/CFreedom6SDevice.h" 00052 #endif 00053 00054 #if defined(_ENABLE_PHANTOM_DEVICE_SUPPORT) 00055 #include "devices/CPhantomDevices.h" 00056 #endif 00057 00058 #if defined(_ENABLE_CUSTOM_DEVICE_SUPPORT) 00059 #include "devices/CMyCustomDevice.h" 00060 #endif 00061 //--------------------------------------------------------------------------- 00063 const unsigned int CHAI_MAX_HAPTIC_DEVICES = 16; 00064 //--------------------------------------------------------------------------- 00065 00066 //=========================================================================== 00075 //=========================================================================== 00076 class cHapticDeviceHandler 00077 { 00078 public: 00079 //----------------------------------------------------------------------- 00080 // CONSTRUCTOR & DESTRUCTOR: 00081 //----------------------------------------------------------------------- 00082 00084 cHapticDeviceHandler(); 00085 00087 virtual ~cHapticDeviceHandler(); 00088 00089 00090 //----------------------------------------------------------------------- 00091 // METHODS: 00092 //----------------------------------------------------------------------- 00093 00095 unsigned int getNumDevices() { return (m_numDevices); } 00096 00098 void update(); 00099 00101 int getDeviceSpecifications(cHapticDeviceInfo& a_deviceSpecifications, unsigned int a_index = 0); 00102 00104 int getDevice(cGenericHapticDevice*& a_hapticDevice, unsigned int a_index = 0); 00105 00106 00107 private: 00108 00110 unsigned int m_numDevices; 00111 00113 cGenericHapticDevice* m_devices[CHAI_MAX_HAPTIC_DEVICES]; 00114 00116 cGenericHapticDevice* m_nullHapticDevice; 00117 }; 00118 00119 //--------------------------------------------------------------------------- 00120 #endif 00121 //---------------------------------------------------------------------------