]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/HUD/HUD.hxx
remove old .cvsignore files
[flightgear.git] / src / Instrumentation / HUD / HUD.hxx
index 7655a31bd5051812833f1f7dd67eccfd877059d6..3408e54c58e55e8e58cf2620ed4c489e4b054eb4 100644 (file)
@@ -38,8 +38,6 @@ using std::vector;
 
 #include <osg/State>
 
-#include <plib/sg.h>
-
 #include <simgear/math/SGLimits.hxx>
 #include <simgear/constants.h>
 #include <simgear/structure/subsystem_mgr.hxx>
@@ -54,6 +52,27 @@ using std::vector;
 class FGViewer;
 
 
+class ClipBox {
+public:
+    ClipBox(const SGPropertyNode *, float xoffset = 0, float yoffset = 0);
+    void set();
+    void unset();
+
+private:
+    bool _active;
+    float _xoffs, _yoffs;
+    SGConstPropertyNode_ptr _top_node;
+    SGConstPropertyNode_ptr _bot_node;
+    SGConstPropertyNode_ptr _left_node;
+    SGConstPropertyNode_ptr _right_node;
+    GLdouble _top[4];
+    GLdouble _bot[4];
+    GLdouble _left[4];
+    GLdouble _right[4];
+};
+
+
+
 class LineSegment {
 public:
     LineSegment(GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1)
@@ -134,6 +153,8 @@ public:
     void init();
     void update(double);
 
+  void reinit();
+
     // called from Main/renderer.cxx to draw 2D and 3D HUD
     void draw(osg::State&);
 
@@ -176,6 +197,8 @@ protected:
             int level = 0, const std::string& indent = "");
 
 private:
+    void deinit();
+    
     void draw3D();
     void draw2D(GLfloat, GLfloat, GLfloat, GLfloat);
 
@@ -192,7 +215,9 @@ private:
     class AimingReticle;
 
     deque<Item *> _items;
+    deque<Item *> _ladders;
 
+    SGPropertyNode_ptr _path;
     SGPropertyNode_ptr _current;
     SGPropertyNode_ptr _visibility;
     SGPropertyNode_ptr _3DenabledN;
@@ -218,7 +243,9 @@ private:
     fntTexFont *_font;
     float _font_size;
     int _style;
+    bool _listener_active;
 
+    ClipBox *_clip_box;
     TextList _text_list;
     LineList _line_list;
     LineList _stipple_line_list;
@@ -332,8 +359,9 @@ protected:
 
     void draw_line(float x1, float y1, float x2, float y2);
     void draw_stipple_line(float x1, float y1, float x2, float y2);
-    void draw_text(float x, float y, char *msg, int align = 0, int digit = 0);
+    void draw_text(float x, float y, const char *msg, int align = 0, int digit = 0);
     void draw_circle(float x1, float y1, float r) const;
+    void draw_arc(float x1, float y1, float t0, float t1, float r) const;
     void draw_bullet(float, float, float);
 
     HUD         *_hud;
@@ -434,6 +462,7 @@ private:
     bool   _draw_cap_right;
     bool   _draw_cap_left;
     float  _marker_offset;
+    float  _label_offset;
     float  _label_gap;
     bool   _pointer;
     Format _label_fmt;
@@ -486,22 +515,22 @@ private:
 class HUD::Ladder : public Item {
 public:
     Ladder(HUD *parent, const SGPropertyNode *, float x, float y);
+    ~Ladder();
     virtual void draw();
 
 private:
     void draw_zenith(float, float);
     void draw_nadir(float, float);
 
-    void draw_text(float x, float y, char *s, int align = 0) {
+    void draw_text(float x, float y, const char *s, int align = 0) {
         _locTextList.add(x, y, s, align, 0);
     }
 
-    void draw_line(float x1, float y1, float x2, float y2) {
-        _locLineList.add(LineSegment(x1, y1, x2, y2));
-    }
-
-    void draw_stipple_line(float x1, float y1, float x2, float y2) {
-        _locStippleLineList.add(LineSegment(x1, y1, x2, y2));
+    void draw_line(float x1, float y1, float x2, float y2, bool stipple = false) {
+        if (stipple)
+            _locStippleLineList.add(LineSegment(x1, y1, x2, y2));
+        else
+            _locLineList.add(LineSegment(x1, y1, x2, y2));
     }
 
     enum   Type { PITCH, CLIMB_DIVE } _type;
@@ -509,12 +538,14 @@ private:
     Input  _roll;
     float  _width_units;
     int    _div_units;
-    unsigned int _scr_hole;
+    float  _scr_hole;
+    float  _zero_bar_overlength;
+    bool   _dive_bar_angle;
+    float  _tick_length;
     float  _vmax;
     float  _vmin;
     float  _compression;
     bool   _dynamic_origin;
-    bool   _clip_plane;
     bool   _frl;               // fuselage reference line
     bool   _target_spot;
     bool   _target_markers;
@@ -531,6 +562,7 @@ private:
     bool   _nadir;
     bool   _hat;
 
+    ClipBox *_clip_box;
     // The Ladder has its own temporary display lists
     TextList _locTextList;
     LineList _locLineList;
@@ -551,7 +583,7 @@ private:
     bool boundOutsidePoints(sgdVec3& v, sgdVec3& m);
     bool drawLine(const sgdVec3& a1, const sgdVec3& a2, const sgdVec3& p1, const sgdVec3& p2);
     void drawArrow();
-    bool get_active_runway(FGRunway& rwy);
+    FGRunway* get_active_runway();
     void get_rwy_points(sgdVec3 *points);
     void setLineWidth();
 
@@ -566,8 +598,7 @@ private:
     double _default_pitch;
     double _default_heading;
     GLint  _view[4];
-    FGRunway _runway;
-    FGViewer* _cockpit_view;
+    FGRunway* _runway;
     unsigned short _stipple_out;    // stipple pattern of the outline of the runway
     unsigned short _stipple_center; // stipple pattern of the center line of the runway
     bool   _draw_arrow;             // draw arrow when runway is not visible in HUD
@@ -583,11 +614,26 @@ public:
 
 private:
     SGSharedPtr<SGCondition> _active_condition;  // stadiametric (true) or standby (false)
+    SGSharedPtr<SGCondition> _tachy_condition;  // tachymetric (true) or standby (false)
+    SGSharedPtr<SGCondition> _align_condition;  // tachymetric (true) or standby (false)
+
     Input   _diameter;               // inner/outer radius relation
+    Input  _pitch;
+    Input  _yaw;
+    Input  _speed;
+    Input  _range;
+    Input  _t0;
+    Input  _t1;
+    Input  _offset_x;
+    Input  _offset_y;
+
     float   _bullet_size;
     float   _inner_radius;
-};
+    float   _compression;
+    float  _limit_x;
+    float  _limit_y;
 
+};
 
 
 #endif // _HUD_HXX