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