triangle_scanline.hpp
Go to the documentation of this file.
1 /*
2 ** TP CPE Lyon
3 ** Copyright (C) 2013 Damien Rohmer
4 **
5 ** This program is free software: you can redistribute it and/or modify
6 ** it under the terms of the GNU General Public License as published by
7 ** the Free Software Foundation, either version 3 of the License, or
8 ** (at your option) any later version.
9 **
10 ** This program is distributed in the hope that it will be useful,
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ** GNU General Public License for more details.
14 **
15 ** You should have received a copy of the GNU General Public License
16 ** along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef TRIANGLE_SCANLINE_HPP
20 #define TRIANGLE_SCANLINE_HPP
21 
22 #include <line_discrete.hpp>
24 #include <pos2.hpp>
25 
26 namespace cpe
27 {
28 
31 {
32  line_pointer(int line_number_data=0,int index_data=0);
33 
34  int line_number; //the number of the pointed line (0,1, or 2)
35  int index; //the index in the pointed line
36 };
37 
38 
41 {
42 public:
43 
45  triangle_scanline(const pos2& u0,const pos2& u1,const pos2& u2);
46 
48  const pos2& get_coordinate(const line_pointer& p);
49 
51  int size();
52 
54  std::vector<line_pointer> first_point;
56  std::vector<line_pointer> last_point;
57 
60 };
61 
62 }
63 
64 #endif