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

Boundary::AARectangle< T, Boolean, Float > Struct Template Reference

#include <aarectangle.h>

List of all members.


Detailed Description

template<class T = int, class Boolean = bool, class Float = double>
struct Boundary::AARectangle< T, Boolean, Float >

Basic specification for an axis-aligned rectangle determined by (rl,cl), the corner closest to the origin, and (rh,ch), the corner furthest from it.

Either corner may be inclusive or exclusive, depending on how this class is used; it is thus not a complete bounding box. To make it fast enough to use widely, it does not use any virtual functions; if such generality is needed use a full BoundingBox instead.

Definition at line 51 of file aarectangle.h.

Public Types

typedef T value_type

Public Methods

 AARectangle (const T &xlow=0, const T &ylow=0, const T &xhigh=0, const T &yhigh=0)
 Typical constructor: square box.

Boolean inside (T x, T y) const
 Returns true if the given coordinates are inside the box, treating both corners as inclusive.

Boolean upperexclusive_inside (T x, T y) const
 Returns true if the given coordinates are inside the box, treating the lower corner as inclusive and the upper as exclusive.

self & operator+= (const self &o)
 Expands this rectangle to be an axis-aligned rectangle covering all area covered by the itself or the given rectangle.

self & scale (T xscale, T yscale)
 Multiply the size times the indicated amounts in each dimension.

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

self & translate (T xoffset, T yoffset)
 Translate the position by the indicated amounts.

self & set (T xlow, T ylow, T xhigh, T yhigh)
 Set the rectangle to the given dimensions.

self & set (const Points &o)
 Set the rectangle to the given dimensions.

self intersection (const self &o)
height () const
 The height of the rectangle, assuming inclusive bounds.

width () const
 The width of the rectangle, assuming inclusive bounds.

Points corners () const
 Discouraged: returns the points making up the corners of the box.

Boolean empty () const
 Regardless of whether the corners are exclusive or inclusive, enclosing a single point or line is always considered empty since zero area is enclosed.

std::ostream & put (std::ostream &s) const
 Output a human-readable representation to the given stream.


Member Function Documentation

template<class T = int, class Boolean = bool, class Float = double>
self& Boundary::AARectangle< T, Boolean, Float >::operator+= const self &    o [inline]
 

Expands this rectangle to be an axis-aligned rectangle covering all area covered by the itself or the given rectangle.

Note that this is not the same as the union of the two areas, since it may include area not covered by either box so that the result remains a rectangle.

Definition at line 82 of file aarectangle.h.

References Boundary::AARectangle< T, Boolean, Float >::empty().


The documentation for this struct was generated from the following file:
Generated on Mon Jan 20 02:37:32 2003 for RF-LISSOM by doxygen1.3-rc2