My Project
affine_matrix.hh
Go to the documentation of this file.
1/* -*- mia-c++ -*-
2 *
3 * This file is part of MIA - a toolbox for medical image analysis
4 * Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
5 *
6 * MIA is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with MIA; if not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21#ifndef mia_3d_affine_matrix_hh
22#define mia_3d_affine_matrix_hh
23
24#include <mia/3d/quaternion.hh>
25
27
28
36{
37
38public:
41
45 CAffinTransformMatrix(float a11, float a12, float a13, float a14,
46 float a21, float a22, float a23, float a24,
47 float a31, float a32, float a33, float a34);
48
54 void rotate_x(float angle, const C3DFVector& center = C3DFVector::_0);
55
61 void rotate_y(float angle, const C3DFVector& center = C3DFVector::_0);
62
68 void rotate_z(float angle, const C3DFVector& center = C3DFVector::_0);
69
76 void rotate(const Quaternion& q, const C3DFVector& center = C3DFVector::_0);
77
84 void transform_centered(const C3DFMatrix& m, const C3DFVector& center = C3DFVector::_0);
85
92 void scale(const C3DFVector& scale, const C3DFVector& center = C3DFVector::_0);
93
94
101 void shear(const C3DFVector& shear, const C3DFVector& center = C3DFVector::_0);
102
107 void translate(const C3DFVector& shift);
108
112 void identity();
113
120
125
134
143 C3DFVector rotate(const C3DFVector& x) const;
144
148 const std::vector<float>& data() const;
149private:
150 std::vector<float> m_matrix;
151
152};
153
154
159
160
161
162
164#endif
EXPORT_3D CAffinTransformMatrix operator*(const CAffinTransformMatrix &lhs, const CAffinTransformMatrix &rhs)
void rotate_y(float angle, const C3DFVector &center=C3DFVector::_0)
const std::vector< float > & data() const
void transform_centered(const C3DFMatrix &m, const C3DFVector &center=C3DFVector::_0)
void translate(const C3DFVector &shift)
void rotate_x(float angle, const C3DFVector &center=C3DFVector::_0)
C3DFVector rotate(const C3DFVector &x) const
void rotate(const Quaternion &q, const C3DFVector &center=C3DFVector::_0)
void scale(const C3DFVector &scale, const C3DFVector &center=C3DFVector::_0)
CAffinTransformMatrix(float a11, float a12, float a13, float a14, float a21, float a22, float a23, float a24, float a31, float a32, float a33, float a34)
void shear(const C3DFVector &shear, const C3DFVector &center=C3DFVector::_0)
const CAffinTransformMatrix inverse() const
CAffinTransformMatrix()
standard constructor, initializes the transformation with the identity.
void rotate_z(float angle, const C3DFVector &center=C3DFVector::_0)
a class to implement a quaternion
Definition quaternion.hh:44
static T3DVector< float > _0
declare the vector (0,0,0)
Definition 3d/vector.hh:342
#define EXPORT_3D
Definition defines3d.hh:45
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36
float EXPORT_2D angle(const C2DFVector &ray_a, const C2DFVector &ray_b)
F operator*(const typename TSparseSolver< F >::A_mult_x &A, const F &x)