vsol_box_2d Class Reference

#include <vsol_box_2d.h>

Inheritance diagram for vsol_box_2d:

vsol_box vbl_ref_count vul_timestamp List of all members.

Detailed Description

A bounding box for 2d spatial objects.

Definition at line 30 of file vsol_box_2d.h.


Public Member Functions

 vsol_box_2d ()
 create an empty box.
 vsol_box_2d (vsol_box_2d const &b)
 vsol_box_2d (vbl_bounding_box< double, 2 > const &b)
 ~vsol_box_2d ()
bool empty () const
double get_min_x () const
double get_max_x () const
double get_min_y () const
double get_max_y () const
double width () const
double height () const
double area () const
void add_point (double x, double y)
 enlarge the bounding box by adding the point (x,y) and taking convex hull.
void grow_minmax_bounds (vsol_box_2d_sptr const &comp_box)
 Compare this' bounds to comp_box and grow to the maximum bounding box.
bool operator< (vsol_box_2d &box) const
 a<b means a is inside b.
bool near_equal (vsol_box_2d const &box, float tolerance) const
 is box about the same as this?.
void reset_bounds ()
 reset the bounds of the box, i.e., make the box empty.
bool inside (double x, double y) const
 is a 2D point inside the bounding box.
void b_write (vsl_b_ostream &os) const
 Binary save self to stream.
void b_read (vsl_b_istream &is)
 Binary load self from stream.
short version () const
 Return IO version number;.
void print_summary (vcl_ostream &os) const
 Print an ascii summary to the stream.
virtual vcl_string is_a () const
 Return a platform independent string identifying the class.
virtual bool is_class (const vcl_string &cls) const
 Return true if the argument matches the string identifying the class or any parent class.
void ref ()
void unref ()
int get_references () const
bool is_referenced () const
void touch ()
unsigned long get_time_stamp () const
bool older (vul_timestamp const &t) const
bool older (vul_timestamp const *t) const

Protected Attributes

vbl_bounding_box< double, 2 > box_
unsigned long timestamp_

Constructor & Destructor Documentation

vsol_box_2d::vsol_box_2d (  )  [inline]

create an empty box.

Definition at line 37 of file vsol_box_2d.h.

vsol_box_2d::vsol_box_2d ( vsol_box_2d const &  b  )  [inline]

Definition at line 39 of file vsol_box_2d.h.

vsol_box_2d::vsol_box_2d ( vbl_bounding_box< double, 2 > const &  b  )  [inline]

Definition at line 42 of file vsol_box_2d.h.

vsol_box_2d::~vsol_box_2d (  )  [inline]

Definition at line 44 of file vsol_box_2d.h.


Member Function Documentation

bool vsol_box_2d::empty (  )  const [inline]

Definition at line 47 of file vsol_box_2d.h.

double vsol_box_2d::get_min_x (  )  const

Definition at line 8 of file vsol_box_2d.cxx.

double vsol_box_2d::get_max_x (  )  const

Definition at line 14 of file vsol_box_2d.cxx.

double vsol_box_2d::get_min_y (  )  const

Definition at line 20 of file vsol_box_2d.cxx.

double vsol_box_2d::get_max_y (  )  const

Definition at line 26 of file vsol_box_2d.cxx.

double vsol_box_2d::width (  )  const [inline]

Definition at line 54 of file vsol_box_2d.h.

double vsol_box_2d::height (  )  const [inline]

Definition at line 55 of file vsol_box_2d.h.

double vsol_box_2d::area (  )  const [inline]

Definition at line 56 of file vsol_box_2d.h.

void vsol_box_2d::add_point ( double  x,
double  y 
)

enlarge the bounding box by adding the point (x,y) and taking convex hull.

Definition at line 32 of file vsol_box_2d.cxx.

void vsol_box_2d::grow_minmax_bounds ( vsol_box_2d_sptr const &  comp_box  ) 

Compare this' bounds to comp_box and grow to the maximum bounding box.

I.e., take the convex union of this and comp_box

Definition at line 38 of file vsol_box_2d.cxx.

bool vsol_box_2d::operator< ( vsol_box_2d b  )  const

a<b means a is inside b.

That is, all boundaries of *this must be on or inside the boundaries of b.

Definition at line 49 of file vsol_box_2d.cxx.

bool vsol_box_2d::near_equal ( vsol_box_2d const &  box,
float  tolerance 
) const

is box about the same as this?.

Definition at line 65 of file vsol_box_2d.cxx.

void vsol_box_2d::reset_bounds (  ) 

reset the bounds of the box, i.e., make the box empty.

Definition at line 76 of file vsol_box_2d.cxx.

bool vsol_box_2d::inside ( double  x,
double  y 
) const [inline]

is a 2D point inside the bounding box.

Definition at line 75 of file vsol_box_2d.h.

void vsol_box_2d::b_write ( vsl_b_ostream os  )  const

Binary save self to stream.

Definition at line 87 of file vsol_box_2d.cxx.

void vsol_box_2d::b_read ( vsl_b_istream is  ) 

Binary load self from stream.

Definition at line 94 of file vsol_box_2d.cxx.

short vsol_box_2d::version (  )  const

Return IO version number;.

Definition at line 111 of file vsol_box_2d.cxx.

void vsol_box_2d::print_summary ( vcl_ostream &  os  )  const

Print an ascii summary to the stream.

Definition at line 117 of file vsol_box_2d.cxx.

virtual vcl_string vsol_box_2d::is_a (  )  const [inline, virtual]

Return a platform independent string identifying the class.

Definition at line 92 of file vsol_box_2d.h.

virtual bool vsol_box_2d::is_class ( const vcl_string &  cls  )  const [inline, virtual]

Return true if the argument matches the string identifying the class or any parent class.

Definition at line 95 of file vsol_box_2d.h.


Member Data Documentation

vbl_bounding_box<double,2> vsol_box_2d::box_ [protected]

Definition at line 33 of file vsol_box_2d.h.


The documentation for this class was generated from the following files:
Generated on Mon Oct 6 05:14:45 2008 for contrib/gel/vsol by  doxygen 1.5.1