#include <bsol_point_index_3d.h>
Public Member Functions | |
bsol_point_index_3d () | |
bsol_point_index_3d (int nrows, int ncols, int nslabs, vsol_box_3d_sptr const &bb) | |
bsol_point_index_3d (int nrows, int ncols, int nslabs, vcl_vector< vsol_point_3d_sptr > const &points) | |
~bsol_point_index_3d () | |
int | ncols () const |
accessors. | |
int | nrows () const |
int | nslabs () const |
double | row_spacing () const |
double | col_spacing () const |
double | slab_spacing () const |
void | origin (double &x0, double &y0, double &z0) |
origin of the index space. | |
int | n_points (const int row, const int col, const int slab) |
number of points in a cell at r, c, s. | |
int | n_points (const double x, const double y, const double z) |
number of points in a cell at x, y, z. | |
int | n_points () |
total number of points in the index. | |
vcl_vector< vsol_point_3d_sptr > | points (const int row, const int col, const int slab) |
the points in an index cell. | |
vcl_vector< vsol_point_3d_sptr > | points () |
all points in the index. | |
vsol_box_3d_sptr | index_cell (const int row, const int col, const int slab) |
the box corresponding to a volume index cell, r, c, s. | |
vsol_box_3d_sptr | index_cell (const double x, const double y, const double z) |
the box corresponding to a volume index cell, x , y, z. | |
vsol_box_3d_sptr | point_bounds () |
the box corresponding to the bounds of all points in the index. | |
bool | add_point (vsol_point_3d_sptr const &p) |
mutators. | |
bool | add_points (vcl_vector< vsol_point_3d_sptr > const &points) |
bool | mark_point (vsol_point_3d_sptr &p) |
mark as not in index, but point remains. Useful for matching. | |
bool | unmark_point (vsol_point_3d_sptr &p) |
clear mark. | |
bool | marked (vsol_point_3d_sptr const &p) |
Is a point marked. | |
bool | find_point (vsol_point_3d_sptr const &p) |
find a point in the index, based on pointer equivalence. | |
bool | in_box (vsol_box_3d_sptr const &box, vcl_vector< vsol_point_3d_sptr > &points) |
find the points within a specified box. | |
bool | in_radius (const double radius, vsol_point_3d_sptr const &p, vcl_vector< vsol_point_3d_sptr > &points) |
find the points within a radius of a point, possibly none. | |
bool | closest_in_radius (const double radius, vsol_point_3d_sptr const &p, vsol_point_3d_sptr &point) |
find the closest point to p within a radius, possibly none. | |
void | clear () |
remove all points from the index, bounds remain the same. | |
void | clear_marks () |
clear marks. | |
Private Member Functions | |
bool | trans (const double x, const double y, const double z, int &row, int &col, int &slab) |
offset to origin of bounds and convert to cell integer coordinates. | |
Private Attributes | |
int | nrows_ |
int | ncols_ |
int | nslabs_ |
double | row_spacing_ |
double | col_spacing_ |
double | slab_spacing_ |
vsol_box_3d_sptr | b_box_ |
vbl_array_2d< vcl_vector < vcl_vector < vsol_point_3d_sptr > > * > | point_array_ |
Definition at line 22 of file bsol_point_index_3d.h.
bsol_point_index_3d::bsol_point_index_3d | ( | ) |
Definition at line 30 of file bsol_point_index_3d.cxx.
bsol_point_index_3d::bsol_point_index_3d | ( | int | nrows, |
int | ncols, | ||
int | nslabs, | ||
vsol_box_3d_sptr const & | bb | ||
) |
Definition at line 38 of file bsol_point_index_3d.cxx.
bsol_point_index_3d::bsol_point_index_3d | ( | int | nrows, |
int | ncols, | ||
int | nslabs, | ||
vcl_vector< vsol_point_3d_sptr > const & | points | ||
) |
Definition at line 68 of file bsol_point_index_3d.cxx.
bsol_point_index_3d::~bsol_point_index_3d | ( | ) |
Definition at line 101 of file bsol_point_index_3d.cxx.
bool bsol_point_index_3d::add_point | ( | vsol_point_3d_sptr const & | p | ) |
mutators.
Add a point to the index.
Should check for duplicate points, but not doing that right now.
Definition at line 171 of file bsol_point_index_3d.cxx.
bool bsol_point_index_3d::add_points | ( | vcl_vector< vsol_point_3d_sptr > const & | points | ) |
Definition at line 184 of file bsol_point_index_3d.cxx.
void bsol_point_index_3d::clear | ( | void | ) |
remove all points from the index, bounds remain the same.
Definition at line 304 of file bsol_point_index_3d.cxx.
void bsol_point_index_3d::clear_marks | ( | ) |
clear marks.
Definition at line 350 of file bsol_point_index_3d.cxx.
bool bsol_point_index_3d::closest_in_radius | ( | const double | radius, |
vsol_point_3d_sptr const & | p, | ||
vsol_point_3d_sptr & | point | ||
) |
find the closest point to p within a radius, possibly none.
find the closest point with the specified radius. If none return false.
Definition at line 288 of file bsol_point_index_3d.cxx.
double bsol_point_index_3d::col_spacing | ( | ) | const [inline] |
Definition at line 36 of file bsol_point_index_3d.h.
bool bsol_point_index_3d::find_point | ( | vsol_point_3d_sptr const & | p | ) |
find a point in the index, based on pointer equivalence.
Definition at line 194 of file bsol_point_index_3d.cxx.
bool bsol_point_index_3d::in_box | ( | vsol_box_3d_sptr const & | box, |
vcl_vector< vsol_point_3d_sptr > & | points | ||
) |
find the points within a specified box.
find the points within a box.
Definition at line 210 of file bsol_point_index_3d.cxx.
bool bsol_point_index_3d::in_radius | ( | const double | radius, |
vsol_point_3d_sptr const & | p, | ||
vcl_vector< vsol_point_3d_sptr > & | points | ||
) |
find the points within a radius of a point, possibly none.
find the points within a radius of p.
Definition at line 248 of file bsol_point_index_3d.cxx.
vsol_box_3d_sptr bsol_point_index_3d::index_cell | ( | const int | row, |
const int | col, | ||
const int | slab | ||
) |
the box corresponding to a volume index cell, r, c, s.
Definition at line 361 of file bsol_point_index_3d.cxx.
vsol_box_3d_sptr bsol_point_index_3d::index_cell | ( | const double | x, |
const double | y, | ||
const double | z | ||
) |
the box corresponding to a volume index cell, x , y, z.
Definition at line 378 of file bsol_point_index_3d.cxx.
bool bsol_point_index_3d::mark_point | ( | vsol_point_3d_sptr & | p | ) |
mark as not in index, but point remains. Useful for matching.
Definition at line 312 of file bsol_point_index_3d.cxx.
bool bsol_point_index_3d::marked | ( | vsol_point_3d_sptr const & | p | ) |
Is a point marked.
Definition at line 328 of file bsol_point_index_3d.cxx.
int bsol_point_index_3d::n_points | ( | const int | row, |
const int | col, | ||
const int | slab | ||
) |
number of points in a cell at r, c, s.
Definition at line 117 of file bsol_point_index_3d.cxx.
int bsol_point_index_3d::n_points | ( | const double | x, |
const double | y, | ||
const double | z | ||
) |
number of points in a cell at x, y, z.
Definition at line 126 of file bsol_point_index_3d.cxx.
int bsol_point_index_3d::n_points | ( | ) |
total number of points in the index.
Definition at line 136 of file bsol_point_index_3d.cxx.
int bsol_point_index_3d::ncols | ( | ) | const [inline] |
accessors.
Definition at line 32 of file bsol_point_index_3d.h.
int bsol_point_index_3d::nrows | ( | ) | const [inline] |
Definition at line 33 of file bsol_point_index_3d.h.
int bsol_point_index_3d::nslabs | ( | ) | const [inline] |
Definition at line 34 of file bsol_point_index_3d.h.
void bsol_point_index_3d::origin | ( | double & | x0, |
double & | y0, | ||
double & | z0 | ||
) |
origin of the index space.
Definition at line 108 of file bsol_point_index_3d.cxx.
vsol_box_3d_sptr bsol_point_index_3d::point_bounds | ( | ) |
the box corresponding to the bounds of all points in the index.
Definition at line 389 of file bsol_point_index_3d.cxx.
vcl_vector< vsol_point_3d_sptr > bsol_point_index_3d::points | ( | const int | row, |
const int | col, | ||
const int | slab | ||
) |
the points in an index cell.
Definition at line 146 of file bsol_point_index_3d.cxx.
vcl_vector< vsol_point_3d_sptr > bsol_point_index_3d::points | ( | ) |
all points in the index.
Definition at line 335 of file bsol_point_index_3d.cxx.
double bsol_point_index_3d::row_spacing | ( | ) | const [inline] |
Definition at line 35 of file bsol_point_index_3d.h.
double bsol_point_index_3d::slab_spacing | ( | ) | const [inline] |
Definition at line 37 of file bsol_point_index_3d.h.
bool bsol_point_index_3d::trans | ( | const double | x, |
const double | y, | ||
const double | z, | ||
int & | row, | ||
int & | col, | ||
int & | slab | ||
) | [private] |
offset to origin of bounds and convert to cell integer coordinates.
Definition at line 156 of file bsol_point_index_3d.cxx.
bool bsol_point_index_3d::unmark_point | ( | vsol_point_3d_sptr & | p | ) |
clear mark.
Definition at line 320 of file bsol_point_index_3d.cxx.
vsol_box_3d_sptr bsol_point_index_3d::b_box_ [private] |
Definition at line 107 of file bsol_point_index_3d.h.
double bsol_point_index_3d::col_spacing_ [private] |
Definition at line 104 of file bsol_point_index_3d.h.
int bsol_point_index_3d::ncols_ [private] |
Definition at line 101 of file bsol_point_index_3d.h.
int bsol_point_index_3d::nrows_ [private] |
Definition at line 100 of file bsol_point_index_3d.h.
int bsol_point_index_3d::nslabs_ [private] |
Definition at line 102 of file bsol_point_index_3d.h.
vbl_array_2d<vcl_vector<vcl_vector<vsol_point_3d_sptr> >* > bsol_point_index_3d::point_array_ [private] |
Definition at line 112 of file bsol_point_index_3d.h.
double bsol_point_index_3d::row_spacing_ [private] |
Definition at line 103 of file bsol_point_index_3d.h.
double bsol_point_index_3d::slab_spacing_ [private] |
Definition at line 105 of file bsol_point_index_3d.h.