My Project
rot.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_rot_hh
22#define mia_3d_rot_hh
23
25#include <mia/3d/quaternion.hh>
26#include <mia/3d/matrix.hh>
27
29
31{
32public:
35
36 C3DRotation(const C3DRotation& other);
37 C3DRotation& operator = (const C3DRotation& other);
38
41 C3DRotation(const std::string& s);
42
45 std::string as_string() const;
46
47 static const C3DRotation _1;
48
49private:
50 class C3DRotationImpl *impl;
51};
52
53
54
55
56template <>
58 static const int value = 0x4000;
59};
60
61template <>
62struct dispatch_attr_string<C3DRotation> {
63 static std::string val2string(const C3DRotation& value)
64 {
65 return value.as_string();
66 }
67 static C3DRotation string2val(const std::string& str)
68 {
69 return C3DRotation(str);
70 }
71};
72
73
74EXPORT_3D bool operator == (const C3DRotation& lhs, const C3DRotation& rhs);
75EXPORT_3D bool operator < (const C3DRotation& lhs, const C3DRotation& rhs);
76
79
81#endif
C3DRotation(const Quaternion &q)
static const C3DRotation _1
Definition rot.hh:47
Quaternion as_quaternion() const
std::string as_string() const
C3DRotation(const std::string &s)
C3DDMatrix as_matrix_3x3() const
C3DRotation(const C3DRotation &other)
C3DRotation(const C3DDMatrix &m)
a class to implement a quaternion
Definition quaternion.hh:44
a simple 3x3 matrix
Definition 3d/matrix.hh:46
Class of an attribute that holds data of type T.
Generic string vs. attribute translator singleton.
#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
TTranslator< C3DRotation > C3DRotationAttributeTranslate
Definition rot.hh:78
TAttribute< C3DRotation > C3DRotationAttribute
Definition rot.hh:77
EXPORT_3D bool operator<(const C3DRotation &lhs, const C3DRotation &rhs)
EXPORT_3D bool operator==(const C3DRotation &lhs, const C3DRotation &rhs)
static const int value
static C3DRotation string2val(const std::string &str)
Definition rot.hh:67
static std::string val2string(const C3DRotation &value)
Definition rot.hh:63