diff --git a/include/hpp/fcl/BV/AABB.h b/include/hpp/fcl/BV/AABB.h index 72954a64436a08f7d2bf41a19e7d6b3ba6664a67..55a5e4adb92a73b9d2b8416c487b1075a8bac831 100644 --- a/include/hpp/fcl/BV/AABB.h +++ b/include/hpp/fcl/BV/AABB.h @@ -46,6 +46,10 @@ namespace hpp namespace fcl { class CollisionRequest; +/// @defgroup Bounding_Volume +/// regroup class of differents types of bounding volume. +/// @{ + /// @brief A class describing the AABB collision structure, which is a box in 3D space determined by two diagonal points class AABB { diff --git a/include/hpp/fcl/BV/BV_node.h b/include/hpp/fcl/BV/BV_node.h index e7fc637418af63b040efc47c7ff1427c77dda8ed..86e858f2f40b5da2857b229ceb9e8b6d13f32985 100644 --- a/include/hpp/fcl/BV/BV_node.h +++ b/include/hpp/fcl/BV/BV_node.h @@ -49,6 +49,10 @@ namespace hpp namespace fcl { +/// @defgroup Construction_Of_BVH +/// regroup class which are used to build BVH (Bounding Volume Hierarchy) +/// @{ + /// @brief BVNodeBase encodes the tree structure for BVH struct BVNodeBase { diff --git a/include/hpp/fcl/BV/OBB.h b/include/hpp/fcl/BV/OBB.h index 80cf45ed0d5f13df7f1ff6aaaec9b48b8efbed5b..32468de639bbef10eea0ac63c1b873e4b5d583ae 100644 --- a/include/hpp/fcl/BV/OBB.h +++ b/include/hpp/fcl/BV/OBB.h @@ -46,6 +46,9 @@ namespace fcl { class CollisionRequest; +/// @addtogroup Bounding_Volume +/// @{ + /// @brief Oriented bounding box class class OBB { diff --git a/include/hpp/fcl/BV/OBBRSS.h b/include/hpp/fcl/BV/OBBRSS.h index 78a32390b9a9b5da6bed59b5dffc4f7326e7ebd9..def7ce67ddd35cc54d5bd654acdeb8c138b5622f 100644 --- a/include/hpp/fcl/BV/OBBRSS.h +++ b/include/hpp/fcl/BV/OBBRSS.h @@ -48,6 +48,9 @@ namespace fcl { class CollisionRequest; +/// @addtogroup Bounding_Volume +/// @{ + /// @brief Class merging the OBB and RSS, can handle collision and distance simultaneously class OBBRSS { diff --git a/include/hpp/fcl/BV/RSS.h b/include/hpp/fcl/BV/RSS.h index b626e27edf8561a1c14211d2bffbc9be73d1a62c..a380de68c2b033bda110b5bee23d1dfa679058bb 100644 --- a/include/hpp/fcl/BV/RSS.h +++ b/include/hpp/fcl/BV/RSS.h @@ -48,6 +48,9 @@ namespace fcl { class CollisionRequest; +/// @addtogroup Bounding_Volume +/// @{ + /// @brief A class for rectangle sphere-swept bounding volume class RSS { diff --git a/include/hpp/fcl/BV/kDOP.h b/include/hpp/fcl/BV/kDOP.h index 61e43d90244dec4fab97de79c62992af18364ee6..6a5c6aabe88b7a3a8cb6398ef2365b8d41d0119f 100644 --- a/include/hpp/fcl/BV/kDOP.h +++ b/include/hpp/fcl/BV/kDOP.h @@ -48,6 +48,9 @@ namespace fcl class CollisionRequest; + /// @addtogroup Bounding_Volume + /// @{ + /// @brief KDOP class describes the KDOP collision structures. K is set as the template parameter, which should be 16, 18, or 24 /// The KDOP structure is defined by some pairs of parallel planes defined by some axes. /// For K = 16, the planes are 6 AABB planes and 10 diagonal planes that cut off some space of the edges: diff --git a/include/hpp/fcl/BV/kIOS.h b/include/hpp/fcl/BV/kIOS.h index 2227c9754a9b07707534cfaba04ab898bf7f56bb..be1a4f0bb0d050646ed287c66245f940d43f3d3a 100644 --- a/include/hpp/fcl/BV/kIOS.h +++ b/include/hpp/fcl/BV/kIOS.h @@ -46,7 +46,10 @@ namespace hpp namespace fcl { class CollisionRequest; - + +/// @addtogroup Bounding_Volume +/// @{ + /// @brief A class describing the kIOS collision structure, which is a set of spheres. class kIOS { diff --git a/include/hpp/fcl/BVH/BVH_model.h b/include/hpp/fcl/BVH/BVH_model.h index d6d200334f6a094f27c307b57c57d095cefb30d7..095ff21c250877fb5b5c42a94aa0b6a89d7b3756 100644 --- a/include/hpp/fcl/BVH/BVH_model.h +++ b/include/hpp/fcl/BVH/BVH_model.h @@ -50,6 +50,9 @@ namespace hpp namespace fcl { +/// @addtogroup Construction_Of_BVH +/// @{ + class ConvexBase; template <typename BV> class BVFitter; @@ -338,7 +341,7 @@ private: /// @brief Recursive kernel for bottomup refitting int recursiveRefitTree_bottomup(int bv_id); - /// @recursively compute each bv's transform related to its parent. For default BV, only the translation works. + /// @ recursively compute each bv's transform related to its parent. For default BV, only the translation works. /// For oriented BV (OBB, RSS, OBBRSS), special implementation is provided. void makeParentRelativeRecurse(int bv_id, Matrix3f& parent_axes, const Vec3f& parent_c) { @@ -353,6 +356,7 @@ private: } }; +/// @} template<> void BVHModel<OBB>::makeParentRelativeRecurse(int bv_id, Matrix3f& parent_axes, const Vec3f& parent_c); diff --git a/include/hpp/fcl/collision_object.h b/include/hpp/fcl/collision_object.h index 9af086f557c5555af4f00988f5d667d46b1e40ba..1e743dbd08709af80e789ca23e63901c97c0bf45 100644 --- a/include/hpp/fcl/collision_object.h +++ b/include/hpp/fcl/collision_object.h @@ -56,6 +56,9 @@ enum OBJECT_TYPE {OT_UNKNOWN, OT_BVH, OT_GEOM, OT_OCTREE, OT_COUNT}; enum NODE_TYPE {BV_UNKNOWN, BV_AABB, BV_OBB, BV_RSS, BV_kIOS, BV_OBBRSS, BV_KDOP16, BV_KDOP18, BV_KDOP24, GEOM_BOX, GEOM_SPHERE, GEOM_CAPSULE, GEOM_CONE, GEOM_CYLINDER, GEOM_CONVEX, GEOM_PLANE, GEOM_HALFSPACE, GEOM_TRIANGLE, GEOM_OCTREE, NODE_COUNT}; +/// @addtogroup Construction_Of_BVH +/// @{ + /// @brief The geometry for the object for collision or distance computation class CollisionGeometry { diff --git a/include/hpp/fcl/distance.h b/include/hpp/fcl/distance.h index d04d2c8224abfdfc1cc25f33d33fb7dbf4929780..45bbcbd736a89d860e759cd1d61b49350584f403 100644 --- a/include/hpp/fcl/distance.h +++ b/include/hpp/fcl/distance.h @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -/** \author Jia Pan */ +/** @author Jia Pan */ #ifndef HPP_FCL_DISTANCE_H #define HPP_FCL_DISTANCE_H diff --git a/include/hpp/fcl/shape/geometric_shapes.h b/include/hpp/fcl/shape/geometric_shapes.h index 557f7c182231a8619aedf44ce4a101ff97fe0ff7..68c5cf07aa0f9d6d5daa4f16ea208ddedb3859ae 100644 --- a/include/hpp/fcl/shape/geometric_shapes.h +++ b/include/hpp/fcl/shape/geometric_shapes.h @@ -62,6 +62,10 @@ public: OBJECT_TYPE getObjectType() const { return OT_GEOM; } }; +/// @defgroup Geometric_Shapes +/// regroup class of differents types of geometric shapes. +/// @{ + /// @brief Triangle stores the points instead of only indices of points class TriangleP : public ShapeBase { diff --git a/src/collision_node.h b/src/collision_node.h index 961e3faaf5940f9938b2df798b3880197e500ed4..7f2ffbd2c6c6e1dd918ae73f179b48ac3e08abb9 100644 --- a/src/collision_node.h +++ b/src/collision_node.h @@ -35,15 +35,14 @@ /** \author Jia Pan */ - #ifndef HPP_FCL_COLLISION_NODE_H #define HPP_FCL_COLLISION_NODE_H +/// @cond INTERNAL + +#include <hpp/fcl/BVH/BVH_front.h> #include "traversal/traversal_node_base.h" #include "traversal/traversal_node_bvhs.h" -#include <hpp/fcl/BVH/BVH_front.h> - - /// @brief collision and distance function on traversal nodes. these functions provide a higher level abstraction for collision functions provided in collision_func_matrix namespace hpp @@ -59,16 +58,16 @@ namespace fcl /// do not collide. /// @param front_list list of nodes visited by the query, can be used to /// accelerate computation -/// @internal collide, private function. void collide(CollisionTraversalNodeBase* node, const CollisionRequest& request, CollisionResult& result, BVHFrontList* front_list = NULL, bool recursive = true); /// @brief distance computation on distance traversal node; can use front list to accelerate -/// @internal distance, private function. void distance(DistanceTraversalNodeBase* node, BVHFrontList* front_list = NULL, int qsize = 2); } } // namespace hpp +/// @endcond + #endif diff --git a/src/distance_func_matrix.h b/src/distance_func_matrix.h index 401accace795857d94ba5c8725ed414d9a9293df..3a142614f523f3a9e35b285c248a46852edebd6f 100644 --- a/src/distance_func_matrix.h +++ b/src/distance_func_matrix.h @@ -34,6 +34,11 @@ /** \author Florent Lamiraux */ +#ifndef HPP_FCL_DISTANCE_FUNC_MATRIX_H +#define HPP_FCL_DISTANCE_FUNC_MATRIX_H + +/// @cond INTERNAL + #include <hpp/fcl/collision_data.h> #include <hpp/fcl/narrowphase/narrowphase.h> @@ -41,7 +46,6 @@ namespace hpp { namespace fcl { - /// @internal ShapeShapeDistance, private function. template<typename T_SH1, typename T_SH2> FCL_REAL ShapeShapeDistance (const CollisionGeometry* o1, const Transform3f& tf1, @@ -49,7 +53,6 @@ namespace fcl const GJKSolver* nsolver, const DistanceRequest& request, DistanceResult& result); - /// @internal ShapeShapeCollide, private function. template<typename T_SH1, typename T_SH2> std::size_t ShapeShapeCollide (const CollisionGeometry* o1, const Transform3f& tf1, @@ -59,3 +62,7 @@ namespace fcl } } // namespace hpp + +/// @endcond + +#endif \ No newline at end of file diff --git a/src/intersect.h b/src/intersect.h index 5e519c7a29ec625f2d47b6d9776ef09aa9385740..b0b397a3aeb3e4dcf5c4e4a55bdcc5fa331eb346 100644 --- a/src/intersect.h +++ b/src/intersect.h @@ -38,6 +38,8 @@ #ifndef HPP_FCL_INTERSECT_H #define HPP_FCL_INTERSECT_H +/// @cond INTERNAL + #include <hpp/fcl/math/transform.h> #include <boost/math/special_functions/erf.hpp> @@ -47,7 +49,6 @@ namespace fcl { /// @brief CCD intersect kernel among primitives -/// @internal Intersect, private class. class Intersect { public: @@ -56,7 +57,6 @@ public: }; // class Intersect /// @brief Project functions -/// @internal Project, private class. class Project { public: @@ -96,7 +96,6 @@ public: }; /// @brief Triangle distance functions -/// @internal TriangleDistance, private class. class TriangleDistance { public: @@ -193,4 +192,6 @@ public: } // namespace hpp +/// @endcond + #endif diff --git a/src/traversal/details/traversal.h b/src/traversal/details/traversal.h index 2979a601f169303b8f3e6cf5b0a010c18d0e43fa..82553dcd6587be92f4279d1fae1f6077f5aa3e4b 100644 --- a/src/traversal/details/traversal.h +++ b/src/traversal/details/traversal.h @@ -34,10 +34,11 @@ /** \author Joseph Mirabel */ - #ifndef HPP_FCL_TRAVERSAL_DETAILS_TRAVERSAL_H #define HPP_FCL_TRAVERSAL_DETAILS_TRAVERSAL_H +/// @cond INTERNAL + namespace hpp { namespace fcl @@ -73,4 +74,6 @@ namespace details } // namespace hpp +/// @endcond + #endif diff --git a/src/traversal/traversal_node_base.h b/src/traversal/traversal_node_base.h index e583cdfda0e1e4fe05881143ab03d089d1c6ead7..6f6c41e32afcd3ddfbf79a11a32a6fefab5eab15 100644 --- a/src/traversal/traversal_node_base.h +++ b/src/traversal/traversal_node_base.h @@ -38,6 +38,8 @@ #ifndef HPP_FCL_TRAVERSAL_NODE_BASE_H #define HPP_FCL_TRAVERSAL_NODE_BASE_H +/// @cond INTERNAL + #include <hpp/fcl/data_types.h> #include <hpp/fcl/math/transform.h> #include <hpp/fcl/collision_data.h> @@ -47,9 +49,7 @@ namespace hpp namespace fcl { - /// @brief Node structure encoding the information required for traversal. -/// @internal TraversalNodeBase, private class. class TraversalNodeBase { @@ -91,9 +91,11 @@ public: Transform3f tf2; }; +/// @defgroup Traversal_For_Collision +/// regroup class about traversal for distance. +/// @{ /// @brief Node structure encoding the information required for collision traversal. -/// @internal CollisionTraversalNodeBase, private class. class CollisionTraversalNodeBase : public TraversalNodeBase { public: @@ -133,8 +135,13 @@ public: bool enable_statistics; }; +/// @} + +/// @defgroup Traversal_For_Distance +/// regroup class about traversal for distance. +/// @{ + /// @brief Node structure encoding the information required for distance traversal. -/// @internal DistanceTraversalNodeBase, private class. class DistanceTraversalNodeBase : public TraversalNodeBase { public: @@ -165,8 +172,13 @@ public: /// @brief Whether stores statistics bool enable_statistics; }; + +///@} + } } // namespace hpp -#endif +/// @endcond + +#endif \ No newline at end of file diff --git a/src/traversal/traversal_node_bvh_shape.h b/src/traversal/traversal_node_bvh_shape.h index 1fbccff9f0493409b37fefd70caf0c5a80ebd258..0fb53f78a55fccd1267ba58f708160607db36b94 100644 --- a/src/traversal/traversal_node_bvh_shape.h +++ b/src/traversal/traversal_node_bvh_shape.h @@ -39,6 +39,8 @@ #ifndef HPP_FCL_TRAVERSAL_NODE_MESH_SHAPE_H #define HPP_FCL_TRAVERSAL_NODE_MESH_SHAPE_H +/// @cond INTERNAL + #include <hpp/fcl/collision_data.h> #include <hpp/fcl/shape/geometric_shapes.h> #include "../src/shape/geometric_shapes_utility.h" @@ -52,8 +54,10 @@ namespace hpp namespace fcl { +/// @addtogroup Traversal_For_Collision +/// @{ + /// @brief Traversal node for collision between BVH and shape -/// @internal BVHShapeCollisionTraversalNode, private class. template<typename BV, typename S> class BVHShapeCollisionTraversalNode : public CollisionTraversalNodeBase { @@ -97,7 +101,6 @@ public: }; /// @brief Traversal node for collision between shape and BVH -/// @internal ShapeBVHCollisionTraversalNode, private class. template<typename S, typename BV> class ShapeBVHCollisionTraversalNode : public CollisionTraversalNodeBase { @@ -148,7 +151,6 @@ public: /// @brief Traversal node for collision between mesh and shape -/// @internal MeshShapeCollisionTraversalNode, private class. template<typename BV, typename S, int _Options = RelativeTransformationIsIdentity> class MeshShapeCollisionTraversalNode : public BVHShapeCollisionTraversalNode<BV, S> @@ -263,7 +265,6 @@ public: }; /// @brief Traversal node for mesh and shape, when mesh BVH is one of the oriented node (OBB, RSS, OBBRSS, kIOS) -/// @internal MeshShapeCollisionTraversalNodeOBB/RSS/kIOS/OBBRSS, private class. template<typename S> class MeshShapeCollisionTraversalNodeOBB : public MeshShapeCollisionTraversalNode<OBB, S, 0> { @@ -311,7 +312,6 @@ public: /// @brief Traversal node for collision between shape and mesh -/// @internalShapeMeshCollisionTraversalNode, private class. template<typename S, typename BV, int _Options = RelativeTransformationIsIdentity> class ShapeMeshCollisionTraversalNode : public ShapeBVHCollisionTraversalNode<S, BV> @@ -425,7 +425,6 @@ public: }; /// @brief Traversal node for shape and mesh, when mesh BVH is one of the oriented node (OBB, RSS, OBBRSS, kIOS) -/// @internal ShapeMeshCollisionTraversalNodeOBB/RSS/kIOS/OBBRSS, private class. template<typename S> class ShapeMeshCollisionTraversalNodeOBB : public ShapeMeshCollisionTraversalNode<S, OBB, 0> { @@ -465,8 +464,12 @@ public: } }; +/// @} + +/// @addtogroup Traversal_For_Distance +/// @{ + /// @brief Traversal node for distance computation between BVH and shape -/// @internal BVHShapeDistanceTraversalNode, private class. template<typename BV, typename S> class BVHShapeDistanceTraversalNode : public DistanceTraversalNodeBase { @@ -515,7 +518,6 @@ public: }; /// @brief Traversal node for distance computation between shape and BVH -/// @internal ShapeBVHShapeDistanceTraversalNode, private class. template<typename S, typename BV> class ShapeBVHDistanceTraversalNode : public DistanceTraversalNodeBase { @@ -565,7 +567,6 @@ public: /// @brief Traversal node for distance between mesh and shape -/// @internal MeshShapeDistanceTraversalNode, private class. template<typename BV, typename S> class MeshShapeDistanceTraversalNode : public BVHShapeDistanceTraversalNode<BV, S> { @@ -691,7 +692,6 @@ static inline void distancePreprocessOrientedNode(const BVHModel<BV>* model1, /// @brief Traversal node for distance between mesh and shape, when mesh BVH is one of the oriented node (RSS, kIOS, OBBRSS) -/// @internal MeshShapeDistanceTraversalNodeRSS/kIOS/OBBRSS, private class. template<typename S> class MeshShapeDistanceTraversalNodeRSS : public MeshShapeDistanceTraversalNode<RSS, S> { @@ -790,7 +790,6 @@ public: }; /// @brief Traversal node for distance between shape and mesh -/// @internal ShapeMeshDistanceTraversalNode, private class. template<typename S, typename BV> class ShapeMeshDistanceTraversalNode : public ShapeBVHDistanceTraversalNode<S, BV> { @@ -850,7 +849,6 @@ public: }; /// @brief Traversal node for distance between shape and mesh, when mesh BVH is one of the oriented node (RSS, kIOS, OBBRSS) -/// @internal ShapeMeshDistanceTraversalNodeRSS/kIOS/OBBRSS, private class. template<typename S> class ShapeMeshDistanceTraversalNodeRSS : public ShapeMeshDistanceTraversalNode<S, RSS> { @@ -946,8 +944,13 @@ public: } }; + +/// @} + } } // namespace hpp +/// @endcond + #endif diff --git a/src/traversal/traversal_node_bvhs.h b/src/traversal/traversal_node_bvhs.h index 603dcec247bfb918fc2f4b51edad585f1caaa25c..13d63f740829c6e9dbbc341a50d9343543066405 100644 --- a/src/traversal/traversal_node_bvhs.h +++ b/src/traversal/traversal_node_bvhs.h @@ -35,10 +35,11 @@ /** \author Jia Pan */ - #ifndef HPP_FCL_TRAVERSAL_NODE_MESHES_H #define HPP_FCL_TRAVERSAL_NODE_MESHES_H +/// @cond INTERNAL + #include <hpp/fcl/collision_data.h> #include "traversal_node_base.h" #include <hpp/fcl/BV/BV_node.h> @@ -55,13 +56,15 @@ #include <vector> #include <cassert> - namespace hpp { namespace fcl { + +/// @addtogroup Traversal_For_Collision +/// @{ + /// @brief Traversal node for collision between BVH models -/// @internal BVHCollisionTraversalNode, private class. template<typename BV> class BVHCollisionTraversalNode : public CollisionTraversalNodeBase { @@ -139,7 +142,6 @@ public: }; /// @brief Traversal node for collision between two meshes -/// @internal MeshCollisionTraversalNode, private class. template<typename BV, int _Options = RelativeTransformationIsIdentity> class MeshCollisionTraversalNode : public BVHCollisionTraversalNode<BV> { @@ -174,7 +176,7 @@ public: /// @retval sqrDistLowerBound square of a lower bound of the minimal /// distance between bounding volumes. bool BVDisjoints(int b1, int b2, FCL_REAL& sqrDistLowerBound) const - {/// @internal MeshCollisionTraversalNode, private class. + { if(this->enable_statistics) this->num_bv_tests++; if (RTIsIdentity) return !this->model1->getBV(b1).overlap(this->model2->getBV(b2), @@ -266,12 +268,13 @@ public: }; /// @brief Traversal node for collision between two meshes if their underlying BVH node is oriented node (OBB, RSS, OBBRSS, kIOS) -/// @internal MeshCollisionTraversalNode (OBB, RSS, OBBRSS, kIOS), private class. typedef MeshCollisionTraversalNode<OBB , 0> MeshCollisionTraversalNodeOBB ; typedef MeshCollisionTraversalNode<RSS , 0> MeshCollisionTraversalNodeRSS ; typedef MeshCollisionTraversalNode<kIOS , 0> MeshCollisionTraversalNodekIOS ; typedef MeshCollisionTraversalNode<OBBRSS, 0> MeshCollisionTraversalNodeOBBRSS; +/// @} + namespace details { template<typename BV> struct DistanceTraversalBVDistanceLowerBound_impl @@ -298,8 +301,10 @@ namespace details }; } // namespace details +/// @addtogroup Traversal_For_Distance +/// @{ + /// @brief Traversal node for distance computation between BVH models -/// @internal BVHDistanceTraversalNode, private class. template<typename BV> class BVHDistanceTraversalNode : public DistanceTraversalNodeBase { @@ -385,7 +390,6 @@ public: /// @brief Traversal node for distance computation between two meshes -/// @internal MeshDistanceTraversalNode, private class. template<typename BV> class MeshDistanceTraversalNode : public BVHDistanceTraversalNode<BV> { @@ -453,7 +457,6 @@ public: }; /// @brief Traversal node for distance computation between two meshes if their underlying BVH node is oriented node (RSS, OBBRSS, kIOS) -/// @internal MeshDistanceTraversalNodeRSS/kIOS/OBBRSS, private class. class MeshDistanceTraversalNodeRSS : public MeshDistanceTraversalNode<RSS> { public: @@ -508,6 +511,8 @@ public: Vec3f T; }; +/// @} + /// @brief for OBB and RSS, there is local coordinate of BV, so normal need to be transformed namespace details { @@ -524,11 +529,12 @@ inline const Matrix3f& getBVAxes<OBBRSS>(const OBBRSS& bv) return bv.obb.axes; } - } } } // namespace hpp +/// @endcond + #endif diff --git a/src/traversal/traversal_node_octree.h b/src/traversal/traversal_node_octree.h index 1590c99bc5bf1e33fa9ef611bf06bf10a16e9119..3042d43bf083aef5b102687c2374141bea520d93 100644 --- a/src/traversal/traversal_node_octree.h +++ b/src/traversal/traversal_node_octree.h @@ -38,6 +38,8 @@ #ifndef HPP_FCL_TRAVERSAL_NODE_OCTREE_H #define HPP_FCL_TRAVERSAL_NODE_OCTREE_H +/// @cond INTERNAL + #include <hpp/fcl/collision_data.h> #include "traversal_node_base.h" #include <hpp/fcl/narrowphase/narrowphase.h> @@ -51,7 +53,6 @@ namespace fcl { /// @brief Algorithms for collision related with octree -/// @internal OcTreeSolver, private class. class OcTreeSolver { private: @@ -886,11 +887,10 @@ private: } }; - - +/// @addtogroup Traversal_For_Collision +/// @{ /// @brief Traversal node for octree collision -/// @internal OcTreeCollisionTraversalNode, private class. class OcTreeCollisionTraversalNode : public CollisionTraversalNodeBase { public: @@ -926,43 +926,7 @@ public: const OcTreeSolver* otsolver; }; -/// @brief Traversal node for octree distance -/// @internal OcTreeDistanceTraversalNode, private class. -class OcTreeDistanceTraversalNode : public DistanceTraversalNodeBase -{ -public: - OcTreeDistanceTraversalNode() - { - model1 = NULL; - model2 = NULL; - - otsolver = NULL; - } - - - FCL_REAL BVDistanceLowerBound(int, int) const - { - return -1; - } - - bool BVDistanceLowerBound(int, int, FCL_REAL&) const - { - return false; - } - - void leafComputeDistance(int, int) const - { - otsolver->OcTreeDistance(model1, model2, tf1, tf2, request, *result); - } - - const OcTree* model1; - const OcTree* model2; - - const OcTreeSolver* otsolver; -}; - /// @brief Traversal node for shape-octree collision -/// @internal ShapeOcTreeCollisionTraversalNode, private class. template<typename S> class ShapeOcTreeCollisionTraversalNode : public CollisionTraversalNodeBase { @@ -1000,7 +964,7 @@ public: }; /// @brief Traversal node for octree-shape collision -/// @internal OcTreeShapeCollisionTraversalNode, private class. + template<typename S> class OcTreeShapeCollisionTraversalNode : public CollisionTraversalNodeBase { @@ -1037,74 +1001,90 @@ public: const OcTreeSolver* otsolver; }; -/// @brief Traversal node for shape-octree distance -/// @internal ShapeOcTreeCollisionTraversalNode, private class. -template<typename S> -class ShapeOcTreeDistanceTraversalNode : public DistanceTraversalNodeBase +/// @brief Traversal node for mesh-octree collision +template<typename BV> +class MeshOcTreeCollisionTraversalNode : public CollisionTraversalNodeBase { public: - ShapeOcTreeDistanceTraversalNode() + MeshOcTreeCollisionTraversalNode(const CollisionRequest& request) : + CollisionTraversalNodeBase (request) { model1 = NULL; model2 = NULL; - + otsolver = NULL; } - FCL_REAL BVDistanceLowerBound(int, int) const + bool BVDisjoints(int, int) const { - return -1; + return false; } - void leafComputeDistance(int, int) const + bool BVDisjoints(int, int, FCL_REAL&) const { - otsolver->OcTreeShapeDistance(model2, *model1, tf2, tf1, request, *result); + return false; } - const S* model1; + void leafCollides(int, int, FCL_REAL&) const + { + otsolver->OcTreeMeshIntersect(model2, model1, tf2, tf1, request, *result); + } + + const BVHModel<BV>* model1; const OcTree* model2; + Transform3f tf1, tf2; + const OcTreeSolver* otsolver; }; -/// @brief Traversal node for octree-shape distance -/// @internal OcTreeShapeDistanceTraversalNode, private class. -template<typename S> -class OcTreeShapeDistanceTraversalNode : public DistanceTraversalNodeBase +/// @brief Traversal node for octree-mesh collision +template<typename BV> +class OcTreeMeshCollisionTraversalNode : public CollisionTraversalNodeBase { public: - OcTreeShapeDistanceTraversalNode() + OcTreeMeshCollisionTraversalNode(const CollisionRequest& request) : + CollisionTraversalNodeBase (request) { model1 = NULL; model2 = NULL; - + otsolver = NULL; } - FCL_REAL BVDistanceLowerBound(int, int) const + bool BVDisjoints(int, int) const { - return -1; + return false; } - void leafComputeDistance(int, int) const + bool BVDisjoints(int, int, FCL_REAL&) const { - otsolver->OcTreeShapeDistance(model1, *model2, tf1, tf2, request, *result); + return false; + } + + void leafCollides(int, int, FCL_REAL&) const + { + otsolver->OcTreeMeshIntersect(model1, model2, tf1, tf2, request, *result); } const OcTree* model1; - const S* model2; + const BVHModel<BV>* model2; + Transform3f tf1, tf2; + const OcTreeSolver* otsolver; }; -/// @brief Traversal node for mesh-octree collision -/// @internal MeshOcTreeCollisionTraversalNode, private class. -template<typename BV> -class MeshOcTreeCollisionTraversalNode : public CollisionTraversalNodeBase +/// @} + +/// @addtogroup Traversal_For_Distance +/// @{ + +/// @brief Traversal node for octree distance +class OcTreeDistanceTraversalNode : public DistanceTraversalNodeBase { public: - MeshOcTreeCollisionTraversalNode(const CollisionRequest& request) : - CollisionTraversalNodeBase (request) + OcTreeDistanceTraversalNode() { model1 = NULL; model2 = NULL; @@ -1112,69 +1092,89 @@ public: otsolver = NULL; } - bool BVDisjoints(int, int) const + + FCL_REAL BVDistanceLowerBound(int, int) const { - return false; + return -1; } - bool BVDisjoints(int, int, FCL_REAL&) const + bool BVDistanceLowerBound(int, int, FCL_REAL&) const { return false; } - void leafCollides(int, int, FCL_REAL&) const + void leafComputeDistance(int, int) const { - otsolver->OcTreeMeshIntersect(model2, model1, tf2, tf1, request, *result); + otsolver->OcTreeDistance(model1, model2, tf1, tf2, request, *result); } - const BVHModel<BV>* model1; + const OcTree* model1; const OcTree* model2; - Transform3f tf1, tf2; - const OcTreeSolver* otsolver; }; -/// @brief Traversal node for octree-mesh collision -/// @internal OcTreeMeshCollisionTraversalNode, private class. -template<typename BV> -class OcTreeMeshCollisionTraversalNode : public CollisionTraversalNodeBase + + +/// @brief Traversal node for shape-octree distance +template<typename S> +class ShapeOcTreeDistanceTraversalNode : public DistanceTraversalNodeBase { public: - OcTreeMeshCollisionTraversalNode(const CollisionRequest& request) : - CollisionTraversalNodeBase (request) + ShapeOcTreeDistanceTraversalNode() { model1 = NULL; model2 = NULL; - + otsolver = NULL; } - bool BVDisjoints(int, int) const + FCL_REAL BVDistanceLowerBound(int, int) const { - return false; + return -1; } - bool BVDisjoints(int, int, FCL_REAL&) const + void leafComputeDistance(int, int) const { - return false; + otsolver->OcTreeShapeDistance(model2, *model1, tf2, tf1, request, *result); } - void leafCollides(int, int, FCL_REAL&) const + const S* model1; + const OcTree* model2; + + const OcTreeSolver* otsolver; +}; + +/// @brief Traversal node for octree-shape distance +template<typename S> +class OcTreeShapeDistanceTraversalNode : public DistanceTraversalNodeBase +{ +public: + OcTreeShapeDistanceTraversalNode() { - otsolver->OcTreeMeshIntersect(model1, model2, tf1, tf2, request, *result); + model1 = NULL; + model2 = NULL; + + otsolver = NULL; + } + + FCL_REAL BVDistanceLowerBound(int, int) const + { + return -1; + } + + void leafComputeDistance(int, int) const + { + otsolver->OcTreeShapeDistance(model1, *model2, tf1, tf2, request, *result); } const OcTree* model1; - const BVHModel<BV>* model2; + const S* model2; - Transform3f tf1, tf2; - const OcTreeSolver* otsolver; }; /// @brief Traversal node for mesh-octree distance -/// @internal MeshOcTreeDistanceTraversalNode, private class. template<typename BV> class MeshOcTreeDistanceTraversalNode : public DistanceTraversalNodeBase { @@ -1205,7 +1205,6 @@ public: }; /// @brief Traversal node for octree-mesh distance -/// @internal OcTreeMeshDistanceTraversalNode, private class. template<typename BV> class OcTreeMeshDistanceTraversalNode : public DistanceTraversalNodeBase { @@ -1235,10 +1234,12 @@ public: }; - +/// @} } } // namespace hpp +/// @endcond + #endif diff --git a/src/traversal/traversal_node_setup.h b/src/traversal/traversal_node_setup.h index 85cdfbc57c8d0868b54b13694af11625b38b1319..4dc10681a4f065b43e025df4483083cfb25d159c 100644 --- a/src/traversal/traversal_node_setup.h +++ b/src/traversal/traversal_node_setup.h @@ -35,10 +35,11 @@ /** \author Jia Pan */ - #ifndef HPP_FCL_TRAVERSAL_NODE_SETUP_H #define HPP_FCL_TRAVERSAL_NODE_SETUP_H +/// @cond INTERNAL + #include "traversal_node_bvhs.h" #include "traversal_node_shapes.h" #include "traversal_node_bvh_shape.h" @@ -61,7 +62,7 @@ inline bool initialize(OcTreeCollisionTraversalNode& node, const OcTree& model2, const Transform3f& tf2, const OcTreeSolver* otsolver, CollisionResult& result) -{ + node.result = &result; node.model1 = &model1; @@ -82,6 +83,7 @@ inline bool initialize(OcTreeDistanceTraversalNode& node, const OcTreeSolver* otsolver, const DistanceRequest& request, DistanceResult& result) + { node.request = request; node.result = &result; @@ -886,4 +888,6 @@ bool initialize(ShapeMeshDistanceTraversalNodeOBBRSS<S>& node, } // namespace hpp +/// @endcond + #endif diff --git a/src/traversal/traversal_node_shapes.h b/src/traversal/traversal_node_shapes.h index a9f6a6e8e79273291db974d61f2073a78e93c737..a6d960603840be3de40ebbc0e4cf5b7cc1c36de4 100644 --- a/src/traversal/traversal_node_shapes.h +++ b/src/traversal/traversal_node_shapes.h @@ -35,24 +35,26 @@ /** \author Jia Pan */ - #ifndef HPP_FCL_TRAVERSAL_NODE_SHAPES_H #define HPP_FCL_TRAVERSAL_NODE_SHAPES_H +/// @cond INTERNAL + #include <hpp/fcl/collision_data.h> -#include "traversal_node_base.h" #include <hpp/fcl/narrowphase/narrowphase.h> #include <hpp/fcl/BV/BV.h> #include "../src/shape/geometric_shapes_utility.h" +#include "traversal_node_base.h" namespace hpp { namespace fcl { +/// @addtogroup Traversal_For_Collision +/// @{ /// @brief Traversal node for collision between two shapes -/// @internal ShapeCollisionTraversalNode, private class. template<typename S1, typename S2> class ShapeCollisionTraversalNode : public CollisionTraversalNodeBase { @@ -114,8 +116,12 @@ public: const GJKSolver* nsolver; }; +/// @} + +/// @addtogroup Traversal_For_Distance +/// @{ + /// @brief Traversal node for distance between two shapes -/// @internal ShapeDistanceTraversalNode, private class. template<typename S1, typename S2> class ShapeDistanceTraversalNode : public DistanceTraversalNodeBase { @@ -150,8 +156,13 @@ public: const GJKSolver* nsolver; }; + +/// @} + } } // namespace hpp +/// @endcond + #endif diff --git a/src/traversal/traversal_recurse.h b/src/traversal/traversal_recurse.h index 4149d1118076bc444fa0dffa0660d8ebdc0087c4..f5ac757894a8cd7988593b8fda03c6ff72fe5645 100644 --- a/src/traversal/traversal_recurse.h +++ b/src/traversal/traversal_recurse.h @@ -35,14 +35,15 @@ /** \author Jia Pan */ - #ifndef HPP_FCL_TRAVERSAL_RECURSE_H #define HPP_FCL_TRAVERSAL_RECURSE_H -#include "traversal_node_base.h" -#include "traversal_node_bvhs.h" +/// @cond INTERNAL + #include <hpp/fcl/BVH/BVH_front.h> #include <queue> +#include "traversal_node_base.h" +#include "traversal_node_bvhs.h" namespace hpp { @@ -53,24 +54,19 @@ namespace fcl /// @param node collision node, /// @param b1, b2 ids of bounding volume nodes for object 1 and object 2 /// @retval sqrDistLowerBound squared lower bound on distance between objects. -/// @internal collisionRecurse, private function. void collisionRecurse(CollisionTraversalNodeBase* node, int b1, int b2, BVHFrontList* front_list, FCL_REAL& sqrDistLowerBound); -/// @internal collisionNonRecurse, private function. void collisionNonRecurse(CollisionTraversalNodeBase* node, BVHFrontList* front_list, FCL_REAL& sqrDistLowerBound); /// @brief Recurse function for distance -/// @internal distanceRecurse, private function. void distanceRecurse(DistanceTraversalNodeBase* node, int b1, int b2, BVHFrontList* front_list); /// @brief Recurse function for distance, using queue acceleration -/// @internal distanceQueueRecurse, private function. void distanceQueueRecurse(DistanceTraversalNodeBase* node, int b1, int b2, BVHFrontList* front_list, int qsize); /// @brief Recurse function for front list propagation -/// @internal propagateBVHFrontListCollisionRecurse, private function. void propagateBVHFrontListCollisionRecurse (CollisionTraversalNodeBase* node, const CollisionRequest& request, CollisionResult& result, BVHFrontList* front_list); @@ -79,4 +75,6 @@ void propagateBVHFrontListCollisionRecurse } // namespace hpp +/// @endcond + #endif