]> git.mxchange.org Git - flightgear.git/blob - src/WeatherCM/FGPhysicalProperties.cpp
3acb90cb25189f8f7b86719d4cf070bc830c45fb
[flightgear.git] / src / WeatherCM / FGPhysicalProperties.cpp
1 /*****************************************************************************
2
3  Module:       FGPhysicalProperties.cpp
4  Author:       Christian Mayer
5  Date started: 28.05.99
6  Called by:    main program
7
8  ---------- Copyright (C) 1999  Christian Mayer (vader@t-online.de) ----------
9
10  This program is free software; you can redistribute it and/or modify it under
11  the terms of the GNU General Public License as published by the Free Software
12  Foundation; either version 2 of the License, or (at your option) any later
13  version.
14
15  This program is distributed in the hope that it will be useful, but WITHOUT
16  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
18  details.
19
20  You should have received a copy of the GNU General Public License along with
21  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
22  Place - Suite 330, Boston, MA  02111-1307, USA.
23
24  Further information about the GNU General Public License can also be found on
25  the world wide web at http://www.gnu.org.
26
27 FUNCTIONAL DESCRIPTION
28 ------------------------------------------------------------------------------
29 Initialice the FGPhysicalProperties struct to something sensible(?)
30
31 HISTORY
32 ------------------------------------------------------------------------------
33 29.05.1999 Christian Mayer      Created
34 16.06.1999 Durk Talsma          Portability for Linux
35 20.06.1999 Christian Mayer      added lots of consts
36 11.10.1999 Christian Mayer      changed set<> to map<> on Bernie Bright's 
37                                 suggestion
38 *****************************************************************************/
39
40 /****************************************************************************/
41 /* INCLUDES                                                                 */
42 /****************************************************************************/
43 #include "FGPhysicalProperties.h"
44 #include "FGWeatherDefs.h"
45
46 /****************************************************************************/
47 /********************************** CODE ************************************/
48 /****************************************************************************/
49 FGPhysicalProperties::FGPhysicalProperties()
50 {
51     /************************************************************************/
52     /* This standart constructor fills the class with a standard weather    */
53     /************************************************************************/
54
55     Wind[-1000.0] = Point3D(0.0);       //no Wind by default
56     Wind[10000.0] = Point3D(0.0);       //no Wind by default
57
58     Turbulence[-1000.0] = Point3D(0.0); //no Turbulence by default
59     Turbulence[10000.0] = Point3D(0.0); //no Turbulence by default
60
61     //Initialice with the CINA atmosphere
62     Temperature[    0.0] = +15.0 + 273.16;  
63     Temperature[11000.0] = -56.5 + 273.16;                          
64     Temperature[20000.0] = -56.5 + 273.16;                          
65
66     AirPressure = FGAirPressureItem(101325.0);  
67
68     VaporPressure[    0.0] = FG_WEATHER_DEFAULT_VAPORPRESSURE;   //in Pa (I *only* accept SI!)
69     VaporPressure[10000.0] = FG_WEATHER_DEFAULT_VAPORPRESSURE;   //in Pa (I *only* accept SI!)
70
71     //Clouds.insert(FGCloudItem())    => none
72     SnowRainIntensity = 0.0;     
73     snowRainType = Rain;            
74     LightningProbability = 0.0;
75 }
76
77 unsigned int FGPhysicalProperties::getNumberOfCloudLayers(void) const
78 {
79     return Clouds.size();
80 }
81
82 FGCloudItem FGPhysicalProperties::getCloudLayer(unsigned int nr) const
83 {
84     map<WeatherPrecition,FGCloudItem>::const_iterator CloudsIt = Clouds.begin();
85
86     //set the iterator to the 'nr'th entry
87     for (; nr > 0; nr--)
88         CloudsIt++;
89
90     return CloudsIt->second;
91 }
92
93
94
95
96