CEdgeNode.h
Go to the documentation of this file.
1 #ifndef iedge_CEdgeNode_included
2 #define iedge_CEdgeNode_included
3 
4 
5 // ACF includes
6 #include <iser/ISerializable.h>
7 #include <i2d/CVector2d.h>
8 
9 
10 namespace iedge
11 {
12 
13 
18 class CEdgeNode: virtual public iser::ISerializable
19 {
20 public:
21  CEdgeNode();
22  CEdgeNode(const i2d::CVector2d& position, double weight);
23 
27  const i2d::CVector2d& GetPosition() const;
31  void SetPosition(const i2d::CVector2d& position);
36  double GetWeight() const;
41  void SetWeight(double weight);
42 
43  // reimplemented (iser::ISerializable)
44  virtual bool Serialize(iser::IArchive& archive);
45 
46 private:
50  i2d::CVector2d m_position;
51 
55  double m_weight;
56 };
57 
58 
59 // inline methods
60 
62 {
63  return m_position;
64 }
65 
66 
67 inline void CEdgeNode::SetPosition(const i2d::CVector2d& position)
68 {
69  m_position = position;
70 }
71 
72 
73 inline double CEdgeNode::GetWeight() const
74 {
75  return m_weight;
76 }
77 
78 
79 inline void CEdgeNode::SetWeight(double weight)
80 {
81  m_weight = weight;
82 }
83 
84 
85 } // namespace iedge
86 
87 
88 #endif // !iedge_CEdgeNode_included
89 
90 
void SetPosition(const i2d::CVector2d &position)
Set position of node.
Definition: CEdgeNode.h:67
const i2d::CVector2d & GetPosition() const
Get position of node.
Definition: CEdgeNode.h:61
virtual bool Serialize(iser::IArchive &archive)
void SetWeight(double weight)
Set node weight.
Definition: CEdgeNode.h:79
double GetWeight() const
Get node weight.
Definition: CEdgeNode.h:73
Description of single node of the edge.
Definition: CEdgeNode.h:18

© 2007-2017 Witold Gantzke and Kirill Lepskiy