Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

BBOX Class Reference

#include <bbox.H>

Inheritance diagram for BBOX:

Inheritance graph
[legend]
Collaboration diagram for BBOX:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BBOX ()
 BBOX (mlib::CWpt &l, mlib::CWpt &h)
 BBOX (CBBOX &b)
 BBOX (CGELptr &g, int recurse=0)
void reset ()
 Invalidate.
bool valid () const
 Is bounding box a valid one?
mlib::Wpt min () const
 One of the two corners defining the box - the so-called 'minimum' corner.
mlib::Wpt max () const
 One of the two corners defining the box - the so-called 'maximum' corner.
mlib::Wpt center () const
 Center of the bounding box.
mlib::Wvec dim () const
 Vector containing the extent of the bounding box along all axes.
double volume () const
bool points (mlib::Wpt_list &p) const
 Return the 8 corners of the box through the reference p, function return value indicating if box is valid or not.
bool overlaps (CBBOX &b) const
 Does the box (partially) overlap the given box?
bool contains (mlib::CWpt &p) const
 Does the box contain the given point?
bool intersects (CRAYhit &r, mlib::CWtransf &m) const
 Does box intersect the given ray?
bool is_off_screen ()
 if this returns true, the bbox is definitely offscreen, but if it returns false the bbox may or may not be offscreen.
void ndcz_bounding_box (mlib::CWtransf &obj_to_ndc, mlib::NDCZpt &min_pt, mlib::NDCZpt &max_pt) const
BBOXoperator+= (CBBOX &b)
 Expands to subsume the given bounding box, if it is valid.
BBOXoperator *= (mlib::CWtransf &x)
 Apply the given transform to the corner points of this box.
BBOXupdate (mlib::CWpt &p)
 Modify self to bound the given point.
BBOXupdate (mlib::CWpt_list &p)
 Modify self to bound the given point list.
void set (mlib::CWpt &l, mlib::CWpt &h)
 Force self to be bounding box between the two points provided.
bool operator== (CBBOX &bb) const
 Are the two boxes identical?

Protected Attributes

bool _valid
 is bounding box valid?
mlib::Wpt _max
 One of the two corners defining the box extent.
mlib::Wpt _min
 One of the two corners defining the box extent.

Friends

BBOX operator * (mlib::CWtransf &x, CBBOX &b)
 The result of transformation of bounding box b by given world-space transform x.
ostream & operator<< (ostream &os, CBBOX &b)
 Output bounding box info to text stream.

Detailed Description

Definition at line 26 of file bbox.H.


Constructor & Destructor Documentation

BBOX::BBOX  )  [inline]
 

Definition at line 32 of file bbox.H.

Referenced by BBOX(), and OctreeNode::set_neibors().

BBOX::BBOX mlib::CWpt l,
mlib::CWpt h
[inline]
 

Definition at line 33 of file bbox.H.

BBOX::BBOX CBBOX &  b  )  [inline]
 

Definition at line 37 of file bbox.H.

BBOX::BBOX CGELptr g,
int  recurse = 0
 

Definition at line 9 of file bbox.C.

References BBOX().


Member Function Documentation

mlib::Wpt BBOX::center  )  const [inline]
 

Center of the bounding box.

Definition at line 49 of file bbox.H.

References _max, and _min.

Referenced by GEOM::bbox(), BMESH::compute_pix_size(), is_off_screen(), VIEW::viewall(), and visit().

bool BBOX::contains mlib::CWpt p  )  const
 

Does the box contain the given point?

Referenced by OctreeNode::build_octree(), and QuadtreeNode::build_quadtree().

mlib::Wvec BBOX::dim  )  const [inline]
 

Vector containing the extent of the bounding box along all axes.

Definition at line 51 of file bbox.H.

References _max, and _min.

Referenced by QuadtreeNode::build_quadtree(), BMESH::compute_pix_size(), LMESH::fit(), is_off_screen(), points(), OctreeNode::set_neibors(), sps(), VIEW::viewall(), and TestSPSapp::visit().

bool BBOX::intersects CRAYhit &  r,
mlib::CWtransf m
const
 

Does box intersect the given ray?

bool BBOX::is_off_screen  ) 
 

if this returns true, the bbox is definitely offscreen, but if it returns false the bbox may or may not be offscreen.

Definition at line 103 of file bbox.C.

References CCAMdataptr, center(), dim(), mlib::Vec3< V >::length_sqrd(), VIEW::peek_cam_const(), sqr(), and valid().

Referenced by GEOM::cull(), and BaseJOTapp::load_scene().

mlib::Wpt BBOX::max  )  const [inline]
 

One of the two corners defining the box - the so-called 'maximum' corner.

Definition at line 47 of file bbox.H.

References _max.

Referenced by generate_samples(), operator==(), overlaps(), OctreeNode::set_neibors(), and sps().

mlib::Wpt BBOX::min  )  const [inline]
 

One of the two corners defining the box - the so-called 'minimum' corner.

Definition at line 45 of file bbox.H.

References _min.

Referenced by generate_samples(), operator==(), overlaps(), OctreeNode::set_neibors(), sps(), and TestSPSapp::visit().

void BBOX::ndcz_bounding_box mlib::CWtransf obj_to_ndc,
mlib::NDCZpt min_pt,
mlib::NDCZpt max_pt
const
 

BBOX& BBOX::operator *= mlib::CWtransf x  ) 
 

Apply the given transform to the corner points of this box.

BBOX& BBOX::operator+= CBBOX &  b  )  [inline]
 

Expands to subsume the given bounding box, if it is valid.

Definition at line 72 of file bbox.H.

References update().

bool BBOX::operator== CBBOX &  bb  )  const [inline]
 

Are the two boxes identical?

Definition at line 96 of file bbox.H.

References max(), min(), and valid().

bool BBOX::overlaps CBBOX &  b  )  const
 

Does the box (partially) overlap the given box?

Definition at line 314 of file bbox.C.

References _valid, max(), and min().

Referenced by OctreeNode::build_octree(), QuadtreeNode::build_quadtree(), Collide::buildCollisionList(), and OctreeNode::set_neibors().

bool BBOX::points mlib::Wpt_list p  )  const
 

Return the 8 corners of the box through the reference p, function return value indicating if box is valid or not.

Definition at line 22 of file bbox.C.

References _max, _min, _valid, mlib::Pointlist< L, P, V, S >::clear(), dim(), and ARRAY< T >::realloc().

Referenced by OctreeNode::build_octree().

void BBOX::reset  )  [inline]
 

Invalidate.

Definition at line 41 of file bbox.H.

References _valid.

Referenced by BMESH::_merge(), GEOM::bbox(), and BMESH::changed().

void BBOX::set mlib::CWpt l,
mlib::CWpt h
[inline]
 

Force self to be bounding box between the two points provided.

Definition at line 89 of file bbox.H.

References _max, _min, and _valid.

Referenced by GESTURE::init().

BBOX& BBOX::update mlib::CWpt_list p  ) 
 

Modify self to bound the given point list.

BBOX& BBOX::update mlib::CWpt p  ) 
 

Modify self to bound the given point.

Referenced by GESTURE::add(), bface_bbox(), LMESH::fit(), BMESH::get_bb(), and operator+=().

bool BBOX::valid  )  const [inline]
 

Is bounding box a valid one?

Definition at line 43 of file bbox.H.

References _valid.

Referenced by BODY::bb_valid(), BMESH::get_bb(), GEOM::is_3D(), is_off_screen(), and operator==().

double BBOX::volume  )  const [inline]
 

Definition at line 53 of file bbox.H.

References _max, and _min.


Friends And Related Function Documentation

BBOX operator * mlib::CWtransf x,
CBBOX &  b
[friend]
 

The result of transformation of bounding box b by given world-space transform x.

Definition at line 79 of file bbox.H.

ostream& operator<< ostream &  os,
CBBOX &  b
[friend]
 

Output bounding box info to text stream.

Definition at line 91 of file bbox.H.


Member Data Documentation

mlib::Wpt BBOX::_max [protected]
 

One of the two corners defining the box extent.

Definition at line 29 of file bbox.H.

Referenced by center(), dim(), max(), OctreeNode::OctreeNode(), points(), set(), and volume().

mlib::Wpt BBOX::_min [protected]
 

One of the two corners defining the box extent.

Definition at line 30 of file bbox.H.

Referenced by center(), dim(), min(), OctreeNode::OctreeNode(), points(), set(), and volume().

bool BBOX::_valid [protected]
 

is bounding box valid?

Definition at line 28 of file bbox.H.

Referenced by OctreeNode::OctreeNode(), overlaps(), points(), reset(), set(), and valid().


The documentation for this class was generated from the following files:
Generated on Mon Sep 18 11:44:26 2006 for jot by  doxygen 1.4.4