38 #ifndef HPP_FCL_TRAVERSAL_NODE_BASE_H 39 #define HPP_FCL_TRAVERSAL_NODE_BASE_H 54 class TraversalNodeBase
57 TraversalNodeBase () : enable_statistics(false) {}
59 virtual ~TraversalNodeBase() {}
61 virtual void preprocess() {}
63 virtual void postprocess() {}
66 virtual bool isFirstNodeLeaf(
int )
const {
return true; }
69 virtual bool isSecondNodeLeaf(
int )
const {
return true; }
72 virtual bool firstOverSecond(
int ,
int )
const {
return true; }
75 virtual int getFirstLeftChild(
int b)
const {
return b; }
78 virtual int getFirstRightChild(
int b)
const {
return b; }
81 virtual int getSecondLeftChild(
int b)
const {
return b; }
84 virtual int getSecondRightChild(
int b)
const {
return b; }
87 void enableStatistics(
bool enable) { enable_statistics = enable; }
96 bool enable_statistics;
104 class CollisionTraversalNodeBase :
public TraversalNodeBase
107 CollisionTraversalNodeBase (
const CollisionRequest& request_) :
108 request (request_), result(NULL) {}
110 virtual ~CollisionTraversalNodeBase() {}
113 virtual bool BVDisjoints(
int b1,
int b2)
const = 0;
119 virtual bool BVDisjoints(
int b1,
int b2,
FCL_REAL& sqrDistLowerBound)
const = 0;
122 virtual void leafCollides(
int ,
int ,
FCL_REAL& )
const 124 throw std::runtime_error (
"Not implemented");
128 bool canStop()
const {
return this->request.isSatisfied(*(this->result)); }
131 const CollisionRequest& request;
134 CollisionResult* result;
137 bool enable_statistics;
147 class DistanceTraversalNodeBase :
public TraversalNodeBase
150 DistanceTraversalNodeBase() : result(NULL) {}
152 virtual ~DistanceTraversalNodeBase() {}
157 virtual FCL_REAL BVDistanceLowerBound(
int ,
int )
const 159 return std::numeric_limits<FCL_REAL>::max();
163 virtual void leafComputeDistance(
int b1,
int b2)
const = 0;
166 virtual bool canStop(
FCL_REAL )
const 170 DistanceRequest request;
173 DistanceResult* result;
Main namespace.
Definition: AABB.h:43
double FCL_REAL
Definition: data_types.h:68