1 /*****************************************************************************
3 Header: FGMicroWeather.h
4 Author: Christian Mayer
7 -------- Copyright (C) 1999 Christian Mayer (fgfs@christianmayer.de) --------
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
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
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.
23 Further information about the GNU General Public License can also be found on
24 the world wide web at http://www.gnu.org.
26 FUNCTIONAL DESCRIPTION
27 ------------------------------------------------------------------------------
28 Store the single weather areas
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 11.10.1999 Christian Mayer changed set<> to map<> on Bernie Bright's
38 19.10.1999 Christian Mayer change to use PLIB's sg instead of Point[2/3]D
39 and lots of wee code cleaning
40 *****************************************************************************/
42 /****************************************************************************/
44 /****************************************************************************/
45 #ifndef FGMicroWeather_H
46 #define FGMicroWeather_H
48 /****************************************************************************/
50 /****************************************************************************/
54 #include "FGWeatherVectorWrap.h"
56 #include "FGWeatherDefs.h"
58 //Include all the simulated weather features
60 #include "FGSnowRain.h"
62 #include "FGAirPressureItem.h"
63 #include "FGWindItem.h"
64 #include "FGTurbulenceItem.h"
66 #include "FGPhysicalProperties.h"
67 #include "FGPhysicalProperty.h"
69 /****************************************************************************/
71 /****************************************************************************/
73 FG_USING_NAMESPACE(std);
75 /****************************************************************************/
76 /* CLASS DECLARATION */
77 /****************************************************************************/
82 typedef vector<sgVec2Wrap> positionList;
83 typedef positionList::iterator positionListIt;
84 typedef positionList::const_iterator const_positionListIt;
85 positionList position; //the points that specify the outline of the
86 //micro weather (lat/lon)
88 FGPhysicalProperties2D StoredWeather; //property if nothing is specified
91 /************************************************************************/
92 /* Constructor and Destructor */
93 /************************************************************************/
94 FGMicroWeather(const FGPhysicalProperties2D& p, const positionList& points);
97 /************************************************************************/
98 /* Add a feature to the micro weather */
99 /************************************************************************/
100 void addWind (const WeatherPrecision alt, const FGWindItem& x);
101 void addTurbulence (const WeatherPrecision alt, const FGTurbulenceItem& x);
102 void addTemperature (const WeatherPrecision alt, const WeatherPrecision x);
103 void addAirPressure (const WeatherPrecision alt, const WeatherPrecision x);
104 void addVaporPressure(const WeatherPrecision alt, const WeatherPrecision x);
105 void addCloud (const WeatherPrecision alt, const FGCloudItem& x);
107 void setSnowRainIntensity (const WeatherPrecision x);
108 void setSnowRainType (const SnowRainType x);
109 void setLightningProbability(const WeatherPrecision x);
111 void setStoredWeather (const FGPhysicalProperties2D& x);
113 /************************************************************************/
114 /* get physical properties in the micro weather */
115 /* NOTE: I don't neet to speify a positon as the properties don't */
116 /* change in a micro weather */
117 /************************************************************************/
118 FGPhysicalProperties get(void) const
120 return FGPhysicalProperties();
123 FGPhysicalProperty get(const WeatherPrecision altitude) const
125 return FGPhysicalProperty(StoredWeather, altitude);
128 /************************************************************************/
129 /* return true if p is inside this micro weather */
130 /************************************************************************/
131 bool hasPoint(const sgVec2& p) const;
132 bool hasPoint(const sgVec3& p) const
135 sgSetVec2(temp, p[0], p[1]);
137 return hasPoint( temp );
141 /****************************************************************************/
142 #endif /*FGMicroWeather_H*/