diff --git a/Base/Devices/imstkHDAPIDeviceClient.cpp b/Base/Devices/imstkHDAPIDeviceClient.cpp index a10bddd70b4e532c2de6b215fc0989ca77707bc5..fe323a5fe6cb3872aef692b529194d639d0ffd2d 100644 --- a/Base/Devices/imstkHDAPIDeviceClient.cpp +++ b/Base/Devices/imstkHDAPIDeviceClient.cpp @@ -19,6 +19,8 @@ =========================================================================*/ +#ifdef iMSTK_USE_OPENHAPTICS + #include "imstkHDAPIDeviceClient.h" #include <HDU/hduVector.h> @@ -100,3 +102,4 @@ HDAPIDeviceClient::hapticCallback(void* pData) return HD_CALLBACK_CONTINUE; } } +#endif // ifdef iMSTK_USE_OPENHAPTICS diff --git a/Base/Devices/imstkHDAPIDeviceClient.h b/Base/Devices/imstkHDAPIDeviceClient.h index d6b4c0ba239623ed13db8340e113b17c1eda332b..d038d2e0dc4e1bdb1ae622d5fdf7c4c8395c900f 100644 --- a/Base/Devices/imstkHDAPIDeviceClient.h +++ b/Base/Devices/imstkHDAPIDeviceClient.h @@ -19,6 +19,8 @@ =========================================================================*/ +#ifdef iMSTK_USE_OPENHAPTICS + #ifndef imstkHDAPIDeviceClient_h #define imstkHDAPIDeviceClient_h @@ -71,3 +73,4 @@ private: } #endif // ifndef imstkHDAPIDeviceClient_h +#endif // ifdef iMSTK_USE_OMNI diff --git a/Base/Devices/imstkVRPNDeviceServer.cpp b/Base/Devices/imstkVRPNDeviceServer.cpp index d1812edc7a1258596a01d11e9b723e2c5fc4454e..2f33804cf328f90e68698e5caaecb801fa1eb2f4 100644 --- a/Base/Devices/imstkVRPNDeviceServer.cpp +++ b/Base/Devices/imstkVRPNDeviceServer.cpp @@ -79,8 +79,8 @@ VRPNDeviceServer::initModule() case DeviceType::PHANTOM_OMNI: { #ifdef VRPN_USE_PHANTOM_SERVER - char * deviceName = const_cast<char*>(name.c_str()); - m_deviceConnections->add(new vrpn_Phantom(deviceName, m_serverConnection, 90.0f, deviceName)); + char * deviceName = const_cast<char*>(name.c_str()); + m_deviceConnections->add(new vrpn_Phantom(deviceName, m_serverConnection, 90.0f, deviceName)); #else LOG(WARNING) << "VRPNDeviceServer::initModule error: no support for Phantom Omni in VRPN. " << "Install OpenHaptics SDK, the omni driver, and build VRPN with VRPN_USE_PHANTOM_SERVER."; diff --git a/CMakeLists.txt b/CMakeLists.txt index 3fc5e620cc5bc6ecd4bcd7ca3740af6d35017635..8b77ef8f3a80dc44ea7a9dcb16735e9572c1eb58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,7 +143,11 @@ find_package( VRPN REQUIRED ) include_directories( ${VRPN_INCLUDE_DIRS} ) add_definitions( -DVRPN_USE_LIBNIFALCON ) if(${PROJECT_NAME}_USE_OMNI) + add_definitions( -DiMSTK_USE_OPENHAPTICS ) add_definitions( -DVRPN_USE_PHANTOM_SERVER ) +else() + remove_definitions( -DiMSTK_USE_OPENHAPTICS ) + remove_definitions( -DVRPN_USE_PHANTOM_SERVER ) endif() #-------------------------------------------------------------------------- diff --git a/Examples/Sandbox/main.cpp b/Examples/Sandbox/main.cpp index 31ab74dcfcd3d185c4dc52a571a910f469e8121c..44b3c1fee9a1ee1da70376695ad4d96ab1420100 100644 --- a/Examples/Sandbox/main.cpp +++ b/Examples/Sandbox/main.cpp @@ -256,6 +256,7 @@ void testTwoFalcons() void testObjectController() { +#ifdef iMSTK_USE_OPENHAPTICS // SDK and Scene auto sdk = std::make_shared<imstk::SimulationManager>(); auto scene = sdk->createNewScene("SceneTestDevice"); @@ -281,6 +282,7 @@ void testObjectController() // Run sdk->setCurrentScene("SceneTestDevice"); sdk->startSimulation(true); +#endif } void testCameraController()