]> git.mxchange.org Git - flightgear.git/blobdiff - src/Environment/environment.hxx
Bugfix: reset transparency of non fog/mist/haze layers
[flightgear.git] / src / Environment / environment.hxx
index 11eccd91b9dac4485bfdbfc5fd41abd3f38d6e0d..048b17992885e77182bba414b6c7e13bf58bb950 100644 (file)
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //
-// $Id$
-
 
 #ifndef _ENVIRONMENT_HXX
 #define _ENVIRONMENT_HXX
 
 #include <simgear/compiler.h>
 
-#ifdef SG_HAVE_STD_INCLUDES
-#  include <cmath>
-#else
-#  include <math.h>
-#endif
-
+#include <cmath>
+#include "tiedpropertylist.hxx"
 
 /**
  * Model the natural environment.
@@ -50,9 +44,11 @@ public:
   FGEnvironment (const FGEnvironment &environment);
   virtual ~FGEnvironment();
 
-  virtual void copy (const FGEnvironment &environment);
+  FGEnvironment & operator = ( const FGEnvironment & other );
 
   virtual void read (const SGPropertyNode * node);
+  virtual void Tie( SGPropertyNode_ptr base, bool setArchivable = true );
+  virtual void Untie();
   
   virtual double get_visibility_m () const;
 
@@ -65,6 +61,11 @@ public:
   virtual double get_pressure_inhg () const;
   virtual double get_density_slugft3 () const;
 
+  virtual double get_relative_humidity () const;
+  virtual double get_density_tropo_avg_kgm3 () const;
+  virtual double get_altitude_half_to_sun_m () const;
+  virtual double get_altitude_tropo_top_m () const;
+
   virtual double get_wind_from_heading_deg () const;
   virtual double get_wind_speed_kt () const;
   virtual double get_wind_from_north_fps () const;
@@ -94,25 +95,33 @@ public:
 
   virtual double get_elevation_ft () const;
   virtual void set_elevation_ft (double elevation_ft);
+  virtual void set_altitude_half_to_sun_m (double alt);
+  virtual void set_altitude_tropo_top_m (double alt);
 
-private:
+  virtual bool set_live_update(bool live_update);
 
+
+  FGEnvironment & interpolate (const FGEnvironment & env2, double fraction, FGEnvironment * result) const;
+private:
+  virtual void copy (const FGEnvironment &environment);
+  void _init();
   void _recalc_hdgspd ();
-  void _recalc_ne ();
 
   void _recalc_sl_temperature ();
-  void _recalc_alt_temperature ();
   void _recalc_sl_dewpoint ();
-  void _recalc_alt_dewpoint ();
   void _recalc_sl_pressure ();
-  void _recalc_alt_pressure ();
+
+  void _recalc_density_tropo_avg_kgm3 ();
+  void _recalc_ne ();
+  void _recalc_alt_dewpoint ();
   void _recalc_density ();
+  void _recalc_relative_humidity ();
+  void _recalc_alt_pt ();
 
   double elevation_ft;
-
   double visibility_m;
 
-                               // Atmosphere
+  // Atmosphere
   double temperature_sea_level_degc;
   double temperature_degc;
   double dewpoint_sea_level_degc;
@@ -121,6 +130,11 @@ private:
   double pressure_inhg;
   double density_slugft3;
 
+  double density_tropo_avg_kgm3;
+  double relative_humidity;
+  double altitude_half_to_sun_m;
+  double altitude_tropo_top_m;
+
   double turbulence_magnitude_norm;
   double turbulence_rate_hz;
 
@@ -131,9 +145,9 @@ private:
   double wind_from_east_fps;
   double wind_from_down_fps;
 
-};
+  bool     live_update;
+  TiedPropertyList _tiedProperties;
 
-void interpolate (const FGEnvironment * env1, const FGEnvironment * env2,
-                  double fraction, FGEnvironment * result);
+};
 
 #endif // _ENVIRONMENT_HXX