![]() |
User Manual, Developers Guide and API Documentation |
![]() |
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 00029 #ifndef WNS_POSITIONABLE_HPP 00030 #define WNS_POSITIONABLE_HPP 00031 00032 #include <WNS/pyconfig/View.hpp> 00033 #include <WNS/Position.hpp> 00034 #include <WNS/PositionObserver.hpp> 00035 #include <WNS/Subject.hpp> 00036 00037 namespace wns 00038 { 00047 class PositionableInterface : 00048 virtual public SubjectInterface< ObserverInterface<PositionObserver> > 00049 { 00050 public: 00051 virtual 00052 ~PositionableInterface() 00053 {}; 00054 00055 virtual const wns::Position& 00056 getPosition() const = 0; 00057 00058 virtual double 00059 getDistance(PositionableInterface* p) = 0; 00060 00061 virtual double 00062 getDistance(const PositionableInterface& p) = 0; 00063 00064 virtual double 00065 getAngle(const PositionableInterface& p) = 0; 00066 }; 00067 00068 class Positionable : 00069 virtual public PositionableInterface, 00070 public Subject<PositionObserver> 00071 { 00072 typedef Subject<PositionObserver> SubjectType; 00073 public: 00074 Positionable(); 00075 00076 Positionable(const Positionable& other); 00077 00078 explicit 00079 Positionable(const Position& p); 00080 00081 explicit 00082 Positionable(const wns::pyconfig::View& positionView); 00083 00084 virtual 00085 ~Positionable(); 00086 00087 virtual const wns::Position& 00088 getPosition() const; 00089 00090 virtual double 00091 getDistance(PositionableInterface* p); 00092 00093 virtual double 00094 getDistance(const PositionableInterface& p); 00095 00096 virtual double 00097 getAngle(const PositionableInterface& p); 00098 00099 protected: 00103 void 00104 setPosition(const wns::Position& p); 00105 00106 private: 00107 Position position; 00108 }; 00109 } 00110 00111 #endif // WNS_POSITIONABLE_HPP 00112 00113
1.5.5