]> git.mxchange.org Git - simgear.git/blobdiff - simgear/environment/visual_enviro.hxx
Cygwin fixes.
[simgear.git] / simgear / environment / visual_enviro.hxx
index 43c510f77e6cc924b8bce5e58a912e11c49e5918..946c169caaa05ade89bbeb3ca3354be970f31eee 100644 (file)
 
 #include <simgear/compiler.h>
 #include STL_STRING
+#include <vector>
 
+SG_USING_STD(vector);
 SG_USING_STD(string);
 
 class SGLightning;
 class SGSoundMgr;
 
+/**
+ * Simulate some echo on a weather radar.
+ * Container class for the wx radar instrument.
+ */
+class SGWxRadarEcho {
+public:
+       SGWxRadarEcho(float _heading, float _alt, float _radius, float _dist, double _LWC, bool _lightning, int _cloudId) :
+         heading( _heading ),
+         alt ( _alt ),
+         radius ( _radius ),
+         dist ( _dist ),
+         LWC ( _LWC ),
+         lightning ( _lightning ),
+         cloudId ( _cloudId )
+       {}
+
+       /** the heading in radian is versus north */
+       float heading;
+       float alt, radius, dist;
+       /** reflectivity converted to liquid water content. */
+       double LWC;
+       /** if true then this data is for a lightning else it is for water echo. */
+       bool   lightning;
+       /** Unique identifier of cloud */
+       int cloudId;
+};
+
+typedef vector<SGWxRadarEcho> list_of_SGWxRadarEcho;
+
 /**
  * Visual environment helper class.
  */
 class SGEnviro {
-friend struct SGLightning;
+friend class SGLightning;
 private:
        void DrawCone2(float baseRadius, float height, int slices, bool down, double rain_norm, double speed);
        void lt_update(void);
@@ -42,6 +73,7 @@ private:
        bool view_in_cloud;
        bool precipitation_enable_state;
        float precipitation_density;
+       float precipitation_max_alt;
        bool turbulence_enable_state;
        double last_cloud_turbulence, cloud_turbulence;
        bool lightning_enable_state;
@@ -56,6 +88,9 @@ private:
 
        float fov_width, fov_height;
 
+       /** a list of all the radar echo. */
+       list_of_SGWxRadarEcho radarEcho;
+
 public:
        SGEnviro();
        ~SGEnviro();
@@ -75,9 +110,9 @@ public:
      * @param familly cloud familly
      * @param dist  squared dist to cloud in meters
      */
-       void callback_cloud(float heading, float alt, float radius, int familly, float dist);
+       void callback_cloud(float heading, float alt, float radius, int familly, float dist, int cloudId);
 
-       void drawRain(double pitch, double roll, double speed, double rain_norm);
+       void drawRain(double pitch, double roll, double heading, double speed, double rain_norm);
     /**
      * Draw rain or snow precipitation around the viewer.
      * @param rain_norm rain normalized intensity given by metar class
@@ -88,7 +123,7 @@ public:
      * @param speed moving speed of viewer in kt
      */
        void drawPrecipitation(double rain_norm, double snow_norm, double hail_norm,
-                                                       double pitch, double roll, double speed);
+                                                       double pitch, double roll, double heading, double speed);
 
     /**
      * Draw the lightnings spawned by cumulo nimbus.
@@ -183,6 +218,9 @@ public:
        void setFOV( float w, float h );
        void getFOV( float &w, float &h );
 
+       list_of_SGWxRadarEcho *get_radar_echo(void);
+
+       sgMat4 *get_transform(void) { return &transform; }
 };
 
 extern SGEnviro sgEnviro;