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

OctreeNode Class Reference

#include <sps.H>

Inheritance diagram for OctreeNode:

Inheritance graph
[legend]
Collaboration diagram for OctreeNode:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 OctreeNode (Wpt min, Wpt max, int height, OctreeNode *p)
 ~OctreeNode ()
void build_octree (int height)
void set_leaf (bool leaf)
bool get_leaf ()
void set_disp (bool disp)
bool get_disp ()
int get_height ()
double get_area ()
OctreeNode ** get_children ()
OctreeNodeparent ()
ARRAY< OctreeNode * > & neibors ()
ARRAY< OctreeNode * > & terms ()
void set_neibors ()
void set_terms ()
int get_term_index ()
Bface_listintersects ()
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 Member Functions

void set_terms (ARRAY< OctreeNode * > &terms, int &count)

Protected Attributes

int _height
int _term_index
double _area
bool _leaf
bool _display
OctreeNode_parent
ARRAY< OctreeNode * > _neibors
ARRAY< OctreeNode * > _terms
OctreeNode_children [8]
Bface_list _intersects
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 10 of file sps.H.


Constructor & Destructor Documentation

OctreeNode::OctreeNode Wpt  min,
Wpt  max,
int  height,
OctreeNode p
[inline]
 

Definition at line 14 of file sps.H.

References _area, _display, _leaf, BBOX::_max, BBOX::_min, and BBOX::_valid.

Referenced by build_octree().

OctreeNode::~OctreeNode  )  [inline]
 

Definition at line 26 of file sps.H.

References _children, _intersects, _leaf, _neibors, _terms, and ARRAY< T >::clear().


Member Function Documentation

void OctreeNode::build_octree int  height  ) 
 

Definition at line 432 of file sps.C.

References _children, _height, _intersects, _leaf, bface_bbox(), build_octree(), BBOX::contains(), intersects(), j, Bvert::loc(), ARRAY< T >::num(), OctreeNode(), BBOX::overlaps(), BBOX::points(), set_disp(), set_leaf(), Bface::v1(), Bface::v2(), and Bface::v3().

Referenced by build_octree(), generate_samples(), and sps().

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

Center of the bounding box.

Definition at line 49 of file bbox.H.

References BBOX::_max, and BBOX::_min.

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

bool BBOX::contains mlib::CWpt p  )  const [inherited]
 

Does the box contain the given point?

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

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

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

Definition at line 51 of file bbox.H.

References BBOX::_max, and BBOX::_min.

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

double OctreeNode::get_area  )  [inline]
 

Definition at line 44 of file sps.H.

References _area.

Referenced by QuadtreeNode::build_quadtree().

OctreeNode** OctreeNode::get_children  )  [inline]
 

Definition at line 45 of file sps.H.

References _children.

Referenced by Collide::buildCollisionList(), set_neibors(), TestSPSapp::visit(), and visit().

bool OctreeNode::get_disp  )  [inline]
 

Definition at line 42 of file sps.H.

References _display.

Referenced by set_neibors(), TestSPSapp::visit(), and visit().

int OctreeNode::get_height  )  [inline]
 

Definition at line 43 of file sps.H.

References _height.

bool OctreeNode::get_leaf  )  [inline]
 

Definition at line 40 of file sps.H.

References _leaf.

Referenced by Collide::buildCollisionList(), set_neibors(), TestSPSapp::visit(), and visit().

int OctreeNode::get_term_index  )  [inline]
 

Definition at line 51 of file sps.H.

References _term_index.

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

Does box intersect the given ray?

Bface_list& OctreeNode::intersects  )  [inline]
 

Definition at line 52 of file sps.H.

References _intersects.

Referenced by build_octree(), Collide::buildCollisionList(), generate_samples(), sps(), and visit().

bool BBOX::is_off_screen  )  [inherited]
 

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, BBOX::center(), BBOX::dim(), mlib::Vec3< V >::length_sqrd(), VIEW::peek_cam_const(), sqr(), and BBOX::valid().

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

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

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

Definition at line 47 of file bbox.H.

References BBOX::_max.

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

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

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

Definition at line 45 of file bbox.H.

References BBOX::_min.

Referenced by generate_samples(), BBOX::operator==(), BBOX::overlaps(), 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 [inherited]
 

ARRAY<OctreeNode*>& OctreeNode::neibors  )  [inline]
 

Definition at line 47 of file sps.H.

References _neibors.

Referenced by set_neibors().

BBOX& BBOX::operator *= mlib::CWtransf x  )  [inherited]
 

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

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

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

Definition at line 72 of file bbox.H.

References BBOX::update().

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

Are the two boxes identical?

Definition at line 96 of file bbox.H.

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

bool BBOX::overlaps CBBOX &  b  )  const [inherited]
 

Does the box (partially) overlap the given box?

Definition at line 314 of file bbox.C.

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

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

OctreeNode* OctreeNode::parent  )  [inline]
 

Definition at line 46 of file sps.H.

References _parent.

bool BBOX::points mlib::Wpt_list p  )  const [inherited]
 

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 BBOX::_max, BBOX::_min, BBOX::_valid, mlib::Pointlist< L, P, V, S >::clear(), BBOX::dim(), and ARRAY< T >::realloc().

Referenced by build_octree().

void BBOX::reset  )  [inline, inherited]
 

Invalidate.

Definition at line 41 of file bbox.H.

References BBOX::_valid.

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

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

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

Definition at line 89 of file bbox.H.

References BBOX::_max, BBOX::_min, and BBOX::_valid.

Referenced by GESTURE::init().

void OctreeNode::set_disp bool  disp  )  [inline]
 

Definition at line 41 of file sps.H.

References _display.

Referenced by build_octree(), generate_samples(), and sps().

void OctreeNode::set_leaf bool  leaf  )  [inline]
 

Definition at line 39 of file sps.H.

References _leaf.

Referenced by build_octree(), generate_samples(), and sps().

void OctreeNode::set_neibors  ) 
 

Definition at line 328 of file sps.C.

References _children, _display, _height, _leaf, _neibors, _parent, BBOX::BBOX(), BBOX::dim(), get_children(), get_disp(), get_leaf(), j, BBOX::max(), BBOX::min(), neibors(), ARRAY< T >::num(), BBOX::overlaps(), and set_neibors().

Referenced by generate_samples(), set_neibors(), and sps().

void OctreeNode::set_terms ARRAY< OctreeNode * > &  terms,
int &  count
[protected]
 

Definition at line 367 of file sps.C.

References _children, _display, _leaf, _term_index, and set_terms().

void OctreeNode::set_terms  ) 
 

Definition at line 382 of file sps.C.

References _terms, and ARRAY< T >::clear().

Referenced by generate_samples(), set_terms(), and sps().

ARRAY<OctreeNode*>& OctreeNode::terms  )  [inline]
 

Definition at line 48 of file sps.H.

References _terms.

Referenced by generate_samples(), and sps().

BBOX& BBOX::update mlib::CWpt_list p  )  [inherited]
 

Modify self to bound the given point list.

BBOX& BBOX::update mlib::CWpt p  )  [inherited]
 

Modify self to bound the given point.

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

bool BBOX::valid  )  const [inline, inherited]
 

Is bounding box a valid one?

Definition at line 43 of file bbox.H.

References BBOX::_valid.

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

double BBOX::volume  )  const [inline, inherited]
 

Definition at line 53 of file bbox.H.

References BBOX::_max, and BBOX::_min.


Friends And Related Function Documentation

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

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, inherited]
 

Output bounding box info to text stream.

Definition at line 91 of file bbox.H.


Member Data Documentation

double OctreeNode::_area [protected]
 

Definition at line 60 of file sps.H.

Referenced by get_area(), and OctreeNode().

OctreeNode* OctreeNode::_children[8] [protected]
 

Definition at line 66 of file sps.H.

Referenced by build_octree(), get_children(), set_neibors(), set_terms(), and ~OctreeNode().

bool OctreeNode::_display [protected]
 

Definition at line 62 of file sps.H.

Referenced by get_disp(), OctreeNode(), set_disp(), set_neibors(), and set_terms().

int OctreeNode::_height [protected]
 

Definition at line 59 of file sps.H.

Referenced by build_octree(), get_height(), and set_neibors().

Bface_list OctreeNode::_intersects [protected]
 

Definition at line 67 of file sps.H.

Referenced by build_octree(), intersects(), and ~OctreeNode().

bool OctreeNode::_leaf [protected]
 

Definition at line 61 of file sps.H.

Referenced by build_octree(), get_leaf(), OctreeNode(), set_leaf(), set_neibors(), set_terms(), and ~OctreeNode().

mlib::Wpt BBOX::_max [protected, inherited]
 

One of the two corners defining the box extent.

Definition at line 29 of file bbox.H.

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

mlib::Wpt BBOX::_min [protected, inherited]
 

One of the two corners defining the box extent.

Definition at line 30 of file bbox.H.

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

ARRAY<OctreeNode*> OctreeNode::_neibors [protected]
 

Definition at line 64 of file sps.H.

Referenced by neibors(), set_neibors(), and ~OctreeNode().

OctreeNode* OctreeNode::_parent [protected]
 

Definition at line 63 of file sps.H.

Referenced by parent(), and set_neibors().

int OctreeNode::_term_index [protected]
 

Definition at line 59 of file sps.H.

Referenced by get_term_index(), and set_terms().

ARRAY<OctreeNode*> OctreeNode::_terms [protected]
 

Definition at line 65 of file sps.H.

Referenced by set_terms(), terms(), and ~OctreeNode().

bool BBOX::_valid [protected, inherited]
 

is bounding box valid?

Definition at line 28 of file bbox.H.

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


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