diff --git a/CMakeLists.txt b/CMakeLists.txt index 1037f4f6f79aea31f79c6322cf8b4fe6ff29d933..7ae56c0658418327833fc23e67b97b4be9a724ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,10 +76,10 @@ search_for_boost() # Optional dependencies add_optional_dependency("octomap >= 1.6") if (OCTOMAP_INCLUDE_DIRS AND OCTOMAP_LIBRARY_DIRS) - include_directories(${OCTOMAP_INCLUDE_DIRS}) - link_directories(${OCTOMAP_LIBRARY_DIRS}) - SET(FCL_HAVE_OCTOMAP TRUE) - add_definitions (-DFCL_HAVE_OCTOMAP) + include_directories(${OCTOMAP_INCLUDE_DIRS}) + link_directories(${OCTOMAP_LIBRARY_DIRS}) + SET(HPP_FCL_HAVE_OCTOMAP TRUE) + add_definitions (-DHPP_FCL_HAVE_OCTOMAP) string(REPLACE "." ";" VERSION_LIST ${OCTOMAP_VERSION}) list(GET VERSION_LIST 0 OCTOMAP_MAJOR_VERSION) list(GET VERSION_LIST 1 OCTOMAP_MINOR_VERSION) @@ -87,20 +87,20 @@ if (OCTOMAP_INCLUDE_DIRS AND OCTOMAP_LIBRARY_DIRS) add_definitions (-DOCTOMAP_MAJOR_VERSION=${OCTOMAP_MAJOR_VERSION} -DOCTOMAP_MINOR_VERSION=${OCTOMAP_MINOR_VERSION} -DOCTOMAP_PATCH_VERSION=${OCTOMAP_PATCH_VERSION}) - message(STATUS "FCL uses Octomap") + message(STATUS "FCL uses Octomap") else() - SET(FCL_HAVE_OCTOMAP FALSE) - message(STATUS "FCL does not use Octomap") + SET(HPP_FCL_HAVE_OCTOMAP FALSE) + message(STATUS "FCL does not use Octomap") endif() ADD_REQUIRED_DEPENDENCY("assimp >= 2.0") if(ASSIMP_FOUND) if (NOT ${ASSIMP_VERSION} VERSION_LESS "2.0.1150") - add_definitions(-DFCL_USE_ASSIMP_UNIFIED_HEADER_NAMES) - SET(WITH_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES TRUE) + add_definitions(-DHPP_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES) + SET(HPP_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES TRUE) message(STATUS "Assimp version has unified headers") else() - SET(WITH_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES FALSE) + SET(HPP_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES FALSE) message(STATUS "Assimp version does not have unified headers") endif() endif() @@ -162,12 +162,14 @@ endif () pkg_config_append_libs("hpp-fcl") PKG_CONFIG_APPEND_BOOST_LIBS(thread date_time filesystem system) -IF(WITH_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES) - PKG_CONFIG_APPEND_CFLAGS("-DFCL_USE_ASSIMP_UNIFIED_HEADER_NAMES") -ENDIF(WITH_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES) -IF(FCL_HAVE_OCTOMAP) +IF(HPP_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES) + #Â FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES kept for backard compatibility reasons. + PKG_CONFIG_APPEND_CFLAGS("-DFCL_USE_ASSIMP_UNIFIED_HEADER_NAMES -DHPP_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES") +ENDIF(HPP_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES) +IF(HPP_FCL_HAVE_OCTOMAP) + #Â FCL_HAVE_OCTOMAP kept for backward compatibility reasons. PKG_CONFIG_APPEND_CFLAGS( - "-DFCL_HAVE_OCTOMAP -DOCTOMAP_MAJOR_VERSION=${OCTOMAP_MAJOR_VERSION} -DOCTOMAP_MINOR_VERSION=${OCTOMAP_MINOR_VERSION} -DOCTOMAP_PATCH_VERSION=${OCTOMAP_PATCH_VERSION}") -ENDIF(FCL_HAVE_OCTOMAP) + "-DHPP_FCL_HAVE_OCTOMAP -DFCL_HAVE_OCTOMAP -DOCTOMAP_MAJOR_VERSION=${OCTOMAP_MAJOR_VERSION} -DOCTOMAP_MINOR_VERSION=${OCTOMAP_MINOR_VERSION} -DOCTOMAP_PATCH_VERSION=${OCTOMAP_PATCH_VERSION}") +ENDIF(HPP_FCL_HAVE_OCTOMAP) setup_project_finalize() diff --git a/include/hpp/fcl/math/vec_3f.h b/include/hpp/fcl/math/vec_3f.h index ede7b01705adf09f0fdd49f5046a008143282468..b7fcef9db0947c75d0324e7fc3a0ab846ded248c 100644 --- a/include/hpp/fcl/math/vec_3f.h +++ b/include/hpp/fcl/math/vec_3f.h @@ -57,7 +57,7 @@ namespace fcl } -#ifdef FCL_HAVE_OCTOMAP +#ifdef HPP_FCL_HAVE_OCTOMAP #define OCTOMAP_VERSION_AT_LEAST(x,y,z) \ (OCTOMAP_MAJOR_VERSION > x || (OCTOMAP_MAJOR_VERSION >= x && \ (OCTOMAP_MINOR_VERSION > y || (OCTOMAP_MINOR_VERSION >= y && \ @@ -67,7 +67,7 @@ namespace fcl (OCTOMAP_MAJOR_VERSION < x || (OCTOMAP_MAJOR_VERSION <= x && \ (OCTOMAP_MINOR_VERSION < y || (OCTOMAP_MINOR_VERSION <= y && \ OCTOMAP_PATCH_VERSION <= z)))) -#endif // FCL_HAVE_OCTOMAP +#endif // HPP_FCL_HAVE_OCTOMAP } // namespace hpp diff --git a/include/hpp/fcl/mesh_loader/assimp.h b/include/hpp/fcl/mesh_loader/assimp.h index 12f6a631be3fa87e698bfb303727d25cd33d5993..8f0bce65999f345aa8e76a5e73d635332e0ca02c 100644 --- a/include/hpp/fcl/mesh_loader/assimp.h +++ b/include/hpp/fcl/mesh_loader/assimp.h @@ -37,7 +37,7 @@ #ifndef HPP_FCL_MESH_LOADER_ASSIMP_H #define HPP_FCL_MESH_LOADER_ASSIMP_H -#ifdef FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES +#ifdef HPP_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES #include <assimp/DefaultLogger.hpp> #include <assimp/IOStream.hpp> #include <assimp/IOSystem.hpp> @@ -166,7 +166,7 @@ inline void buildMesh (const fcl::Vec3f & scale, aiFace& face = input_mesh->mFaces[j]; if (face.mNumIndices != 3) { std::stringstream ss; -#ifdef FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES +#ifdef HPP_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES ss << "Mesh " << input_mesh->mName.C_Str() << " has a face with " << face.mNumIndices << " vertices. This is not supported\n"; ss << "Node name is: " << node->mName.C_Str() << "\n"; diff --git a/include/hpp/fcl/traversal/traversal_node_setup.h b/include/hpp/fcl/traversal/traversal_node_setup.h index b58ea4572b2debf0266eb63a87f2e712d1b60853..041b3fa68731525070797d48661ee7cde48d35b5 100644 --- a/include/hpp/fcl/traversal/traversal_node_setup.h +++ b/include/hpp/fcl/traversal/traversal_node_setup.h @@ -43,7 +43,7 @@ #include <hpp/fcl/traversal/traversal_node_shapes.h> #include <hpp/fcl/traversal/traversal_node_bvh_shape.h> -#ifdef FCL_HAVE_OCTOMAP +#ifdef HPP_FCL_HAVE_OCTOMAP #include <hpp/fcl/traversal/traversal_node_octree.h> #endif @@ -54,7 +54,7 @@ namespace hpp namespace fcl { -#ifdef FCL_HAVE_OCTOMAP +#ifdef HPP_FCL_HAVE_OCTOMAP /// @brief Initialize traversal node for collision between two octrees, given current object transform template<typename NarrowPhaseSolver> bool initialize(OcTreeCollisionTraversalNode<NarrowPhaseSolver>& node, diff --git a/src/collision_func_matrix.cpp b/src/collision_func_matrix.cpp index 68a3120b19887b938fdaaa00c3b9cd0cfa25c9ea..7a7a6fba92c6456fe8385bde4c08a6047053b7d7 100644 --- a/src/collision_func_matrix.cpp +++ b/src/collision_func_matrix.cpp @@ -48,7 +48,7 @@ namespace hpp namespace fcl { -#ifdef FCL_HAVE_OCTOMAP +#ifdef HPP_FCL_HAVE_OCTOMAP template<typename T_SH, typename NarrowPhaseSolver> std::size_t ShapeOcTreeCollide(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const NarrowPhaseSolver* nsolver, @@ -505,7 +505,7 @@ CollisionFunctionMatrix<NarrowPhaseSolver>::CollisionFunctionMatrix() collision_matrix[BV_kIOS][BV_kIOS] = &BVHCollide<kIOS, NarrowPhaseSolver>; collision_matrix[BV_OBBRSS][BV_OBBRSS] = &BVHCollide<OBBRSS, NarrowPhaseSolver>; -#ifdef FCL_HAVE_OCTOMAP +#ifdef HPP_FCL_HAVE_OCTOMAP collision_matrix[GEOM_OCTREE][GEOM_BOX] = &OcTreeShapeCollide<Box, NarrowPhaseSolver>; collision_matrix[GEOM_OCTREE][GEOM_SPHERE] = &OcTreeShapeCollide<Sphere, NarrowPhaseSolver>; collision_matrix[GEOM_OCTREE][GEOM_CAPSULE] = &OcTreeShapeCollide<Capsule, NarrowPhaseSolver>; diff --git a/src/distance_func_matrix.cpp b/src/distance_func_matrix.cpp index 3b31a59c9b5f6c05cf85efbbe5fc97cd71c35de9..c83148c07e5bc412692f9eef213e3f9391d78c3b 100644 --- a/src/distance_func_matrix.cpp +++ b/src/distance_func_matrix.cpp @@ -46,7 +46,7 @@ namespace hpp namespace fcl { -#ifdef FCL_HAVE_OCTOMAP +#ifdef HPP_FCL_HAVE_OCTOMAP template<typename T_SH, typename NarrowPhaseSolver> FCL_REAL ShapeOcTreeDistance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const NarrowPhaseSolver* nsolver, const DistanceRequest& request, DistanceResult& result) @@ -452,7 +452,7 @@ DistanceFunctionMatrix<NarrowPhaseSolver>::DistanceFunctionMatrix() distance_matrix[BV_kIOS][BV_kIOS] = &BVHDistance<kIOS, NarrowPhaseSolver>; distance_matrix[BV_OBBRSS][BV_OBBRSS] = &BVHDistance<OBBRSS, NarrowPhaseSolver>; -#ifdef FCL_HAVE_OCTOMAP +#ifdef HPP_FCL_HAVE_OCTOMAP distance_matrix[GEOM_OCTREE][GEOM_BOX] = &OcTreeShapeDistance<Box, NarrowPhaseSolver>; distance_matrix[GEOM_OCTREE][GEOM_SPHERE] = &OcTreeShapeDistance<Sphere, NarrowPhaseSolver>; distance_matrix[GEOM_OCTREE][GEOM_CAPSULE] = &OcTreeShapeDistance<Capsule, NarrowPhaseSolver>;