- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# col::ElemBox Class Reference

Elementary box, enclosing one polygon, for Boxtree. More...

Collaboration diagram for col::ElemBox:

[legend]
List of all members.

## Public Member Functions
| ElemBox ()
| Default constructor.
| ElemBox (const osg::FaceIterator &fi, const osg::MFPnt3f *points)
| Constructor.
void | set (const osg::FaceIterator &fi, const osg::MFPnt3f *points)
| Copy a polygon into an elementary box.
void | operator= (const ElemBox &source)
| Copy elementary box.
bool | operator== (const ElemBox &other) const
| Two elementary boxes are equal, if their polygons are equal.
## Static Public Member Functions
static void | calcBox (const vector< ElemBox > &elem, const int left, const int right, Pnt3f *low, Pnt3f *high)
| Compute bbox enclosing all elementary boxes.
## Public Attributes
Pnt3f | m_low
Pnt3f | m_high
const osg::MFPnt3f * | points
unsigned int | m_pgon [Boxtree::M_MaxNVertices]
unsigned int | m_nvertices
osg::GeometryPtr | geom
unsigned int | m_index
Pnt3f | m_center

## Detailed Description

Elementary box, enclosing one polygon, for Boxtree.

This is a helper class for Boxtree::build() only!

Author:
  Gabriel Zachmann, written 1997, re-implemented on OSG in Mar 2002.

## Constructor & Destructor Documentation

col::ElemBox::ElemBox | ( | const osg::FaceIterator & | fi,
|  | const osg::MFPnt3f * | nodepoints |
| ) |  |  |

Constructor.

See also:
  ElemBox::set

## Member Function Documentation

void col::ElemBox::set | ( | const osg::FaceIterator & | fi,
|  | const osg::MFPnt3f * | nodepoints |
| ) |  |  |

Copy a polygon into an elementary box.

Parameters:

  | fi | face iterator
  | nodepoints | the array of points of the geometry

Copies the number of vertices, vertex indices, and pgon's index of the polygon the FaceIterator fi is pointing to into the elementary box. The index is the one returned from the iterator, not the one in the Geometry's array!

Calculate and set the barycenter of the elementary box.

Todo:
  Warum werden bei GL_QUAD_STRIP die letzten beiden Vertices immer geswappt??

bool col::ElemBox::operator== | ( | const ElemBox & | other | ) | const

Two elementary boxes are equal, if their polygons are equal.

Bug:
  Does not work if the polygons are the same but the start index is different!

void col::ElemBox::calcBox | ( | const vector< ElemBox > & | elem,
|  | const int | left,
|  | const int | right,
|  | Pnt3f * | low,
|  | Pnt3f * | high |
| ) |  |  | `[static]`

Compute bbox enclosing all elementary boxes.

Parameters:

  | elem | array of elementary boxes
  | left,right | consider only elems from left..right (inclusively)
  | low,high | resulting bbox (out)

The box will not be increased by NearZero, because this has already been done for the elementary boxes.

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

- ColBoxtree.h
- ColBoxtree.cpp