patch4.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 PATCH4_HPP
22 #define PATCH4_HPP
23 
24 #include "../lib3d/vec3.hpp"
25 
26 namespace cpe
27 {
28 class matrix4;
29 
30 class patch4
31 {
32  public:
33 
34  // ********************************************* //
35  // ********************************************* //
36  // CONSTRUCTORS
37  // ********************************************* //
38  // ********************************************* //
39 
41  patch4();
43  patch4(const vec3& x00,const vec3& x01,const vec3& x02,const vec3& x03,
44  const vec3& x10,const vec3& x11,const vec3& x12,const vec3& x13,
45  const vec3& x20,const vec3& x21,const vec3& x22,const vec3& x23,
46  const vec3& x30,const vec3& x31,const vec3& x32,const vec3& x33);
47 
48  // ********************************************* //
49  // ********************************************* //
50  // Data
51  // ********************************************* //
52  // ********************************************* //
53 
55  const vec3& operator()(unsigned int ku ,unsigned int kv) const;
57  vec3& operator()(unsigned int ku ,unsigned int kv);
58 
60  matrix4 get_x() const;
62  matrix4 get_y() const;
64  matrix4 get_z() const;
65 
66  private:
67 
69  void assert_size(unsigned int ku,unsigned int kv) const;
70 
73 };
74 }
75 
76 #endif
matrix4 get_y() const
Get y coordinate in matrix4 form.
Definition: patch4.cpp:61
patch4()
Empty constructor.
Definition: patch4.cpp:26
vec3 internal_data[16]
internal data
Definition: patch4.hpp:72
Definition: patch4.hpp:30
Matrix 4x4.
Definition: matrix4.hpp:37
Vectors/Points 3D.
Definition: vec3.hpp:36
matrix4 get_z() const
Get z coordinate in matrix4 form.
Definition: patch4.cpp:68
void assert_size(unsigned int ku, unsigned int kv) const
Definition: patch4.cpp:75
matrix4 get_x() const
Get x coordinate in matrix4 form.
Definition: patch4.cpp:54
const vec3 & operator()(unsigned int ku, unsigned int kv) const
Get value.
Definition: patch4.cpp:43