From cfdb3136b02b4d62c8729cb2483903f77c7c5817 Mon Sep 17 00:00:00 2001
From: Lucile Remigy <lucile.remigy@epitech.eu>
Date: Wed, 25 Sep 2019 17:02:40 +0200
Subject: [PATCH] modif leaftesting-> leafcollides or leafcomputedistance, 0
 tests failed

---
 src/traversal/traversal_node_base.h      |  4 +--
 src/traversal/traversal_node_bvh_shape.h | 34 ++++++++++++------------
 src/traversal/traversal_node_bvhs.cpp    | 14 +++++-----
 src/traversal/traversal_node_bvhs.h      | 10 +++----
 src/traversal/traversal_node_octree.h    | 20 +++++++-------
 src/traversal/traversal_node_shapes.h    |  4 +--
 src/traversal/traversal_recurse.cpp      |  8 +++---
 7 files changed, 47 insertions(+), 47 deletions(-)

diff --git a/src/traversal/traversal_node_base.h b/src/traversal/traversal_node_base.h
index ebf1ac75..2e541959 100644
--- a/src/traversal/traversal_node_base.h
+++ b/src/traversal/traversal_node_base.h
@@ -107,7 +107,7 @@ public:
   virtual bool BVDisjoints(int b1, int b2, FCL_REAL& sqrDistLowerBound) const = 0;
 
   /// @brief Leaf test between node b1 and b2, if they are both leafs
-  virtual void leafTesting(int /*b1*/, int /*b2*/, FCL_REAL& /*sqrDistLowerBound*/) const
+  virtual void leafCollides(int /*b1*/, int /*b2*/, FCL_REAL& /*sqrDistLowerBound*/) const
   {
     throw std::runtime_error ("Not implemented");
   }
@@ -142,7 +142,7 @@ public:
   virtual FCL_REAL BVDistanceLowerBound(int b1, int b2) const;
 
   /// @brief Leaf test between node b1 and b2, if they are both leafs
-  virtual void leafTesting(int b1, int b2) const = 0;
+  virtual void leafComputeDistance(int b1, int b2) const = 0;
 
   /// @brief Check whether the traversal can stop
   virtual bool canStop(FCL_REAL c) const;
diff --git a/src/traversal/traversal_node_bvh_shape.h b/src/traversal/traversal_node_bvh_shape.h
index c516ac33..2ed8460b 100644
--- a/src/traversal/traversal_node_bvh_shape.h
+++ b/src/traversal/traversal_node_bvh_shape.h
@@ -195,7 +195,7 @@ public:
   }
 
   /// @brief Intersection testing between leaves (one triangle and one shape)
-  void leafTesting(int b1, int /*b2*/, FCL_REAL& sqrDistLowerBound) const
+  void leafCollides(int b1, int /*b2*/, FCL_REAL& sqrDistLowerBound) const
   {
     if(this->enable_statistics) this->num_leaf_tests++;
     const BVNode<BV>& node = this->model1->getBV(b1);
@@ -355,7 +355,7 @@ public:
   }
 
   /// @brief Intersection testing between leaves (one shape and one triangle)
-  void leafTesting(int /*b1*/, int b2, FCL_REAL& sqrDistLowerBound) const
+  void leafCollides(int /*b1*/, int b2, FCL_REAL& sqrDistLowerBound) const
   {
     if(this->enable_statistics) this->num_leaf_tests++;
     const BVNode<BV>& node = this->model2->getBV(b2);
@@ -573,7 +573,7 @@ public:
   }
 
   /// @brief Distance testing between leaves (one triangle and one shape)
