Go to the documentation of this file.00001 #ifndef bsol_point_index_3d_h_
00002 #define bsol_point_index_3d_h_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <vcl_vector.h>
00019 #include <vbl/vbl_array_2d.h>
00020 #include <vsol/vsol_box_3d_sptr.h>
00021 #include <vsol/vsol_point_3d_sptr.h>
00022
00023 class bsol_point_index_3d
00024 {
00025 public:
00026 bsol_point_index_3d();
00027 bsol_point_index_3d(int nrows, int ncols, int nslabs,
00028 vsol_box_3d_sptr const& bb);
00029 bsol_point_index_3d(int nrows, int ncols, int nslabs,
00030 vcl_vector<vsol_point_3d_sptr> const& points);
00031 ~bsol_point_index_3d();
00032
00033 int ncols() const {return ncols_;}
00034 int nrows() const {return nrows_;}
00035 int nslabs() const {return nrows_;}
00036 double row_spacing() const {return row_spacing_;}
00037 double col_spacing() const {return col_spacing_;}
00038 double slab_spacing() const {return slab_spacing_;}
00039
00040 void origin(double& x0, double& y0, double& z0);
00041
00042 int n_points(const int row, const int col, const int slab);
00043
00044 int n_points(const double x, const double y, const double z);
00045
00046 int n_points();
00047
00048
00049 vcl_vector<vsol_point_3d_sptr> points(const int row, const int col,
00050 const int slab);
00051
00052 vcl_vector<vsol_point_3d_sptr> points();
00053
00054
00055 vsol_box_3d_sptr index_cell(const int row, const int col, const int slab);
00056
00057
00058 vsol_box_3d_sptr index_cell(const double x, const double y, const double z);
00059
00060
00061 vsol_box_3d_sptr point_bounds();
00062
00063
00064 bool add_point(vsol_point_3d_sptr const& p);
00065 bool add_points(vcl_vector<vsol_point_3d_sptr> const& points);
00066
00067
00068 bool mark_point(vsol_point_3d_sptr& p);
00069
00070 bool unmark_point(vsol_point_3d_sptr& p);
00071
00072
00073 bool marked(vsol_point_3d_sptr const& p);
00074
00075
00076
00077
00078 bool find_point(vsol_point_3d_sptr const& p);
00079
00080
00081 bool in_box(vsol_box_3d_sptr const& box,
00082 vcl_vector<vsol_point_3d_sptr>& points);
00083
00084
00085 bool in_radius(const double radius, vsol_point_3d_sptr const& p,
00086 vcl_vector<vsol_point_3d_sptr>& points);
00087
00088
00089 bool closest_in_radius(const double radius, vsol_point_3d_sptr const& p,
00090 vsol_point_3d_sptr& point);
00091
00092
00093 void clear();
00094
00095 void clear_marks();
00096 private:
00097
00098 bool trans(const double x, const double y, const double z,
00099 int& row, int& col, int& slab);
00100
00101 int nrows_;
00102 int ncols_;
00103 int nslabs_;
00104 double row_spacing_;
00105 double col_spacing_;
00106 double slab_spacing_;
00107
00108 vsol_box_3d_sptr b_box_;
00109
00110
00111
00112
00113 vbl_array_2d<vcl_vector<vcl_vector<vsol_point_3d_sptr> >* > point_array_;
00114 };
00115
00116 #endif