]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/NavDisplay.hxx
NavDisplay: fix update lag when switching range or centre.
[flightgear.git] / src / Instrumentation / NavDisplay.hxx
index 00725e0820ce05f8e7bc46a60b30cd2d9647081f..368ff8c55d12d3925a79412750139938354927fb 100644 (file)
@@ -67,17 +67,26 @@ public:
     {
         _cachedItemsValid = false;
     }
+    
+    double textureSize() const
+    { return _textureSize; }
+    
+    void forceUpdate()
+    { _forceUpdate = true; }
+    
 protected:
     std::string _name;
     int _num;
     double _time;
     double _updateInterval;
-
+    bool _forceUpdate;
+    
     SGPropertyNode_ptr _serviceable_node;
     SGPropertyNode_ptr _Instrument;
     SGPropertyNode_ptr _radar_mode_control_node;
     SGPropertyNode_ptr _user_heading_node;
-
+    SGPropertyNode_ptr _testModeNode;
+  
     FGODGauge *_odg;
 
     // Convenience function for creating a property node with a
@@ -105,15 +114,18 @@ private:
     bool anyRuleMatches(const std::string& type, const string_set& states) const;
     void findRules(const std::string& type, const string_set& states, SymbolDefVector& rules);
     
-    bool addSymbolInstance(const osg::Vec2& proj, double heading, SymbolDef* def, SGPropertyNode* vars);
+    SymbolInstance* addSymbolInstance(const osg::Vec2& proj, double heading, SymbolDef* def, SGPropertyNode* vars);
     void addLine(osg::Vec2 a, osg::Vec2 b, const osg::Vec4& color);
     osg::Vec2 projectBearingRange(double bearingDeg, double rangeNm) const;
     osg::Vec2 projectGeod(const SGGeod& geod) const;
     bool isProjectedClipped(const osg::Vec2& projected) const;
     void updateFont();
     
+    void addTestSymbol(const std::string& type, const std::string& states, const SGGeod& pos, double heading, SGPropertyNode* vars);
+    void addTestSymbols();
+  
     std::string _texture_path;
-
+    unsigned int _textureSize;
 
     float _scale;   // factor to convert nm to display units
     float _view_heading;
@@ -126,6 +138,7 @@ private:
     SGPropertyNode_ptr _ai_enabled_node;
     SGPropertyNode_ptr _navRadio1Node;
     SGPropertyNode_ptr _navRadio2Node;
+    SGPropertyNode_ptr _xCenterNode, _yCenterNode;
     
     osg::ref_ptr<osg::Texture2D> _resultTexture;
     osg::ref_ptr<osg::Texture2D> _symbolTexture;
@@ -171,6 +184,9 @@ private:
     
     class CacheListener;
     std::auto_ptr<CacheListener> _cacheListener;
+    
+    class ForceUpdateListener;
+    std::auto_ptr<ForceUpdateListener> _forceUpdateListener;
 };
 
 #endif // _INST_ND_HXX