Skip to content

Commit

Permalink
Merge branch 'dev' into alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
larc committed Sep 21, 2023
2 parents 8a93e54 + 89edb18 commit 8476f9f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
sudo apt update
sudo apt install \
libarmadillo-dev \
libflann-dev \
libeigen3-dev \
libcgal-dev \
libsuitesparse-dev \
Expand All @@ -36,6 +35,11 @@ jobs:
libglfw3-dev \
cimg-dev \
wget
wget http://mirrors.kernel.org/ubuntu/pool/universe/f/flann/libflann-dev_1.9.2+dfsg-1_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/f/flann/libflann1.9_1.9.2+dfsg-1_amd64.deb
sudo dpkg -i libflann1.9_1.9.2+dfsg-1_amd64.deb
sudo dpkg -i libflann-dev_1.9.2+dfsg-1_amd64.deb
sudo apt install -f
- name: Install Cuda
if: matrix.cuda == 'cuda'
Expand Down
4 changes: 3 additions & 1 deletion include/gproshan/pointcloud/knn.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ class k3tree
k3tree(const point * pc, const size_t & n_points, const size_t & k = 8, const std::vector<point> & query = {});
~k3tree();

int * operator () (const index_t & i) const;
const int * operator [] (const index_t & i) const;
const int * operator () (const index_t & i) const;
const int & operator () (const index_t & i, const index_t & j) const;
};


Expand Down
2 changes: 1 addition & 1 deletion src/gproshan/app_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ bool app_viewer::process_knn(viewer * p_view)
for(const index_t & p: query)
{
const int * result = k3tree(p);
for(index_t i = 0; i < 8; ++i)
for(int i = 0; i < k; ++i)
mesh.selected.push_back(result[i]);
}
}
Expand Down
12 changes: 11 additions & 1 deletion src/gproshan/pointcloud/knn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,21 @@ k3tree::~k3tree()
delete [] indices.ptr();
}

int * k3tree::operator () (const index_t & i) const
const int * k3tree::operator [] (const index_t & i) const
{
return indices[i];
}

const int * k3tree::operator () (const index_t & i) const
{
return indices[i];
}

const int & k3tree::operator () (const index_t & i, const index_t & j) const
{
return indices[i][j];
}


} // namespace gproshan

0 comments on commit 8476f9f

Please sign in to comment.