Alpine3D  Alpine3D-3.2.0
ViewFactorsSectors.h
Go to the documentation of this file.
1 /***********************************************************************************/
2 /* Copyright 2009-2015 WSL Institute for Snow and Avalanche Research SLF-DAVOS */
3 /***********************************************************************************/
4 /* This file is part of Alpine3D.
5  Alpine3D is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  Alpine3D is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with Alpine3D. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef VIEWFACTORSSECTORS_H
19 #define VIEWFACTORSSECTORS_H
20 
21 #include <meteoio/MeteoIO.h>
23 #include <map>
24 
26  public:
27  ViewFactorsSectors(const mio::Config& cfg, const mio::DEMObject &dem_in);
28  double getSkyViewFactor(const int &i, const int &j);
29  void getSkyViewFactor(mio::Array2D<double> &o_sky_vf) const;
30  double GetViewfactor(const int i, const int j, const int a, const int b);
31  int getViewCells(const int i, const int j, const int h, const int v);
32 
33  private:
34  std::map<int, double> vf;
35  mio::Array4D<unsigned int> viewCells;
36  mio::Array2D<double> sky_vf;
37  mio::DEMObject dem;
38 
39  double cellsize;
40  double max_shade_distance;
41  double sw_radius;
42 
43  int dimx, dimy;
44  int hSections, vSections;
45  unsigned int schrittweitenLimit;
46 
47  void fill_vf_map();
48  void calcHorizonField();
49  void calcSchrittweite(const double& altitude, const double& dH, const double& distance,
50  const double& horizon_tan_angle, unsigned int& schrittweite) const;
51  double getHorizonForRay(const unsigned int& ix1, const unsigned int& iy1, const double& alpha,
52  std::vector<unsigned int>& viewCells);
53  double getPrecViewFactor(const double& cos_theta_min, const double& cos_theta_max, const double& radius);
54 };
55 
56 #endif
double getSkyViewFactor(const int &i, const int &j)
Definition: ViewFactorsSectors.cc:42
Definition: ViewFactorsAlgorithm.h:21
Definition: ViewFactorsSectors.h:25
ViewFactorsSectors(const mio::Config &cfg, const mio::DEMObject &dem_in)
Definition: ViewFactorsSectors.cc:20
int getViewCells(const int i, const int j, const int h, const int v)
Definition: ViewFactorsSectors.cc:227
double GetViewfactor(const int i, const int j, const int a, const int b)
Definition: ViewFactorsSectors.cc:217