Public Member Functions | Protected Attributes
vsol_box_2d Class Reference

A bounding box for 2d spatial objects. More...

#include <vsol_box_2d.h>

Inheritance diagram for vsol_box_2d:
Inheritance graph
[legend]

List of all members.

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_

Detailed Description

A bounding box for 2d spatial objects.

Definition at line 31 of file vsol_box_2d.h.


Constructor & Destructor Documentation

vsol_box_2d::vsol_box_2d ( ) [inline]

create an empty box.

Definition at line 38 of file vsol_box_2d.h.

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

Definition at line 40 of file vsol_box_2d.h.

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

Definition at line 43 of file vsol_box_2d.h.

vsol_box_2d::~vsol_box_2d ( ) [inline]

Definition at line 45 of file vsol_box_2d.h.


Member Function Documentation

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 33 of file vsol_box_2d.cxx.

double vsol_box_2d::area ( ) const [inline]

Definition at line 57 of file vsol_box_2d.h.

void vsol_box_2d::b_read ( vsl_b_istream is)

Binary load self from stream.

Binary load self from stream (not typically used).

Definition at line 95 of file vsol_box_2d.cxx.

void vsol_box_2d::b_write ( vsl_b_ostream os) const

Binary save self to stream.

Definition at line 88 of file vsol_box_2d.cxx.

bool vsol_box_2d::empty ( ) const [inline]

Definition at line 48 of file vsol_box_2d.h.

double vsol_box_2d::get_max_x ( ) const

Definition at line 15 of file vsol_box_2d.cxx.

double vsol_box_2d::get_max_y ( ) const

Definition at line 27 of file vsol_box_2d.cxx.

double vsol_box_2d::get_min_x ( ) const

Definition at line 9 of file vsol_box_2d.cxx.

double vsol_box_2d::get_min_y ( ) const

Definition at line 21 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 39 of file vsol_box_2d.cxx.

double vsol_box_2d::height ( ) const [inline]

Definition at line 56 of file vsol_box_2d.h.

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

is a 2D point inside the bounding box.

Definition at line 76 of file vsol_box_2d.h.

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

Return a platform independent string identifying the class.

Definition at line 93 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 96 of file vsol_box_2d.h.

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

is box about the same as this?.

Definition at line 66 of file vsol_box_2d.cxx.

bool vsol_box_2d::operator< ( vsol_box_2d b) const

a<b means a is inside b.

Determines if this box is inside the right hand side box.

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

Definition at line 50 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 118 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 77 of file vsol_box_2d.cxx.

short vsol_box_2d::version ( ) const

Return IO version number;.

Definition at line 112 of file vsol_box_2d.cxx.

double vsol_box_2d::width ( ) const [inline]

Definition at line 55 of file vsol_box_2d.h.


Member Data Documentation

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

Definition at line 34 of file vsol_box_2d.h.


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