]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/NavDisplay.hxx
ADF: code clean-up/documentation
[flightgear.git] / src / Instrumentation / NavDisplay.hxx
index 368ff8c55d12d3925a79412750139938354927fb..870c3cc3051a58089dd83a13cd143a221253ef3e 100644 (file)
@@ -44,6 +44,7 @@ class FGNavRecord;
 
 class SymbolInstance;
 class SymbolDef;
+class SymbolRule;
 
 namespace flightgear
 {
@@ -51,6 +52,7 @@ namespace flightgear
 }
 
 typedef std::set<std::string> string_set;
+typedef std::vector<SymbolRule*> SymbolRuleVector;
 typedef std::vector<SymbolDef*> SymbolDefVector;
 
 class NavDisplay : public SGSubsystem
@@ -74,6 +76,8 @@ public:
     void forceUpdate()
     { _forceUpdate = true; }
     
+    bool anyRuleForType(const std::string& type) const;
+    bool isPositionedShown(FGPositioned* pos);
 protected:
     std::string _name;
     int _num;
@@ -95,11 +99,17 @@ protected:
     SGPropertyNode *getInstrumentNode(const char *name, DefaultType value);
 
 private:
+    friend class SymbolRule;
+    friend class SymbolDef;
+  
+    void addRule(SymbolRule*);
+  
     void addSymbolsToScene();
     void addSymbolToScene(SymbolInstance* sym);
     void limitDisplayedSymbols();
     
     void findItems();
+    void isPositionedShownInner(FGPositioned* pos, SymbolRuleVector& rules);
     void foundPositionedItem(FGPositioned* pos);
     void computePositionedPropsAndHeading(FGPositioned* pos, SGPropertyNode* nd, double& heading);
     void computePositionedState(FGPositioned* pos, string_set& states);
@@ -110,9 +120,7 @@ private:
     void processAI();
     void computeAIStates(const SGPropertyNode* ai, string_set& states);
     
-    bool anyRuleForType(const std::string& type) const;
-    bool anyRuleMatches(const std::string& type, const string_set& states) const;
-    void findRules(const std::string& type, const string_set& states, SymbolDefVector& rules);
+    void findRules(const std::string& type, const string_set& states, SymbolRuleVector& rules);
     
     SymbolInstance* addSymbolInstance(const osg::Vec2& proj, double heading, SymbolDef* def, SGPropertyNode* vars);
     void addLine(osg::Vec2 a, osg::Vec2 b, const osg::Vec4& color);
@@ -139,8 +147,8 @@ private:
     SGPropertyNode_ptr _navRadio1Node;
     SGPropertyNode_ptr _navRadio2Node;
     SGPropertyNode_ptr _xCenterNode, _yCenterNode;
-    
-    osg::ref_ptr<osg::Texture2D> _resultTexture;
+    SGPropertyNode_ptr _viewHeadingNode;
+  
     osg::ref_ptr<osg::Texture2D> _symbolTexture;
     osg::ref_ptr<osg::Geode> _radarGeode;
     osg::ref_ptr<osg::Geode> _textGeode;
@@ -171,7 +179,8 @@ private:
     double _rangeNm;
     SGPropertyNode_ptr _rangeNode;
     
-    SymbolDefVector _rules;
+    SymbolDefVector _definitions;
+    SymbolRuleVector _rules;
     FGNavRecord* _nav1Station;
     FGNavRecord* _nav2Station;
     std::vector<SymbolInstance*> _symbols;
@@ -181,7 +190,8 @@ private:
     SGVec3d _cachedPos;
     FGPositioned::List _itemsInRange;
     SGPropertyNode_ptr _excessDataNode;
-    
+    int _maxSymbols;
+  
     class CacheListener;
     std::auto_ptr<CacheListener> _cacheListener;