User Manual, Developers Guide and API Documentation

Shape2D.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_SHAPE2D_HPP
00029 #define WNS_GEOMETRY_SHAPE2D_HPP
00030 
00031 #include "Point.hpp"
00032 #include "AABoundingBox.hpp"
00033 
00034 namespace wns { namespace geometry {
00035     
00036     class Shape2D
00037     {
00038     
00039     public:
00040     virtual ~Shape2D(){};
00041 
00042     AABoundingBox getBoundingBox() const
00043     {
00044         return boundingBox;
00045     }
00046     
00047     virtual bool 
00048     contains(const Point& point)const = 0;
00049   
00050     bool intersectsBoundingBoxOf(const Shape2D& other) const;
00051     
00052     void 
00053     operator=(const Shape2D& other);
00054     
00055     bool 
00056     operator==(const Shape2D& other) const;
00057     
00058     bool 
00059     operator!=(const Shape2D& other) const;
00060     
00061 
00062 //  virtual unsigned int countBorderIntersections(const LineSegments& line)
00063 
00064     protected:
00065     Shape2D();
00066     
00067     Shape2D(const Point& a, const Point& b);
00068     
00069     Shape2D(const Point& a, const Vector& v);
00070     
00071     static Point zeroZ(const Point& p);
00072 
00073     Point a;
00074     Point b;
00075     AABoundingBox boundingBox;
00076 
00077     };
00078 
00079 } // geometry
00080 } // wns
00081 
00082 #endif // WNS_GEOMETRY_SHAPE2D_HPP

Generated on Fri May 25 03:31:39 2012 for openWNS by  doxygen 1.5.5