Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

AARBoundingBox Template Class Reference

General-purpose axis-aligned rectangular bounding box. More...

#include <boundingbox.h>

Inheritance diagram for AARBoundingBox

Inheritance graph

[legend]
Collaboration diagram for AARBoundingBox:

Collaboration graph

[legend]
List of all members.

Public Methods

 AARBoundingBox ()
 Default constructor: infinite extent. More...

 AARBoundingBox (T xlow, T ylow, T xhigh, T yhigh )
 Typical constructor: square box. More...

 AARBoundingBox (T centerx, T centery, T radius )
 Constructor taking a center and a radius for a square box with odd dimensions. More...

virtual bool inside (T x, T y) const
 Returns true if the given coordinates are inside the box. More...

virtual AARBoundingBox<T>& set ()
 Make the bounding box infinite. More...

virtual AARBoundingBox<T>& set (T xlow, T ylow, T xhigh, T yhigh )
 Set the bounding box to the given dimensions. More...

virtual AARBoundingBox<T>& operator+= ( const AARBoundingBox<T>& b )
 Expand this box to enclose the given one. More...

virtual BoundingBox<T>& scale ( T xscale, T yscale )
 Multiply the size times the indicated amounts in each dimension. More...

virtual BoundingBox<T>& rotate ( T theta )
 Rotate the box by the given angle (in radians) and take the smallest axis-aligned rectangle which encloses the result. More...

virtual BoundingBox<T>& translate ( T xoffset, T yoffset )
 Translate the position by the indicated amounts. More...

virtual ostream& put (ostream &s) const
 Virtual interface to the operator<<, since << cannot be virtual. More...


Protected Methods

virtual bool empty () const
 Enclosing a single point or line is considered empty since zero area is enclosed. More...


Protected Attributes

bool infinite
xl
yl
xh
yh

Detailed Description

template<class T = double> template class AARBoundingBox

General-purpose axis-aligned rectangular bounding box.

Definition at line 52 of file boundingbox.h.


Constructor & Destructor Documentation

template<classT = double>
AARBoundingBox<T>::AARBoundingBox<T> ( )
 

Default constructor: infinite extent.

Definition at line 55 of file boundingbox.h.

template<classT = double>
AARBoundingBox<T>::AARBoundingBox<T> ( T xlow,
T ylow,
T xhigh,
T yhigh )
 

Typical constructor: square box.

Definition at line 58 of file boundingbox.h.

template<classT = double>
AARBoundingBox<T>::AARBoundingBox<T> ( T centerx,
T centery,
T radius )
 

Constructor taking a center and a radius for a square box with odd dimensions.

Definition at line 63 of file boundingbox.h.


Member Function Documentation

template<classT = double>
bool AARBoundingBox<T>::empty ( ) const [inline, protected, virtual]
 

Enclosing a single point or line is considered empty since zero area is enclosed.

Definition at line 145 of file boundingbox.h.

Referenced by operator+=().

template<classT = double>
bool AARBoundingBox<T>::inside ( T x,
T y ) const [inline, virtual]
 

Returns true if the given coordinates are inside the box.

Reimplemented from BoundingBox.

Reimplemented in BoundingEllipse.

Definition at line 67 of file boundingbox.h.

Referenced by Retinal_Object::activation().

template<classT = double>
AARBoundingBox< T >& AARBoundingBox<T>::operator+= ( const AARBoundingBox< T >& b ) [inline, virtual]
 

Expand this box to enclose the given one.

An infinite box already encloses all boxes, while an empty() box will enclose any other box exactly, regardless of the original location of the empty box.

Definition at line 87 of file boundingbox.h.

template<classT = double>
ostream & AARBoundingBox<T>::put ( ostream & s ) const [inline, virtual]
 

Virtual interface to the operator<<, since << cannot be virtual.

This implementation is just a stub, and should be overriden in derived classes.

Reimplemented from BoundingBox.

Definition at line 136 of file boundingbox.h.

template<classT = double>
BoundingBox< T >& AARBoundingBox<T>::rotate ( T theta ) [inline, virtual]
 

Rotate the box by the given angle (in radians) and take the smallest axis-aligned rectangle which encloses the result.

Reimplemented from BoundingBox.

Reimplemented in BoundingEllipse.

Definition at line 104 of file boundingbox.h.

template<classT = double>
BoundingBox< T >& AARBoundingBox<T>::scale ( T xscale,
T yscale ) [inline, virtual]
 

Multiply the size times the indicated amounts in each dimension.

Reimplemented from BoundingBox.

Definition at line 96 of file boundingbox.h.

template<classT = double>
AARBoundingBox< T >& AARBoundingBox<T>::set ( T xlow,
T ylow,
T xhigh,
T yhigh ) [inline, virtual]
 

Set the bounding box to the given dimensions.

Definition at line 74 of file boundingbox.h.

template<classT = double>
AARBoundingBox< T >& AARBoundingBox<T>::set ( ) [inline, virtual]
 

Make the bounding box infinite.

Definition at line 71 of file boundingbox.h.

template<classT = double>
BoundingBox< T >& AARBoundingBox<T>::translate ( T xoffset,
T yoffset ) [inline, virtual]
 

Translate the position by the indicated amounts.

Reimplemented from BoundingBox.

Definition at line 130 of file boundingbox.h.


Member Data Documentation

template<classT = double>
bool AARBoundingBox<T>::infinite [protected]
 

Definition at line 141 of file boundingbox.h.

template<classT = double>
T AARBoundingBox<T>::xh [protected]
 

Definition at line 142 of file boundingbox.h.

template<classT = double>
T AARBoundingBox<T>::xl [protected]
 

Definition at line 142 of file boundingbox.h.

template<classT = double>
T AARBoundingBox<T>::yh [protected]
 

Definition at line 142 of file boundingbox.h.

template<classT = double>
T AARBoundingBox<T>::yl [protected]
 

Definition at line 142 of file boundingbox.h.


The documentation for this class was generated from the following file:
Generated at Mon Aug 21 00:31:14 2000 for RF-LISSOM by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000