Assignments Assignments

Public Member Functions | Private Attributes | List of all members
Util::BoundingBox< Dim > Class Template Reference

`#include <geometry.h>`

Inheritance diagram for Util::BoundingBox< Dim >:

## 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]

## Detailed Description

template<unsigned int Dim>
class Util::BoundingBox< Dim >

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.

## Constructor & Destructor Documentation

## ◆ BoundingBox() [1/3]

template<unsigned int Dim>

Util::BoundingBox< Dim >::BoundingBox | ( | void |  | ) |

The default constructor

## ◆ BoundingBox() [2/3]

template<unsigned int Dim>

Util::BoundingBox< Dim >::BoundingBox | ( | const Point< Dim > & | p1,
|  | const Point< Dim > & | p2 )

This constructor creates the (minimal) bounding box containing the two points.

## ◆ BoundingBox() [3/3]

template<unsigned int Dim>

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.

## Member Function Documentation

## ◆ intersect()

template<unsigned int Dim>

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

## ◆ isEmpty()

template<unsigned int Dim>

bool Util::BoundingBox< Dim >::isEmpty | ( | void |  | ) | const

This method indicates if the bounding box is empty.

## ◆ isInside()

template<unsigned int Dim>

bool Util::BoundingBox< Dim >::isInside | ( | const Point< Dim > & | p | ) | const

This method returns true if a point in inside the box

## ◆ operator+()

template<unsigned int Dim>

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.

## ◆ operator+=()

template<unsigned int Dim>

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.

## ◆ operator[]() [1/2]

template<unsigned int Dim>

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 }.

## ◆ operator[]() [2/2]

template<unsigned int Dim>

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 }.

## ◆ operator^()

template<unsigned int Dim>

BoundingBox< Dim > Util::BoundingBox< Dim >::operator^ | ( | const BoundingBox< Dim > & | b | ) | const

This method returns intersection of the two bounding boxes.

## ◆ operator^=()

template<unsigned int Dim>

BoundingBox< Dim > & Util::BoundingBox< Dim >::operator^= | ( | const BoundingBox< Dim > & | b | ) |

This method returns intersection of the two bounding boxes.

## Member Data Documentation

## ◆ _p

template<unsigned int Dim>

Point< Dim > Util::BoundingBox< Dim >::_p[2]
| private

The end-points of the bounding box.

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

- Assignments/Util/geometry.h
- Assignments/Util/geometry.inl
- Assignments/Util/geometry.todo.inl