rot.hh
Go to the documentation of this file.
/* -*- mia-c++ -*-
*
* This file is part of MIA - a toolbox for medical image analysis
* Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
*
* MIA is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MIA; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef mia_3d_rot_hh
#define mia_3d_rot_hh
#include <mia/core/attributes.hh>
#include <mia/3d/quaternion.hh>
#include <mia/3d/matrix.hh>
NS_MIA_BEGIN
class EXPORT_3D C3DRotation
{
public:
C3DRotation();
~C3DRotation();
C3DRotation(const C3DRotation& other);
C3DRotation& operator = (const C3DRotation& other);
C3DRotation(const C3DDMatrix& m);
C3DRotation(const Quaternion& q);
C3DRotation(const std::string& s);
C3DDMatrix as_matrix_3x3() const;
Quaternion as_quaternion() const;
std::string as_string() const;
static const C3DRotation _1;
private:
class C3DRotationImpl *impl;
};
template <>
struct attribute_type<C3DRotation> {
static const int value = 0x4000;
};
template <>
struct dispatch_attr_string<C3DRotation> {
static std::string val2string(const C3DRotation& value)
{
return value.as_string();
}
static C3DRotation string2val(const std::string& str)
{
return C3DRotation(str);
}
};
EXPORT_3D bool operator == (const C3DRotation& lhs, const C3DRotation& rhs);
EXPORT_3D bool operator < (const C3DRotation& lhs, const C3DRotation& rhs);
typedef TAttribute<C3DRotation> C3DRotationAttribute;
typedef TTranslator<C3DRotation> C3DRotationAttributeTranslate;
NS_MIA_END
#endif
matrix.hh
C3DDMatrix
T3DMatrix< double > C3DDMatrix
a simple 3x3 matrix with double precision floating point values
Definition 3d/matrix.hh:229
attributes.hh
C3DRotation
Definition rot.hh:31
C3DRotation::C3DRotation
C3DRotation(const Quaternion &q)
C3DRotation::_1
static const C3DRotation _1
Definition rot.hh:47
C3DRotation::as_quaternion
Quaternion as_quaternion() const
C3DRotation::as_string
std::string as_string() const
C3DRotation::C3DRotation
C3DRotation(const std::string &s)
C3DRotation::as_matrix_3x3
C3DDMatrix as_matrix_3x3() const
C3DRotation::C3DRotation
C3DRotation(const C3DRotation &other)
C3DRotation::C3DRotation
C3DRotation(const C3DDMatrix &m)
C3DRotation::~C3DRotation
~C3DRotation()
C3DRotation::C3DRotation
C3DRotation()
Quaternion
a class to implement a quaternion
Definition quaternion.hh:44
TAttribute
Class of an attribute that holds data of type T.
Definition attributes.hh:119
TTranslator
Generic string vs. attribute translator singleton.
Definition attributes.hh:518
EXPORT_3D
#define EXPORT_3D
Definition defines3d.hh:45
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36
quaternion.hh
C3DRotationAttributeTranslate
TTranslator< C3DRotation > C3DRotationAttributeTranslate
Definition rot.hh:78
C3DRotationAttribute
TAttribute< C3DRotation > C3DRotationAttribute
Definition rot.hh:77
operator<
EXPORT_3D bool operator<(const C3DRotation &lhs, const C3DRotation &rhs)
operator==
EXPORT_3D bool operator==(const C3DRotation &lhs, const C3DRotation &rhs)
attribute_type< C3DRotation >::value
static const int value
Definition rot.hh:58
attribute_type
Definition attributetype.hh:65
dispatch_attr_string< C3DRotation >::string2val
static C3DRotation string2val(const std::string &str)
Definition rot.hh:67
dispatch_attr_string< C3DRotation >::val2string
static std::string val2string(const C3DRotation &value)
Definition rot.hh:63