Radium Engine  1.5.20
Loading...
Searching...
No Matches
TypesUtils.cpp
1#include <Core/Utils/TypesUtils.hpp>
2
3#include <Core/Utils/StringUtils.hpp>
4
5#include <map>
6
7namespace Ra {
8namespace Core {
9namespace Utils {
10namespace TypeInternal {
11
12RA_CORE_API auto makeTypeReadable( const std::string& fullType ) -> std::string {
13 static std::map<std::string, std::string> knownTypes {
14 { "std::", "" },
15 { "__cxx11::", "" },
16 { ", std::allocator<float>", "" },
17 { ", std::allocator<double>", "" },
18 { ", std::allocator<int>", "" },
19 { ", std::allocator<unsigned int>", "" },
20 { "Ra::Core::VectorArray", "RaVector" },
21 { "Ra::Core::Utils::ColorBase<float>", "Color" },
22 { "Ra::Core::Utils::ColorBase<double>", "Color" },
23 { "Eigen::Matrix<float, 2, 1, 0, 2, 1>", "Vector2" },
24 { "Eigen::Matrix<double, 2, 1, 0, 2, 1>", "Vector2d" },
25 { "Eigen::Matrix<int, 2, 1, 0, 2, 1>", "Vector2i" },
26 { "Eigen::Matrix<unsigned int, 2, 1, 0, 2, 1>", "Vector2ui" },
27 { "Eigen::Matrix<float, 3, 1, 0, 3, 1>", "Vector3" },
28 { "Eigen::Matrix<double, 3, 1, 0, 3, 1>", "Vector3d" },
29 { "Eigen::Matrix<int, 3, 1, 0, 3, 1>", "Vector3i" },
30 { "Eigen::Matrix<unsigned int, 3, 1, 0, 3, 1>", "Vector3ui" },
31 { "Eigen::Matrix<float, 4, 1, 0, 4, 1>", "Vector4" },
32 { "Eigen::Matrix<double, 4, 1, 0, 4, 1>", "Vector4d" },
33 { "Eigen::Matrix<int, 4, 1, 0, 4, 1>", "Vector4i" },
34 { "Eigen::Matrix<unsigned int, 4, 1, 0, 4, 1>", "Vector4ui" },
35 // Windows (visual studio 2022) specific name fix
36 { " __ptr64", "" } };
37
38 auto processedType = fullType;
39 for ( const auto& [key, value] : knownTypes ) {
40 Ra::Core::Utils::replaceAllInString( processedType, key, value );
41 }
42 return processedType;
43}
44
45} // namespace TypeInternal
46} // namespace Utils
47} // namespace Core
48} // namespace Ra
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:3