Unverified Commit bfb5b93c authored by Joseph Mirabel's avatar Joseph Mirabel Committed by GitHub
Browse files

Merge pull request #174 from jmirabel/windows

Compilation on Windows.
parents d4571ba0 97fbbeb7
......@@ -41,10 +41,6 @@ set(PROJECT_DESCRIPTION
)
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
IF(NOT DEFINED CMAKE_CXX_STANDARD)
SET(CMAKE_CXX_STANDARD 98)
ENDIF()
# Do not support CMake older than 2.8.12
CMAKE_POLICY(SET CMP0022 NEW)
SET(PROJECT_USE_KEYWORD_LINK_LIBRARIES TRUE)
......@@ -100,6 +96,9 @@ endif()
option(HPP_FCL_HAS_QHULL "use qhull library to compute convex hulls." FALSE)
if(HPP_FCL_HAS_QHULL)
if(DEFINED CMAKE_CXX_STANDARD AND CMAKE_CXX_STANDARD EQUAL 98)
message(FATAL_ERROR "Cannot use qhull library with C++ < 11.\nYou may add -DCMAKE_CXX_STANDARD=11")
endif()
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/third-parties)
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
${CMAKE_SOURCE_DIR}/third-parties/qhull/src/libqhullcpp
......
......@@ -72,7 +72,7 @@ class XmlDocString (object):
from sys import stdout, stderr
self.writeErrors(output)
self._clean()
return self._linesep.join(self.lines)
return self._linesep.join(self.lines).encode("utf-8")
def visit (self, node):
assert isinstance(node.tag, str)
......
......@@ -52,7 +52,7 @@ struct CollisionRequest;
/// @{
/// @brief A class describing the AABB collision structure, which is a box in 3D space determined by two diagonal points
class AABB
class HPP_FCL_DLLAPI AABB
{
public:
/// @brief The min point in the AABB
......@@ -245,12 +245,12 @@ static inline AABB rotate(const AABB& aabb, const Matrix3f& R)
}
/// @brief Check collision between two aabbs, b1 is in configuration (R0, T0) and b2 is in identity.
bool overlap(const Matrix3f& R0, const Vec3f& T0, const AABB& b1, const AABB& b2);
bool overlap(const Matrix3f& R0, const Vec3f& T0, const AABB& b1, const AABB& b2) HPP_FCL_DLLAPI;
/// @brief Check collision between two aabbs, b1 is in configuration (R0, T0) and b2 is in identity.
bool overlap(const Matrix3f& R0, const Vec3f& T0, const AABB& b1,
const AABB& b2, const CollisionRequest& request,
FCL_REAL& sqrDistLowerBound);
FCL_REAL& sqrDistLowerBound) HPP_FCL_DLLAPI;
}
} // namespace hpp
......
......@@ -59,7 +59,7 @@ namespace details
/// @brief Convert a bounding volume of type BV1 in configuration tf1 to a bounding volume of type BV2 in I configuration.
template<typename BV1, typename BV2>
class Converter
class HPP_FCL_DLLAPI Converter
{
private:
static void convert(const BV1& /*bv1*/, const Transform3f& /*tf1*/, BV2& /*bv2*/)
......@@ -71,7 +71,7 @@ private:
/// @brief Convert from AABB to AABB, not very tight but is fast.
template<>
class Converter<AABB, AABB>
class HPP_FCL_DLLAPI Converter<AABB, AABB>
{
public:
static void convert(const AABB& bv1, const Transform3f& tf1, AABB& bv2)
......@@ -86,7 +86,7 @@ public:
};
template<>
class Converter<AABB, OBB>
class HPP_FCL_DLLAPI Converter<AABB, OBB>
{
public:
static void convert(const AABB& bv1, const Transform3f& tf1, OBB& bv2)
......@@ -98,7 +98,7 @@ public:
};
template<>
class Converter<OBB, OBB>
class HPP_FCL_DLLAPI Converter<OBB, OBB>
{
public:
static void convert(const OBB& bv1, const Transform3f& tf1, OBB& bv2)
......@@ -110,7 +110,7 @@ public:
};
template<>
class Converter<OBBRSS, OBB>
class HPP_FCL_DLLAPI Converter<OBBRSS, OBB>
{
public:
static void convert(const OBBRSS& bv1, const Transform3f& tf1, OBB& bv2)
......@@ -120,7 +120,7 @@ public:
};
template<>
class Converter<RSS, OBB>
class HPP_FCL_DLLAPI Converter<RSS, OBB>
{
public:
static void convert(const RSS& bv1, const Transform3f& tf1, OBB& bv2)
......@@ -133,7 +133,7 @@ public:
template<typename BV1>
class Converter<BV1, AABB>
class HPP_FCL_DLLAPI Converter<BV1, AABB>
{
public:
static void convert(const BV1& bv1, const Transform3f& tf1, AABB& bv2)
......@@ -148,7 +148,7 @@ public:
};
template<typename BV1>
class Converter<BV1, OBB>
class HPP_FCL_DLLAPI Converter<BV1, OBB>
{
public:
static void convert(const BV1& bv1, const Transform3f& tf1, OBB& bv2)
......@@ -160,7 +160,7 @@ public:
};
template<>
class Converter<OBB, RSS>
class HPP_FCL_DLLAPI Converter<OBB, RSS>
{
public:
static void convert(const OBB& bv1, const Transform3f& tf1, RSS& bv2)
......@@ -175,7 +175,7 @@ public:
};
template<>
class Converter<RSS, RSS>
class HPP_FCL_DLLAPI Converter<RSS, RSS>
{
public:
static void convert(const RSS& bv1, const Transform3f& tf1, RSS& bv2)
......@@ -190,7 +190,7 @@ public:
};
template<>
class Converter<OBBRSS, RSS>
class HPP_FCL_DLLAPI Converter<OBBRSS, RSS>
{
public:
static void convert(const OBBRSS& bv1, const Transform3f& tf1, RSS& bv2)
......@@ -200,7 +200,7 @@ public:
};
template<>
class Converter<AABB, RSS>
class HPP_FCL_DLLAPI Converter<AABB, RSS>
{
public:
static void convert(const AABB& bv1, const Transform3f& tf1, RSS& bv2)
......@@ -246,7 +246,7 @@ public:
};
template<>
class Converter<AABB, OBBRSS>
class HPP_FCL_DLLAPI Converter<AABB, OBBRSS>
{
public:
static void convert(const AABB& bv1, const Transform3f& tf1, OBBRSS& bv2)
......
......@@ -54,7 +54,7 @@ namespace fcl
/// @{
/// @brief BVNodeBase encodes the tree structure for BVH
struct BVNodeBase
struct HPP_FCL_DLLAPI BVNodeBase
{
/// @brief An index for first child node or primitive
/// If the value is positive, it is the index of the first child bv node
......@@ -84,7 +84,7 @@ struct BVNodeBase
/// @brief A class describing a bounding volume node. It includes the tree structure providing in BVNodeBase and also the geometry data provided in BV template parameter.
template<typename BV>
struct BVNode : public BVNodeBase
struct HPP_FCL_DLLAPI BVNode : public BVNodeBase
{
/// @brief bounding volume storing the geometry
BV bv;
......
......@@ -51,7 +51,7 @@ struct CollisionRequest;
/// @{
/// @brief Oriented bounding box class
class OBB
class HPP_FCL_DLLAPI OBB
{
public:
/// @brief Orientation of OBB. axis[i] is the ith column of the orientation matrix for the box; it is also the i-th principle direction of the box.
......@@ -133,15 +133,15 @@ public:
/// @brief Translate the OBB bv
OBB translate(const OBB& bv, const Vec3f& t);
OBB translate(const OBB& bv, const Vec3f& t) HPP_FCL_DLLAPI;
/// @brief Check collision between two obbs, b1 is in configuration (R0, T0) and b2 is in identity.
bool overlap(const Matrix3f& R0, const Vec3f& T0, const OBB& b1, const OBB& b2);
bool overlap(const Matrix3f& R0, const Vec3f& T0, const OBB& b1, const OBB& b2) HPP_FCL_DLLAPI;
/// @brief Check collision between two obbs, b1 is in configuration (R0, T0) and b2 is in identity.
bool overlap(const Matrix3f& R0, const Vec3f& T0, const OBB& b1,
const OBB& b2, const CollisionRequest& request,
FCL_REAL& sqrDistLowerBound);
FCL_REAL& sqrDistLowerBound) HPP_FCL_DLLAPI;
/// Check collision between two boxes
......@@ -149,7 +149,7 @@ bool overlap(const Matrix3f& R0, const Vec3f& T0, const OBB& b1,
/// @param a half dimensions of first box,
/// @param b half dimensions of second box.
/// The second box is in identity configuration.
bool obbDisjoint(const Matrix3f& B, const Vec3f& T, const Vec3f& a, const Vec3f& b);
bool obbDisjoint(const Matrix3f& B, const Vec3f& T, const Vec3f& a, const Vec3f& b) HPP_FCL_DLLAPI;
}
} // namespace hpp
......
......@@ -53,7 +53,7 @@ namespace fcl
/// @{
/// @brief Class merging the OBB and RSS, can handle collision and distance simultaneously
class OBBRSS
class HPP_FCL_DLLAPI OBBRSS
{
public:
......
......@@ -52,7 +52,7 @@ struct CollisionRequest;
/// @{
/// @brief A class for rectangle sphere-swept bounding volume
class RSS
class HPP_FCL_DLLAPI RSS
{
public:
/// @brief Orientation of RSS. axis[i] is the ith column of the orientation matrix for the RSS; it is also the i-th principle direction of the RSS.
......@@ -148,16 +148,16 @@ public:
/// @brief distance between two RSS bounding volumes
/// P and Q (optional return values) are the closest points in the rectangles, not the RSS. But the direction P - Q is the correct direction for cloest points
/// Notice that P and Q are both in the local frame of the first RSS (not global frame and not even the local frame of object 1)
FCL_REAL distance(const Matrix3f& R0, const Vec3f& T0, const RSS& b1, const RSS& b2, Vec3f* P = NULL, Vec3f* Q = NULL);
FCL_REAL distance(const Matrix3f& R0, const Vec3f& T0, const RSS& b1, const RSS& b2, Vec3f* P = NULL, Vec3f* Q = NULL) HPP_FCL_DLLAPI;
/// @brief Check collision between two RSSs, b1 is in configuration (R0, T0) and b2 is in identity.
bool overlap(const Matrix3f& R0, const Vec3f& T0, const RSS& b1, const RSS& b2);
bool overlap(const Matrix3f& R0, const Vec3f& T0, const RSS& b1, const RSS& b2) HPP_FCL_DLLAPI;
/// @brief Check collision between two RSSs, b1 is in configuration (R0, T0) and b2 is in identity.
bool overlap(const Matrix3f& R0, const Vec3f& T0, const RSS& b1, const RSS& b2,
const CollisionRequest& request,
FCL_REAL& sqrDistLowerBound);
FCL_REAL& sqrDistLowerBound) HPP_FCL_DLLAPI;
}
......
......@@ -86,7 +86,7 @@ struct CollisionRequest;
/// (-1, 1, -1) and (1, -1, 1) --> indices 10 and 22
/// (1, -1, -1) and (-1, 1, 1) --> indices 11 and 23
template<short N>
class KDOP
class HPP_FCL_DLLAPI KDOP
{
private:
/// @brief Origin's distances to N KDOP planes
......@@ -198,7 +198,7 @@ bool overlap(const Matrix3f& /*R0*/, const Vec3f& /*T0*/,
/// @brief translate the KDOP BV
template<short N>
KDOP<N> translate(const KDOP<N>& bv, const Vec3f& t);
KDOP<N> translate(const KDOP<N>& bv, const Vec3f& t) HPP_FCL_DLLAPI;
}
......
......@@ -52,10 +52,10 @@ struct CollisionRequest;
/// @{
/// @brief A class describing the kIOS collision structure, which is a set of spheres.
class kIOS
class HPP_FCL_DLLAPI kIOS
{
/// @brief One sphere in kIOS
struct kIOS_Sphere
struct HPP_FCL_DLLAPI kIOS_Sphere
{
Vec3f o;
FCL_REAL r;
......@@ -147,21 +147,21 @@ public:
/// @brief Translate the kIOS BV
kIOS translate(const kIOS& bv, const Vec3f& t);
kIOS translate(const kIOS& bv, const Vec3f& t) HPP_FCL_DLLAPI;
/// @brief Check collision between two kIOSs, b1 is in configuration (R0, T0) and b2 is in identity.
/// @todo Not efficient
bool overlap(const Matrix3f& R0, const Vec3f& T0, const kIOS& b1, const kIOS& b2);
bool overlap(const Matrix3f& R0, const Vec3f& T0, const kIOS& b1, const kIOS& b2) HPP_FCL_DLLAPI;
/// @brief Check collision between two kIOSs, b1 is in configuration (R0, T0) and b2 is in identity.
/// @todo Not efficient
bool overlap(const Matrix3f& R0, const Vec3f& T0, const kIOS& b1, const kIOS& b2,
const CollisionRequest& request,
FCL_REAL& sqrDistLowerBound);
FCL_REAL& sqrDistLowerBound) HPP_FCL_DLLAPI;
/// @brief Approximate distance between two kIOS bounding volumes
/// @todo P and Q is not returned, need implementation
FCL_REAL distance(const Matrix3f& R0, const Vec3f& T0, const kIOS& b1, const kIOS& b2, Vec3f* P = NULL, Vec3f* Q = NULL);
FCL_REAL distance(const Matrix3f& R0, const Vec3f& T0, const kIOS& b1, const kIOS& b2, Vec3f* P = NULL, Vec3f* Q = NULL) HPP_FCL_DLLAPI;
}
......
......@@ -41,6 +41,8 @@
#include <list>
#include <hpp/fcl/config.hh>
namespace hpp
{
namespace fcl
......@@ -50,7 +52,7 @@ namespace fcl
/// Front list is a set of internal and leaf nodes in the BVTT hierarchy, where
/// the traversal terminates while performing a query during a given time instance. The front list reflects the subset of a
/// BVTT that is traversed for that particular proximity query.
struct BVHFrontNode
struct HPP_FCL_DLLAPI BVHFrontNode
{
/// @brief The nodes to start in the future, i.e. the wave front of the traversal tree.
int left, right;
......
......@@ -59,7 +59,7 @@ template <typename BV> class BVFitter;
template <typename BV> class BVSplitter;
/// @brief A base class describing the bounding hierarchy of a mesh model or a point cloud model (which is viewed as a degraded version of mesh)
class BVHModelBase : public CollisionGeometry
class HPP_FCL_DLLAPI BVHModelBase : public CollisionGeometry
{
public:
/// @brief Geometry point data
......@@ -266,7 +266,7 @@ protected:
/// @brief A class describing the bounding hierarchy of a mesh model or a point cloud model (which is viewed as a degraded version of mesh)
/// \tparam BV one of the bounding volume class in \ref Bounding_Volume.
template<typename BV>
class BVHModel : public BVHModelBase
class HPP_FCL_DLLAPI BVHModel : public BVHModelBase
{
public:
......
......@@ -49,22 +49,22 @@ namespace fcl
/// @brief Extract the part of the BVHModel that is inside an AABB.
/// A triangle in collision with the AABB is considered inside.
template<typename BV>
BVHModel<BV>* BVHExtract(const BVHModel<BV>& model, const Transform3f& pose, const AABB& aabb);
BVHModel<BV>* BVHExtract(const BVHModel<BV>& model, const Transform3f& pose, const AABB& aabb) HPP_FCL_DLLAPI;
/// @brief Compute the covariance matrix for a set or subset of points. if ts = null, then indices refer to points directly; otherwise refer to triangles
void getCovariance(Vec3f* ps, Vec3f* ps2, Triangle* ts, unsigned int* indices, int n, Matrix3f& M);
void getCovariance(Vec3f* ps, Vec3f* ps2, Triangle* ts, unsigned int* indices, int n, Matrix3f& M) HPP_FCL_DLLAPI;
/// @brief Compute the RSS bounding volume parameters: radius, rectangle size and the origin, given the BV axises.
void getRadiusAndOriginAndRectangleSize(Vec3f* ps, Vec3f* ps2, Triangle* ts, unsigned int* indices, int n, const Matrix3f& axes, Vec3f& origin, FCL_REAL l[2], FCL_REAL& r);
void getRadiusAndOriginAndRectangleSize(Vec3f* ps, Vec3f* ps2, Triangle* ts, unsigned int* indices, int n, const Matrix3f& axes, Vec3f& origin, FCL_REAL l[2], FCL_REAL& r) HPP_FCL_DLLAPI;
/// @brief Compute the bounding volume extent and center for a set or subset of points, given the BV axises.
void getExtentAndCenter(Vec3f* ps, Vec3f* ps2, Triangle* ts, unsigned int* indices, int n, Matrix3f& axes, Vec3f& center, Vec3f& extent);
void getExtentAndCenter(Vec3f* ps, Vec3f* ps2, Triangle* ts, unsigned int* indices, int n, Matrix3f& axes, Vec3f& center, Vec3f& extent) HPP_FCL_DLLAPI;
/// @brief Compute the center and radius for a triangle's circumcircle
void circumCircleComputation(const Vec3f& a, const Vec3f& b, const Vec3f& c, Vec3f& center, FCL_REAL& radius);
void circumCircleComputation(const Vec3f& a, const Vec3f& b, const Vec3f& c, Vec3f& center, FCL_REAL& radius) HPP_FCL_DLLAPI;
/// @brief Compute the maximum distance from a given center point to a point cloud
FCL_REAL maximumDistance(Vec3f* ps, Vec3f* ps2, Triangle* ts, unsigned int* indices, int n, const Vec3f& query);
FCL_REAL maximumDistance(Vec3f* ps, Vec3f* ps2, Triangle* ts, unsigned int* indices, int n, const Vec3f& query) HPP_FCL_DLLAPI;
}
......
......@@ -53,12 +53,12 @@ namespace fcl
/// performs the collision between them.
/// Return value is the number of contacts generated between the two objects.
std::size_t collide(const CollisionObject* o1, const CollisionObject* o2,
const CollisionRequest& request, CollisionResult& result);
const CollisionRequest& request, CollisionResult& result) HPP_FCL_DLLAPI;
/// @copydoc collide(const CollisionObject*, const CollisionObject*, const CollisionRequest&, CollisionResult&)
std::size_t collide(const CollisionGeometry* o1, const Transform3f& tf1,
const CollisionGeometry* o2, const Transform3f& tf2,
const CollisionRequest& request, CollisionResult& result);
const CollisionRequest& request, CollisionResult& result) HPP_FCL_DLLAPI;
/// @copydoc collide(const CollisionObject*, const CollisionObject*, const CollisionRequest&, CollisionResult&)
/// \note this function update the initial guess of \c request if requested.
......
......@@ -56,7 +56,7 @@ namespace fcl
const int GST_INDEP HPP_FCL_DEPRECATED = 0;
/// @brief Contact information returned by collision
struct Contact
struct HPP_FCL_DLLAPI Contact
{
/// @brief collision object 1
const CollisionGeometry* o1;
......@@ -139,7 +139,7 @@ struct Contact
struct QueryResult;
/// @brief base class for all query requests
struct QueryRequest
struct HPP_FCL_DLLAPI QueryRequest
{
/// @brief whether enable gjk intial guess
bool enable_cached_gjk_guess;
......@@ -160,7 +160,7 @@ struct QueryRequest
};
/// @brief base class for all query results
struct QueryResult
struct HPP_FCL_DLLAPI QueryResult
{
/// @brief stores the last GJK ray when relevant.
Vec3f cached_gjk_guess;
......@@ -188,7 +188,7 @@ enum CollisionRequestFlag
};
/// @brief request to the collision algorithm
struct CollisionRequest : QueryRequest
struct HPP_FCL_DLLAPI CollisionRequest : QueryRequest
{
/// @brief The maximum number of contacts will return
size_t num_max_contacts;
......@@ -237,7 +237,7 @@ struct CollisionRequest : QueryRequest
};
/// @brief collision result
struct CollisionResult : QueryResult
struct HPP_FCL_DLLAPI CollisionResult : QueryResult
{
private:
/// @brief contact information
......@@ -321,7 +321,7 @@ public:
struct DistanceResult;
/// @brief request to the distance computation
struct DistanceRequest : QueryRequest
struct HPP_FCL_DLLAPI DistanceRequest : QueryRequest
{
/// @brief whether to return the nearest points
bool enable_nearest_points;
......@@ -357,7 +357,7 @@ struct DistanceRequest : QueryRequest
};
/// @brief distance result
struct DistanceResult : QueryResult
struct HPP_FCL_DLLAPI DistanceResult : QueryResult
{
public:
......
......@@ -51,7 +51,7 @@ namespace fcl
/// @brief collision matrix stores the functions for collision between different types of objects and provides a uniform call interface
struct CollisionFunctionMatrix
struct HPP_FCL_DLLAPI CollisionFunctionMatrix
{
/// @brief the uniform call interface for collision: for collision, we need know
/// 1. two objects o1 and o2 and their configuration in world coordinate tf1 and tf2;
......
......@@ -60,7 +60,7 @@ enum NODE_TYPE {BV_UNKNOWN, BV_AABB, BV_OBB, BV_RSS, BV_kIOS, BV_OBBRSS, BV_KDOP
/// @{
/// @brief The geometry for the object for collision or distance computation
class CollisionGeometry
class HPP_FCL_DLLAPI CollisionGeometry
{
public:
CollisionGeometry() : cost_density(1),
......@@ -154,7 +154,7 @@ public:
};
/// @brief the object for collision or distance computation, contains the geometry and the transform information
class CollisionObject
class HPP_FCL_DLLAPI CollisionObject
{
public:
CollisionObject(const boost::shared_ptr<CollisionGeometry> &cgeom_) :
......
......@@ -23,7 +23,7 @@ namespace hpp
{
namespace fcl
{
CollisionGeometry* extract(const CollisionGeometry* model, const Transform3f& pose, const AABB& aabb);
CollisionGeometry* extract(const CollisionGeometry* model, const Transform3f& pose, const AABB& aabb) HPP_FCL_DLLAPI;
}
} // namespace hpp
......
......@@ -44,6 +44,7 @@
#include <Eigen/Core>
#include <Eigen/Geometry>
#include <hpp/fcl/config.hh>
namespace hpp
{
......@@ -75,7 +76,7 @@ typedef Eigen::Matrix<FCL_REAL, 3, 3> Matrix3f;
typedef Eigen::Vector2i support_func_guess_t;
/// @brief Triangle with 3 indices for points
class Triangle
class HPP_FCL_DLLAPI Triangle
{
public:
typedef std::size_t index_type;
......
......@@ -48,12 +48,12 @@ namespace fcl
/// @brief Main distance interface: given two collision objects, and the requirements for contacts, including whether return the nearest points, this function performs the distance between them.
/// Return value is the minimum distance generated between the two objects.
FCL_REAL distance(const CollisionObject* o1, const CollisionObject* o2, const DistanceRequest& request, DistanceResult& result);
FCL_REAL distance(const CollisionObject* o1, const CollisionObject* o2, const DistanceRequest& request, DistanceResult& result) HPP_FCL_DLLAPI;
/// @copydoc distance(const CollisionObject*, const CollisionObject*, const DistanceRequest&, DistanceResult&)
FCL_REAL distance(const CollisionGeometry* o1, const Transform3f& tf1,
const CollisionGeometry* o2, const Transform3f& tf2,
const DistanceRequest& request, DistanceResult& result);
const DistanceRequest& request, DistanceResult& result) HPP_FCL_DLLAPI;
/// @copydoc distance(const CollisionObject*, const CollisionObject*, const DistanceRequest&, DistanceResult&)
/// \note this function update the initial guess of \c request if requested.
......
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