surface_param_drawable.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 
20 #ifndef SURFACE_PARAM_DRAWABLE_HPP_
21 #define SURFACE_PARAM_DRAWABLE_HPP_
22 
23 #include <surface_param.hpp>
24 #include <vec3.hpp>
25 #include <quad_index.hpp>
26 
27 namespace cpe
28 {
29 
30 
31 
34 {
35  public:
36 
37  // ********************************************* //
38  // ********************************************* //
39  // CONSTRUCTORS
40  // ********************************************* //
41  // ********************************************* //
42 
46  surface_param_drawable(const unsigned int& Nu,const unsigned int& Nv);
47 
48  // ********************************************* //
49  // ********************************************* //
50  // Update drawing parameters
51  // ********************************************* //
52  // ********************************************* //
53 
55  void update_connectivity();
56 
58  void set_normal(const unsigned int ku,const unsigned int kv,const cpe::vec3 n);
59 
60 
61  // ********************************************* //
62  // ********************************************* //
63  // Get drawing pointers
64  // ********************************************* //
65  // ********************************************* //
66 
68  const unsigned int* pointer_draw_connectivity() const;
70  const float* pointer_draw_normal() const;
72  const float* pointer_draw_vertices() const;
73 
74 
75 
76 
77 
78  private:
79 
81  void build_connectivity();
82 
84  std::vector<quad_index> internal_connectivity;
86  std::vector<vec3> internal_normal;
87 
89  unsigned int internal_old_size_u;
91  unsigned int internal_old_size_v;
92 };
93 }
94 
95 #endif