|
Assignments
Assignments
|
#include <geometry.h>
Public Member Functions | |
| BoundingBox (void) | |
| BoundingBox (const Point< Dim > &p1, const Point< Dim > &p2) | |
| BoundingBox (const Point< Dim > *pList, int pSize) | |
| Point< Dim > & | operator[] (int index) |
| const Point< Dim > & | operator[] (int index) const |
| BoundingBox | operator+ (const BoundingBox &b) const |
| BoundingBox & | operator+= (const BoundingBox &b) |
| BoundingBox | operator^ (const BoundingBox &b) const |
| BoundingBox & | operator^= (const BoundingBox &b) |
| bool | isInside (const Point< Dim > &p) const |
| bool | isEmpty (void) const |
| BoundingBox< 1 > | intersect (const Ray< Dim > &ray) const |
Private Attributes | |
| Point< Dim > | _p [2] |
This templated class represents a bounding box. If any of the coefficients of the first corner are greater than or equal to the coefficients of the second, the bounding box is assumed to be empty.
| Util::BoundingBox< Dim >::BoundingBox | ( | void | ) |
The default constructor
| Util::BoundingBox< Dim >::BoundingBox | ( | const Point< Dim > & | p1, |
| const Point< Dim > & | p2 ) |
This constructor creates the (minimal) bounding box containing the two points.
| Util::BoundingBox< Dim >::BoundingBox | ( | const Point< Dim > * | pList, |
| int | pSize ) |
This constructor generates the (minimal) bounding box that contains all of the points in the input array.
| BoundingBox< 1 > Util::BoundingBox< Dim >::intersect | ( | const Ray< Dim > & | ray | ) | const |
This method returns the span of the intersection of the box with the ray. If the ray does not intersect the ray, it returns an empty span
| bool Util::BoundingBox< Dim >::isEmpty | ( | void | ) | const |
This method indicates if the bounding box is empty.
| bool Util::BoundingBox< Dim >::isInside | ( | const Point< Dim > & | p | ) | const |
This method returns true if a point in inside the box
| BoundingBox< Dim > Util::BoundingBox< Dim >::operator+ | ( | const BoundingBox< Dim > & | b | ) | const |
This method returns the (minimal) bounding box containing the union of the two bounding boxes. If one of the bounding boxes is empty, it is ignored.
| BoundingBox< Dim > & Util::BoundingBox< Dim >::operator+= | ( | const BoundingBox< Dim > & | b | ) |
This method returns the (minimal) bounding box containing the union of the two bounding boxes. If one of the bounding boxes is empty, it is ignored.
| Point< Dim > & Util::BoundingBox< Dim >::operator[] | ( | int | index | ) |
This method returns the value of the indexed corner of the bounding box. Valid values for index are { 0 , 1 }.
| const Point< Dim > & Util::BoundingBox< Dim >::operator[] | ( | int | index | ) | const |
This method returns the value of the indexed corner of the bounding box. Valid values for index are { 0 , 1 }.
| BoundingBox< Dim > Util::BoundingBox< Dim >::operator^ | ( | const BoundingBox< Dim > & | b | ) | const |
This method returns intersection of the two bounding boxes.
| BoundingBox< Dim > & Util::BoundingBox< Dim >::operator^= | ( | const BoundingBox< Dim > & | b | ) |
This method returns intersection of the two bounding boxes.
|
private |
The end-points of the bounding box.