1 /*
2     Copyright (C) 2009 Andrew Caudwell (acaudwell@gmail.com)
3 
4     This program is free software; you can redistribute it and/or
5     modify it under the terms of the GNU General Public License
6     as published by the Free Software Foundation; either version
7     3 of the License, or (at your option) any later version.
8 
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13 
14     You should have received a copy of the GNU General Public License
15     along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 */
17 
18 #ifndef SPLINE_EDGE_H
19 #define SPLINE_EDGE_H
20 
21 #include "core/display.h"
22 #include "core/vectors.h"
23 #include "core/pi.h"
24 
25 #include "pawn.h"
26 
27 #include <vector>
28 
29 class SplineEdge {
30 
31     std::vector<vec2> spline_point;
32     std::vector<vec4> spline_colour;
33 
34     vec2 label_pos;
35 
36     void drawBeam(const vec2 & pos1, const vec4 & col1, const vec2 & pos2, const vec4 & col2, float radius, bool first) const;
37 public:
38     SplineEdge();
39 
40     const vec2& getLabelPos() const;
41 
42     void update(const vec2& pos1, const vec4& col1, const vec2& pos2, const vec4& col2, const vec2& spos);
43 
44     void drawToVBO(quadbuf& buffer) const;
45 
46     void drawShadow() const;
47     void draw() const;
48 };
49 
50 #endif
51