Quaternion.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T),
5  * Karlsruhe Institute of Technology (KIT), all rights reserved.
6  *
7  * ArmarX is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  *
11  * ArmarX is distributed in the hope that it will be useful, but
12  * 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 this program. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * @author Fabian Peller-Konrad (fabian dot peller-konrad at kit dot edu)
20  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
21  * GNU General Public License
22  */
23 
24 // Header
25 #include "Quaternion.h"
26 
27 #include <SimoxUtility/algorithm/string/string_conversion.h>
28 
29 namespace armarx::aron::type
30 {
31  const std::map<quaternion::ElementType, std::string> Quaternion::Elementtype2String = {
32  {quaternion::ElementType::FLOAT32, "FLOAT32"},
33  {quaternion::ElementType::FLOAT64, "FLOAT64"}};
34  const std::map<std::string, quaternion::ElementType> Quaternion::String2Elementtype =
35  conversion::util::InvertMap(Elementtype2String);
36 
37  // constructors
39  detail::NDArrayVariant<type::dto::Quaternion, Quaternion>(type::Descriptor::QUATERNION,
40  path)
41  {
42  }
43 
45  detail::NDArrayVariant<type::dto::Quaternion, Quaternion>(o,
46  type::Descriptor::QUATERNION,
47  path)
48  {
49  }
50 
53  {
54  return this->aron;
55  }
56 
59  {
60  return this->aron->elementType;
61  }
62 
63  void
65  {
66  this->aron->elementType = t;
67  }
68 
69  // virtual implementations
70  std::string
72  {
73  return "Quaternion";
74  }
75 
76  std::string
78  {
79  return "armarx::aron::type::Quaternion<" + Elementtype2String.at(this->aron->elementType) +
80  ">";
81  }
82 } // namespace armarx::aron::type
armarx::aron::type::Quaternion::Quaternion
Quaternion(const Path &path=Path())
Definition: Quaternion.cpp:38
Quaternion.h
detail
Definition: OpenCVUtil.cpp:127
armarx::aron::type::Quaternion::getShortName
virtual std::string getShortName() const override
get a short name of this specific type
Definition: Quaternion.cpp:71
armarx::VariantType::Quaternion
const VariantTypeId Quaternion
Definition: Pose.h:39
armarx::aron::type::Quaternion
The Qaternion class.
Definition: Quaternion.h:39
armarx::aron::Path
The Path class.
Definition: Path.h:36
armarx::aron::type::Quaternion::Elementtype2String
static const std::map< quaternion::ElementType, std::string > Elementtype2String
Definition: Quaternion.h:56
armarx::aron::conversion::util::InvertMap
std::map< T2, T1 > InvertMap(const std::map< T1, T2 > &m)
Definition: Descriptor.h:42
armarx::aron::type::Quaternion::getFullName
virtual std::string getFullName() const override
get the full name of this specific type
Definition: Quaternion.cpp:77
armarx::aron::type::detail::SpecializedVariantBase< type::dto::Quaternion, Quaternion >::aron
type::dto::Quaternion ::PointerType aron
Definition: SpecializedVariant.h:137
armarx::aron::type::Quaternion::getElementType
type::quaternion::ElementType getElementType() const
Definition: Quaternion.cpp:58
armarx::aron::type::Descriptor::QUATERNION
@ QUATERNION
armarx::aron::type
A convenience header to include all aron files (full include, not forward declared)
Definition: aron_conversions.cpp:9
armarx::ElementTypes::ElementType
ElementType
Definition: AbstractObjectSerializer.h:32
armarx::aron::type::Quaternion::String2Elementtype
static const std::map< std::string, quaternion::ElementType > String2Elementtype
Definition: Quaternion.h:57
armarx::aron::type::Quaternion::toQuaternionDTO
type::dto::QuaternionPtr toQuaternionDTO() const
Definition: Quaternion.cpp:52
armarx::aron::type::QuaternionPtr
std::shared_ptr< class Quaternion > QuaternionPtr
Definition: forward_declarations.h:21
armarx::aron::type::Quaternion::setElementType
void setElementType(type::quaternion::ElementType)
Definition: Quaternion.cpp:64
armarx::aron::type::Descriptor
Descriptor
Definition: Descriptor.h:76