1 /*****************************************************************************
3 Module: FGPhysicalProperties.cpp
4 Author: Christian Mayer
6 Called by: main program
8 -------- Copyright (C) 1999 Christian Mayer (fgfs@christianmayer.de) --------
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
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
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.
24 Further information about the GNU General Public License can also be found on
25 the world wide web at http://www.gnu.org.
27 FUNCTIONAL DESCRIPTION
28 ------------------------------------------------------------------------------
29 Initialice the FGPhysicalProperties struct to something sensible(?)
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
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 #include "FGPhysicalProperties.h"
46 #include "FGWeatherDefs.h"
48 /****************************************************************************/
49 /********************************** CODE ************************************/
50 /****************************************************************************/
51 FGPhysicalProperties::FGPhysicalProperties()
55 /************************************************************************/
56 /* This standart constructor fills the class with a standard weather */
57 /************************************************************************/
59 Wind[-1000.0] = FGWindItem(zero); //no Wind by default
60 Wind[10000.0] = FGWindItem(zero); //no Wind by default
62 Turbulence[-1000.0] = FGTurbulenceItem(zero); //no Turbulence by default
63 Turbulence[10000.0] = FGTurbulenceItem(zero); //no Turbulence by default
65 //Initialice with the CINA atmosphere
66 Temperature[ 0.0] = +15.0 + 273.16;
67 Temperature[11000.0] = -56.5 + 273.16;
68 Temperature[20000.0] = -56.5 + 273.16;
70 AirPressure = FGAirPressureItem(101325.0);
72 VaporPressure[ 0.0] = FG_WEATHER_DEFAULT_VAPORPRESSURE; //in Pa (I *only* accept SI!)
73 VaporPressure[10000.0] = FG_WEATHER_DEFAULT_VAPORPRESSURE; //in Pa (I *only* accept SI!)
75 //Clouds.insert(FGCloudItem()) => none
76 SnowRainIntensity = 0.0;
78 LightningProbability = 0.0;
81 unsigned int FGPhysicalProperties::getNumberOfCloudLayers(void) const
86 FGCloudItem FGPhysicalProperties::getCloudLayer(unsigned int nr) const
88 map<WeatherPrecision,FGCloudItem>::const_iterator CloudsIt = Clouds.begin();
90 //set the iterator to the 'nr'th entry
94 return CloudsIt->second;