From 3fa6789ee46171d30bcce44c512b9773069bd89e Mon Sep 17 00:00:00 2001
From: Lucile Remigy <lucile.remigy@epitech.eu>
Date: Fri, 27 Sep 2019 13:49:58 +0200
Subject: [PATCH] fusion data_types.h and types.h

---
 include/hpp/fcl/BV/AABB.h                |  2 +-
 include/hpp/fcl/BV/BV_node.h             |  2 +-
 include/hpp/fcl/BV/OBB.h                 |  2 +-
 include/hpp/fcl/BV/RSS.h                 |  2 +-
 include/hpp/fcl/BV/kDOP.h                |  2 +-
 include/hpp/fcl/collision.h              |  2 +-
 include/hpp/fcl/collision_data.h         |  2 +-
 include/hpp/fcl/data_types.h             | 30 ++++++++++++++++++++++
 include/hpp/fcl/math/transform.h         |  2 +-
 include/hpp/fcl/math/types.h             | 32 +++---------------------
 include/hpp/fcl/mesh_loader/loader.h     |  2 +-
 include/hpp/fcl/shape/geometric_shapes.h |  2 +-
 test/math.cpp                            |  2 +-
 13 files changed, 44 insertions(+), 40 deletions(-)

diff --git a/include/hpp/fcl/BV/AABB.h b/include/hpp/fcl/BV/AABB.h
index 05859d25..e67ae4bf 100644
--- a/include/hpp/fcl/BV/AABB.h
+++ b/include/hpp/fcl/BV/AABB.h
@@ -39,7 +39,7 @@
 #define HPP_FCL_AABB_H
 
 #include <stdexcept>
-#include <hpp/fcl/math/types.h>
+#include <hpp/fcl/data_types.h>
 
 namespace hpp
 {
diff --git a/include/hpp/fcl/BV/BV_node.h b/include/hpp/fcl/BV/BV_node.h
index 08dbbf8b..e7fc6374 100644
--- a/include/hpp/fcl/BV/BV_node.h
+++ b/include/hpp/fcl/BV/BV_node.h
@@ -39,7 +39,7 @@
 #ifndef HPP_FCL_BV_NODE_H
 #define HPP_FCL_BV_NODE_H
 
-#include <hpp/fcl/math/types.h>
+#include <hpp/fcl/data_types.h>
 
 #include <hpp/fcl/BV/BV.h>
 #include <iostream>
diff --git a/include/hpp/fcl/BV/OBB.h b/include/hpp/fcl/BV/OBB.h
index 3b1cb3f5..c359e315 100644
--- a/include/hpp/fcl/BV/OBB.h
+++ b/include/hpp/fcl/BV/OBB.h
@@ -38,7 +38,7 @@
 #ifndef HPP_FCL_OBB_H
 #define HPP_FCL_OBB_H
 
-#include <hpp/fcl/math/types.h>
+#include <hpp/fcl/data_types.h>
 
 namespace hpp
 {
diff --git a/include/hpp/fcl/BV/RSS.h b/include/hpp/fcl/BV/RSS.h
index e158d5cc..5a00e4b6 100644
--- a/include/hpp/fcl/BV/RSS.h
+++ b/include/hpp/fcl/BV/RSS.h
@@ -39,7 +39,7 @@
 #define HPP_FCL_RSS_H
 
 #include <stdexcept>
-#include <hpp/fcl/math/types.h>
+#include <hpp/fcl/data_types.h>
 #include <boost/math/constants/constants.hpp>
 
 namespace hpp
diff --git a/include/hpp/fcl/BV/kDOP.h b/include/hpp/fcl/BV/kDOP.h
index 00af0f81..61e43d90 100644
--- a/include/hpp/fcl/BV/kDOP.h
+++ b/include/hpp/fcl/BV/kDOP.h
@@ -39,7 +39,7 @@
 #define HPP_FCL_KDOP_H
 
 #include <stdexcept>
-#include <hpp/fcl/math/types.h>
+#include <hpp/fcl/data_types.h>
 
 namespace hpp
 {
diff --git a/include/hpp/fcl/collision.h b/include/hpp/fcl/collision.h
index 700e3234..cc68c88b 100644
--- a/include/hpp/fcl/collision.h
+++ b/include/hpp/fcl/collision.h
@@ -39,7 +39,7 @@
 #ifndef HPP_FCL_COLLISION_H
 #define HPP_FCL_COLLISION_H
 
-#include <hpp/fcl/math/types.h>
+#include <hpp/fcl/data_types.h>
 #include <hpp/fcl/collision_object.h>
 #include <hpp/fcl/collision_data.h>
 
diff --git a/include/hpp/fcl/collision_data.h b/include/hpp/fcl/collision_data.h
index ded18050..d6278c2e 100644
--- a/include/hpp/fcl/collision_data.h
+++ b/include/hpp/fcl/collision_data.h
@@ -41,7 +41,7 @@
 
 #include <hpp/fcl/collision_object.h>
 
-#include <hpp/fcl/math/types.h>
+#include <hpp/fcl/data_types.h>
 #include <vector>
 #include <set>
 #include <limits>
diff --git a/include/hpp/fcl/data_types.h b/include/hpp/fcl/data_types.h
index fb234d91..dbaa684e 100644
--- a/include/hpp/fcl/data_types.h
+++ b/include/hpp/fcl/data_types.h
@@ -41,6 +41,9 @@
 #include <cstddef>
 #include <boost/cstdint.hpp>
 
+#include <Eigen/Core>
+#include <Eigen/Geometry>
+
 namespace hpp
 {
 namespace fcl
@@ -84,4 +87,31 @@ public:
 
 } // namespace hpp
 
+namespace hpp
+{
+
+#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 && \
+    OCTOMAP_PATCH_VERSION >= z))))
+
+  #define OCTOMAP_VERSION_AT_MOST(x,y,z) \
+    (OCTOMAP_MAJOR_VERSION < x || (OCTOMAP_MAJOR_VERSION <= x && \
+    (OCTOMAP_MINOR_VERSION < y || (OCTOMAP_MINOR_VERSION <= y && \
+    OCTOMAP_PATCH_VERSION <= z))))
+#endif // HPP_FCL_HAVE_OCTOMAP
+}
+
+namespace hpp
+{
+namespace fcl 
+{
+  typedef Eigen::Matrix<FCL_REAL, 3, 1> Vec3f;
+  typedef Eigen::Matrix<FCL_REAL, 3, 3> Matrix3f;
+
+}
+} // namespace hpp
+
+
 #endif
