Public Member Functions | Public Attributes | Private Member Functions | Static Private Attributes | List of all members
AcceptEllipse Struct Reference

Public Member Functions

 AcceptEllipse (const BoundingBox &b, double r1, double r2)
 
bool operator() (const RTree::Node *const node) const
 
bool operator() (const RTree::Leaf *const leaf) const
 

Public Attributes

const BoundingBoxm_bound
 
double r [2]
 
double c [2]
 center of the bounding box More...
 
double d [2]
 half More...
 

Private Member Functions

 AcceptEllipse ()
 

Static Private Attributes

static const BoundingBox EmptyBoundingBox
 

Detailed Description

Definition at line 73 of file DBScanAlg.cxx.

Constructor & Destructor Documentation

AcceptEllipse::AcceptEllipse ( const BoundingBox b,
double  r1,
double  r2 
)
inlineexplicit

Definition at line 78 of file DBScanAlg.cxx.

78  : m_bound(b), r(), c()
79  {
80  r[0] = r1;
81  r[1] = r2;
82  c[0] = (m_bound.edges[0].second + m_bound.edges[0].first) / 2.0;
83  c[1] = (m_bound.edges[1].second + m_bound.edges[1].first) / 2.0;
84  d[0] = (m_bound.edges[0].second - m_bound.edges[0].first) / 2.0;
85  d[1] = (m_bound.edges[1].second - m_bound.edges[1].first) / 2.0;
86  }
double d[2]
half
Definition: DBScanAlg.cxx:77
double c[2]
center of the bounding box
Definition: DBScanAlg.cxx:76
double r[2]
Definition: DBScanAlg.cxx:75
const BoundingBox & m_bound
Definition: DBScanAlg.cxx:74
std::pair< double, double > edges[dimensions]
AcceptEllipse::AcceptEllipse ( )
inlineprivate

Definition at line 114 of file DBScanAlg.cxx.

114  : m_bound(EmptyBoundingBox), r(), c()
115  {
116  r[0] = r[1] = 1.0;
117  c[0] = (m_bound.edges[0].second - m_bound.edges[0].first) / 2.0;
118  c[1] = (m_bound.edges[1].second - m_bound.edges[1].first) / 2.0;
119  }
static const BoundingBox EmptyBoundingBox
Definition: DBScanAlg.cxx:112
double c[2]
center of the bounding box
Definition: DBScanAlg.cxx:76
double r[2]
Definition: DBScanAlg.cxx:75
const BoundingBox & m_bound
Definition: DBScanAlg.cxx:74
std::pair< double, double > edges[dimensions]

Member Function Documentation

bool AcceptEllipse::operator() ( const RTree::Node *const  node) const
inline

Definition at line 88 of file DBScanAlg.cxx.

89  {
90  // At the node level we use a rectangualr overlap condition
91  return m_bound.overlaps(node->bound);
92  }
const BoundingBox & m_bound
Definition: DBScanAlg.cxx:74
bool overlaps(const RStarBoundingBox< dimensions > &bb) const
bool AcceptEllipse::operator() ( const RTree::Leaf *const  leaf) const
inline

Definition at line 94 of file DBScanAlg.cxx.

95  {
96  // At the leaf level we have to more careful
97  double C[2], D[2];
98  C[0] = (leaf->bound.edges[0].second + leaf->bound.edges[0].first) / 2.0;
99  C[1] = (leaf->bound.edges[1].second + leaf->bound.edges[1].first) / 2.0;
100  D[0] = (leaf->bound.edges[0].second - leaf->bound.edges[0].first) / 2.0;
101  D[1] = (leaf->bound.edges[1].second - leaf->bound.edges[1].first) / 2.0;
102  double t = 0;
103  for (int i = 0; i < 2; ++i) {
104  // This is only approximate, it will accept a few classes of
105  // non-overlapping ellipses
106  t += ((c[i] - C[i]) * (c[i] - C[i])) / ((d[i] + D[i]) * (d[i] + D[i]));
107  }
108  return (t < 1);
109  }
double d[2]
half
Definition: DBScanAlg.cxx:77
double c[2]
center of the bounding box
Definition: DBScanAlg.cxx:76

Member Data Documentation

double AcceptEllipse::c[2]

center of the bounding box

Definition at line 76 of file DBScanAlg.cxx.

double AcceptEllipse::d[2]

half

Definition at line 77 of file DBScanAlg.cxx.

const BoundingBox AcceptEllipse::EmptyBoundingBox
staticprivate

Definition at line 112 of file DBScanAlg.cxx.

const BoundingBox& AcceptEllipse::m_bound

Definition at line 74 of file DBScanAlg.cxx.

double AcceptEllipse::r[2]

Definition at line 75 of file DBScanAlg.cxx.


The documentation for this struct was generated from the following file: