User Manual, Developers Guide and API Documentation

AABoundingBox.hpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * This file is part of openWNS (open Wireless Network Simulator)
00003  * _____________________________________________________________________________
00004  *
00005  * Copyright (C) 2004-2007
00006  * Chair of Communication Networks (ComNets)
00007  * Kopernikusstr. 5, D-52074 Aachen, Germany
00008  * phone: ++49-241-80-27910,
00009  * fax: ++49-241-80-22242
00010  * email: info@openwns.org
00011  * www: http://www.openwns.org
00012  * _____________________________________________________________________________
00013  *
00014  * openWNS is free software; you can redistribute it and/or modify it under the
00015  * terms of the GNU Lesser General Public License version 2 as published by the
00016  * Free Software Foundation;
00017  *
00018  * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY
00019  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
00020  * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00021  * details.
00022  *
00023  * You should have received a copy of the GNU Lesser General Public License
00024  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00025  *
00026  ******************************************************************************/
00027 
00028 #ifndef WNS_GEOMETRY_AABOUNDINGBOX_HPP
00029 #define WNS_GEOMETRY_AABOUNDINGBOX_HPP
00030 
00031 #include <vector>
00032 #include "Point.hpp"
00033 
00034 namespace wns { namespace geometry {
00035 
00036     // Axis aligned bounding box of a 2D object
00037     class AABoundingBox
00038     {
00039         friend class Shape2D;
00040         friend class AxisParallelRectangle;
00041 
00042         public:
00043         AABoundingBox();
00044         AABoundingBox(const Point& a, const Point& b);
00045 //      AABoundingBox(const std::vector<Point>& vertices);
00046         ~AABoundingBox();
00047 
00048         bool
00049         contains(const Point& other) const;
00050 
00051         bool
00052         contains(const AABoundingBox other) const;
00053 
00054         bool
00055         intersects(const AABoundingBox& other) const;
00056 
00057         Point
00058         getA() const { return a; }
00059 
00060         Point
00061         getB() const { return b; }
00062 
00063         double
00064         getMinX() { return a.getX();}
00065 
00066         double
00067         getMaxX() { return b.getX();}
00068 
00069         double
00070         getMinY() { return a.getY();}
00071 
00072         double
00073         getMaxY() { return b.getY();}
00074 
00075         void
00076         operator=(const AABoundingBox& other);
00077 
00078         bool
00079         operator==(const AABoundingBox& other) const;
00080 
00081         bool
00082         operator!=(const AABoundingBox& other) const;
00083 
00084         private:
00085         Point a;
00086         Point b;
00087 
00088     };
00089 
00090 }//geometry
00091 }//wns
00092 
00093 #endif //WNS_GEOMETRY_AABOUNDINGBOX_HPP
00094 
00095 

Generated on Mon May 21 03:31:41 2012 for openWNS by  doxygen 1.5.5