-  void leafTesting(int b1, int /*b2*/) const
+  void leafComputeDistance(int b1, int /*b2*/) const
   {
     if(this->enable_statistics) this->num_leaf_tests++;
     
@@ -620,7 +620,7 @@ namespace details
 {
 
 template<typename BV, typename S, typename GJKSolver>
-void meshShapeDistanceOrientedNodeLeafTesting(int b1, int /* b2 */,
+void meshShapeDistanceOrientedNodeleafComputeDistance(int b1, int /* b2 */,
                                               const BVHModel<BV>* model1, const S& model2,
                                               Vec3f* vertices, Triangle* tri_indices,
                                               const Transform3f& tf1,
@@ -706,9 +706,9 @@ public:
     return distance(this->tf1.getRotation(), this->tf1.getTranslation(), this->model2_bv, this->model1->getBV(b1).bv);
   }
 
-  void leafTesting(int b1, int b2) const
+  void leafComputeDistance(int b1, int b2) const
   {
-    details::meshShapeDistanceOrientedNodeLeafTesting(b1, b2, this->model1, *(this->model2), this->vertices, this->tri_indices,
+    details::meshShapeDistanceOrientedNodeleafComputeDistance(b1, b2, this->model1, *(this->model2), this->vertices, this->tri_indices,
                                                       this->tf1, this->tf2, this->nsolver, this->enable_statistics, this->num_leaf_tests, this->request, *(this->result));
   }
 };
@@ -738,9 +738,9 @@ public:
     return distance(this->tf1.getRotation(), this->tf1.getTranslation(), this->model2_bv, this->model1->getBV(b1).bv);
   }
 
-  void leafTesting(int b1, int b2) const
+  void leafComputeDistance(int b1, int b2) const
   {
-    details::meshShapeDistanceOrientedNodeLeafTesting(b1, b2, this->model1, *(this->model2), this->vertices, this->tri_indices,
+    details::meshShapeDistanceOrientedNodeleafComputeDistance(b1, b2, this->model1, *(this->model2), this->vertices, this->tri_indices,
                                                       this->tf1, this->tf2, this->nsolver, this->enable_statistics, this->num_leaf_tests, this->request, *(this->result));
   }
 
@@ -771,9 +771,9 @@ public:
     return distance(this->tf1.getRotation(), this->tf1.getTranslation(), this->model2_bv, this->model1->getBV(b1).bv);
   }
 
-  void leafTesting(int b1, int b2) const
+  void leafComputeDistance(int b1, int b2) const
   {
-    details::meshShapeDistanceOrientedNodeLeafTesting(b1, b2, this->model1, *(this->model2), this->vertices, this->tri_indices,
+    details::meshShapeDistanceOrientedNodeleafComputeDistance(b1, b2, this->model1, *(this->model2), this->vertices, this->tri_indices,
                                                       this->tf1, this->tf2, this->nsolver, this->enable_statistics, this->num_leaf_tests, this->request, *(this->result));
   }
   
@@ -796,7 +796,7 @@ public:
   }
 
   /// @brief Distance testing between leaves (one shape and one triangle)
-  void leafTesting(int b1, int b2) const
+  void leafComputeDistance(int b1, int b2) const
   {
     if(this->enable_statistics) this->num_leaf_tests++;
     
@@ -862,9 +862,9 @@ public:
     return distance(this->tf2.getRotation(), this->tf2.getTranslation(), this->model1_bv, this->model2->getBV(b2).bv);
   }
 
-  void leafTesting(int b1, int b2) const
+  void leafComputeDistance(int b1, int b2) const
   {
-    details::meshShapeDistanceOrientedNodeLeafTesting(b2, b1, this->model2, *(this->model1), this->vertices, this->tri_indices,
+    details::meshShapeDistanceOrientedNodeleafComputeDistance(b2, b1, this->model2, *(this->model1), this->vertices, this->tri_indices,
                                                       this->tf2, this->tf1, this->nsolver, this->enable_statistics, this->num_leaf_tests, this->request, *(this->result));
   }
 
@@ -894,9 +894,9 @@ public:
     return distance(this->tf2.getRotation(), this->tf2.getTranslation(), this->model1_bv, this->model2->getBV(b2).bv);
   }
 
-  void leafTesting(int b1, int b2) const
+  void leafComputeDistance(int b1, int b2) const
   {
-    details::meshShapeDistanceOrientedNodeLeafTesting(b2, b1, this->model2, *(this->model1), this->vertices, this->tri_indices,
+    details::meshShapeDistanceOrientedNodeleafComputeDistance(b2, b1, this->model2, *(this->model1), this->vertices, this->tri_indices,
                                                       this->tf2, this->tf1, this->nsolver, this->enable_statistics, this->num_leaf_tests, this->request, *(this->result));
   }
   
@@ -926,9 +926,9 @@ public:
     return distance(this->tf2.getRotation(), this->tf2.getTranslation(), this->model1_bv, this->model2->getBV(b2).bv);
   }
 
-  void leafTesting(int b1, int b2) const
+  void leafComputeDistance(int b1, int b2) const
   {
-    details::meshShapeDistanceOrientedNodeLeafTesting(b2, b1, this->model2, *(this->model1), this->vertices, this->tri_indices,
+    details::meshShapeDistanceOrientedNodeleafComputeDistance(b2, b1, this->model2, *(this->model1), this->vertices, this->tri_indices,
                                                       this->tf2, this->tf1, this->nsolver, this->enable_statistics, this->num_leaf_tests, this->request, *(this->result));
   }
   
diff --git a/src/traversal/traversal_node_bvhs.cpp b/src/traversal/traversal_node_bvhs.cpp
index 28eb3704..c4e3fbf6 100644
--- a/src/traversal/traversal_node_bvhs.cpp
+++ b/src/traversal/traversal_node_bvhs.cpp
@@ -46,7 +46,7 @@ namespace fcl
 namespace details
 {
 template<typename BV>
-static inline void meshDistanceOrientedNodeleafTesting(int b1, int b2,
+static inline void meshDistanceOrientedNodeleafComputeDistance(int b1, int b2,
                                                        const BVHModel<BV>* model1, const BVHModel<BV>* model2,
                                                        Vec3f* vertices1, Vec3f* vertices2, 
                                                        Triangle* tri_indices1, Triangle* tri_indices2,
@@ -158,9 +158,9 @@ FCL_REAL MeshDistanceTraversalNodeRSS::BVDistanceLowerBound(int b1, int b2) cons
   return distance(R, T, model1->getBV(b1).bv, model2->getBV(b2).bv);
 }
 
-void MeshDistanceTraversalNodeRSS::leafTesting(int b1, int b2) const
+void MeshDistanceTraversalNodeRSS::leafComputeDistance(int b1, int b2) const
 {
-  details::meshDistanceOrientedNodeleafTesting(b1, b2, model1, model2, vertices1, vertices2, tri_indices1, tri_indices2, 
+  details::meshDistanceOrientedNodeleafComputeDistance(b1, b2, model1, model2, vertices1, vertices2, tri_indices1, tri_indices2, 
                                                R, T, enable_statistics, num_leaf_tests, 
                                                request, *result);
 }
@@ -186,9 +186,9 @@ FCL_REAL MeshDistanceTraversalNodekIOS::BVDistanceLowerBound(int b1, int b2) con
   return distance(R, T, model1->getBV(b1).bv, model2->getBV(b2).bv);
 }
 
-void MeshDistanceTraversalNodekIOS::leafTesting(int b1, int b2) const
+void MeshDistanceTraversalNodekIOS::leafComputeDistance(int b1, int b2) const
 {
-  details::meshDistanceOrientedNodeleafTesting(b1, b2, model1, model2, vertices1, vertices2, tri_indices1, tri_indices2, 
+  details::meshDistanceOrientedNodeleafComputeDistance(b1, b2, model1, model2, vertices1, vertices2, tri_indices1, tri_indices2, 
                                                R, T, enable_statistics, num_leaf_tests, 
                                                request, *result);
 }
@@ -214,9 +214,9 @@ FCL_REAL MeshDistanceTraversalNodeOBBRSS::BVDistanceLowerBound(int b1, int b2) c
   return distance(R, T, model1->getBV(b1).bv, model2->getBV(b2).bv);
 }
 
-void MeshDistanceTraversalNodeOBBRSS::leafTesting(int b1, int b2) const
+void MeshDistanceTraversalNodeOBBRSS::leafComputeDistance(int b1, int b2) const
 {
-  details::meshDistanceOrientedNodeleafTesting(b1, b2, model1, model2, vertices1, vertices2, tri_indices1, tri_indices2, 
+  details::meshDistanceOrientedNodeleafComputeDistance(b1, b2, model1, model2, vertices1, vertices2, tri_indices1, tri_indices2, 
                                                R, T, enable_statistics, num_leaf_tests, 
                                                request, *result);
 }
diff --git a/src/traversal/traversal_node_bvhs.h b/src/traversal/traversal_node_bvhs.h
index be8a78e2..f0ca5d16 100644
--- a/src/traversal/traversal_node_bvhs.h
+++ b/src/traversal/traversal_node_bvhs.h
@@ -200,7 +200,7 @@ public:
   /// \note If the distance between objects is less than the security margin,
   ///       and the object are not colliding, the penetration depth is
   ///       negative.
-  void leafTesting(int b1, int b2, FCL_REAL& sqrDistLowerBound) const
+  void leafCollides(int b1, int b2, FCL_REAL& sqrDistLowerBound) const
   {
     if(this->enable_statistics) this->num_leaf_tests++;
 
@@ -397,7 +397,7 @@ public:
   }
 
   /// @brief Distance testing between leaves (two triangles)
-  void leafTesting(int b1, int b2) const
+  void leafComputeDistance(int b1, int b2) const
   {
     if(this->enable_statistics) this->num_leaf_tests++;
 
@@ -459,7 +459,7 @@ public:
 
   FCL_REAL BVDistanceLowerBound(int b1, int b2) const;
 
-  void leafTesting(int b1, int b2) const;
+  void leafComputeDistance(int b1, int b2) const;
 
   Matrix3f R;
   Vec3f T;
@@ -477,7 +477,7 @@ public:
 
   FCL_REAL BVDistanceLowerBound(int b1, int b2) const;
 
-  void leafTesting(int b1, int b2) const;
+  void leafComputeDistance(int b1, int b2) const;
 
   Matrix3f R;
   Vec3f T;
@@ -496,7 +496,7 @@ public:
 
   FCL_REAL BVDistanceLowerBound(int b1, int b2, FCL_REAL& sqrDistLowerBound) const;
 
-  void leafTesting(int b1, int b2) const;
+  void leafComputeDistance(int b1, int b2) const;
 
   Matrix3f R;
   Vec3f T;
diff --git a/src/traversal/traversal_node_octree.h b/src/traversal/traversal_node_octree.h
index 7ab9ce7c..270fb06d 100644
--- a/src/traversal/traversal_node_octree.h
+++ b/src/traversal/traversal_node_octree.h
@@ -913,7 +913,7 @@ public:
     return false;
   }
 
-  void leafTesting(int, int, FCL_REAL&) const
+  void leafCollides(int, int, FCL_REAL&) const
   {
     otsolver->OcTreeIntersect(model1, model2, tf1, tf2, request, *result);
   }
@@ -950,7 +950,7 @@ public:
     return false;
   }
 
-  void leafTesting(int, int) const
+  void leafComputeDistance(int, int) const
   {
     otsolver->OcTreeDistance(model1, model2, tf1, tf2, request, *result);
   }
@@ -985,7 +985,7 @@ public:
     return false;
   }
 
-  void leafTesting(int, int, FCL_REAL&) const
+  void leafCollides(int, int, FCL_REAL&) const
   {
     otsolver->OcTreeShapeIntersect(model2, *model1, tf2, tf1, request, *result);
   }
@@ -1022,7 +1022,7 @@ public:
     return false;
   }
 
-  void leafTesting(int, int, FCL_REAL&) const
+  void leafCollides(int, int, FCL_REAL&) const
   {
     otsolver->OcTreeShapeIntersect(model1, *model2, tf1, tf2, request, *result);
   }
@@ -1053,7 +1053,7 @@ public:
     return -1;
   }
 
-  void leafTesting(int, int) const
+  void leafComputeDistance(int, int) const
   {
     otsolver->OcTreeShapeDistance(model2, *model1, tf2, tf1, request, *result);
   }
@@ -1082,7 +1082,7 @@ public:
     return -1;
   }
 
-  void leafTesting(int, int) const
+  void leafComputeDistance(int, int) const
   {
     otsolver->OcTreeShapeDistance(model1, *model2, tf1, tf2, request, *result);
   }
@@ -1117,7 +1117,7 @@ public:
     return false;
   }
 
-  void leafTesting(int, int, FCL_REAL&) const
+  void leafCollides(int, int, FCL_REAL&) const
   {
     otsolver->OcTreeMeshIntersect(model2, model1, tf2, tf1, request, *result);
   }
@@ -1154,7 +1154,7 @@ public:
     return false;
   }
 
-  void leafTesting(int, int, FCL_REAL&) const
+  void leafCollides(int, int, FCL_REAL&) const
   {
     otsolver->OcTreeMeshIntersect(model1, model2, tf1, tf2, request, *result);
   }
@@ -1185,7 +1185,7 @@ public:
     return -1;
   }
 
-  void leafTesting(int, int) const
+  void leafComputeDistance(int, int) const
   {
     otsolver->OcTreeMeshDistance(model2, model1, tf2, tf1, request, *result);
   }
@@ -1215,7 +1215,7 @@ public:
     return -1;
   }
 
-  void leafTesting(int, int) const
+  void leafComputeDistance(int, int) const
   {
     otsolver->OcTreeMeshDistance(model1, model2, tf1, tf2, request, *result);
   }
diff --git a/src/traversal/traversal_node_shapes.h b/src/traversal/traversal_node_shapes.h
index d2acc573..17be1e73 100644
--- a/src/traversal/traversal_node_shapes.h
+++ b/src/traversal/traversal_node_shapes.h
@@ -79,7 +79,7 @@ public:
   }
 
   /// @brief Intersection testing between leaves (two shapes)
-  void leafTesting(int, int, FCL_REAL&) const
+  void leafCollides(int, int, FCL_REAL&) const
   {
     bool is_collision = false;
     if(request.enable_contact)
@@ -134,7 +134,7 @@ public:
   }
 
   /// @brief Distance testing between leaves (two shapes)
-  void leafTesting(int, int) const
+  void leafComputeDistance(int, int) const
   {
     FCL_REAL distance;
     Vec3f closest_p1, closest_p2, normal;
diff --git a/src/traversal/traversal_recurse.cpp b/src/traversal/traversal_recurse.cpp
index fe7c37d7..dd2e8d28 100644
--- a/src/traversal/traversal_recurse.cpp
+++ b/src/traversal/traversal_recurse.cpp
@@ -55,7 +55,7 @@ void collisionRecurse(CollisionTraversalNodeBase* node, int b1, int b2,
     updateFrontList(front_list, b1, b2);
 
     if(node->BVDisjoints(b1, b2, sqrDistLowerBound)) return;
-    node->leafTesting(b1, b2, sqrDistLowerBound);
+    node->leafCollides(b1, b2, sqrDistLowerBound);
     return;
   }
 
@@ -122,7 +122,7 @@ void collisionNonRecurse(CollisionTraversalNodeBase* node,
         //if (sdlb < sqrDistLowerBound) sqrDistLowerBound = sdlb;
         //continue;
       //}
-      node->leafTesting(a, b, sdlb);
+      node->leafCollides(a, b, sdlb);
       if (sdlb < sqrDistLowerBound) sqrDistLowerBound = sdlb;
       if (node->canStop() && !front_list) return;
       continue;
@@ -169,7 +169,7 @@ void distanceRecurse(DistanceTraversalNodeBase* node, int b1, int b2, BVHFrontLi
   {
     updateFrontList(front_list, b1, b2);
 
-    node->leafTesting(b1, b2);
+    node->leafComputeDistance(b1, b2);
     return;
   }
 
@@ -298,7 +298,7 @@ void distanceQueueRecurse(DistanceTraversalNodeBase* node, int b1, int b2, BVHFr
     {
       updateFrontList(front_list, min_test.b1, min_test.b2);
 
-      node->leafTesting(min_test.b1, min_test.b2);
+      node->leafComputeDistance(min_test.b1, min_test.b2);
     }
     else if(bvtq.full())
     {
-- 
GitLab