Commit adc98a11 authored by Ricardo Ortiz's avatar Ricardo Ortiz
Browse files

ENH: Remove WIN32_LEAN_AND_MEAN

form each UnitTest directory to avoid warning C4138 in windows.
parent 97db2d8d
......@@ -17,6 +17,11 @@
###########################################################################
set(MODULE_NAME Assembler)
if(WIN32)
remove_definitions(-DWIN32_LEAN_AND_MEAN)
endif(WIN32)
imstk_add_library(${MODULE_NAME}
SOURCES
Assembler.cpp
......
......@@ -177,7 +177,7 @@ if(MSVC)
set(msvc_suppressed_warnings
# C++ exception specification ignored except to indicate a function is not
# __declspec(nothrow)
"/wd4290"
"/wd4290 /wd4267"
)
set(msvc_other_flags
# Enable C++ Exceptions
......
......@@ -18,6 +18,10 @@
set(Module Collision)
if(WIN32)
remove_definitions(-DWIN32_LEAN_AND_MEAN)
endif(WIN32)
add_executable(${Module}UnitTestRunner
${BANDIT_RUNNER}
SpatialHashSpec.cpp
......
......@@ -18,6 +18,10 @@
set(Module CollisionContext)
if(WIN32)
remove_definitions(-DWIN32_LEAN_AND_MEAN)
endif(WIN32)
add_executable(${Module}UnitTestRunner
${BANDIT_RUNNER}
CollisionContextSpec.cpp
......
......@@ -18,6 +18,10 @@
set(Module ContactHandling)
if(WIN32)
remove_definitions(-DWIN32_LEAN_AND_MEAN)
endif(WIN32)
add_executable(${Module}UnitTestRunner
${BANDIT_RUNNER}
PenaltyContactHandlingSpec.cpp
......
......@@ -18,6 +18,10 @@
set(Module Core)
if(WIN32)
remove_definitions(-DWIN32_LEAN_AND_MEAN)
endif(WIN32)
add_executable(${Module}UnitTestRunner
${BANDIT_RUNNER}
Factory.cpp
......
......@@ -169,12 +169,12 @@ public:
///
/// \brief write data (for ADU interface device)
///
virtual Message write(void */*Interfacehandle*/, int /*port*/, void */*data*/);
virtual Message write(void *Interfacehandle, int port, void *data);
///
/// \brief read data (for ADU interface device)
///
virtual Message read(void */*Interfacehandle*/, int /*port*/, void */*data*/);
virtual Message read(void *Interfacehandle, int port, void *data);
protected:
bool driverInstalled; //!< true if device driver is installed
......
......@@ -64,14 +64,6 @@ void VRPNForceDevice::processChanges()
this->vrpnForce->mainloop();
}
//---------------------------------------------------------------------------
bool VRPNForceDevice::init()
{
this->buttons.resize(2);
this->buttonTimers.resize(2);
return DeviceInterface::init();
}
//---------------------------------------------------------------------------
void VRPN_CALLBACK
VRPNForceDevice::forceChangeHandler(void *userData, const vrpn_FORCECB f)
......@@ -96,4 +88,90 @@ VRPNForceDevice::forceChangeHandler(void *userData, const vrpn_FORCECB f)
handler->vrpnForce->setRecoveryTime( 10 );
}
//---------------------------------------------------------------------------
bool VRPNForceDevice::init()
{
this->buttons.resize(2);
this->buttonTimers.resize(2);
return DeviceInterface::init();
}
//---------------------------------------------------------------------------
void VRPNForceDevice::setEnableForce(const bool &enable)
{
this->enableForce = enable;
}
//---------------------------------------------------------------------------
const bool &VRPNForceDevice::getEnableForce() const
{
return this->enableForce;
}
//---------------------------------------------------------------------------
void VRPNForceDevice::setContactPlane(const Vec4f &plane)
{
this->contactPlane = plane;
}
//---------------------------------------------------------------------------
void VRPNForceDevice::setContactPlane(const Vec3f &plane, const float d)
{
this->contactPlane << plane, d;
}
//---------------------------------------------------------------------------
const Vec4f &VRPNForceDevice::getContactPlane() const
{
return this->contactPlane;
}
//---------------------------------------------------------------------------
void VRPNForceDevice::setDampingCoefficient(const double &coeff)
{
this->dampingCoefficient = coeff;
}
//---------------------------------------------------------------------------
const double &VRPNForceDevice::getDampingCoefficient() const
{
return this->dampingCoefficient;
}
//---------------------------------------------------------------------------
void VRPNForceDevice::setDynamicFriction(const double &coeff)
{
this->dynamicFriction = coeff;
}
//---------------------------------------------------------------------------
const double &VRPNForceDevice::getDynamicFriction() const
{
return this->dynamicFriction;
}
//---------------------------------------------------------------------------
void VRPNForceDevice::setSpringCoefficient(const double &coeff)
{
this->springCoefficient = coeff;
}
//---------------------------------------------------------------------------
const double &VRPNForceDevice::getSpringCoefficient() const
{
return this->springCoefficient;
}
//---------------------------------------------------------------------------
void VRPNForceDevice::setStaticFriction(const double &coeff)
{
this->staticFriction = coeff;
}
//---------------------------------------------------------------------------
const double &VRPNForceDevice::getStaticFriction() const
{
return this->staticFriction;
}
}
......@@ -62,106 +62,67 @@ public:
///
/// \brief Enable force feedback
///
void setEnableForce(const bool &enable)
{
this->enableForce = enable;
}
void setEnableForce(const bool &enable);
///
/// \brief Get enabling force variable
///
const bool &getEnableForce() const
{
return this->enableForce;
}
const bool &getEnableForce() const;
///
/// \brief Set contact plane
///
void setContactPlane(const Vec4f &plane)
{
this->contactPlane = plane;
}
void setContactPlane(const Vec4f &plane);
///
/// \brief Set contact plane
///
void setContactPlane(const Vec3f &plane, const float d)
{
this->contactPlane << plane,d;
}
void setContactPlane(const Vec3f &plane, const float d);
///
/// \brief Get contact plane
///
const Vec4f &getContactPlane() const
{
return this->contactPlane;
}
const Vec4f &getContactPlane() const;
///
/// \brief Set damping coefficient
///
void setDampingCoefficient(const double &coeff)
{
this->dampingCoefficient = coeff;
}
void setDampingCoefficient(const double &coeff);
///
/// \brief Get damping coefficient
///
const double &getDampingCoefficient() const
{
return this->dampingCoefficient;
}
const double &getDampingCoefficient() const;
///
/// \brief Set dynamic friction coefficient
///
void setDynamicFriction(const double &coeff)
{
this->dynamicFriction = coeff;
}
void setDynamicFriction(const double &coeff);
///
/// \brief Get dynamic friction coefficient
///
const double &getDynamicFriction() const
{
return this->dynamicFriction;
}
const double &getDynamicFriction() const;
///
/// \brief Set spring coefficient
///
void setSpringCoefficient(const double &coeff)
{
this->springCoefficient = coeff;
}
void setSpringCoefficient(const double &coeff);
///
/// \brief Get spring coefficient
///
const double &getSpringCoefficient() const
{
return this->springCoefficient;
}
const double &getSpringCoefficient() const;
///
/// \brief Set static friction coefficient
///
void setStaticFriction(const double &coeff)
{
this->staticFriction = coeff;
}
void setStaticFriction(const double &coeff);
///
/// \brief Get static friction coefficient
///
const double &getStaticFriction() const
{
return this->staticFriction;
}
const double &getStaticFriction() const;
protected:
///
......
......@@ -18,6 +18,10 @@
set(Module Event)
if(WIN32)
remove_definitions(-DWIN32_LEAN_AND_MEAN)
endif(WIN32)
add_executable(${Module}UnitTestRunner
${BANDIT_RUNNER}
EventHandlerSpec.cpp
......
......@@ -81,10 +81,6 @@ int main(int ac, char** av)
return EXIT_FAILURE;
}
// Set up a controller to control a mesh with an external device
std::string deviceURL = "Phantom@localhost";
auto controller = sdk->createForceDeviceController(deviceURL);
//-------------------------------------------------------
// Create scene actor 1: fem scene object + fem simulator
//-------------------------------------------------------
......@@ -157,6 +153,10 @@ int main(int ac, char** av)
loliMesh->transform(transform);
loliMesh->updateInitialVertices();
// Set up a controller to control this mesh
std::string deviceURL = "Phantom1@10.171.2.217";
auto controller = sdk->createForceDeviceController(deviceURL);
controller->setScalingFactor(30.0);
controller->setMesh(loliCollisionModel->getMesh());
//-------------------------------------------------------
......
......@@ -18,6 +18,10 @@
set(Module Geometry)
if(WIN32)
remove_definitions(-DWIN32_LEAN_AND_MEAN)
endif(WIN32)
add_executable(${Module}UnitTestRunner
${BANDIT_RUNNER}
MeshModelSpec.cpp
......
......@@ -18,6 +18,10 @@
set(Module IO)
if(WIN32)
remove_definitions(-DWIN32_LEAN_AND_MEAN)
endif(WIN32)
add_executable(${Module}UnitTestRunner
${BANDIT_RUNNER}
IOMeshSpec.cpp
......
......@@ -18,6 +18,10 @@
set(Module Mesh)
if(WIN32)
remove_definitions(-DWIN32_LEAN_AND_MEAN)
endif(WIN32)
add_executable(${Module}UnitTestRunner
${BANDIT_RUNNER}
VegaVolumetricMeshSpec.cpp
......
......@@ -18,6 +18,10 @@
set(Module VtkRendering)
if(WIN32)
remove_definitions(-DWIN32_LEAN_AND_MEAN)
endif(WIN32)
add_executable(${Module}UnitTestRunner
${BANDIT_RUNNER}
MeshNodalCoordinatesSpec.cpp
......
......@@ -26,22 +26,23 @@
namespace imstk {
///
/// \brief Base class for all deformable scene objects.
///
class InteractionSceneModel : public SceneObject, public OdeSystem
{
public:
///
/// \brief Base class for all deformable scene objects.
/// \brief Constructor
///
class InteractionSceneModel : public SceneObject, public OdeSystem
{
public:
///
/// \brief Constructor
///
InteractionSceneModel() = default;
InteractionSceneModel() = default;
///
/// \brief Destructor
///
virtual ~InteractionSceneModel() = default;
};
///
/// \brief Destructor
///
virtual ~InteractionSceneModel() = default;
};
}
#endif // SCENE_MODELS_INTERACTIONSCENEMODEL_H
......@@ -85,12 +85,12 @@ private:
///
//not implemented yet..tansel
///
virtual void serialize(void */*p_memoryBlock*/) override {}
virtual void serialize(void *) override {}
///
//not implemented yet..tansel
///
virtual void unSerialize(void */*p_memoryBlock*/) override {}
virtual void unSerialize(void *) override {}
private:
std::string fileName;
......
......@@ -18,6 +18,10 @@
set(Module SceneModels)
if(WIN32)
remove_definitions(-DWIN32_LEAN_AND_MEAN)
endif(WIN32)
add_executable(${Module}UnitTestRunner
${BANDIT_RUNNER}
VegaFEMDeformableSceneObjectSpec.cpp
......
......@@ -260,14 +260,16 @@ std::shared_ptr< VRPNDeviceServer > SDK::createDeviceServer()
}
//---------------------------------------------------------------------------
std::shared_ptr< ToolCoupler > SDK::createForceDeviceController(std::string &deviceURL)
std::shared_ptr< ToolCoupler > SDK::createForceDeviceController(std::string &deviceURL, bool createServer)
{
auto server = this->createDeviceServer();
auto client = std::make_shared<VRPNForceDevice>(deviceURL);
this->addModule(client);
server->addDeviceClient(client);
if(createServer)
{
auto server = this->createDeviceServer();
server->addDeviceClient(client);
}
auto controller = std::make_shared<ToolCoupler>(client);
this->addModule(controller);
......
......@@ -199,7 +199,7 @@ public:
///
/// \param deviceURL Client name to make the connection
///
std::shared_ptr<ToolCoupler> createForceDeviceController(std::string &deviceURL);
std::shared_ptr<ToolCoupler> createForceDeviceController(std::string &deviceURL, bool createServer = false);
private:
SDK() = default;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment