]> git.mxchange.org Git - flightgear.git/blob - src/WeatherCM/FGMicroWeather.h
Updates by Christian Mayer.
[flightgear.git] / src / WeatherCM / FGMicroWeather.h
1 /*****************************************************************************
2
3  Header:       FGMicroWeather.h 
4  Author:       Christian Mayer
5  Date started: 28.05.99
6
7  ---------- Copyright (C) 1999  Christian Mayer (vader@t-online.de) ----------
8
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
17  details.
18
19  You should have received a copy of the GNU General Public License along with
20  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21  Place - Suite 330, Boston, MA  02111-1307, USA.
22
23  Further information about the GNU General Public License can also be found on
24  the world wide web at http://www.gnu.org.
25
26 FUNCTIONAL DESCRIPTION
27 ------------------------------------------------------------------------------
28 Store the single weather areas
29
30 HISTORY
31 ------------------------------------------------------------------------------
32 28.05.1999 Christian Mayer      Created
33 16.06.1999 Durk Talsma          Portability for Linux
34 20.06.1999 Christian Mayer      added lots of consts
35 30.06.1999 Christian Mayer      STL portability
36 *****************************************************************************/
37
38 /****************************************************************************/
39 /* SENTRY                                                                   */
40 /****************************************************************************/
41 #ifndef FGMicroWeather_H
42 #define FGMicroWeather_H
43
44 /****************************************************************************/
45 /* INCLUDES                                                                 */
46 /****************************************************************************/
47 //Include all the simulated weather features
48 #include "FGCloud.h"
49 #include "FGSnowRain.h"
50
51 #include "FGAirPressureItem.h"
52 #include "FGTemperatureItem.h"
53 #include "FGWindItem.h"
54 #include "FGTurbulenceItem.h"
55 #include "FGVaporPressureItem.h"
56
57 #include "FGWeatherDefs.h"
58 #include "FGPhysicalProperties.h"
59 #include "FGPhysicalProperty.h"
60 #include <Voronoi/point2d.h>
61
62 #include <set>
63
64 /****************************************************************************/
65 /* DEFINES                                                                  */
66 /****************************************************************************/
67 FG_USING_STD(set);
68 FG_USING_NAMESPACE(std);
69
70 /****************************************************************************/
71 /* CLASS DECLARATION                                                        */
72 /****************************************************************************/
73 class FGMicroWeather
74 {
75 private:
76 protected:
77     typedef vector<Point2D> positionList;
78     typedef positionList::iterator positionListIt;
79     typedef positionList::const_iterator const_positionListIt;
80     positionList position;      //the points that specify the outline of the
81                                 //micro weather (lat/lon)
82
83
84     FGPhysicalProperties2D StoredWeather;    //property if nothing is specified
85
86 public:
87     /************************************************************************/
88     /* Constructor and Destructor                                           */
89     /************************************************************************/
90     FGMicroWeather(const FGPhysicalProperties2D& p, const positionList& points);
91     ~FGMicroWeather();
92
93     /************************************************************************/
94     /* Add a feature to the micro weather                                   */
95     /************************************************************************/
96     void addWind(const FGWindItem& x);
97     void addTurbulence(const FGTurbulenceItem& x);
98     void addTemperature(const FGTemperatureItem& x);
99     void addAirPressure(const FGAirPressureItem& x);
100     void addVaporPressure(const FGVaporPressureItem& x);
101     void addCloud(const FGCloudItem& x);
102
103     void setSnowRainIntensity(const WeatherPrecition& x);
104     void setSnowRainType(const SnowRainType& x);
105     void setLightningProbability(const WeatherPrecition& x);
106
107     void setStoredWeather(const FGPhysicalProperties2D& x);
108
109     /************************************************************************/
110     /* get physical properties in the micro weather                         */
111     /* NOTE: I don't neet to speify a positon as the properties don't       */
112     /*       change in a micro weather                                      */
113     /************************************************************************/
114     inline FGPhysicalProperty get(const WeatherPrecition& altitude) const
115     {
116         return FGPhysicalProperty(StoredWeather, altitude);
117     }
118
119     /************************************************************************/
120     /* return true if p is inside this micro weather                        */
121     /************************************************************************/
122     inline bool hasPoint(const Point3D& p) const { return hasPoint((Point2D) p); } 
123     bool hasPoint(const Point2D& p) const;
124 };
125
126 /****************************************************************************/
127 #endif /*FGMicroWeather_H*/