surface_param_drawable.hpp
Go to the documentation of this file.
1 /*
2 ** TP CPE Lyon
3 ** Copyright (C) 2014 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 #pragma once
20 
21 #ifndef SURFACE_PARAM_DRAWABLE_HPP
22 #define SURFACE_PARAM_DRAWABLE_HPP
23 
24 #include "surface_param.hpp"
25 #include "../lib3d/vec3.hpp"
26 #include "../libspline/quad_index.hpp"
27 
28 namespace cpe
29 {
30 
31 
32 
35 {
36  public:
37 
38  // ********************************************* //
39  // ********************************************* //
40  // CONSTRUCTORS
41  // ********************************************* //
42  // ********************************************* //
43 
47  surface_param_drawable(unsigned int Nu,unsigned int Nv);
48 
49  // ********************************************* //
50  // ********************************************* //
51  // Update drawing parameters
52  // ********************************************* //
53  // ********************************************* //
54 
56  void update_connectivity();
57 
59  void set_normal(unsigned int ku,unsigned int kv,const cpe::vec3& n);
60 
61 
62  // ********************************************* //
63  // ********************************************* //
64  // Get drawing pointers
65  // ********************************************* //
66  // ********************************************* //
67 
69  const unsigned int* pointer_draw_connectivity() const;
71  const float* pointer_draw_normal() const;
73  const float* pointer_draw_vertices() const;
74 
75 
76 
77 
78 
79  private:
80 
82  void build_connectivity();
83 
85  std::vector<quad_index> internal_connectivity;
87  std::vector<vec3> internal_normal;
88 
90  unsigned int internal_old_size_u;
92  unsigned int internal_old_size_v;
93 };
94 }
95 
96 #endif
Definition: surface_param.hpp:30
unsigned int internal_old_size_u
storage for size u stored since the previous update
Definition: surface_param_drawable.hpp:90
const unsigned int * pointer_draw_connectivity() const
get pointer on connectivity
Definition: surface_param_drawable.cpp:58
void build_connectivity()
force to build connectivity
Definition: surface_param_drawable.cpp:74
std::vector< vec3 > internal_normal
internal normal
Definition: surface_param_drawable.hpp:87
void update_connectivity()
update connectivity of needed
Definition: surface_param_drawable.cpp:34
Wrapper class to help drawing a surface_param class.
Definition: surface_param_drawable.hpp:34
const float * pointer_draw_vertices() const
get pointer on vertices
Definition: surface_param_drawable.cpp:69
unsigned int internal_old_size_v
storage for size u stored since the previous update
Definition: surface_param_drawable.hpp:92
void set_normal(unsigned int ku, unsigned int kv, const cpe::vec3 &n)
set a specific normal
Definition: surface_param_drawable.cpp:44
std::vector< quad_index > internal_connectivity
internal connectivity
Definition: surface_param_drawable.hpp:85
Vectors/Points 3D.
Definition: vec3.hpp:36
surface_param_drawable()
empty constructor
Definition: surface_param_drawable.cpp:24
const float * pointer_draw_normal() const
get pointer on normal
Definition: surface_param_drawable.cpp:64