My Project
 All Classes Files Functions Variables Enumerations Pages
triangle.h
Go to the documentation of this file.
1 /**************************************************************************/
2 /* Copyright 2009 Tim Day */
3 /* */
4 /* This file is part of Fracplanet */
5 /* */
6 /* Fracplanet is free software: you can redistribute it and/or modify */
7 /* it under the terms of the GNU General Public License as published by */
8 /* the Free Software Foundation, either version 3 of the License, or */
9 /* (at your option) any later version. */
10 /* */
11 /* Fracplanet is distributed in the hope that it will be useful, */
12 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
13 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
14 /* GNU General Public License for more details. */
15 /* */
16 /* You should have received a copy of the GNU General Public License */
17 /* along with Fracplanet. If not, see <http://www.gnu.org/licenses/>. */
18 /**************************************************************************/
19 
24 #ifndef _triangle_h_
25 #define _triangle_h_
26 
27 #include "rgb.h"
28 #include "xyz.h"
29 
31 
34 class Triangle
35 {
36  public:
37 
38  Triangle()
39  {}
40 
41  Triangle(uint v0,uint v1,uint v2)
42  {
43  _vertex[0]=v0;
44  _vertex[1]=v1;
45  _vertex[2]=v2;
46  }
47 
48  Triangle(const Triangle& t)
49  {
50  _vertex[0]=t.vertex(0);
51  _vertex[1]=t.vertex(1);
52  _vertex[2]=t.vertex(2);
53  }
54 
56  const uint& vertex(uint i) const
57  {
58  return _vertex[i];
59  }
60 
61  protected:
62 
63  uint _vertex[3];
64 };
65 
66 #endif