]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/HUD/HUD.hxx
better use unset() for unsetting ...
[flightgear.git] / src / Instrumentation / HUD / HUD.hxx
index 7655a31bd5051812833f1f7dd67eccfd877059d6..ba0b4d4b1f04f72c665167b7c03912fda96a1842 100644 (file)
@@ -54,6 +54,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)
@@ -192,6 +213,7 @@ private:
     class AimingReticle;
 
     deque<Item *> _items;
+    deque<Item *> _ladders;
 
     SGPropertyNode_ptr _current;
     SGPropertyNode_ptr _visibility;
@@ -219,6 +241,7 @@ private:
     float _font_size;
     int _style;
 
+    ClipBox *_clip_box;
     TextList _text_list;
     LineList _line_list;
     LineList _stipple_line_list;
@@ -332,7 +355,7 @@ 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_bullet(float, float, float);
 
@@ -486,22 +509,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 +532,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 +556,7 @@ private:
     bool   _nadir;
     bool   _hat;
 
+    ClipBox *_clip_box;
     // The Ladder has its own temporary display lists
     TextList _locTextList;
     LineList _locLineList;
@@ -589,5 +615,4 @@ private:
 };
 
 
-
 #endif // _HUD_HXX