GlobeEngine
WeightedUndirectedEdge.h
Go to the documentation of this file.
1 //
2 // VBOVertex.h
3 // GlobeEngine
4 //
5 // Created by Mathias Thöny on 27.12.11.
6 // Copyright (c) 2011 University of Zurich. All rights reserved.
7 //
8 
9 #ifndef GlobeEngine_WeightedUndirectedEdge_h
10 #define GlobeEngine_WeightedUndirectedEdge_h
11 #include "VBOVertex.h"
12 #include "OpenGL_Includes.h"
13 #include <iostream>
14 #include "UndirectedEdge.h"
15 
16 namespace geGraph {
17  /*
18  * wheigted undirected edge
19  */
20  template <class T> class WeightedUndirectedEdge : public UndirectedEdge< T >
21  {
22  public:
24  this->weight = 0.0;
25  }
26 
27  WeightedUndirectedEdge(T _node1, T _node2): UndirectedEdge< T >(_node1, _node2) {
28  this->weight = 0.0;
29  }
30 
31  WeightedUndirectedEdge(T _uid, T _node1, T _node2): UndirectedEdge< T >(_uid, _node1, _node2) {
32  this->weight = 0.0;
33  }
34 
35  WeightedUndirectedEdge(T _uid, T _node1, T _node2, float _weight): UndirectedEdge< T >(_uid, _node1, _node2) {
36  this->weight = _weight;
37  }
38 
39  void setWeight(float _input) {
40  this->weight = _input;
41  }
42 
43  void addWeight(float _input) {
44  this->weight += _input;
45  }
46 
47  float getWeight() {
48  return this->weight;
49  }
50 
51 
52 
53  protected:
54  float weight;
55  };
56 
59 }
60 #endif
WeightedUndirectedEdge< unsigned int > WeightedUndirectedEdgeui
Definition: WeightedUndirectedEdge.h:58
WeightedUndirectedEdge< unsigned int > WeightedEdgeui
Definition: WeightedUndirectedEdge.h:57
WeightedUndirectedEdge(T _uid, T _node1, T _node2)
Definition: WeightedUndirectedEdge.h:31
WeightedUndirectedEdge(T _node1, T _node2)
Definition: WeightedUndirectedEdge.h:27
WeightedUndirectedEdge()
Definition: WeightedUndirectedEdge.h:23
void addWeight(float _input)
Definition: WeightedUndirectedEdge.h:43
Definition: DirectedEdge.h:16
void setWeight(float _input)
Definition: WeightedUndirectedEdge.h:39
float weight
Definition: WeightedUndirectedEdge.h:54
Definition: WeightedUndirectedEdge.h:20
float getWeight()
Definition: WeightedUndirectedEdge.h:47
Definition: UndirectedEdge.h:19
WeightedUndirectedEdge(T _uid, T _node1, T _node2, float _weight)
Definition: WeightedUndirectedEdge.h:35