Boost logo

Boost :

From: michael toksvig (michaeltoksvig_at_[hidden])
Date: 2004-12-17 11:47:04


correct, axis-aligned rectangles and boxes can be thought of as
multi-dimensional ranges

this implies that area (or whatever) could be defined as:
   struct area {
      point low;
      point high;
      point &operator[](size_t i) { return (&low)[i]; } // contentious, i
know

      // things you'd expect from a range
      bool contains(const point &p) { return !strict_less(p, low) &&
strict_less(p, high); }
   };

note that area could be templated with the point type, since it would work
just as well for float, point3d, etc.

/tox

"Michael Walter" <michael.walter_at_[hidden]> wrote in message
news:877e9a1704121705302ac4bce4_at_mail.gmail.com...
> On Fri, 17 Dec 2004 13:06 +0000 (GMT), Dave Harris
> <brangdon_at_[hidden]> wrote:
> > [...] So conceptually we
> > need two rectangle types. I suggest "rectangle" is reserved for the
> > general case, and the aligned one is called "box". As in "bounding box".
> > It has the benefit of being short.
> Not sure. In computer graphics you specifically talk about
> "axis-aligned bounding boxes". To me, "box" is the 3d version of
> "rectangle".
>
> Cheers,
> Michael
> _______________________________________________
> Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk