diff --git a/Source/EbsdLib/Core/EbsdLibConstants.h b/Source/EbsdLib/Core/EbsdLibConstants.h index a476154..e90acd5 100644 --- a/Source/EbsdLib/Core/EbsdLibConstants.h +++ b/Source/EbsdLib/Core/EbsdLibConstants.h @@ -38,8 +38,6 @@ #include #include -#include "EbsdLib/Core/StringLiteral.hpp" - /** * @file EbsdConstants.h * @brief This file contains many constants that are generic to the EBSD library @@ -49,7 +47,7 @@ namespace EbsdLib using Rgb = uint32_t; inline constexpr Rgb RGB_MASK = 0x00ffffff; // masks RGB values -inline constexpr StringLiteral PathSep = "|"; +inline const std::string PathSep("|"); inline constexpr uint8_t Unchecked = 0; inline constexpr uint8_t PartiallyChecked = 1; inline constexpr uint8_t Checked = 2; @@ -66,29 +64,14 @@ enum InfoStringFormat namespace StringConstants { -inline constexpr StringLiteral Statistics = "Statistics"; -inline constexpr StringLiteral StatsData = "StatsData"; -inline constexpr StringLiteral StatsType = "StatsType"; -inline constexpr StringLiteral GBCD = "GBCD"; +inline const std::string Statistics("Statistics"); +inline const std::string StatsData("StatsData"); +inline const std::string StatsType("StatsType"); +inline const std::string GBCD("GBCD"); } // namespace StringConstants namespace NumericTypes { -namespace Names -{ -inline constexpr StringLiteral Int8 = "signed int 8 bit"; -inline constexpr StringLiteral UInt8 = "unsigned int 8 bit"; -inline constexpr StringLiteral Int16 = "signed int 16 bit"; -inline constexpr StringLiteral UInt16 = "unsigned int 16 bit"; -inline constexpr StringLiteral Int32 = "signed int 32 bit"; -inline constexpr StringLiteral UInt32 = "unsigned int 32 bit"; -inline constexpr StringLiteral Int64 = "signed int 64 bit"; -inline constexpr StringLiteral UInt64 = "unsigned int 64 bit"; -inline constexpr StringLiteral Float = "Float 32 bit"; -inline constexpr StringLiteral Double = "Double 64 bit"; -inline constexpr StringLiteral Bool = "Bool"; -inline constexpr StringLiteral SizeT = "size_t"; -} // namespace Names enum class Type : int32_t { @@ -107,10 +90,6 @@ enum class Type : int32_t UnknownNumType }; -inline std::string SupportedTypeList(NumericTypes::Names::Int8.str() + ", " + NumericTypes::Names::UInt8.str() + ", " + NumericTypes::Names::Int16.str() + ", " + NumericTypes::Names::UInt16.str() + - ", " + NumericTypes::Names::Int32.str() + ", " + NumericTypes::Names::UInt32.str() + ", " + NumericTypes::Names::Int64.str() + ", " + - NumericTypes::Names::UInt64.str() + ", " + NumericTypes::Names::Float.str() + ", " + NumericTypes::Names::Double.str() + ", " + NumericTypes::Names::Bool.str() + - ", " + NumericTypes::Names::SizeT.str()); } // namespace NumericTypes /** @brief RefFrameZDir defined for the Stacking order of images into a 3D Volume */ @@ -123,35 +102,35 @@ inline constexpr uint32_t UnknownRefFrameZDirection = 2; namespace H5Ebsd { -inline constexpr StringLiteral Manufacturer = "Manufacturer"; -inline constexpr StringLiteral Header = "Header"; -inline constexpr StringLiteral Phases = "Phases"; -inline constexpr StringLiteral Phase = "Phase"; -inline constexpr StringLiteral Data = "Data"; -inline constexpr StringLiteral Index = "Index"; +inline const std::string Manufacturer("Manufacturer"); +inline const std::string Header("Header"); +inline const std::string Phases("Phases"); +inline const std::string Phase("Phase"); +inline const std::string Data("Data"); +inline const std::string Index("Index"); -inline constexpr StringLiteral ZStartIndex = "ZStartIndex"; -inline constexpr StringLiteral ZEndIndex = "ZEndIndex"; -inline constexpr StringLiteral ZResolution = "Z Resolution"; -inline constexpr StringLiteral StackingOrder = "Stacking Order"; -inline constexpr StringLiteral SampleTransformationAngle = "SampleTransformationAngle"; -inline constexpr StringLiteral SampleTransformationAxis = "SampleTransformationAxis"; -inline constexpr StringLiteral EulerTransformationAngle = "EulerTransformationAngle"; -inline constexpr StringLiteral EulerTransformationAxis = "EulerTransformationAxis"; +inline const std::string ZStartIndex("ZStartIndex"); +inline const std::string ZEndIndex("ZEndIndex"); +inline const std::string ZResolution("Z Resolution"); +inline const std::string StackingOrder("Stacking Order"); +inline const std::string SampleTransformationAngle("SampleTransformationAngle"); +inline const std::string SampleTransformationAxis("SampleTransformationAxis"); +inline const std::string EulerTransformationAngle("EulerTransformationAngle"); +inline const std::string EulerTransformationAxis("EulerTransformationAxis"); // Each Manufacturer has their own naming scheme for these variables but for // DREAM.3D we are going to settle on using these names for consistency -inline constexpr StringLiteral XResolution = "X Resolution"; -inline constexpr StringLiteral YResolution = "Y Resolution"; +inline const std::string XResolution("X Resolution"); +inline const std::string YResolution("Y Resolution"); // We store the Maximum number of X and Y Points for the given volume. This // allows us to store slices that have different XY voxel dimensions. -inline constexpr StringLiteral XPoints = "Max X Points"; -inline constexpr StringLiteral YPoints = "Max Y Points"; +inline const std::string XPoints("Max X Points"); +inline const std::string YPoints("Max Y Points"); -inline constexpr StringLiteral FileVersionStr = "FileVersion"; +inline const std::string FileVersionStr("FileVersion"); inline constexpr uint32_t FileVersion = 5; -inline constexpr StringLiteral EbsdLibVersionStr = "EbsdLibVersion"; +inline const std::string EbsdLibVersionStr("EbsdLibVersion"); } // namespace H5Ebsd using EnumType = int32_t; @@ -170,8 +149,8 @@ enum class OEM : EnumType namespace CellData { -inline constexpr StringLiteral EulerAngles = "EulerAngles"; -inline constexpr StringLiteral Phases = "Phases"; +inline const std::string EulerAngles("EulerAngles"); +inline const std::string Phases("Phases"); } // namespace CellData enum EbsdToSampleCoordinateMapping @@ -184,9 +163,9 @@ enum EbsdToSampleCoordinateMapping namespace StackingOrder { -inline constexpr StringLiteral LowToHigh = "Low To High"; -inline constexpr StringLiteral HighToLow = "High To Low"; -inline constexpr StringLiteral UnknownStackingOrder = "Unknown Stacking Order"; +inline const std::string LowToHigh("Low To High"); +inline const std::string HighToLow("High To Low"); +inline const std::string UnknownStackingOrder("Unknown Stacking Order"); namespace Utils { @@ -244,9 +223,9 @@ inline constexpr uint32_t UnknownCrystalStructure = 999; //!< UnknownCrystalStru namespace BravaisLattice { -inline constexpr StringLiteral Unknown = "Unknown"; -inline constexpr StringLiteral Cubic = "Cubic"; -inline constexpr StringLiteral Hexagonal = "Hexagonal"; +inline const std::string Unknown("Unknown"); +inline const std::string Cubic("Cubic"); +inline const std::string Hexagonal("Hexagonal"); } // namespace BravaisLattice namespace AngleRepresentation diff --git a/Source/EbsdLib/Core/SourceList.cmake b/Source/EbsdLib/Core/SourceList.cmake index b06ccda..49c73f9 100644 --- a/Source/EbsdLib/Core/SourceList.cmake +++ b/Source/EbsdLib/Core/SourceList.cmake @@ -12,7 +12,6 @@ set(EbsdLib_${DIR_NAME}_HDRS ${EbsdLibProj_SOURCE_DIR}/Source/EbsdLib/${DIR_NAME}/OrientationRepresentation.h ${EbsdLibProj_SOURCE_DIR}/Source/EbsdLib/${DIR_NAME}/OrientationTransformation.hpp ${EbsdLibProj_SOURCE_DIR}/Source/EbsdLib/${DIR_NAME}/Quaternion.hpp - ${EbsdLibProj_SOURCE_DIR}/Source/EbsdLib/${DIR_NAME}/StringLiteral.hpp ) set(EbsdLib_${DIR_NAME}_SRCS diff --git a/Source/EbsdLib/IO/H5EbsdVolumeInfo.cpp b/Source/EbsdLib/IO/H5EbsdVolumeInfo.cpp index ee557fb..89ddede 100644 --- a/Source/EbsdLib/IO/H5EbsdVolumeInfo.cpp +++ b/Source/EbsdLib/IO/H5EbsdVolumeInfo.cpp @@ -48,20 +48,20 @@ #include "EbsdLib/Utilities/EbsdStringUtils.hpp" #define EBSD_VOLREADER_READ_HEADER(fileId, path, var) \ - err = H5Lite::readScalarDataset(fileId, path.c_str(), var); \ + err = H5Lite::readScalarDataset(fileId, path, var); \ if(err < 0) \ { \ - std::cout << "H5EbsdVolumeInfo Error: Could not load header value for " << path.str(); \ + std::cout << "H5EbsdVolumeInfo Error: Could not load header value for " << path; \ err = H5Utilities::closeFile(fileId); \ return err; \ } #define EBSD_VOLREADER_READ_VECTOR3_HEADER(fileId, path, var, type) \ { \ - err = H5Lite::readPointerDataset(fileId, path.c_str(), var.data()); \ + err = H5Lite::readPointerDataset(fileId, path, var.data()); \ if(err < 0) \ { \ - std::cout << "H5EbsdVolumeInfo Error: Could not load header (as vector) for " << path.str(); \ + std::cout << "H5EbsdVolumeInfo Error: Could not load header (as vector) for " << path; \ err = H5Utilities::closeFile(fileId); \ return err; \ } \ @@ -178,7 +178,7 @@ int H5EbsdVolumeInfo::readVolumeInfo() err = H5Lite::readStringDataset(fileId, EbsdLib::H5Ebsd::Manufacturer, data); if(err < 0) { - std::cout << "H5EbsdVolumeInfo Error: Could not load header value for " << EbsdLib::H5Ebsd::Manufacturer.str() << std::endl; + std::cout << "H5EbsdVolumeInfo Error: Could not load header value for " << EbsdLib::H5Ebsd::Manufacturer << std::endl; err = H5Utilities::closeFile(fileId); return err; }