SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Friends | List of all members
BBox Class Reference

#include <BBox.h>

Public Types

enum  { INSIDE, INTERSECT, OUTSIDE }
 

Public Member Functions

 BBox ()
 
 BBox (const BBox &copy)
 
BBoxoperator= (const BBox &copy)
 
 BBox (const BBox &b1, const BBox &b2)
 
 BBox (const Point &p1, const Point &p2)
 
 BBox (const Point &p1, const Point &p2, const Point &p3)
 
 BBox (const std::vector< Point > &points)
 
bool valid () const
 
void set_valid (bool v)
 
void reset ()
 
BBoxextend (const Point &p)
 Expand the bounding box to include point p. More...
 
void extend (double val)
 
void extend (const Point &p, double radius)
 
void extend (const BBox &b)
 Expand the bounding box to include bounding box b. More...
 
SCISHARE void extend_disk (const Point &cen, const Vector &normal, double r)
 
Point center () const
 
double longest_edge () const
 
double shortest_edge () const
 
SCISHARE bool is_similar_to (const BBox &b, double diff=0.5) const
 Check whether two BBoxes are similar. More...
 
SCISHARE void translate (const Vector &v)
 Move the bounding box. More...
 
SCISHARE void scale (double s, const Vector &o)
 Scale the bounding box by s, centered around o. More...
 
Point min () const
 
Point max () const
 
Vector diagonal () const
 
bool inside (const Point &p) const
 
int intersect (const BBox &b) const
 
double x_length ()
 
double y_length ()
 
double z_length ()
 
SCISHARE bool overlaps (const BBox &bb) const
 bbox's that share a face overlap More...
 
SCISHARE bool overlaps_inside (const BBox &bb) const
 bbox's that share a face do not overlap_inside More...
 
SCISHARE bool intersect (const Point &e, const Vector &v, Point &hitNear)
 

Friends

std::ostream & operator<< (std::ostream &out, const BBox &b)
 

Member Enumeration Documentation

anonymous enum
Enumerator
INSIDE 
INTERSECT 
OUTSIDE 

Constructor & Destructor Documentation

BBox ( )
inline
BBox ( const BBox copy)
inline
BBox ( const BBox b1,
const BBox b2 
)
inline
BBox ( const Point p1,
const Point p2 
)
inline
BBox ( const Point p1,
const Point p2,
const Point p3 
)
inline
BBox ( const std::vector< Point > &  points)
inlineexplicit

Member Function Documentation

Point center ( ) const
inline
Todo:
: C assert: assert(is_valid_);
Vector diagonal ( ) const
inline
BBox& extend ( const Point p)
inline

Expand the bounding box to include point p.

void extend ( double  val)
inline

Extend the bounding box on all sides by a margin For example to expand it by a certain epsilon to make sure that a lookup will be inside the bounding box

void extend ( const Point p,
double  radius 
)
inline

Expand the bounding box to include a sphere of radius radius and centered at point p

void extend ( const BBox b)
inline

Expand the bounding box to include bounding box b.

void extend_disk ( const Point cen,
const Vector normal,
double  r 
)

Expand the bounding box to include a disk centered at cen, with normal normal, and radius r.

bool inside ( const Point p) const
inline
int intersect ( const BBox b) const
inline
bool intersect ( const Point e,
const Vector v,
Point hitNear 
)

returns true if the ray hit the bbox and returns the hit point in hitNear

bool is_similar_to ( const BBox b,
double  diff = 0.5 
) const

Check whether two BBoxes are similar.

double longest_edge ( ) const
inline
Todo:
: C assert: assert(is_valid_);
Point max ( ) const
inline
Point min ( ) const
inline
BBox& operator= ( const BBox copy)
inline
bool overlaps ( const BBox bb) const

bbox's that share a face overlap

bool overlaps_inside ( const BBox bb) const

bbox's that share a face do not overlap_inside

void reset ( )
inline
void scale ( double  s,
const Vector o 
)

Scale the bounding box by s, centered around o.

void set_valid ( bool  v)
inline
double shortest_edge ( ) const
inline
Todo:
: C assert: assert(is_valid_);
void translate ( const Vector v)

Move the bounding box.

bool valid ( ) const
inline
double x_length ( )
inline
double y_length ( )
inline
double z_length ( )
inline

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const BBox b 
)
friend

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