FlatNormalThreshPointCompatibilityFunc.h
Go to the documentation of this file.
1 #ifndef FLATNORMALTHRESHPOINTCOMPATIBILITYFUNC_HEADER
2 #define FLATNORMALTHRESHPOINTCOMPATIBILITYFUNC_HEADER
3 #include <GfxTL/MathHelper.h>
4 
6 {
7 public:
10  float normalThresh)
11  : m_distThresh(distThresh)
12  , m_normalThresh(normalThresh)
13  {}
14  template< class ShapeT, class OctreeT >
15  bool operator()(const ShapeT& shape, const OctreeT& oct,
16  unsigned int i) const
17  {
18  Vec3f n;
19  float distance = shape.DistanceAndNormal(oct.at(i), &n);
20  if (distance < m_distThresh)
21  {
22  return abs(n.dot(oct.at(i).normal)) >= m_normalThresh;
23  }
24  return false;
25  }
26  bool operator()(float distance, float normalDeviation) const
27  {
28  return distance < m_distThresh
29  && abs(normalDeviation) >= m_normalThresh;
30  }
31  float DistanceThresh() const
32  {
33  return m_distThresh;
34  }
35  float NormalThresh() const
36  {
37  return m_normalThresh;
38  }
39 
40 private:
41  float m_distThresh;
42  float m_normalThresh;
43 };
44 
45 #endif
FlatNormalThreshPointCompatibilityFunc::operator()
bool operator()(const ShapeT &shape, const OctreeT &oct, unsigned int i) const
Definition: FlatNormalThreshPointCompatibilityFunc.h:15
Vec3f
Definition: basic.h:16
FlatNormalThreshPointCompatibilityFunc::NormalThresh
float NormalThresh() const
Definition: FlatNormalThreshPointCompatibilityFunc.h:35
armarx::abs
std::vector< T > abs(const std::vector< T > &v)
Definition: VectorHelpers.h:253
FlatNormalThreshPointCompatibilityFunc::DistanceThresh
float DistanceThresh() const
Definition: FlatNormalThreshPointCompatibilityFunc.h:31
FlatNormalThreshPointCompatibilityFunc::FlatNormalThreshPointCompatibilityFunc
FlatNormalThreshPointCompatibilityFunc(float distThresh, float normalThresh)
Definition: FlatNormalThreshPointCompatibilityFunc.h:9
FlatNormalThreshPointCompatibilityFunc
Definition: FlatNormalThreshPointCompatibilityFunc.h:5
Vec3f::dot
float dot(const Vec3f &v) const
Definition: basic.h:92
FlatNormalThreshPointCompatibilityFunc::FlatNormalThreshPointCompatibilityFunc
FlatNormalThreshPointCompatibilityFunc()
Definition: FlatNormalThreshPointCompatibilityFunc.h:8
distance
double distance(const Point &a, const Point &b)
Definition: point.hpp:88
MathHelper.h
FlatNormalThreshPointCompatibilityFunc::operator()
bool operator()(float distance, float normalDeviation) const
Definition: FlatNormalThreshPointCompatibilityFunc.h:26