diff --git a/include/hpp/fcl/math/transform.h b/include/hpp/fcl/math/transform.h
index c51d5057..7abdb7e7 100644
--- a/include/hpp/fcl/math/transform.h
+++ b/include/hpp/fcl/math/transform.h
@@ -39,7 +39,7 @@
 #ifndef HPP_FCL_TRANSFORM_H
 #define HPP_FCL_TRANSFORM_H
 
-#include <hpp/fcl/math/types.h>
+#include <hpp/fcl/data_types.h>
 #include <boost/thread/mutex.hpp>
 
 namespace hpp
diff --git a/include/hpp/fcl/math/types.h b/include/hpp/fcl/math/types.h
index a60b25a7..ec431e7a 100644
--- a/include/hpp/fcl/math/types.h
+++ b/include/hpp/fcl/math/types.h
@@ -38,35 +38,9 @@
 #ifndef HPP_FCL_MATH_TYPES_H
 #define HPP_FCL_MATH_TYPES_H
 
-#include <hpp/fcl/data_types.h>
+# warning "This file is deprecated. Include <hpp/fcl/data_types.h> instead."
 
-#include <Eigen/Core>
-#include <Eigen/Geometry>
-
-namespace hpp
-{
-
-#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 && \
-    OCTOMAP_PATCH_VERSION >= z))))
-
-  #define OCTOMAP_VERSION_AT_MOST(x,y,z) \
-    (OCTOMAP_MAJOR_VERSION < x || (OCTOMAP_MAJOR_VERSION <= x && \
-    (OCTOMAP_MINOR_VERSION < y || (OCTOMAP_MINOR_VERSION <= y && \
-    OCTOMAP_PATCH_VERSION <= z))))
-#endif // HPP_FCL_HAVE_OCTOMAP
-}
-
-namespace hpp
-{
-namespace fcl 
-{
-  typedef Eigen::Matrix<FCL_REAL, 3, 1> Vec3f;
-  typedef Eigen::Matrix<FCL_REAL, 3, 3> Matrix3f;
-
-}
-} // namespace hpp
+// List of equivalent includes.
+# include <hpp/fcl/data_types.h>
 
 #endif
\ No newline at end of file
diff --git a/include/hpp/fcl/mesh_loader/loader.h b/include/hpp/fcl/mesh_loader/loader.h
index 4739b753..43d4c703 100644
--- a/include/hpp/fcl/mesh_loader/loader.h
+++ b/include/hpp/fcl/mesh_loader/loader.h
@@ -40,7 +40,7 @@
 #include <boost/shared_ptr.hpp>
 #include <hpp/fcl/fwd.hh>
 #include <hpp/fcl/config.hh>
-#include <hpp/fcl/math/types.h>
+#include <hpp/fcl/data_types.h>
 #include <hpp/fcl/collision_object.h>
 
 namespace hpp
diff --git a/include/hpp/fcl/shape/geometric_shapes.h b/include/hpp/fcl/shape/geometric_shapes.h
index 7d00796f..3c37dc63 100644
--- a/include/hpp/fcl/shape/geometric_shapes.h
+++ b/include/hpp/fcl/shape/geometric_shapes.h
@@ -42,7 +42,7 @@
 #include <boost/math/constants/constants.hpp>
 
 #include <hpp/fcl/collision_object.h>
-#include <hpp/fcl/math/types.h>
+#include <hpp/fcl/data_types.h>
 #include <string.h>
 
 namespace hpp
diff --git a/test/math.cpp b/test/math.cpp
index 33845b0a..fb872745 100644
--- a/test/math.cpp
+++ b/test/math.cpp
@@ -39,7 +39,7 @@
 #include <boost/test/unit_test.hpp>
 #include <boost/utility/binary.hpp>
 
-#include <hpp/fcl/math/types.h>
+#include <hpp/fcl/data_types.h>
 #include <hpp/fcl/math/transform.h>
 
 #include <hpp/fcl/intersect.h>
-- 
GitLab