Skip to content
Snippets Groups Projects
Commit 97bdc520 authored by Alexis Girault's avatar Alexis Girault
Browse files

COMP: add proper definitions check for openhaptics

parent 8b3d503f
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -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
......@@ -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.";
......
......@@ -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()
#--------------------------------------------------------------------------
......
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment