Data.h
Go to the documentation of this file.
1 /*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @author Fabian Peller (fabian dot peller at kit dot edu)
17 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
18 * GNU General Public License
19 */
20 
21 #pragma once
22 
23 // STD/STL
24 #include <string>
25 
26 // ArmarX
27 #include <RobotAPI/interface/aron.h>
29 
31 {
32  namespace constantes
33  {
34  const std::string TYPE_SLUG = "_ARON_TYPE";
35  const std::string PATH_SLUG = "_ARON_PATH";
36  const std::string VERSION_SLUG = "_ARON_VERSION";
37 
38  const std::string KEY_SLUG = "_ARON_KEY";
39  const std::string VALUE_SLUG = "_ARON_VALUE";
40  const std::string MEMBERS_SLUG = "_ARON_MEMBERS";
41  const std::string ELEMENTS_SLUG = "_ARON_ELEMENTS";
42 
43  const std::string NAME_SLUG = "_ARON_NAME";
44  const std::string DIMENSIONS_SLUG = "_ARON_DIMESIONS";
45  const std::string DATA_SLUG = "_ARON_DATA";
46  const std::string USED_TYPE_SLUG = "_ARON_USED_TYPE";
47 
48  const std::string LIST_TYPENAME_SLUG = "_ARON_LIST";
49  const std::string DICT_TYPENAME_SLUG = "_ARON_DICT";
50  const std::string NDARRAY_TYPENAME_SLUG = "_ARON_NDARRAY";
51  const std::string INT_TYPENAME_SLUG = "_ARON_INT";
52  const std::string LONG_TYPENAME_SLUG = "_ARON_LONG";
53  const std::string FLOAT_TYPENAME_SLUG = "_ARON_FLOAT";
54  const std::string DOUBLE_TYPENAME_SLUG = "_ARON_DOUBLE";
55  const std::string STRING_TYPENAME_SLUG = "_ARON_STRING";
56  const std::string BOOL_TYPENAME_SLUG = "_ARON_BOOL";
57  const std::string TIME_TYPENAME_SLUG = "_ARON_TIME";
58  }
59 
60  namespace conversion
61  {
62  const std::map<data::Descriptor, std::string> Descriptor2String = {
72  };
74 
75  const std::map<type::Maybe, std::string> Maybe2String =
76  {
77  {type::Maybe::NONE, "type::maybe::NONE"},
78  {type::Maybe::OPTIONAL, "type::maybe::OPTIONAL"},
79  {type::Maybe::RAW_PTR, "type::maybe::RAW_PTR"},
80  {type::Maybe::SHARED_PTR, "type::maybe::SHARED_PTR"},
81  {type::Maybe::UNIQUE_PTR, "type::maybe::UNIQUE_PTR"}
82  };
84 
85  const std::map<type::ndarray::ElementType, std::string> NDArrayType2String =
86  {
87  {type::ndarray::ElementType::INT8, "type::ndarray::INT8"},
88  {type::ndarray::ElementType::INT16, "type::ndarray::INT16"},
89  {type::ndarray::ElementType::INT32, "type::ndarray::INT32"},
90  {type::ndarray::ElementType::UINT8, "type::ndarray::UINT8"},
91  {type::ndarray::ElementType::UINT16, "type::ndarray::UINT16"},
92  {type::ndarray::ElementType::UINT32, "type::ndarray::UINT32"},
93  {type::ndarray::ElementType::FLOAT32, "type::ndarray::FLOAT32"},
94  {type::ndarray::ElementType::FLOAT64, "type::ndarray::FLOAT64"}
95  };
97 
98  const std::map<type::matrix::ElementType, std::string> MatrixType2String =
99  {
100  {type::matrix::ElementType::UINT8, "type::matrix::UINT8"},
101  {type::matrix::ElementType::UINT16, "type::matrix::UINT16"},
102  {type::matrix::ElementType::UINT32, "type::matrix::UINT32"},
103  {type::matrix::ElementType::INT8, "type::matrix::INT8"},
104  {type::matrix::ElementType::INT16, "type::matrix::INT16"},
105  {type::matrix::ElementType::INT32, "type::matrix::INT32"},
106  {type::matrix::ElementType::INT64, "type::matrix::INT64"},
107  {type::matrix::ElementType::FLOAT32, "type::matrix::FLOAT32"},
108  {type::matrix::ElementType::FLOAT64, "type::matrix::FLOAT64"}
109  };
111 
112  const std::map<type::quaternion::ElementType, std::string> QuaternionType2String =
113  {
114  {type::quaternion::ElementType::FLOAT32, "type::quaternion::FLOAT32"},
115  {type::quaternion::ElementType::FLOAT64, "type::quaternion::FLOAT64"}
116  };
118 
119  const std::map<type::image::PixelType, std::string> PixelType2String =
120  {
121  {type::image::PixelType::RGB24, "type::image::RGB24"},
122  {type::image::PixelType::DEPTH32, "type::image::DEPTH32"}
123  };
125 
126  const std::map<type::pointcloud::VoxelType, std::string> VoxelType2String =
127  {
128  {type::pointcloud::VoxelType::POINT_XYZ, "type::pointcloud::POINT_XYZ"},
129  {type::pointcloud::VoxelType::POINT_XYZI, "type::pointcloud::POINT_XYZI"},
130  {type::pointcloud::VoxelType::POINT_XYZL, "type::pointcloud::POINT_XYZL"},
131  {type::pointcloud::VoxelType::POINT_XYZRGB, "type::pointcloud::POINT_XYZRGB"},
132  {type::pointcloud::VoxelType::POINT_XYZRGBA, "type::pointcloud::POINT_XYZRGBA"},
133  {type::pointcloud::VoxelType::POINT_XYZRGBL, "type::pointcloud::POINT_XYZRGBL"},
134  {type::pointcloud::VoxelType::POINT_XYZHSV, "type::pointcloud::POINT_XYZHSV"}
135  };
137  }
138 }
armarx::aron::data::rw::json::conversion::Maybe2String
const std::map< type::Maybe, std::string > Maybe2String
Definition: Data.h:75
armarx::aron::data::rw::json
Definition: Data.h:30
armarx::aron::data::Descriptor::NDARRAY
@ NDARRAY
armarx::aron::data::rw::json::conversion::String2NDArrayType
const auto String2NDArrayType
Definition: Data.h:96
armarx::aron::data::rw::json::constantes::KEY_SLUG
const std::string KEY_SLUG
Definition: Data.h:38
Descriptor.h
armarx::aron::data::rw::json::constantes::PATH_SLUG
const std::string PATH_SLUG
Definition: Data.h:35
armarx::aron::data::Descriptor::LIST
@ LIST
armarx::aron::data::Descriptor::STRING
@ STRING
armarx::aron::data::rw::json::constantes::DOUBLE_TYPENAME_SLUG
const std::string DOUBLE_TYPENAME_SLUG
Definition: Data.h:54
armarx::aron::data::rw::json::constantes::INT_TYPENAME_SLUG
const std::string INT_TYPENAME_SLUG
Definition: Data.h:51
armarx::aron::data::rw::json::constantes::VALUE_SLUG
const std::string VALUE_SLUG
Definition: Data.h:39
armarx::aron::data::rw::json::constantes::FLOAT_TYPENAME_SLUG
const std::string FLOAT_TYPENAME_SLUG
Definition: Data.h:53
armarx::aron::data::rw::json::conversion::String2MatrixType
const auto String2MatrixType
Definition: Data.h:110
armarx::aron::data::rw::json::constantes::DATA_SLUG
const std::string DATA_SLUG
Definition: Data.h:45
armarx::aron::data::rw::json::constantes::DICT_TYPENAME_SLUG
const std::string DICT_TYPENAME_SLUG
Definition: Data.h:49
armarx::aron::data::Descriptor::FLOAT
@ FLOAT
armarx::aron::data::Descriptor::INT
@ INT
armarx::aron::data::rw::json::constantes::TIME_TYPENAME_SLUG
const std::string TIME_TYPENAME_SLUG
Definition: Data.h:57
armarx::aron::data::rw::json::conversion::String2Maybe
const auto String2Maybe
Definition: Data.h:83
armarx::aron::data::rw::json::conversion::NDArrayType2String
const std::map< type::ndarray::ElementType, std::string > NDArrayType2String
Definition: Data.h:85
armarx::aron::data::Descriptor::DICT
@ DICT
armarx::aron::data::rw::json::constantes::NDARRAY_TYPENAME_SLUG
const std::string NDARRAY_TYPENAME_SLUG
Definition: Data.h:50
armarx::aron::conversion::util::InvertMap
std::map< T2, T1 > InvertMap(const std::map< T1, T2 > &m)
Definition: Descriptor.h:42
armarx::aron::data::rw::json::constantes::BOOL_TYPENAME_SLUG
const std::string BOOL_TYPENAME_SLUG
Definition: Data.h:56
armarx::aron::data::rw::json::constantes::LIST_TYPENAME_SLUG
const std::string LIST_TYPENAME_SLUG
Definition: Data.h:48
armarx::aron::data::rw::json::constantes::DIMENSIONS_SLUG
const std::string DIMENSIONS_SLUG
Definition: Data.h:44
armarx::aron::data::rw::json::conversion::String2QuaternionType
const auto String2QuaternionType
Definition: Data.h:117
armarx::aron::data::rw::json::constantes::STRING_TYPENAME_SLUG
const std::string STRING_TYPENAME_SLUG
Definition: Data.h:55
armarx::aron::data::Descriptor::BOOL
@ BOOL
armarx::aron::data::rw::json::conversion::QuaternionType2String
const std::map< type::quaternion::ElementType, std::string > QuaternionType2String
Definition: Data.h:112
armarx::aron::data::rw::json::constantes::USED_TYPE_SLUG
const std::string USED_TYPE_SLUG
Definition: Data.h:46
armarx::aron::data::rw::json::conversion::String2PixelType
const auto String2PixelType
Definition: Data.h:124
armarx::aron::data::rw::json::constantes::VERSION_SLUG
const std::string VERSION_SLUG
Definition: Data.h:36
armarx::aron::data::rw::json::conversion::VoxelType2String
const std::map< type::pointcloud::VoxelType, std::string > VoxelType2String
Definition: Data.h:126
armarx::aron::data::rw::json::conversion::MatrixType2String
const std::map< type::matrix::ElementType, std::string > MatrixType2String
Definition: Data.h:98
armarx::aron::data::rw::json::conversion::String2Descriptor
const auto String2Descriptor
Definition: Data.h:73
armarx::aron::similarity::FloatSimilarity::NONE
@ NONE
Definition: FloatSimilarity.h:11
armarx::aron::data::rw::json::constantes::TYPE_SLUG
const std::string TYPE_SLUG
Definition: Data.h:34
armarx::aron::data::rw::json::conversion::String2VoxelType
const auto String2VoxelType
Definition: Data.h:136
armarx::aron::data::rw::json::constantes::NAME_SLUG
const std::string NAME_SLUG
Definition: Data.h:43
armarx::aron::data::rw::json::conversion::PixelType2String
const std::map< type::image::PixelType, std::string > PixelType2String
Definition: Data.h:119
armarx::aron::data::Descriptor::LONG
@ LONG
armarx::aron::data::rw::json::constantes::LONG_TYPENAME_SLUG
const std::string LONG_TYPENAME_SLUG
Definition: Data.h:52
armarx::aron::data::rw::json::constantes::ELEMENTS_SLUG
const std::string ELEMENTS_SLUG
Definition: Data.h:41
armarx::aron::data::Descriptor::DOUBLE
@ DOUBLE
armarx::aron::data::rw::json::conversion::Descriptor2String
const std::map< data::Descriptor, std::string > Descriptor2String
Definition: Data.h:62
armarx::aron::data::rw::json::constantes::MEMBERS_SLUG
const std::string MEMBERS_SLUG
Definition: Data.h:40