GlobeEngine
Triangle.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_Triangle_h
10 #define GlobeEngine_Triangle_h
11 
12 #include "VBOVertex.h"
13 #include "OpenGL_Includes.h"
14 #include <iostream>
15 
16 namespace geData {
17 
18  template <class T> class Triangle
19  {
20  public:
22 
23  Triangle(T _p1, T _p2, T _p3){
24  points[0] = _p1;
25  points[1] = _p2;
26  points[2] = _p3;
27  }
28 
29  ~Triangle() { }
30 
31  void set(T _p1, T _p2, T _p3){
32  points[0] = _p1;
33  points[1] = _p2;
34  points[2] = _p3;
35  }
36 
37  T getPoint(int _idx) const {
38  return this->points[_idx];
39  }
40 
41  T getArray(){
42  return points;
43  }
44 
45  friend std::ostream& operator<< (std::ostream &out, const Triangle<T> &triangle) {
46  out << "[0]:" << triangle.points[0] << ",[1]:" << triangle.points[1] << ",[2]:" << triangle.points[2];
47  return out;
48  }
49 
50  private:
51  T points[3];
52  };
53 
62 
71 
80 }
81 #endif
Triangle< ge::Vertex2f > Triangle2Df
Definition: Triangle.h:60
Triangle< ge::VBOVertex3ui > Triangle3Dui
Definition: Triangle.h:68
Triangle< ge::VBOVertex4d > Triangle4Dd
Definition: Triangle.h:79
Triangle< ge::VBOVertex3us > Triangle3Dus
Definition: Triangle.h:66
Triangle< ge::Vertex2ub > Triangle2Dub
Definition: Triangle.h:55
Triangle< ge::VBOVertex4f > Triangle4Df
Definition: Triangle.h:78
Triangle< ge::Vertex2b > Triangle2Db
Definition: Triangle.h:54
Definition: AvalancheTrainingSimulationEngine.h:39
Triangle< ge::Vertex2us > Triangle2Dus
Definition: Triangle.h:57
Triangle< ge::VBOVertex3i > Triangle3Di
Definition: Triangle.h:67
Triangle< ge::Vertex2ui > Triangle2Dui
Definition: Triangle.h:59
Triangle< ge::Vertex2d > Triangle2Dd
Definition: Triangle.h:61
Triangle< ge::VBOVertex3b > Triangle3Db
Definition: Triangle.h:63
Triangle< ge::VBOVertex3ub > Triangle3Dub
Definition: Triangle.h:64
void set(T _p1, T _p2, T _p3)
Definition: Triangle.h:31
Triangle< ge::Vertex2s > Triangle2Ds
Definition: Triangle.h:56
Triangle< ge::VBOVertex3s > Triangle3Ds
Definition: Triangle.h:65
Triangle< ge::VBOVertex4us > Triangle4Dus
Definition: Triangle.h:75
Triangle< ge::VBOVertex4ub > Triangle4Dub
Definition: Triangle.h:73
Triangle< ge::Vertex2i > Triangle2Di
Definition: Triangle.h:58
Triangle< ge::VBOVertex4i > Triangle4Di
Definition: Triangle.h:76
Triangle(T _p1, T _p2, T _p3)
Definition: Triangle.h:23
Triangle< ge::VBOVertex4ui > Triangle4Dui
Definition: Triangle.h:77
T getPoint(int _idx) const
Definition: Triangle.h:37
Triangle< ge::VBOVertex4s > Triangle4Ds
Definition: Triangle.h:74
T getArray()
Definition: Triangle.h:41
Triangle< ge::VBOVertex3f > Triangle3Df
Definition: Triangle.h:69
~Triangle()
Definition: Triangle.h:29
Triangle< ge::VBOVertex3d > Triangle3Dd
Definition: Triangle.h:70
Triangle< ge::VBOVertex4b > Triangle4Db
Definition: Triangle.h:72
Definition: Triangle.h:18
Triangle()
Definition: Triangle.h:21