Main Page   Class Overview   Pixels   Images   Geometry   Quick Index  

HxBoundingBox.h

00001 /*
00002  *  Copyright (c) 2000, University of Amsterdam, The Netherlands.
00003  *  All rights reserved.
00004  *
00005  *
00006  *  Author(s):
00007  *  Edo Poll (poll@wins.uva.nl)
00008  */
00009 
00010 #ifndef HxBoundingBox_h
00011 #define HxBoundingBox_h
00012 
00013 #include "HxPointZ.h"
00014 #include "HxSizes.h"
00015 #include "HxIoFwd.h"
00016 
00017 class L_HXBASIS HxBoundingBox
00018 {
00019 public:
00020     // Begin and end point are inclusive.
00021                         HxBoundingBox(HxPointZ b, HxPointZ e);
00022                         HxBoundingBox(HxSizes s);
00023 
00024     HxPointZ            begin() const;
00025     HxPointZ            end() const;
00026     HxSizes             size() const;
00027 
00028     bool                isEmpty() const;
00029 
00030     HxBoundingBox       unite(const HxBoundingBox& arg) const;
00031     HxBoundingBox       intersect(const HxBoundingBox& arg) const;
00032 
00033     HxBoundingBox       extend(HxPointZ p) const;
00034     HxBoundingBox       translate(HxPointZ p) const;
00035 
00036     bool                includes(HxPointZ p) const;
00037 
00038     STD_OSTREAM&        put(STD_OSTREAM&) const;
00039 
00040 private:
00041     HxPointZ            _begin;
00042     HxPointZ            _end;
00043     bool                _isEmpty;
00044 };
00045 
00046 inline HxPointZ
00047 HxBoundingBox::begin() const
00048 {
00049     return _begin;
00050 }
00051 
00052 inline HxPointZ
00053 HxBoundingBox::end() const
00054 {
00055     return _end;
00056 }
00057 
00058 inline bool
00059 HxBoundingBox::isEmpty() const
00060 {
00061     return _isEmpty;
00062 }
00063 
00064 inline STD_OSTREAM&
00065 operator<<(STD_OSTREAM& os, const HxBoundingBox& bb)
00066 {
00067     return bb.put(os);
00068 }
00069 
00070 #endif

Generated on Tue Jan 8 13:59:10 2002 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001