Skip to content

Commit

Permalink
Split templated octree into pair of separately implemented versions
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonCampolattaro committed Jul 31, 2020
1 parent cceb96d commit 00f3223
Show file tree
Hide file tree
Showing 2 changed files with 393 additions and 45 deletions.
Expand Up @@ -211,10 +211,11 @@ class Efficient_RANSAC {

private:

typedef internal::Octree<internal::DirectPointAccessor<Traits> >
Direct_octree;
typedef internal::Octree<internal::IndexedPointAccessor<Traits> >
Indexed_octree;
// typedef internal::Octree<internal::DirectPointAccessor<Traits> >
// Direct_octree;
typedef internal::Direct_octree<Traits> Direct_octree;
typedef internal::Indexed_octree<Traits> Indexed_octree;

//--------------------------------------------typedef

// Creates a function pointer for instancing shape instances.
Expand Down Expand Up @@ -377,7 +378,7 @@ class Efficient_RANSAC {
m_global_octree = new Indexed_octree(
m_traits, m_input_iterator_first, m_input_iterator_beyond,
m_point_pmap
);
);
m_global_octree->createTree(m_options.cluster_epsilon);

return true;
Expand Down Expand Up @@ -1014,14 +1015,14 @@ class Efficient_RANSAC {


// TODO: Make these work outside the octree!
template<class PointAccessor>
std::size_t score(internal::Octree<PointAccessor> *octree,
template<class Octree>
std::size_t score(Octree *octree,
Shape *candidate,
std::vector<int> &shapeIndex,
FT epsilon,
FT normal_threshold) {

typedef typename internal::Octree<PointAccessor>::Cell Cell;
typedef typename Octree::Cell Cell;

std::stack<const Cell *> stack;
stack.push(octree->root());
Expand Down Expand Up @@ -1064,15 +1065,15 @@ class Efficient_RANSAC {
return candidate->m_indices.size();
}

template<class PointAccessor>
bool drawSamplesFromCellContainingPoint(internal::Octree<PointAccessor> *octree,
template<class Octree>
bool drawSamplesFromCellContainingPoint(Octree *octree,
const Point &p,
std::size_t level,
std::set<std::size_t> &indices,
const std::vector<int> &shapeIndex,
std::size_t requiredSamples) {

typedef typename internal::Octree<PointAccessor>::Cell Cell;
typedef typename Octree::Cell Cell;

bool upperZ, upperY, upperX;
const Cell *cur = octree->root();
Expand Down

0 comments on commit 00f3223

Please sign in to comment.