]> git.mxchange.org Git - flightgear.git/commitdiff
Upgraded to latest weather data base code from Christian Mayer's and make
authorcurt <curt>
Thu, 14 Oct 1999 20:30:54 +0000 (20:30 +0000)
committercurt <curt>
Thu, 14 Oct 1999 20:30:54 +0000 (20:30 +0000)
it the default.

35 files changed:
acconfig.h
src/Main/Makefile.am
src/Main/fg_init.cxx
src/Main/keyboard.cxx
src/Main/main.cxx
src/Scenery/tilemgr.cxx
src/WeatherCM/FGAirPressureItem.cpp
src/WeatherCM/FGAirPressureItem.h
src/WeatherCM/FGCloud.h
src/WeatherCM/FGCloudItem.cpp
src/WeatherCM/FGCloudItem.h
src/WeatherCM/FGGlobalWeatherDatabase.cpp
src/WeatherCM/FGGlobalWeatherDatabase.h
src/WeatherCM/FGLocalWeatherDatabase.cpp
src/WeatherCM/FGLocalWeatherDatabase.h
src/WeatherCM/FGMicroWeather.cpp
src/WeatherCM/FGMicroWeather.h
src/WeatherCM/FGPhysicalProperties.cpp
src/WeatherCM/FGPhysicalProperties.h
src/WeatherCM/FGPhysicalProperty.cpp
src/WeatherCM/FGPhysicalProperty.h
src/WeatherCM/FGSnowRain.h
src/WeatherCM/FGTemperatureItem.cpp
src/WeatherCM/FGTemperatureItem.h
src/WeatherCM/FGTurbulenceItem.cpp
src/WeatherCM/FGTurbulenceItem.h
src/WeatherCM/FGVaporPressureItem.cpp
src/WeatherCM/FGVaporPressureItem.h
src/WeatherCM/FGVoronoi.cpp
src/WeatherCM/FGVoronoi.h
src/WeatherCM/FGWeatherDefs.h
src/WeatherCM/FGWeatherFeature.h
src/WeatherCM/FGWeatherUtils.h
src/WeatherCM/FGWindItem.cpp
src/WeatherCM/FGWindItem.h

index e708de34608253d6dd327fdbc70399206f6e7e30..0598e55f62495ccf2db69c54d94aa98ad872a68b 100644 (file)
@@ -61,8 +61,8 @@
 /* Define to include Oliver's networking support */
 #undef FG_NETWORK_OLK
    
-/* Define to include Oliver's networking support */
-#undef FG_NEW_WEATHER
+/* Define to avoid Christian's new weather code */
+#undef FG_OLD_WEATHER
    
 /* Define if we are building FGFS (should always be defined) */
 #undef FGFS
index d5c4d6e1cce1e8edce915079a799ae9e37b3d84b..874dcee0c969d31e038d64d68901e3a2c5f69e26 100644 (file)
@@ -4,11 +4,11 @@ else
 SERIAL_LIBS =
 endif
 
-if ENABLE_NEW_WEATHER
+if ENABLE_OLD_WEATHER
+WEATHER_LIBS = $(top_builddir)/Simulator/Weather/libWeather.a
+else
 WEATHER_LIBS = $(top_builddir)/Simulator/WeatherCM/libWeatherCM.a \
                $(top_builddir)/Lib/Voronoi/libVoronoi.a
-else
-WEATHER_LIBS = $(top_builddir)/Simulator/Weather/libWeather.a
 endif
 
 
index c435786c73d22a623d010db3a325fca69da5e580..1b19c9d4c2b69845628b8196f1942f5dbd2d1c33 100644 (file)
@@ -75,7 +75,7 @@
 #include <Time/sunpos.hxx>
 #include <Time/moonpos.hxx>
 
-#ifdef FG_NEW_WEATHER
+#ifndef FG_OLD_WEATHER
 #  include <WeatherCM/FGLocalWeatherDatabase.h>
 #else
 #  include <Weather/weather.hxx>
@@ -429,7 +429,7 @@ bool fgInitSubsystems( void ) {
                            fgEVENT::FG_EVENT_READY, 30000 );
 
     // Initialize the weather modeling subsystem
-#ifdef FG_NEW_WEATHER
+#ifndef FG_OLD_WEATHER
     // Initialize the WeatherDatabase
     FG_LOG(FG_GENERAL, FG_INFO, "Creating LocalWeatherDatabase");
     FGLocalWeatherDatabase::theFGLocalWeatherDatabase = 
index 67296cab57d35b9144f235b0d5fa5f40413007d1..36d79c7ede24e430eca03e2e8d325c1b3273b59a 100644 (file)
@@ -55,7 +55,7 @@
 #include <Time/fg_time.hxx>
 #include <Time/light.hxx>
 
-#ifdef FG_NEW_WEATHER
+#ifndef FG_OLD_WEATHER
 #  include <WeatherCM/FGLocalWeatherDatabase.h>
 #else
 #  include <Weather/weather.hxx>
