4 * Created on: 11.07.2012
8 #ifndef CANVAS_GEO_NODE_PAIR_HXX_
9 #define CANVAS_GEO_NODE_PAIR_HXX_
19 LON_MISSING = LAT_MISSING << 1,
20 INCOMPLETE = LAT_MISSING | LON_MISSING,
21 DIRTY = LON_MISSING << 1
30 uint8_t getStatus() const
35 void setDirty(bool flag = true)
45 return _status & DIRTY;
48 bool isComplete() const
50 return !(_status & INCOMPLETE);
53 void setNodeLat(SGPropertyNode* node)
56 _status &= ~LAT_MISSING;
58 if( node == _node_lon )
61 _status |= LON_MISSING;
65 void setNodeLon(SGPropertyNode* node)
68 _status &= ~LON_MISSING;
70 if( node == _node_lat )
73 _status |= LAT_MISSING;
77 const char* getLat() const
79 return _node_lat ? _node_lat->getStringValue() : "";
82 const char* getLon() const
84 return _node_lon ? _node_lon->getStringValue() : "";
87 void setTargetName(const std::string& name)
92 void setScreenPos(float x, float y)
94 assert( isComplete() );
95 SGPropertyNode *parent = _node_lat->getParent();
96 parent->getChild(_target_name, _node_lat->getIndex(), true)
98 parent->getChild(_target_name, _node_lon->getIndex(), true)
104 std::cout << "lat=" << (_node_lat ? _node_lat->getPath() : "")
105 << ", lon=" << (_node_lon ? _node_lon->getPath() : "")
112 SGPropertyNode *_node_lat,
114 std::string _target_name;
118 } // namespace canvas
120 #endif /* CANVAS_GEO_NODE_PAIR_HXX_ */