![]() |
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 #ifndef _SCENERYMAP_HPP 00029 #define _SCENERYMAP_HPP 00030 00031 #include <WNS/container/Matrix.hpp> 00032 #include <WNS/NearestNeighbour.hpp> 00033 #include <WNS/NLinear.hpp> 00034 #include <cstddef> 00035 #include <stdint.h> 00036 00037 namespace rise 00038 { 00039 namespace scenario 00040 { 00041 namespace scenerymap 00042 { 00043 typedef double resolution; 00044 typedef std::size_t dimension; 00045 00046 // standard dimensions 00047 namespace Dim { 00048 enum { X = 0, Y = 1, Z = 2 }; 00049 } 00050 00052 template<typename t, std::size_t dims> 00053 class SceneryMap : public wns::container::Matrix<t, dims, t> 00054 { 00055 public: 00056 00057 SceneryMap() : 00058 wns::container::Matrix<t, dims, t>(), 00059 resolutions() 00060 {} 00061 00062 SceneryMap(const std::size_t sizes[dims], 00063 const resolution res[dims], 00064 const t defaultValue = t()) : 00065 wns::container::Matrix<t, dims, t>(sizes, defaultValue), 00066 resolutions() 00067 { 00068 // const resolution res[dims] is treated as 00069 // const resolution* res, which can't be 00070 // assigned directly to resolutions 00071 for (unsigned long int i = 0; i < dims; ++i) { 00072 resolutions[i] = res[i]; 00073 } 00074 } 00075 00076 00077 void setResolution(const dimension dim, const resolution res) 00078 { resolutions[dim] = res; } 00079 00080 resolution getResolution(const dimension dim) const 00081 { return resolutions[dim]; } 00082 00083 private: 00084 resolution resolutions[dims]; 00085 }; 00086 00088 typedef SceneryMap<char, 2> MorphologyMap2D; 00089 00091 typedef SceneryMap<double, 2> PathlossMap2D; 00092 typedef std::vector<PathlossMap2D> PathlossMaps2D; 00093 00095 typedef SceneryMap<double, 2> ShadowingMap2D; 00096 00097 // 2D interpolated map 00098 typedef wns::Interpolation<double, 2> Interpolation2D; 00099 00100 // 2D nearest neighbour interpolation. 00101 typedef wns::NearestNeighbour<double, 2> NearestNeighbour2D; 00102 00103 // Bilinear interpolation. 00104 typedef wns::NLinear<double, 2> Bilinear; 00105 } 00106 } 00107 } 00108 00109 #endif // _SCENERYMAP_HPP 00110 00111
1.5.5