surface_param.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_HPP_
21 #define _SURFACE_PARAM_HPP_
22 
23 #include <vec3.hpp>
24 #include <vector>
25 
26 namespace cpe
27 {
29 {
30  public:
31 
32  // ********************************************* //
33  // ********************************************* //
34  // CONSTRUCTORS
35  // ********************************************* //
36  // ********************************************* //
37 
39  surface_param();
41  surface_param(const unsigned int& Nu,const unsigned int& Nv);
42 
43  // ********************************************* //
44  // ********************************************* //
45  // Size
46  // ********************************************* //
47  // ********************************************* //
48 
49 
51  void resize(const unsigned int& Nu,const unsigned int& Nv);
52 
54  const unsigned int& size_u() const;
56  const unsigned int& size_v() const;
57 
58 
59  // ********************************************* //
60  // ********************************************* //
61  // Data
62  // ********************************************* //
63  // ********************************************* //
64 
66  const vec3& operator()(const unsigned int& ku,const unsigned int& kv) const;
68  vec3& operator()(const unsigned int& ku,const unsigned int& kv);
69 
70 
71  // ********************************************* //
72  // ********************************************* //
73  // Internal access
74  // ********************************************* //
75  // ********************************************* //
76 
78  const vec3* pointer() const;
81 
82 
83  protected:
84 
86  const vec3& get(const unsigned int& ku,const unsigned int& kv) const;
87 
89  void assert_size(const unsigned int& ku,const unsigned int& kv) const;
90 
91  private:
92 
93 
94 
95 
96 
98  unsigned int internal_size_u;
100  unsigned int internal_size_v;
102  std::vector<vec3> internal_data;
103 };
104 }
105 
106 #endif