@@ -190,7 +190,7 @@ void GLUTkey(unsigned char k, int x, int y) {
            v->force_update_fov_math();
            return;
        case 90: // Z key
-#ifdef FG_NEW_WEATHER
+#ifndef FG_OLD_WEATHER
            tmp = WeatherDatabase->getWeatherVisibility();
            tmp /= 1.10;
            WeatherDatabase->setWeatherVisibility( tmp );
@@ -326,7 +326,7 @@ void GLUTkey(unsigned char k, int x, int y) {
            v->force_update_fov_math();
            return;
        case 122: // z key
-#ifdef FG_NEW_WEATHER
+#ifndef FG_OLD_WEATHER
            tmp = WeatherDatabase->getWeatherVisibility();
            tmp *= 1.10;
            WeatherDatabase->setWeatherVisibility( tmp );
index cc13c554e8e4111a0db886e72fc5300aa787969b..28a4f031cb6064904ba5518d4235aa0dd3903cad 100644 (file)
@@ -92,7 +92,7 @@
 #include <Time/fg_timer.hxx>
 #include <Time/sunpos.hxx>
 
-#ifndef FG_NEW_WEATHER
+#ifdef FG_OLD_WEATHER
 #  include <Weather/weather.hxx>
 #endif
 
@@ -593,7 +593,7 @@ static void fgMainLoop( void ) {
     // init routine and we don't have to worry about it again.
 #endif
 
-#ifndef FG_NEW_WEATHER
+#ifdef FG_OLD_WEATHER
     current_weather.Update();
 #endif
 
index 8cf2b6c98d3480b01a9e95f4a8d5cf249f25f20d..11dd1f1a898e9160e6c9679668fc76c3b6472175 100644 (file)
@@ -47,7 +47,7 @@
 #include <Objects/materialmgr.hxx>
 #include <Objects/obj.hxx>
 
-#ifdef FG_NEW_WEATHER
+#ifndef FG_OLD_WEATHER
 #  include <WeatherCM/FGLocalWeatherDatabase.h>
 #else
 #  include <Weather/weather.hxx>
@@ -695,7 +695,7 @@ void FGTileMgr::prep_ssg_nodes( void ) {
        if ( t->is_loaded() ) {
            // set range selector (LOD trick) to be distance to center
            // of tile + bounding radius
-#ifdef FG_NEW_WEATHER
+#ifndef FG_OLD_WEATHER
            ranges[1] = WeatherDatabase->getWeatherVisibility()
                + t->bounding_radius;
 #else
index 08889b8c048c372334a05f75b0b835bdbb6caac1..916f36f4579d5fe97e80896dd25c6620fbf39053 100644 (file)
@@ -33,6 +33,8 @@ HISTORY
 28.05.1999 Christian Mayer     Created
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
index c6622b34c81e03795dd521921d570aa31876d21f..9040b5705f4f6463cbc7b4a2a5f610c8c5e2fa23 100644 (file)
@@ -33,6 +33,8 @@ HISTORY
 08.06.1999 Christian Mayer      Added international air preasure formula
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
index 3d84687204fc2f18fb0045ea6f64ff42fce1c037..29f39b36cfc63dedab70ded21f89b160e2722b1a 100644 (file)
@@ -32,6 +32,8 @@ HISTORY
 28.05.1999 Christian Mayer     Created
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
index 960109b1fb8c61528df984240554be87ce8771c7..7626fd4a4215fb51ff33fa04851d98c91a422a06 100644 (file)
@@ -33,6 +33,9 @@ HISTORY
 28.05.1999 Christian Mayer     Created
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
+09.10.1999 Christian Mayer     changed CloudItem on Durks request
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
@@ -43,8 +46,4 @@ HISTORY
 /****************************************************************************/
 /********************************** CODE ************************************/
 /****************************************************************************/
-bool operator<(const FGCloudItem& arg1, const FGCloudItem& arg2)
-{
-    return arg1.alt < arg2.alt;
-}
 
index 9f022489fbb590d94e1c4d08898777b505ea0a0c..8ef3c1a9bbcd80e2f21a7054048e67e1a9b9ffb8 100644 (file)
@@ -32,6 +32,9 @@ HISTORY
 28.05.1999 Christian Mayer     Created
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
+09.10.1999 Christian Mayer     changed CloudItem on Durks request
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
@@ -55,16 +58,17 @@ HISTORY
 class FGCloudItem
 {
 private:
+    WeatherPrecition thickness;
+    WeatherPrecition density;
+
 protected:
 public:
-    WeatherPrecition value;
-    WeatherPrecition alt;
 
-    FGCloudItem(const WeatherPrecition& a, const WeatherPrecition& v)  {alt = a; value = v;}
-    FGCloudItem(const WeatherPrecition& v)                             {alt = 0.0; value = v;}
-    FGCloudItem()                                                      {alt = 0.0; value = FG_WEATHER_DEFAULT_AIRPRESSURE;}
+    FGCloudItem(const WeatherPrecition& t, const WeatherPrecition& d)  {thickness = t; density = d;}
+    FGCloudItem()                                                      {thickness = 0.0; density = 0.0;}
 
-    friend bool operator<(const FGCloudItem& arg1, const FGCloudItem& arg2);
+    WeatherPrecition getThickness(void) const { return thickness; }
+    WeatherPrecition getDensity  (void) const { return density;   }
 };
 
 /****************************************************************************/
index e23c8bbf40217f74c6efd039ea5c74adef4a9498..7818e6adf57ebe59bf6111e808905f03b10fef5a 100644 (file)
@@ -35,6 +35,8 @@ HISTORY
 28.05.1999 Christian Mayer     Created
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
@@ -232,7 +234,7 @@ FGPhysicalProperties2DVector FGGlobalWeatherDatabase::getAll(const Point2D& p, c
        
        if (ret_list.size()<min)
        {
-           for(i = 0; (i < (min - ret_list.size())) && (ret_list.size() < database.size()); i++)
+           for(i = 0; (i < (int)(min - ret_list.size())) && (ret_list.size() < database.size()); i++)
                ret_list.push_back(*it[i]);
        }
        
index 94ed6d07fc22df909ca48c588fd66c8ff4323c24..e231af2a42b796833f59cdfa5edccdbac014f863 100644 (file)
@@ -35,6 +35,8 @@ HISTORY
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
 30.06.1999 Christian Mayer     STL portability
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
@@ -48,6 +50,7 @@ HISTORY
 /****************************************************************************/
 #include "FGPhysicalProperties.h"
 #include "FGPhysicalProperty.h"
+#include "sg.h"
 #include <Include/compiler.h>
 #include <vector>
 #include STL_IOSTREAM
@@ -90,7 +93,9 @@ public:
     /* Get the physical properties on the specified point p                */
     /************************************************************************/
     FGPhysicalProperties get(const Point2D& p) const;
+    FGPhysicalProperties get(const sgVec2& p) const {return get(Point2D(p[0], p[1]));}
     inline FGPhysicalProperty get(const Point3D& p) const {return FGPhysicalProperty(get(Point2D(p)), p.elev());}
+    inline FGPhysicalProperty get(const sgVec3& p) const {return FGPhysicalProperty(get(Point2D(p[0], p[1])), p[3]);}
 
     /************************************************************************/
     /* update the database. Since the last call we had dt seconds          */
index 761c5e25cc80f5d510dd1d03a375c3e1362081a1..7d284e011f4b25696971a7494e8097826cd3d7b3 100644 (file)
@@ -34,6 +34,8 @@ HISTORY
 28.05.1999 Christian Mayer     Created
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
@@ -212,6 +214,17 @@ FGPhysicalProperty FGLocalWeatherDatabase::get(const sgVec3& p) const
        return global->get(temp);
 }
 
+FGPhysicalProperties FGLocalWeatherDatabase::get(const sgVec2& p) const
+{
+    Point3D temp(p[0], p[1], 0.0);
+
+    unsigned int a = AreaWith(temp);
+    if (a != 0)
+       return WeatherAreas[a-1].get();
+    else    //point is outside => ask GlobalWeatherDatabase
+       return global->get(p);
+}
+
 WeatherPrecition FGLocalWeatherDatabase::getAirDensity(const Point3D& p) const
 {
     FGPhysicalProperty dummy;
@@ -245,46 +258,46 @@ WeatherPrecition FGLocalWeatherDatabase::getAirDensity(const sgVec3& p) const
 /****************************************************************************/
 /* Add a weather feature at the point p and surrounding area               */
 /****************************************************************************/
-void FGLocalWeatherDatabase::addWind(const FGWindItem& x, const Point2D& p)
+void FGLocalWeatherDatabase::addWind(const WeatherPrecition alt, const Point3D& x, const Point2D& p)
 {
     unsigned int a = AreaWith(p);
     if (a != 0)
-       WeatherAreas[a-1].addWind(x);
+       WeatherAreas[a-1].addWind(alt, x);
 }
 
-void FGLocalWeatherDatabase::addTurbulence(const FGTurbulenceItem& x, const Point2D& p)
+void FGLocalWeatherDatabase::addTurbulence(const WeatherPrecition alt, const Point3D& x, const Point2D& p)
 {
     unsigned int a = AreaWith(p);
     if (a != 0)
-       WeatherAreas[a-1].addTurbulence(x);
+       WeatherAreas[a-1].addTurbulence(alt, x);
 }
 
-void FGLocalWeatherDatabase::addTemperature(const FGTemperatureItem& x, const Point2D& p)
+void FGLocalWeatherDatabase::addTemperature(const WeatherPrecition alt, const WeatherPrecition x, const Point2D& p)
 {
     unsigned int a = AreaWith(p);
     if (a != 0)
-       WeatherAreas[a-1].addTemperature(x);
+       WeatherAreas[a-1].addTemperature(alt, x);
 }
 
-void FGLocalWeatherDatabase::addAirPressure(const FGAirPressureItem& x, const Point2D& p)
+void FGLocalWeatherDatabase::addAirPressure(const WeatherPrecition alt, const WeatherPrecition x, const Point2D& p)
 {
     unsigned int a = AreaWith(p);
     if (a != 0)
-       WeatherAreas[a-1].addAirPressure(x);
+       WeatherAreas[a-1].addAirPressure(alt, x);
 }
 
-void FGLocalWeatherDatabase::addVaporPressure(const FGVaporPressureItem& x, const Point2D& p)
+void FGLocalWeatherDatabase::addVaporPressure(const WeatherPrecition alt, const WeatherPrecition x, const Point2D& p)
 {
     unsigned int a = AreaWith(p);
     if (a != 0)
-       WeatherAreas[a-1].addVaporPressure(x);
+       WeatherAreas[a-1].addVaporPressure(alt, x);
 }
 
-void FGLocalWeatherDatabase::addCloud(const FGCloudItem& x, const Point2D& p)
+void FGLocalWeatherDatabase::addCloud(const WeatherPrecition alt, const FGCloudItem& x, const Point2D& p)
 {
     unsigned int a = AreaWith(p);
     if (a != 0)
-       WeatherAreas[a-1].addCloud(x);
+       WeatherAreas[a-1].addCloud(alt, x);
 }
 
 void FGLocalWeatherDatabase::setSnowRainIntensity(const WeatherPrecition& x, const Point2D& p)
index 5be5482572c7e42a203fdbe4f1ae7e6ea4893e7f..aa0c008e0fdfa5a1d7841997ffd8826958964341 100644 (file)
@@ -34,6 +34,8 @@ HISTORY
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
 30.06.1999 Christian Mayer     STL portability
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
@@ -141,6 +143,7 @@ public:
     /************************************************************************/
     FGPhysicalProperty get(const Point3D& p) const;
     FGPhysicalProperty get(const sgVec3& p) const;
+    FGPhysicalProperties get(const sgVec2& p) const;
 
     WeatherPrecition getAirDensity(const Point3D& p) const;
     WeatherPrecition getAirDensity(const sgVec3& p) const;
@@ -149,12 +152,12 @@ public:
     /* Add a weather feature at the point p and surrounding area           */
     /************************************************************************/
 
-    void addWind(const FGWindItem& x, const Point2D& p);
-    void addTurbulence(const FGTurbulenceItem& x, const Point2D& p);
-    void addTemperature(const FGTemperatureItem& x, const Point2D& p);
-    void addAirPressure(const FGAirPressureItem& x, const Point2D& p);
-    void addVaporPressure(const FGVaporPressureItem& x, const Point2D& p);
-    void addCloud(const FGCloudItem& x, const Point2D& p);
+    void addWind(const WeatherPrecition alt, const Point3D& x, const Point2D& p);
+    void addTurbulence(const WeatherPrecition alt, const Point3D& x, const Point2D& p);
+    void addTemperature(const WeatherPrecition alt, const WeatherPrecition x, const Point2D& p);
+    void addAirPressure(const WeatherPrecition alt, const WeatherPrecition x, const Point2D& p);
+    void addVaporPressure(const WeatherPrecition alt, const WeatherPrecition x, const Point2D& p);
+    void addCloud(const WeatherPrecition alt, const FGCloudItem& x, const Point2D& p);
 
     void setSnowRainIntensity(const WeatherPrecition& x, const Point2D& p);
     void setSnowRainType(const SnowRainType& x, const Point2D& p);
index b49b1ea802376a22afa0a89395b8073dc966a482..6ee133fc36223167f9664d2c3d869993997ab90a 100644 (file)
@@ -33,6 +33,8 @@ HISTORY
 28.05.1999 Christian Mayer     Created
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
@@ -58,35 +60,35 @@ FGMicroWeather::~FGMicroWeather()
 /* Add the features to the micro weather                                   */
 /* return succss                                                           */
 /****************************************************************************/
-void FGMicroWeather::addWind(const FGWindItem& x)
+void FGMicroWeather::addWind(const WeatherPrecition alt, const Point3D& x)
 {
-    StoredWeather.Wind.insert(x);
+    StoredWeather.Wind[alt] = x;
 }
 
-void FGMicroWeather::addTurbulence(const FGTurbulenceItem& x)
+void FGMicroWeather::addTurbulence(const WeatherPrecition alt, const Point3D& x)
 {
-    StoredWeather.Turbulence.insert(x);
+    StoredWeather.Turbulence[alt] = x;
 }
 
-void FGMicroWeather::addTemperature(const FGTemperatureItem& x)
+void FGMicroWeather::addTemperature(const WeatherPrecition alt, const WeatherPrecition x)
 {
-    StoredWeather.Temperature.insert(x);
+    StoredWeather.Temperature[alt] = x;
 }
 
-void FGMicroWeather::addAirPressure(const FGAirPressureItem& x)
+void FGMicroWeather::addAirPressure(const WeatherPrecition alt, const WeatherPrecition x)
 {
     cerr << "Error: caught attempt to add AirPressure which is logical wrong\n";
-    //StoredWeather.AirPressure.insert(x);
+    //StoredWeather.AirPressure[alt] = x;
 }
 
-void FGMicroWeather::addVaporPressure(const FGVaporPressureItem& x)
+void FGMicroWeather::addVaporPressure(const WeatherPrecition alt, const WeatherPrecition x)
 {
-    StoredWeather.VaporPressure.insert(x);
+    StoredWeather.VaporPressure[alt] = x;
 }
 
-void FGMicroWeather::addCloud(const FGCloudItem& x)
+void FGMicroWeather::addCloud(const WeatherPrecition alt, const FGCloudItem& x)
 {
-    StoredWeather.Clouds.insert(x);
+    StoredWeather.Clouds[alt] = x;
 }
 
 void FGMicroWeather::setSnowRainIntensity(const WeatherPrecition& x)
index 1844b3c517a572f6a604879cd836a3fa1ddb2ae7..3f55c3404d82580297f6e579ab2e58d683d70f6d 100644 (file)
@@ -33,6 +33,8 @@ HISTORY
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
 30.06.1999 Christian Mayer     STL portability
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
@@ -93,12 +95,12 @@ public:
     /************************************************************************/
     /* Add a feature to the micro weather                                  */
     /************************************************************************/
-    void addWind(const FGWindItem& x);
-    void addTurbulence(const FGTurbulenceItem& x);
-    void addTemperature(const FGTemperatureItem& x);
-    void addAirPressure(const FGAirPressureItem& x);
-    void addVaporPressure(const FGVaporPressureItem& x);
-    void addCloud(const FGCloudItem& x);
+    void addWind(const WeatherPrecition alt, const Point3D& x);
+    void addTurbulence(const WeatherPrecition alt, const Point3D& x);
+    void addTemperature(const WeatherPrecition alt, const WeatherPrecition x);
+    void addAirPressure(const WeatherPrecition alt, const WeatherPrecition x);
+    void addVaporPressure(const WeatherPrecition alt, const WeatherPrecition x);
+    void addCloud(const WeatherPrecition alt, const FGCloudItem& x);
 
     void setSnowRainIntensity(const WeatherPrecition& x);
     void setSnowRainType(const SnowRainType& x);
@@ -116,6 +118,11 @@ public:
        return FGPhysicalProperty(StoredWeather, altitude);
     }
 
+    inline FGPhysicalProperties get(void) const
+    {
+       return FGPhysicalProperties();
+    }
+
     /************************************************************************/
     /* return true if p is inside this micro weather                       */
     /************************************************************************/
index 5267383070dc90b7f2bc5d38d504d7bc240e382a..3acb90cb25189f8f7b86719d4cf070bc830c45fb 100644 (file)
@@ -33,6 +33,8 @@ HISTORY
 29.05.1999 Christian Mayer     Created
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
@@ -50,21 +52,21 @@ FGPhysicalProperties::FGPhysicalProperties()
     /* This standart constructor fills the class with a standard weather    */
     /************************************************************************/
 
-    Wind.insert(FGWindItem(-1000.0, Point3D(0.0)));    //no Wind by default
-    Wind.insert(FGWindItem(10000.0, Point3D(0.0)));    //no Wind by default
+    Wind[-1000.0] = Point3D(0.0);      //no Wind by default
+    Wind[10000.0] = Point3D(0.0);      //no Wind by default
 
-    Turbulence.insert(FGTurbulenceItem(-1000.0, Point3D(0.0)));        //no Turbulence by default
-    Turbulence.insert(FGTurbulenceItem(10000.0, Point3D(0.0)));        //no Turbulence by default
+    Turbulence[-1000.0] = Point3D(0.0);        //no Turbulence by default
+    Turbulence[10000.0] = Point3D(0.0);        //no Turbulence by default
 
     //Initialice with the CINA atmosphere
-    Temperature.insert(FGTemperatureItem(    0.0, (+15.0+273.16)));  
-    Temperature.insert(FGTemperatureItem(11000.0, (-56.5+273.16)));                        
-    Temperature.insert(FGTemperatureItem(20000.0, (-56.5+273.16)));                        
+    Temperature[    0.0] = +15.0 + 273.16;  
+    Temperature[11000.0] = -56.5 + 273.16;                         
+    Temperature[20000.0] = -56.5 + 273.16;                         
 
     AirPressure = FGAirPressureItem(101325.0); 
 
-    VaporPressure.insert(FGVaporPressureItem(    0.0, FG_WEATHER_DEFAULT_VAPORPRESSURE));   //in Pa (I *only* accept SI!)
-    VaporPressure.insert(FGVaporPressureItem(10000.0, FG_WEATHER_DEFAULT_VAPORPRESSURE));   //in Pa (I *only* accept SI!)
+    VaporPressure[    0.0] = FG_WEATHER_DEFAULT_VAPORPRESSURE;   //in Pa (I *only* accept SI!)
+    VaporPressure[10000.0] = FG_WEATHER_DEFAULT_VAPORPRESSURE;   //in Pa (I *only* accept SI!)
 
     //Clouds.insert(FGCloudItem())    => none
     SnowRainIntensity = 0.0;     
@@ -72,6 +74,23 @@ FGPhysicalProperties::FGPhysicalProperties()
     LightningProbability = 0.0;
 }
 
+unsigned int FGPhysicalProperties::getNumberOfCloudLayers(void) const
+{
+    return Clouds.size();
+}
+
+FGCloudItem FGPhysicalProperties::getCloudLayer(unsigned int nr) const
+{
+    map<WeatherPrecition,FGCloudItem>::const_iterator CloudsIt = Clouds.begin();
+
+    //set the iterator to the 'nr'th entry
+    for (; nr > 0; nr--)
+       CloudsIt++;
+
+    return CloudsIt->second;
+}
+
+
 
 
 
index 0795d4d51b3a86a85e9163d3eb62023f65f34d7d..9e62be9e8365c77dad603dd745af366b9b61bde1 100644 (file)
@@ -34,6 +34,8 @@ HISTORY
 20.06.1999 Christian Mayer     Changed struct to class 
 20.06.1999 Christian Mayer     added lots of consts
 30.06.1999 Christian Mayer     STL portability
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
@@ -47,21 +49,17 @@ HISTORY
 /****************************************************************************/
 #include <Include/compiler.h>
 #include <vector>
-#include <set>
+#include <map>
 
 FG_USING_STD(vector);
-FG_USING_STD(set);
+FG_USING_STD(map);
 FG_USING_NAMESPACE(std);
 
 #include <Math/point3d.hxx>
 #include <Voronoi/point2d.h>
 #include "FGWeatherDefs.h"
 
-#include "FGWindItem.h"
-#include "FGTurbulenceItem.h"
-#include "FGTemperatureItem.h"
 #include "FGAirPressureItem.h"
-#include "FGVaporPressureItem.h"
 
 #include "FGCloudItem.h"
 #include "FGSnowRain.h"
@@ -69,13 +67,16 @@ FG_USING_NAMESPACE(std);
 class FGPhysicalProperties
 {
 public:
-    set<FGWindItem> Wind;                  //all Wind vectors
-    set<FGTurbulenceItem> Turbulence;      //all Turbulence vectors
-    set<FGTemperatureItem> Temperature;            //in deg. Kelvin (I *only* accept SI!)
-    FGAirPressureItem AirPressure;         //in Pascal (I *only* accept SI!)
-    set<FGVaporPressureItem> VaporPressure; //in Pascal (I *only* accept SI!)
+    typedef WeatherPrecition Altitude;  
+
+    map<Altitude,Point3D> Wind;                            //all Wind vectors
+    map<Altitude,Point3D> Turbulence;              //all Turbulence vectors
+    map<Altitude,WeatherPrecition> Temperature;            //in deg. Kelvin (I *only* accept SI!)
+    FGAirPressureItem AirPressure;                 //in Pascal (I *only* accept SI!)
+    map<Altitude,WeatherPrecition> VaporPressure;   //in Pascal (I *only* accept SI!)
+
+    map<Altitude,FGCloudItem> Clouds;              //amount of covering and type
 
-    set<FGCloudItem> Clouds;               //amount of covering and type
     WeatherPrecition SnowRainIntensity;     //this also stands for hail, snow,...
     SnowRainType     snowRainType;         
     WeatherPrecition LightningProbability;
@@ -88,6 +89,10 @@ public:
     WeatherPrecition TemperatureAt(const WeatherPrecition& a) const;
     WeatherPrecition AirPressureAt(const WeatherPrecition& a) const;
     WeatherPrecition VaporPressureAt(const WeatherPrecition& a) const;
+
+    //for easier access to the cloud stuff:
+    unsigned int getNumberOfCloudLayers(void) const;
+    FGCloudItem getCloudLayer(unsigned int nr) const;
     
     FGPhysicalProperties& operator = ( const FGPhysicalProperties& p ); 
     FGPhysicalProperties& operator *= ( const WeatherPrecition& d ); 
@@ -123,32 +128,44 @@ typedef FGPhysicalProperties2DVector::const_iterator FGPhysicalProperties2DVecto
 
 inline ostream& operator<< ( ostream& out, const FGPhysicalProperties2D& p )
 {
-    out << "Position: " << p.p << "\nStored Wind: ";
-    for (set<FGWindItem>::const_iterator WindIt = p.Wind.begin(); WindIt != p.Wind.end(); WindIt++)
-       out << "(" << WindIt->getValue() << ") at " << WindIt->getAlt() << "m; ";
-
-    out << "\nStored Turbulence: ";
-    for (set<FGTurbulenceItem>::const_iterator TurbulenceIt = p.Turbulence.begin(); 
-                                              TurbulenceIt != p.Turbulence.end(); 
-                                              TurbulenceIt++)
-       out << "(" << TurbulenceIt->getValue() << ") at " << TurbulenceIt->getAlt() << "m; ";
-
-    out << "\nStored Temperature: ";
-    for (set<FGTemperatureItem>::const_iterator TemperatureIt = p.Temperature.begin(); 
-                                               TemperatureIt != p.Temperature.end(); 
-                                               TemperatureIt++)
-       out << TemperatureIt->getValue() << " at " << TemperatureIt->getAlt() << "m; ";
-
-    out << "\nStored AirPressure: ";
-    out << p.AirPressure.getValue(0) << " at " << 0 << "m; ";
-
-    out << "\nStored VaporPressure: ";
-    for (set<FGVaporPressureItem>::const_iterator VaporPressureIt = p.VaporPressure.begin(); 
-                                                 VaporPressureIt != p.VaporPressure.end(); 
-                                                 VaporPressureIt++)
-       out << VaporPressureIt->getValue() << " at " << VaporPressureIt->getAlt() << "m; ";
-
-    return out << "\n";
+    typedef map<FGPhysicalProperties::Altitude, Point3D         >::const_iterator vector_iterator;
+    typedef map<FGPhysicalProperties::Altitude, WeatherPrecition>::const_iterator scalar_iterator;
+
+    out << "Position: " << p.p << endl;
+    
+    out << "Stored Wind: ";
+    for (vector_iterator WindIt = p.Wind.begin(); 
+                        WindIt != p.Wind.end(); 
+                        WindIt++)
+       out << "(" << WindIt->first << ") at " << WindIt->second << "m; ";
+    out << endl;
+
+    out << "Stored Turbulence: ";
+    for (vector_iterator TurbulenceIt = p.Turbulence.begin(); 
+                        TurbulenceIt != p.Turbulence.end(); 
+                        TurbulenceIt++)
+       out << "(" << TurbulenceIt->first << ") at " << TurbulenceIt->second << "m; ";
+    out << endl;
+
+    out << "Stored Temperature: ";
+    for (scalar_iterator TemperatureIt = p.Temperature.begin(); 
+                        TemperatureIt != p.Temperature.end(); 
+                        TemperatureIt++)
+       out << TemperatureIt->first << " at " << TemperatureIt->second << "m; ";
+    out << endl;
+
+    out << "Stored AirPressure: ";
+    out << p.AirPressure.getValue(0) << " at " << 0.0 << "m; ";
+    out << endl;
+
+    out << "Stored VaporPressure: ";
+    for (scalar_iterator VaporPressureIt = p.VaporPressure.begin(); 
+                        VaporPressureIt != p.VaporPressure.end(); 
+                        VaporPressureIt++)
+       out << VaporPressureIt->first << " at " << VaporPressureIt->second << "m; ";
+    out << endl;
+
+    return out << endl;
 }
 
 
@@ -164,107 +181,99 @@ inline FGPhysicalProperties& FGPhysicalProperties::operator = ( const FGPhysical
 
 inline FGPhysicalProperties& FGPhysicalProperties::operator *= ( const WeatherPrecition& d )
 {
+    typedef map<FGPhysicalProperties::Altitude, Point3D         >::iterator vector_iterator;
+    typedef map<FGPhysicalProperties::Altitude, WeatherPrecition>::iterator scalar_iterator;
 
-    for (set<FGWindItem>::iterator WindIt = Wind.begin(); 
-                                  WindIt != Wind.end(); 
-                                  WindIt++)
-       *WindIt *= d;
+    for (vector_iterator WindIt = Wind.begin(); 
+                        WindIt != Wind.end(); 
+                        WindIt++)
+       WindIt->second *= d;
 
-    for (set<FGTurbulenceItem>::iterator TurbulenceIt = Turbulence.begin(); 
-                                         TurbulenceIt != Turbulence.end(); 
-                                         TurbulenceIt++)
-       *TurbulenceIt  *= d;
+    for (vector_iterator TurbulenceIt = Turbulence.begin(); 
+                         TurbulenceIt != Turbulence.end(); 
+                         TurbulenceIt++)
+       TurbulenceIt->second  *= d;
 
-    for (set<FGTemperatureItem>::iterator TemperatureIt = Temperature.begin(); 
-                                          TemperatureIt != Temperature.end(); 
-                                          TemperatureIt++)
-       *TemperatureIt *= d;
+    for (scalar_iterator TemperatureIt = Temperature.begin(); 
+                         TemperatureIt != Temperature.end(); 
+                         TemperatureIt++)
+       TemperatureIt->second *= d;
 
     AirPressure *= d;
 
-    for (set<FGVaporPressureItem>::iterator VaporPressureIt = VaporPressure.begin(); 
-                                            VaporPressureIt != VaporPressure.end(); 
-                                            VaporPressureIt++)
-       *VaporPressureIt *= d;
+    for (scalar_iterator VaporPressureIt = VaporPressure.begin(); 
+                         VaporPressureIt != VaporPressure.end(); 
+                         VaporPressureIt++)
+       VaporPressureIt->second *= d;
 
     return *this;
 }
 
 inline FGPhysicalProperties& FGPhysicalProperties::operator += (const FGPhysicalProperties& p)
 {
-    for (set<FGWindItem>::const_iterator WindIt = p.Wind.begin(); 
-                                        WindIt != p.Wind.end(); 
-                                        WindIt++ )
-       if (WindIt != Wind.upper_bound( FGWindItem(WindIt->getAlt(), Point3D(0)) ))
-           Wind.insert(*WindIt);
-       else
-           *(Wind.upper_bound( FGWindItem(WindIt->getAlt(), Point3D(0))) ) += WindIt->getValue();
+    typedef map<FGPhysicalProperties::Altitude, Point3D         >::const_iterator vector_iterator;
+    typedef map<FGPhysicalProperties::Altitude, WeatherPrecition>::const_iterator scalar_iterator;
+
+    for (vector_iterator WindIt = p.Wind.begin(); 
+                        WindIt != p.Wind.end(); 
+                        WindIt++ )
+       if (!Wind.insert(*WindIt).second)           //when it's not inserted => it's already existing
+           Wind[WindIt->first] += WindIt->second;  //=> add the value
            
-    for (set<FGTurbulenceItem>::const_iterator TurbulenceIt = p.Turbulence.begin(); 
-                                              TurbulenceIt != p.Turbulence.end(); 
-                                               TurbulenceIt++)
-       if (TurbulenceIt != Turbulence.upper_bound( FGTurbulenceItem(TurbulenceIt->getAlt(), Point3D(0)) ))
-           Turbulence.insert(*TurbulenceIt);
-       else
-           *(Turbulence.upper_bound( FGTurbulenceItem(TurbulenceIt->getAlt(), Point3D(0)) )) += TurbulenceIt->getValue();
+    for (vector_iterator TurbulenceIt = p.Turbulence.begin(); 
+                        TurbulenceIt != p.Turbulence.end(); 
+                         TurbulenceIt++)
+       if (!Turbulence.insert(*TurbulenceIt).second)   
+           Turbulence[TurbulenceIt->first] += TurbulenceIt->second;
            
-    for (set<FGTemperatureItem>::const_iterator TemperatureIt = p.Temperature.begin(); 
-                                                TemperatureIt != p.Temperature.end(); 
-                                                TemperatureIt++)
-       if (TemperatureIt != Temperature.upper_bound( FGTemperatureItem(TemperatureIt->getAlt(), 0.0) ))
-           Temperature.insert(*TemperatureIt);
-       else
-           *(Temperature.upper_bound( FGTemperatureItem(TemperatureIt->getAlt(), 0.0) )) += TemperatureIt->getValue();
+    for (scalar_iterator TemperatureIt = p.Temperature.begin(); 
+                         TemperatureIt != p.Temperature.end(); 
+                         TemperatureIt++)
+       if (!Temperature.insert(*TemperatureIt).second) 
+           Temperature[TemperatureIt->first] += TemperatureIt->second;
            
     AirPressure += p.AirPressure.getValue(0.0);
            
-    for (set<FGVaporPressureItem>::const_iterator VaporPressureIt = p.VaporPressure.begin(); 
-                                                  VaporPressureIt != p.VaporPressure.end(); 
-                                                  VaporPressureIt++)
-       if (VaporPressureIt != VaporPressure.upper_bound( FGVaporPressureItem(VaporPressureIt->getAlt(), 0.0) ))
-           VaporPressure.insert(*VaporPressureIt);
-       else
-           *(VaporPressure.upper_bound( FGVaporPressureItem(VaporPressureIt->getAlt(), 0.0) )) += VaporPressureIt->getValue();
+    for (scalar_iterator VaporPressureIt = p.VaporPressure.begin(); 
+                         VaporPressureIt != p.VaporPressure.end(); 
+                         VaporPressureIt++)
+       if (!VaporPressure.insert(*VaporPressureIt).second)     
+           VaporPressure[VaporPressureIt->first] += VaporPressureIt->second;
 
     return *this;
 }
 
 inline FGPhysicalProperties& FGPhysicalProperties::operator -= (const FGPhysicalProperties& p)
 {
-
-    for (set<FGWindItem>::const_iterator WindIt = p.Wind.begin(); 
-                                        WindIt != p.Wind.end(); 
-                                        WindIt++)
-       if (WindIt != Wind.upper_bound( FGWindItem(WindIt->getAlt(), Point3D(0)) ))
-           Wind.insert(-(*WindIt));
-       else
-           *(Wind.upper_bound( FGWindItem(WindIt->getAlt(), Point3D(0)) ))  -= WindIt->getValue();
+    typedef map<FGPhysicalProperties::Altitude, Point3D         >::const_iterator vector_iterator;
+    typedef map<FGPhysicalProperties::Altitude, WeatherPrecition>::const_iterator scalar_iterator;
+
+    for (vector_iterator WindIt = p.Wind.begin(); 
+                        WindIt != p.Wind.end(); 
+                        WindIt++ )
+       if (!Wind.insert( make_pair(WindIt->first, -WindIt->second) ).second)   //when it's not inserted => it's already existing
+           Wind[WindIt->first] -= WindIt->second;                              //=> substract the value
            
-    for (set<FGTurbulenceItem>::const_iterator TurbulenceIt = p.Turbulence.begin(); 
-                                               TurbulenceIt != p.Turbulence.end(); 
-                                               TurbulenceIt++)
-       if (TurbulenceIt != Turbulence.upper_bound( FGTurbulenceItem(TurbulenceIt->getAlt(), Point3D(0)) ))
-           Turbulence.insert(-(*TurbulenceIt));
-       else
-           *(Turbulence.upper_bound( FGTurbulenceItem(TurbulenceIt->getAlt(), Point3D(0)) )) -= TurbulenceIt->getValue();
+    for (vector_iterator TurbulenceIt = p.Turbulence.begin(); 
+                        TurbulenceIt != p.Turbulence.end(); 
+                         TurbulenceIt++)
+       if (!Turbulence.insert( make_pair(TurbulenceIt->first, -TurbulenceIt->second) ).second) 
+           Turbulence[TurbulenceIt->first] -= TurbulenceIt->second;
            
-    for (set<FGTemperatureItem>::const_iterator TemperatureIt = p.Temperature.begin(); 
-                                               TemperatureIt != p.Temperature.end(); 
-                                                TemperatureIt++)
-       if (TemperatureIt != Temperature.upper_bound( FGTemperatureItem(TemperatureIt->getAlt(), 0.0) ))
-           Temperature.insert(-(*TemperatureIt));
-       else
-           *(Temperature.upper_bound( FGTemperatureItem(TemperatureIt->getAlt(), 0.0) )) -= TemperatureIt->getValue();
+    for (scalar_iterator TemperatureIt = p.Temperature.begin(); 
+                         TemperatureIt != p.Temperature.end(); 
+                         TemperatureIt++)
+       if (!Temperature.insert( make_pair(TemperatureIt->first, -TemperatureIt->second) ).second)      
+           Temperature[TemperatureIt->first] -= TemperatureIt->second;
            
     AirPressure -= p.AirPressure.getValue(0.0);
            
-    for (set<FGVaporPressureItem>::const_iterator VaporPressureIt = p.VaporPressure.begin(); 
-                                                  VaporPressureIt != p.VaporPressure.end(); 
-                                                  VaporPressureIt++)
-       if (VaporPressureIt != VaporPressure.upper_bound( FGVaporPressureItem(VaporPressureIt->getAlt(), 0.0) ))
-           VaporPressure.insert(-(*VaporPressureIt));
-       else
-           *(VaporPressure.upper_bound( FGVaporPressureItem(VaporPressureIt->getAlt(), 0.0) )) -= VaporPressureIt->getValue();
+    for (scalar_iterator VaporPressureIt = p.VaporPressure.begin(); 
+                         VaporPressureIt != p.VaporPressure.end(); 
+                         VaporPressureIt++)
+       if (!VaporPressure.insert( make_pair(VaporPressureIt->first, -VaporPressureIt->second) ).second)        
+           VaporPressure[VaporPressureIt->first] -= VaporPressureIt->second;
+
 
     return *this;
 }
@@ -272,36 +281,38 @@ inline FGPhysicalProperties& FGPhysicalProperties::operator -= (const FGPhysical
 
 inline Point3D FGPhysicalProperties::WindAt(const WeatherPrecition& a) const
 {
-    set<FGWindItem>::const_iterator it = Wind.lower_bound(FGWindItem(a, Point3D(0)));
-    set<FGWindItem>::const_iterator it2 = it;
+    typedef map<FGPhysicalProperties::Altitude, Point3D>::const_iterator vector_iterator;
+
+    vector_iterator it = Wind.lower_bound(a);
+    vector_iterator it2 = it;
     it--;
 
     //now I've got it->alt < a < it2->alt so I can interpolate
-    return ( (it2->getValue() - it->getValue())/(it2->getAlt() - it->getAlt()) )*
-             (a - it2->getAlt()) + 
-              it2->getValue(); 
+    return ( (it2->second - it->second)/(it2->first - it->first) ) * (a - it2->first) + it2->second; 
 }
 
 inline Point3D FGPhysicalProperties::TurbulenceAt(const WeatherPrecition& a) const
 {
-    set<FGTurbulenceItem>::const_iterator it = Turbulence.lower_bound(FGTurbulenceItem(a, Point3D(0)));
-    set<FGTurbulenceItem>::const_iterator it2 = it;
+    typedef map<FGPhysicalProperties::Altitude, Point3D>::const_iterator vector_iterator;
+
+    vector_iterator it = Turbulence.lower_bound(a);
+    vector_iterator it2 = it;
     it--;
 
     //now I've got it->alt < a < it2->alt so I can interpolate
-    return ( (it2->getValue() - it->getValue() )/(it2->getAlt() - it->getAlt()) )*
-           (a - it2->getAlt())+ it2->getValue(); 
+    return ( (it2->second - it->second)/(it2->first - it->first) ) * (a - it2->first) + it2->second; 
 }
 
 inline WeatherPrecition FGPhysicalProperties::TemperatureAt(const WeatherPrecition& a) const
 {
-    set<FGTemperatureItem>::const_iterator it = Temperature.lower_bound(FGTemperatureItem(a, 0));
-    set<FGTemperatureItem>::const_iterator it2 = it;
+    typedef map<FGPhysicalProperties::Altitude, WeatherPrecition>::const_iterator scalar_iterator;
+
+    scalar_iterator it = Temperature.lower_bound(a);
+    scalar_iterator it2 = it;
     it--;
 
     //now I've got it->alt < a < it2->alt so I can interpolate
-    return ( (it2->getValue() - it->getValue()) / (it2->getAlt() - it->getAlt()) )* 
-           (a - it2->getAlt() )+ it2->getValue(); 
+    return ( (it2->second - it->second)/(it2->first - it->first) ) * (a - it2->first) + it2->second; 
 }
 
 inline WeatherPrecition FGPhysicalProperties::AirPressureAt(const WeatherPrecition& a) const
@@ -311,34 +322,35 @@ inline WeatherPrecition FGPhysicalProperties::AirPressureAt(const WeatherPreciti
 
 inline WeatherPrecition FGPhysicalProperties::VaporPressureAt(const WeatherPrecition& a) const
 {
-    set<FGVaporPressureItem>::const_iterator it = VaporPressure.lower_bound(FGVaporPressureItem(a, 0));
-    set<FGVaporPressureItem>::const_iterator it2 = it;
+    typedef map<FGPhysicalProperties::Altitude, WeatherPrecition>::const_iterator scalar_iterator;
+
+    scalar_iterator it = VaporPressure.lower_bound(a);
+    scalar_iterator it2 = it;
     it--;
 
     //now I've got it->alt < a < it2->alt so I can interpolate
-    return ( (it2->getValue() - it->getValue() ) / (it2->getAlt() - it->getAlt() ) ) *
-           (a - it2->getAlt() )+ it2->getValue(); 
+    return ( (it2->second - it->second)/(it2->first - it->first) ) * (a - it2->first) + it2->second; 
 }
 
 
-inline FGPhysicalProperties operator * (const FGPhysicalProperties& a, const WeatherPrecition& b)
+inline FGPhysicalProperties operator * (FGPhysicalProperties a, const WeatherPrecition& b)
 {
-    return FGPhysicalProperties(a) *= b;
+    return a *= b;
 }
 
-inline FGPhysicalProperties operator * (const WeatherPrecition& b, const FGPhysicalProperties& a)
+inline FGPhysicalProperties operator * (const WeatherPrecition& b, FGPhysicalProperties a)
 {
-    return FGPhysicalProperties(a) *= b;
+    return a *= b;
 }
 
-inline FGPhysicalProperties operator + (const FGPhysicalProperties& a, const FGPhysicalProperties& b)
+inline FGPhysicalProperties operator + (FGPhysicalProperties a, const FGPhysicalProperties& b)
 {
-    return FGPhysicalProperties(a) += (FGPhysicalProperties)b;
+    return a += b;
 }
 
-inline FGPhysicalProperties operator - (const FGPhysicalProperties& a, const FGPhysicalProperties& b)
+inline FGPhysicalProperties operator - (FGPhysicalProperties a, const FGPhysicalProperties& b)
 {
-    return FGPhysicalProperties(a) -= (FGPhysicalProperties)b;
+    return a -= b;
 }
 
 /****************************************************************************/
index 0abca2743ac362c86f3ec3cd50ba09416b2c4ed5..a28c27caafdd58892ec719af97d8312a866aac4b 100644 (file)
@@ -33,6 +33,8 @@ HISTORY
 29.05.1999 Christian Mayer     Created
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
index d5489ad08ecc26e5a6aeee112b6cde410d078c93..3452dfdf381ca60b86f37277193eea7964625236 100644 (file)
@@ -34,6 +34,8 @@ HISTORY
 20.06.1999 Christian Mayer      Changed struct to class
 20.06.1999 Christian Mayer     added lots of consts
 30.06.1999 Christian Mayer     STL portability
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
index d6910f4ff64ba143cd8afbb90428bc6462dc6837..6cdd0079d1c66630e2be88287e1d6dd7d60347bc 100644 (file)
@@ -32,6 +32,8 @@ HISTORY
 28.05.1999 Christian Mayer     Created
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
index 0c276012a00d83f4b383fea1a6f94bf83a5a82d4..f754023404220a568f4643bfaf810e8ac65d3ee7 100644 (file)
@@ -33,6 +33,8 @@ HISTORY
 28.05.1999 Christian Mayer     Created
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
index 83fcc207b9411c7e844d984a1adb98ca8997ddf8..063acbf1fb9b75cc287bd21931ece05140fba88b 100644 (file)
@@ -32,6 +32,9 @@ HISTORY
 28.05.1999 Christian Mayer     Created
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
+10.10.1999 Christian Mayer     added mutable for gcc 2.95 portability
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
@@ -44,6 +47,9 @@ HISTORY
 /* INCLUDES                                                                */
 /****************************************************************************/
 #include "FGWeatherDefs.h"
+
+//for the case that mutable isn't supported:
+#include "Include/compiler.h"
                
 /****************************************************************************/
 /* DEFINES                                                                 */
@@ -57,7 +63,7 @@ FGTemperatureItem operator-(const FGTemperatureItem& arg);
 class FGTemperatureItem
 {
 private:
-    WeatherPrecition value;
+    mutable WeatherPrecition value;
     WeatherPrecition alt;
 
 protected:
index 9a1028e2503f5f59b597733472caf9434dd21d6d..8595b4ad16b6d87ed932667731979fc16c02e5fb 100644 (file)
@@ -33,6 +33,8 @@ HISTORY
 28.05.1999 Christian Mayer     Created
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
index 3052d543e71a87bc407040111760777b52b0889a..4cc927a6156ee9414f7a33a1949ad038bc2952ed 100644 (file)
@@ -32,6 +32,9 @@ HISTORY
 28.05.1999 Christian Mayer     Created
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
+10.10.1999 Christian Mayer     added mutable for gcc 2.95 portability
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
@@ -45,6 +48,9 @@ HISTORY
 /****************************************************************************/
 #include <Math/point3d.hxx>
 #include "FGWeatherDefs.h"
+
+//for the case that mutable isn't supported:
+#include "Include/compiler.h"
        
 /****************************************************************************/
 /* DEFINES                                                                 */
@@ -58,7 +64,7 @@ FGTurbulenceItem operator-(const FGTurbulenceItem& arg);
 class FGTurbulenceItem
 {
 private:
-    Point3D value;
+    mutable Point3D value;
     WeatherPrecition alt;
 
 protected:
index bbd74746e492c101ff9b071c6bcb5a7bc3cac00e..7ebd36ff58c83593edf15e72c751d731bc414925 100644 (file)
@@ -33,6 +33,8 @@ HISTORY
 28.05.1999 Christian Mayer     Created
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
index ca3b9adf3fcfc5d8b3326cd3b5f537bb9c0b239e..1a990e1e9e3b88e447a17a96df905854453f74dd 100644 (file)
@@ -32,6 +32,9 @@ HISTORY
 28.05.1999 Christian Mayer     Created
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
+10.10.1999 Christian Mayer     added mutable for gcc 2.95 portability
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
@@ -44,6 +47,9 @@ HISTORY
 /* INCLUDES                                                                */
 /****************************************************************************/
 #include "FGWeatherDefs.h"
+
+//for the case that mutable isn't supported:
+#include "Include/compiler.h"
                
 /****************************************************************************/
 /* DEFINES                                                                 */
@@ -57,7 +63,7 @@ FGVaporPressureItem operator-(const FGVaporPressureItem& arg);
 class FGVaporPressureItem
 {
 private:
-    WeatherPrecition value;
+    mutable WeatherPrecition value;
     WeatherPrecition alt;
 
 protected:
index 3c9296ecceb612ad62a5fe0efc1ece94b6dac355..f645d19fcce9c92085c2db4e0decb31e9a494f0b 100644 (file)
@@ -36,6 +36,8 @@ HISTORY
 ------------------------------------------------------------------------------
 30.05.99   Christian Mayer     Created
 16.06.99   Durk Talsma         Portability for Linux
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
index 6a83ea1cd0a8e43b87b5cfc0aac45fa0ae077e47..178e0efc30851fe01c0c60c131ae95aef80f6db0 100644 (file)
@@ -37,6 +37,8 @@ HISTORY
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
 30.06.1999 Christian Mayer     STL portability
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
index 8e816d2a7631596c638dc4b49c737d0ebe60e5e7..8b3063bd3642a772d82ddfbb8b0eaf29b78e780a 100644 (file)
@@ -32,6 +32,8 @@ HISTORY
 28.05.1999 Christian Mayer     Created
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
index 1d51a3a4d3b1e1e2174b8277364f8b8bae92ae8a..c0a261ad9412d3b532c266a839e60b8353df56d2 100644 (file)
@@ -34,6 +34,8 @@ HISTORY
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
 30.06.1999 Christian Mayer     STL portability
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
index 166a23117d966b2340994e0e2ff55ce4f0432a0b..5e3ca61f8aa9167b0024ceb7bbf30c64291cd657 100644 (file)
@@ -33,6 +33,8 @@ HISTORY
 08.06.1999 Christian Mayer      Changed sat_vp
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
index 7795919f691ad5fe3c38577c7a85a4c7ddea7932..47bcd9d52c7ae9a8f749b5aef99f738a01bdedc2 100644 (file)
@@ -33,6 +33,8 @@ HISTORY
 28.05.1999 Christian Mayer     Created
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
index 1376e453debf8d2da6a15141fe92f3894357a652..5bd7e9ff7a8f8d04fb650de612ba9ce527e73702 100644 (file)
@@ -32,6 +32,9 @@ HISTORY
 28.05.1999 Christian Mayer     Created
 16.06.1999 Durk Talsma         Portability for Linux
 20.06.1999 Christian Mayer     added lots of consts
+10.10.1999 Christian Mayer     added mutable for gcc 2.95 portability
+11.10.1999 Christian Mayer     changed set<> to map<> on Bernie Bright's 
+                               suggestion
 *****************************************************************************/
 
 /****************************************************************************/
@@ -45,6 +48,9 @@ HISTORY
 /****************************************************************************/
 #include <Math/point3d.hxx>
 #include "FGWeatherDefs.h"
+
+//for the case that mutable isn't supported:
+#include "Include/compiler.h"
                
 /****************************************************************************/
 /* DEFINES                                                                 */
@@ -58,7 +64,7 @@ FGWindItem operator-(const FGWindItem& arg);
 class FGWindItem
 {
 private:
-    Point3D value;
+    mutable Point3D value;
     WeatherPrecition alt;
 
 protected: