Public Member Functions | Private Member Functions | Private Attributes
bsol_point_index_2d Class Reference

#include <bsol_point_index_2d.h>

List of all members.

Public Member Functions

 bsol_point_index_2d (int nrows, int ncols, vsol_box_2d_sptr const &bb)
 Constructors.
 bsol_point_index_2d (int nrows, int ncols, vcl_vector< vsol_point_2d_sptr > const &points)
 ~bsol_point_index_2d ()
 Destructor.
int ncols () const
 accessors.
int nrows () const
double row_spacing () const
double col_spacing () const
void origin (double &x0, double &y0)
 origin of the index space.
int n_points (const int row, const int col)
 number of points in a cell at r, c.
int n_points (const double x, const double y)
 number of points in a cell at x, y.
int n_points ()
 total number of points in the index.
vcl_vector< vsol_point_2d_sptrpoints (const int row, const int col)
 the points in an index cell.
vcl_vector< vsol_point_2d_sptrpoints ()
 all points in the index.
vsol_box_2d_sptr index_cell (const int row, const int col)
 the box corresponding to an index cell, r, c.
vsol_box_2d_sptr index_cell (const double x, const double y)
 the box corresponding to an index cell, x , y.
vsol_box_2d_sptr point_bounds ()
 the box corresponding to the bounds of all points in the index.
bool add_point (vsol_point_2d_sptr const &p)
 mutators.
bool add_points (vcl_vector< vsol_point_2d_sptr > const &points)
bool mark_point (vsol_point_2d_sptr &p)
 mark as not in index, but point remains. Useful for matching.
bool unmark_point (vsol_point_2d_sptr &p)
 clear mark.
bool marked (vsol_point_2d_sptr const &p)
 Is a point marked.
bool find_point (vsol_point_2d_sptr const &p)
 find a point in the index.
bool in_radius (const double radius, vsol_point_2d_sptr const &p, vcl_vector< vsol_point_2d_sptr > &points)
 find the points within a radius of a point, possibly none.
bool closest_in_radius (const double radius, vsol_point_2d_sptr const &p, vsol_point_2d_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

 bsol_point_index_2d ()
bool trans (const double x, const double y, int &row, int &col)
 offset to origin of bounds and convert to cell integer coordinates.

Private Attributes

int nrows_
int ncols_
double row_spacing_
double col_spacing_
vsol_box_2d_sptr b_box_
vcl_vector< vcl_vector
< vcl_vector
< vsol_point_2d_sptr > > > 
point_array_

Detailed Description

Definition at line 21 of file bsol_point_index_2d.h.


Constructor & Destructor Documentation

bsol_point_index_2d::bsol_point_index_2d ( ) [inline, private]

Definition at line 23 of file bsol_point_index_2d.h.

bsol_point_index_2d::bsol_point_index_2d ( int  nrows,
int  ncols,
vsol_box_2d_sptr const &  bb 
)

Constructors.

Definition at line 29 of file bsol_point_index_2d.cxx.

bsol_point_index_2d::bsol_point_index_2d ( int  nrows,
int  ncols,
vcl_vector< vsol_point_2d_sptr > const &  points 
)

Definition at line 52 of file bsol_point_index_2d.cxx.

bsol_point_index_2d::~bsol_point_index_2d ( )

Destructor.

Definition at line 75 of file bsol_point_index_2d.cxx.


Member Function Documentation

bool bsol_point_index_2d::add_point ( vsol_point_2d_sptr const &  p)

mutators.

Add a point to the index.

Should check for duplicate points, but not doing that right now.

Definition at line 93 of file bsol_point_index_2d.cxx.

bool bsol_point_index_2d::add_points ( vcl_vector< vsol_point_2d_sptr > const &  points)

Definition at line 105 of file bsol_point_index_2d.cxx.

void bsol_point_index_2d::clear ( void  )

remove all points from the index, bounds remain the same.

Definition at line 184 of file bsol_point_index_2d.cxx.

void bsol_point_index_2d::clear_marks ( )

clear marks.

Definition at line 228 of file bsol_point_index_2d.cxx.

bool bsol_point_index_2d::closest_in_radius ( const double  radius,
vsol_point_2d_sptr const &  p,
vsol_point_2d_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 168 of file bsol_point_index_2d.cxx.

double bsol_point_index_2d::col_spacing ( ) const [inline]

Definition at line 33 of file bsol_point_index_2d.h.

bool bsol_point_index_2d::find_point ( vsol_point_2d_sptr const &  p)

find a point in the index.

Definition at line 115 of file bsol_point_index_2d.cxx.

bool bsol_point_index_2d::in_radius ( const double  radius,
vsol_point_2d_sptr const &  p,
vcl_vector< vsol_point_2d_sptr > &  points 
)

find the points within a radius of a point, possibly none.

find the points within a radius of p.

Definition at line 131 of file bsol_point_index_2d.cxx.

vsol_box_2d_sptr bsol_point_index_2d::index_cell ( const int  row,
const int  col 
)

the box corresponding to an index cell, r, c.

Definition at line 287 of file bsol_point_index_2d.cxx.

vsol_box_2d_sptr bsol_point_index_2d::index_cell ( const double  x,
const double  y 
)

the box corresponding to an index cell, x , y.

Definition at line 303 of file bsol_point_index_2d.cxx.

bool bsol_point_index_2d::mark_point ( vsol_point_2d_sptr p)

mark as not in index, but point remains. Useful for matching.

Definition at line 191 of file bsol_point_index_2d.cxx.

bool bsol_point_index_2d::marked ( vsol_point_2d_sptr const &  p)

Is a point marked.

Definition at line 207 of file bsol_point_index_2d.cxx.

int bsol_point_index_2d::n_points ( const int  row,
const int  col 
)

number of points in a cell at r, c.

Definition at line 247 of file bsol_point_index_2d.cxx.

int bsol_point_index_2d::n_points ( const double  x,
const double  y 
)

number of points in a cell at x, y.

Definition at line 256 of file bsol_point_index_2d.cxx.

int bsol_point_index_2d::n_points ( )

total number of points in the index.

Definition at line 267 of file bsol_point_index_2d.cxx.

int bsol_point_index_2d::ncols ( ) const [inline]

accessors.

Definition at line 30 of file bsol_point_index_2d.h.

int bsol_point_index_2d::nrows ( ) const [inline]

Definition at line 31 of file bsol_point_index_2d.h.

void bsol_point_index_2d::origin ( double &  x0,
double &  y0 
)

origin of the index space.

Definition at line 237 of file bsol_point_index_2d.cxx.

vsol_box_2d_sptr bsol_point_index_2d::point_bounds ( )

the box corresponding to the bounds of all points in the index.

Definition at line 314 of file bsol_point_index_2d.cxx.

vcl_vector< vsol_point_2d_sptr > bsol_point_index_2d::points ( const int  row,
const int  col 
)

the points in an index cell.

Definition at line 278 of file bsol_point_index_2d.cxx.

vcl_vector< vsol_point_2d_sptr > bsol_point_index_2d::points ( )

all points in the index.

Definition at line 214 of file bsol_point_index_2d.cxx.

double bsol_point_index_2d::row_spacing ( ) const [inline]

Definition at line 32 of file bsol_point_index_2d.h.

bool bsol_point_index_2d::trans ( const double  x,
const double  y,
int &  row,
int &  col 
) [private]

offset to origin of bounds and convert to cell integer coordinates.

Definition at line 80 of file bsol_point_index_2d.cxx.

bool bsol_point_index_2d::unmark_point ( vsol_point_2d_sptr p)

clear mark.

Definition at line 199 of file bsol_point_index_2d.cxx.


Member Data Documentation

Definition at line 99 of file bsol_point_index_2d.h.

Definition at line 97 of file bsol_point_index_2d.h.

Definition at line 95 of file bsol_point_index_2d.h.

Definition at line 94 of file bsol_point_index_2d.h.

vcl_vector<vcl_vector<vcl_vector<vsol_point_2d_sptr> > > bsol_point_index_2d::point_array_ [private]

Definition at line 102 of file bsol_point_index_2d.h.

Definition at line 96 of file bsol_point_index_2d.h.


The documentation for this class was generated from the following files: