38
38
#include < cstdint>
39
39
#include < string>
40
40
41
+ #include " EbsdLib/Core/StringLiteral.hpp"
42
+
43
+
41
44
/* *
42
45
* @file EbsdConstants.h
43
46
* @brief This file contains many constants that are generic to the EBSD library
@@ -47,7 +50,7 @@ namespace EbsdLib
47
50
48
51
using Rgb = uint32_t ;
49
52
inline constexpr Rgb RGB_MASK = 0x00ffffff ; // masks RGB values
50
- inline const std::string PathSep ( " |" ) ;
53
+ inline constexpr StringLiteral PathSep = " |" ;
51
54
inline constexpr uint8_t Unchecked = 0 ;
52
55
inline constexpr uint8_t PartiallyChecked = 1 ;
53
56
inline constexpr uint8_t Checked = 2 ;
@@ -64,28 +67,28 @@ enum InfoStringFormat
64
67
65
68
namespace StringConstants
66
69
{
67
- inline const std::string Statistics ( " Statistics" ) ;
68
- inline const std::string StatsData ( " StatsData" ) ;
69
- inline const std::string StatsType ( " StatsType" ) ;
70
- inline const std::string GBCD ( " GBCD" ) ;
70
+ inline constexpr StringLiteral Statistics = " Statistics" ;
71
+ inline constexpr StringLiteral StatsData = " StatsData" ;
72
+ inline constexpr StringLiteral StatsType = " StatsType" ;
73
+ inline constexpr StringLiteral GBCD = " GBCD" ;
71
74
} // namespace StringConstants
72
75
73
76
namespace NumericTypes
74
77
{
75
78
namespace Names
76
79
{
77
- inline const std::string Int8 ( " signed int 8 bit" ) ;
78
- inline const std::string UInt8 ( " unsigned int 8 bit" ) ;
79
- inline const std::string Int16 ( " signed int 16 bit" ) ;
80
- inline const std::string UInt16 ( " unsigned int 16 bit" ) ;
81
- inline const std::string Int32 ( " signed int 32 bit" ) ;
82
- inline const std::string UInt32 ( " unsigned int 32 bit" ) ;
83
- inline const std::string Int64 ( " signed int 64 bit" ) ;
84
- inline const std::string UInt64 ( " unsigned int 64 bit" ) ;
85
- inline const std::string Float ( " Float 32 bit" ) ;
86
- inline const std::string Double ( " Double 64 bit" ) ;
87
- inline const std::string Bool ( " Bool" ) ;
88
- inline const std::string SizeT ( " size_t" ) ;
80
+ inline constexpr StringLiteral Int8 = " signed int 8 bit" ;
81
+ inline constexpr StringLiteral UInt8 = " unsigned int 8 bit" ;
82
+ inline constexpr StringLiteral Int16 = " signed int 16 bit" ;
83
+ inline constexpr StringLiteral UInt16 = " unsigned int 16 bit" ;
84
+ inline constexpr StringLiteral Int32 = " signed int 32 bit" ;
85
+ inline constexpr StringLiteral UInt32 = " unsigned int 32 bit" ;
86
+ inline constexpr StringLiteral Int64 = " signed int 64 bit" ;
87
+ inline constexpr StringLiteral UInt64 = " unsigned int 64 bit" ;
88
+ inline constexpr StringLiteral Float = " Float 32 bit" ;
89
+ inline constexpr StringLiteral Double = " Double 64 bit" ;
90
+ inline constexpr StringLiteral Bool = " Bool" ;
91
+ inline constexpr StringLiteral SizeT = " size_t" ;
89
92
} // namespace Names
90
93
91
94
enum class Type : int32_t
@@ -105,9 +108,9 @@ enum class Type : int32_t
105
108
UnknownNumType
106
109
};
107
110
108
- inline const std::string SupportedTypeList (NumericTypes::Names::Int8 + " , " + NumericTypes::Names::UInt8 + " , " + NumericTypes::Names::Int16 + " , " + NumericTypes::Names::UInt16 + " , " +
109
- NumericTypes::Names::Int32 + " , " + NumericTypes::Names::UInt32 + " , " + NumericTypes::Names::Int64 + " , " + NumericTypes::Names::UInt64 + " , " +
110
- NumericTypes::Names::Float + " , " + NumericTypes::Names::Double + " , " + NumericTypes::Names::Bool + " , " + NumericTypes::Names::SizeT);
111
+ inline std::string SupportedTypeList (NumericTypes::Names::Int8.str() + ", " + NumericTypes::Names::UInt8.str() + ", " + NumericTypes::Names::Int16.str() + ", " + NumericTypes::Names::UInt16.str() + ", " +
112
+ NumericTypes::Names::Int32.str() + ", " + NumericTypes::Names::UInt32.str() + ", " + NumericTypes::Names::Int64.str() + ", " + NumericTypes::Names::UInt64.str() + ", " +
113
+ NumericTypes::Names::Float.str() + ", " + NumericTypes::Names::Double.str() + ", " + NumericTypes::Names::Bool.str() + ", " + NumericTypes::Names::SizeT.str() );
111
114
} // namespace NumericTypes
112
115
113
116
/* * @brief RefFrameZDir defined for the Stacking order of images into a 3D Volume */
@@ -120,35 +123,35 @@ inline constexpr uint32_t UnknownRefFrameZDirection = 2;
120
123
121
124
namespace H5Ebsd
122
125
{
123
- inline const std::string Manufacturer ( " Manufacturer" ) ;
124
- inline const std::string Header ( " Header" ) ;
125
- inline const std::string Phases ( " Phases" ) ;
126
- inline const std::string Phase ( " Phase" ) ;
127
- inline const std::string Data ( " Data" ) ;
128
- inline const std::string Index ( " Index" ) ;
129
-
130
- inline const std::string ZStartIndex ( " ZStartIndex" ) ;
131
- inline const std::string ZEndIndex ( " ZEndIndex" ) ;
132
- inline const std::string ZResolution ( " Z Resolution" ) ;
133
- inline const std::string StackingOrder ( " Stacking Order" ) ;
134
- inline const std::string SampleTransformationAngle ( " SampleTransformationAngle" ) ;
135
- inline const std::string SampleTransformationAxis ( " SampleTransformationAxis" ) ;
136
- inline const std::string EulerTransformationAngle ( " EulerTransformationAngle" ) ;
137
- inline const std::string EulerTransformationAxis ( " EulerTransformationAxis" ) ;
126
+ inline constexpr StringLiteral Manufacturer = " Manufacturer" ;
127
+ inline constexpr StringLiteral Header = " Header" ;
128
+ inline constexpr StringLiteral Phases = " Phases" ;
129
+ inline constexpr StringLiteral Phase = " Phase" ;
130
+ inline constexpr StringLiteral Data = " Data" ;
131
+ inline constexpr StringLiteral Index = " Index" ;
132
+
133
+ inline constexpr StringLiteral ZStartIndex = " ZStartIndex" ;
134
+ inline constexpr StringLiteral ZEndIndex = " ZEndIndex" ;
135
+ inline constexpr StringLiteral ZResolution = " Z Resolution" ;
136
+ inline constexpr StringLiteral StackingOrder = " Stacking Order" ;
137
+ inline constexpr StringLiteral SampleTransformationAngle = " SampleTransformationAngle" ;
138
+ inline constexpr StringLiteral SampleTransformationAxis = " SampleTransformationAxis" ;
139
+ inline constexpr StringLiteral EulerTransformationAngle = " EulerTransformationAngle" ;
140
+ inline constexpr StringLiteral EulerTransformationAxis = " EulerTransformationAxis" ;
138
141
139
142
// Each Manufacturer has their own naming scheme for these variables but for
140
143
// DREAM.3D we are going to settle on using these names for consistency
141
- inline const std::string XResolution ( " X Resolution" ) ;
142
- inline const std::string YResolution ( " Y Resolution" ) ;
144
+ inline constexpr StringLiteral XResolution = " X Resolution" ;
145
+ inline constexpr StringLiteral YResolution = " Y Resolution" ;
143
146
144
147
// We store the Maximum number of X and Y Points for the given volume. This
145
148
// allows us to store slices that have different XY voxel dimensions.
146
- inline const std::string XPoints ( " Max X Points" ) ;
147
- inline const std::string YPoints ( " Max Y Points" ) ;
149
+ inline constexpr StringLiteral XPoints = " Max X Points" ;
150
+ inline constexpr StringLiteral YPoints = " Max Y Points" ;
148
151
149
- inline const std::string FileVersionStr ( " FileVersion" ) ;
152
+ inline constexpr StringLiteral FileVersionStr = " FileVersion" ;
150
153
inline constexpr uint32_t FileVersion = 5 ;
151
- inline const std::string EbsdLibVersionStr ( " EbsdLibVersion" ) ;
154
+ inline constexpr StringLiteral EbsdLibVersionStr = " EbsdLibVersion" ;
152
155
} // namespace H5Ebsd
153
156
154
157
using EnumType = int32_t ;
@@ -167,8 +170,8 @@ enum class OEM : EnumType
167
170
168
171
namespace CellData
169
172
{
170
- inline const std::string EulerAngles ( " EulerAngles" ) ;
171
- inline const std::string Phases ( " Phases" ) ;
173
+ inline constexpr StringLiteral EulerAngles = " EulerAngles" ;
174
+ inline constexpr StringLiteral Phases = " Phases" ;
172
175
} // namespace CellData
173
176
174
177
enum EbsdToSampleCoordinateMapping
@@ -181,9 +184,9 @@ enum EbsdToSampleCoordinateMapping
181
184
182
185
namespace StackingOrder
183
186
{
184
- inline const std::string LowToHigh ( " Low To High" ) ;
185
- inline const std::string HighToLow ( " High To Low" ) ;
186
- inline const std::string UnknownStackingOrder ( " Unknown Stacking Order" ) ;
187
+ inline constexpr StringLiteral LowToHigh = " Low To High" ;
188
+ inline constexpr StringLiteral HighToLow = " High To Low" ;
189
+ inline constexpr StringLiteral UnknownStackingOrder = " Unknown Stacking Order" ;
187
190
188
191
namespace Utils
189
192
{
@@ -241,9 +244,9 @@ inline constexpr uint32_t UnknownCrystalStructure = 999; //!< UnknownCrystalStru
241
244
242
245
namespace BravaisLattice
243
246
{
244
- inline const std::string Unknown ( " Unknown" ) ;
245
- inline const std::string Cubic ( " Cubic" ) ;
246
- inline const std::string Hexagonal ( " Hexagonal" ) ;
247
+ inline constexpr StringLiteral Unknown = " Unknown" ;
248
+ inline constexpr StringLiteral Cubic = " Cubic" ;
249
+ inline constexpr StringLiteral Hexagonal = " Hexagonal" ;
247
250
} // namespace BravaisLattice
248
251
249
252
namespace AngleRepresentation
@@ -292,3 +295,4 @@ inline constexpr double BP[6] = {0.0, 1.0, 0.5773502691896260, 0.414213562373095
292
295
namespace LPs = LambertParametersType;
293
296
294
297
} // namespace EbsdLib
298
+
0 commit comments