From b9e71378d7196759fd92051e49a4a3d8e82e5fee Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Mon, 26 Aug 2024 20:36:30 -0400 Subject: [PATCH] ENH: Format all source codes according to clang formatting rules. Signed-off-by: Michael Jackson --- Source/EbsdLib/Core/EbsdSetGetMacros.h | 2 +- Source/EbsdLib/IO/HKL/CtfConstants.h | 29 +++++------ Source/EbsdLib/IO/HKL/CtfReader.cpp | 8 ++-- Source/EbsdLib/IO/HKL/DataParser.hpp | 4 +- Source/EbsdLib/IO/HKL/H5OINAReader.cpp | 21 ++++---- Source/EbsdLib/IO/HKL/H5OINAReader.h | 2 +- Source/EbsdLib/IO/TSL/AngConstants.h | 48 +++++++++---------- Source/EbsdLib/IO/TSL/AngPhase.h | 4 +- Source/EbsdLib/Utilities/ColorTable.cpp | 2 +- Source/EbsdLib/Utilities/EbsdStringUtils.hpp | 2 +- .../ModifiedLambertProjectionArray.cpp | 5 +- Source/Test/H5OINAReaderTest.cpp | 21 ++++---- 12 files changed, 67 insertions(+), 81 deletions(-) diff --git a/Source/EbsdLib/Core/EbsdSetGetMacros.h b/Source/EbsdLib/Core/EbsdSetGetMacros.h index bc92955..d58a23b 100644 --- a/Source/EbsdLib/Core/EbsdSetGetMacros.h +++ b/Source/EbsdLib/Core/EbsdSetGetMacros.h @@ -52,7 +52,7 @@ //-- Qt includes #include #include -//#define RAW_PTR data +// #define RAW_PTR data #endif /** diff --git a/Source/EbsdLib/IO/HKL/CtfConstants.h b/Source/EbsdLib/IO/HKL/CtfConstants.h index 61ce7d3..be33bbf 100644 --- a/Source/EbsdLib/IO/HKL/CtfConstants.h +++ b/Source/EbsdLib/IO/HKL/CtfConstants.h @@ -193,7 +193,6 @@ const std::string LatticeConstants("LatticeConstants"); const std::string BravaisLattice("BravaisLattice"); } // namespace CtfFile - //----------------------------------------------------------------------------- // https://github.com/oinanoanalysis/h5oina/blob/master/H5OINAFile.md#ebsd-data //----------------------------------------------------------------------------- @@ -202,8 +201,8 @@ namespace H5OINA const std::string H5FileExt("h5oina"); const std::string Index("Index"); -const std::string FormatVersion("Format Version"); // String 2.0 is the earliest that I seem to have -const std::string Manufacturer("Manufacturer"); // String +const std::string FormatVersion("Format Version"); // String 2.0 is the earliest that I seem to have +const std::string Manufacturer("Manufacturer"); // String const std::string SoftwareVersion("Software Version"); // String const std::string FormatVersion_2("2.0"); @@ -247,27 +246,21 @@ const std::string SpaceGroup("Space Group"); // Data: Format Version 2 const std::string EBSD("EBSD"); const std::string Data("Data"); -const std::string BandContrast("Band Contrast"); // uint8 -const std::string BandSlope("Band Slope"); // uint8 -const std::string Bands("Bands"); // uint8 -const std::string Error("Error"); // uint8 -const std::string Euler("Euler"); // 3xFloat32 +const std::string BandContrast("Band Contrast"); // uint8 +const std::string BandSlope("Band Slope"); // uint8 +const std::string Bands("Bands"); // uint8 +const std::string Error("Error"); // uint8 +const std::string Euler("Euler"); // 3xFloat32 const std::string MeanAngularDeviation("Mean Angular Deviation"); // Float -const std::string Phase("Phase"); // uint8 -const std::string X("X"); // uint8 -const std::string Y("Y"); // uint8 - +const std::string Phase("Phase"); // uint8 +const std::string X("X"); // uint8 +const std::string Y("Y"); // uint8 // Data Format Version 5 const std::string UnprocessedPatterns("Unprocessed Patterns"); const std::string ProcessedPatterns("Processed Patterns"); - - - - - -} +} // namespace H5OINA } // namespace EbsdLib diff --git a/Source/EbsdLib/IO/HKL/CtfReader.cpp b/Source/EbsdLib/IO/HKL/CtfReader.cpp index 50a8182..a5e146a 100644 --- a/Source/EbsdLib/IO/HKL/CtfReader.cpp +++ b/Source/EbsdLib/IO/HKL/CtfReader.cpp @@ -45,10 +45,10 @@ #include "EbsdLib/Math/EbsdLibMath.h" #include "EbsdLib/Utilities/EbsdStringUtils.hpp" -//#define PI_OVER_2f 90.0f -//#define THREE_PI_OVER_2f 270.0f -//#define TWO_PIf 360.0f -//#define ONE_PIf 180.0f +// #define PI_OVER_2f 90.0f +// #define THREE_PI_OVER_2f 270.0f +// #define TWO_PIf 360.0f +// #define ONE_PIf 180.0f namespace { diff --git a/Source/EbsdLib/IO/HKL/DataParser.hpp b/Source/EbsdLib/IO/HKL/DataParser.hpp index 3121f45..aa72c2b 100644 --- a/Source/EbsdLib/IO/HKL/DataParser.hpp +++ b/Source/EbsdLib/IO/HKL/DataParser.hpp @@ -328,7 +328,6 @@ class Int32Parser : public DataParser Int32Parser& operator=(Int32Parser&&) = delete; // Move Assignment Not Implemented }; - // ----------------------------------------------------------------------------- class FloatParser : public DataParser { @@ -432,7 +431,7 @@ class FloatParser : public DataParser FloatParser& operator=(FloatParser&&) = delete; // Move Assignment Not Implemented }; -template +template class NumericParser : public DataParser { public: @@ -534,4 +533,3 @@ class NumericParser : public DataParser NumericParser& operator=(const NumericParser&) = delete; // Copy Assignment Not Implemented NumericParser& operator=(NumericParser&&) = delete; // Move Assignment Not Implemented }; - diff --git a/Source/EbsdLib/IO/HKL/H5OINAReader.cpp b/Source/EbsdLib/IO/HKL/H5OINAReader.cpp index 7016c8a..d9840fc 100644 --- a/Source/EbsdLib/IO/HKL/H5OINAReader.cpp +++ b/Source/EbsdLib/IO/HKL/H5OINAReader.cpp @@ -123,31 +123,31 @@ void* H5OINAReader::getPointerByName(const std::string& featureName) { return m_BandSlope.data(); } - if(featureName == EbsdLib::H5OINA::Bands) + if(featureName == EbsdLib::H5OINA::Bands) { return m_Bands.data(); } - if(featureName == EbsdLib::H5OINA::Error) + if(featureName == EbsdLib::H5OINA::Error) { return m_Error.data(); } - if(featureName == EbsdLib::H5OINA::Euler) + if(featureName == EbsdLib::H5OINA::Euler) { return m_Euler.data(); } - if(featureName == EbsdLib::H5OINA::MeanAngularDeviation) + if(featureName == EbsdLib::H5OINA::MeanAngularDeviation) { return m_MeanAngularDeviation.data(); } - if(featureName == EbsdLib::H5OINA::Phase) + if(featureName == EbsdLib::H5OINA::Phase) { return m_Phase.data(); } - if(featureName == EbsdLib::H5OINA::X) + if(featureName == EbsdLib::H5OINA::X) { return m_X.data(); } - if(featureName == EbsdLib::H5OINA::Y) + if(featureName == EbsdLib::H5OINA::Y) { return m_Y.data(); } @@ -202,19 +202,18 @@ EbsdLib::NumericTypes::Type H5OINAReader::getPointerType(const std::string& feat return EbsdLib::NumericTypes::Type::UnknownNumType; } -void H5OINAReader::setReadPatternData(bool value) +void H5OINAReader::setReadPatternData(bool value) { m_ReadPatternData = value; } - uint16_t* H5OINAReader::getPatternData() { return nullptr; } -void H5OINAReader::getPatternDims(std::array dims) +void H5OINAReader::getPatternDims(std::array dims) { -; + ; } // ----------------------------------------------------------------------------- diff --git a/Source/EbsdLib/IO/HKL/H5OINAReader.h b/Source/EbsdLib/IO/HKL/H5OINAReader.h index 77dfb87..8d1b368 100644 --- a/Source/EbsdLib/IO/HKL/H5OINAReader.h +++ b/Source/EbsdLib/IO/HKL/H5OINAReader.h @@ -123,7 +123,7 @@ class EbsdLib_EXPORT H5OINAReader : public EbsdReader void setReadPatternData(bool value); uint16_t* getPatternData(); - void getPatternDims(std::array dims); + void getPatternDims(std::array dims); /** * @brief Returns the pointer to the data for a given feature diff --git a/Source/EbsdLib/IO/TSL/AngConstants.h b/Source/EbsdLib/IO/TSL/AngConstants.h index c5cdd52..a465b0b 100644 --- a/Source/EbsdLib/IO/TSL/AngConstants.h +++ b/Source/EbsdLib/IO/TSL/AngConstants.h @@ -170,17 +170,17 @@ const std::string EDAX("EDAX"); // LAUE Symmetry Identifiers // Old Style LAUE Symmetry Identifiers -#define CIs 1 // triclinic (S2, Ci) [-1] a!=b!=c a!=b!=g!=90 -#define D2H 22 // orthrohombic (D2h) [mmm] a!=b!=c a=b=g=90 -#define C4H 4 // tetragonal (C4h) [4/m] a=b!=c a=b=g=90 -#define D4H 42 // ditetragonal (D4h) [4/mmm] a=b!=c a=b=g=90 -#define C3I 3 // trigonal (S6, C3i) [-3] a=b=c a=b=g!=90 -#define D3D 32 // ditrigonal (D3d) [-3m] a=b=c a=b=g!=90 -#define C6H 6 // hexagonal (C6h) [6/m] a=b!=c a=b=90 g=120 -#define D6H 62 // dihexagonal (D6h) [6/mmm] a=b!=c a=b=90 g=120 -#define TH 23 // tetrahedral (Th) [m3] a=b=c a=b=g=90 -#define OH 43 // cubic (Oh) [m3m] a=b=c a=b=g=90 -#define C2H_c 2 // monoclinic c (C2h) [2/m] a!=b!=c a=b=90!=g +#define CIs 1 // triclinic (S2, Ci) [-1] a!=b!=c a!=b!=g!=90 +#define D2H 22 // orthrohombic (D2h) [mmm] a!=b!=c a=b=g=90 +#define C4H 4 // tetragonal (C4h) [4/m] a=b!=c a=b=g=90 +#define D4H 42 // ditetragonal (D4h) [4/mmm] a=b!=c a=b=g=90 +#define C3I 3 // trigonal (S6, C3i) [-3] a=b=c a=b=g!=90 +#define D3D 32 // ditrigonal (D3d) [-3m] a=b=c a=b=g!=90 +#define C6H 6 // hexagonal (C6h) [6/m] a=b!=c a=b=90 g=120 +#define D6H 62 // dihexagonal (D6h) [6/mmm] a=b!=c a=b=90 g=120 +#define TH 23 // tetrahedral (Th) [m3] a=b=c a=b=g=90 +#define OH 43 // cubic (Oh) [m3m] a=b=c a=b=g=90 +#define C2H_c 2 // monoclinic c (C2h) [2/m] a!=b!=c a=b=90!=g #define C2H_b 20 // monoclinic b (C2h) [2/m] a!=b!=c a=g=90!=b #define C2H_a 21 // monoclinic a (C2h) [2/m] a!=b!=c b=g=90!=a @@ -188,15 +188,15 @@ const std::string EDAX("EDAX"); #define Sym_C1 100 // Triclinic (C1) [1] #define Sym_S2 101 // Triclinic (S2, Ci) [-1] -#define Sym_D2 105 // Orthorhombic (D2) [222] +#define Sym_D2 105 // Orthorhombic (D2) [222] #define Sym_C2v 106 // Orthorhombic (C2v) [mm2] #define Sym_D2h 107 // Orthorhombic (D2h) [mmm] -#define Sym_C4 108 // Tetragonal (C4) [4] -#define Sym_S4 109 // Tetragonal (S4) [-4] +#define Sym_C4 108 // Tetragonal (C4) [4] +#define Sym_S4 109 // Tetragonal (S4) [-4] #define Sym_C4h 110 // Tetragonal (C4h) [4/m] -#define Sym_D4 111 // Tetragonal (D4) [422] +#define Sym_D4 111 // Tetragonal (D4) [422] #define Sym_C4v 112 // Tetragonal (C4v) [4mm] #define Sym_D2d 113 // Tetragonal (D2d) [-42m] #define Sym_D4h 114 // Tetragonal (D4h) [4/mmm] @@ -204,33 +204,33 @@ const std::string EDAX("EDAX"); #define Sym_C3 115 // Trigonal (C3) [3] #define Sym_S6 116 // Trigonal (S6, C3i) [-3] -#define Sym_D3 117 // Trigonal (D3) [32] +#define Sym_D3 117 // Trigonal (D3) [32] #define Sym_C3v 118 // Trigonal (C3v) [3m] #define Sym_D3d 119 // Trigonal (D3d) [-3m] -#define Sym_C6 120 // Hexagonal (C6) [6] +#define Sym_C6 120 // Hexagonal (C6) [6] #define Sym_C3h 121 // Hexagonal (C3h) [-6] #define Sym_C6h 122 // Hexagonal (C6h) [6/m] -#define Sym_D6 123 // Hexagonal (D6) [622] +#define Sym_D6 123 // Hexagonal (D6) [622] #define Sym_C6v 124 // Hexagonal (C6v) [6mm] #define Sym_D3h 125 // Hexagonal (D3h) [-6m2] #define Sym_D6h 126 // Hexagonal (D6h) [6/mmm] -#define Sym_T 127 // Cubic (T) [23] +#define Sym_T 127 // Cubic (T) [23] #define Sym_Th 128 // Cubic (Th) [m-3] -#define Sym_O 129 // Cubic (O) [432] +#define Sym_O 129 // Cubic (O) [432] #define Sym_Td 130 // Cubic (Td) [-43m] #define Sym_Oh 131 // Cubic (Oh) [m3m] -#define Sym_C2_c 102 // Monoclinic c (C2)[2] +#define Sym_C2_c 102 // Monoclinic c (C2)[2] #define Sym_C1h_c 103 // Monoclinic c (C1h, Cs) [m] #define Sym_C2h_c 104 // Monoclinic c (C2h) [2/m] -#define Sym_C2_b 132 // Monoclinic b (C2)[2] +#define Sym_C2_b 132 // Monoclinic b (C2)[2] #define Sym_C1h_b 133 // Monoclinic b (C1h, Cs) [m] #define Sym_C2h_b 134 // Monoclinic b (C2h) [2/m] -#define Sym_C2_a 135 // Monoclinic a (C2)[2] +#define Sym_C2_a 135 // Monoclinic a (C2)[2] #define Sym_C1h_a 136 // Monoclinic a (C1h, Cs) [m] #define Sym_C2h_a 137 // Monoclinic a (C2h) [2/m] namespace PhaseSymmetry @@ -401,7 +401,7 @@ const std::string ColumnUnits(COLUMN_UNITS); #define ANG_Y_STEP_LOWER "ystep" #define ANG_NCOLS_ODD_LOWER "ncols_odd" #define ANG_NCOLS_EVEN_LOWER "ncols_even" -//#define ANG_NCOLS_LOWER "ncols" +// #define ANG_NCOLS_LOWER "ncols" #define ANG_NROWS_LOWER "nrows" #define ANG_OPERATOR_LOWER "operator" diff --git a/Source/EbsdLib/IO/TSL/AngPhase.h b/Source/EbsdLib/IO/TSL/AngPhase.h index 8531206..352501b 100644 --- a/Source/EbsdLib/IO/TSL/AngPhase.h +++ b/Source/EbsdLib/IO/TSL/AngPhase.h @@ -42,7 +42,7 @@ #include "EbsdLib/Core/EbsdSetGetMacros.h" #include "EbsdLib/EbsdLib.h" -//#pragma pack(push, r1, 1) /* push current alignment to stack. set alignment to 1 byte boundary */ +// #pragma pack(push, r1, 1) /* push current alignment to stack. set alignment to 1 byte boundary */ /*! * @struct HKLFamily_t is used to write the HKL Family to an HDF5 file using a * compound data type. @@ -223,4 +223,4 @@ class EbsdLib_EXPORT AngPhase // std::string m_Info = {}; }; -//#pragma pack(pop, r1) +// #pragma pack(pop, r1) diff --git a/Source/EbsdLib/Utilities/ColorTable.cpp b/Source/EbsdLib/Utilities/ColorTable.cpp index 4dcc98e..179d25d 100644 --- a/Source/EbsdLib/Utilities/ColorTable.cpp +++ b/Source/EbsdLib/Utilities/ColorTable.cpp @@ -38,7 +38,7 @@ #include #include -//#include +// #include using namespace EbsdLib; // ----------------------------------------------------------------------------- diff --git a/Source/EbsdLib/Utilities/EbsdStringUtils.hpp b/Source/EbsdLib/Utilities/EbsdStringUtils.hpp index b1ffd43..7eb5e1d 100644 --- a/Source/EbsdLib/Utilities/EbsdStringUtils.hpp +++ b/Source/EbsdLib/Utilities/EbsdStringUtils.hpp @@ -169,7 +169,7 @@ enum SplitType : uint8_t AllowEmptyRightAnalyze }; -inline std::vector specific_split(std::string_view str, std::vector&& delimiters, SplitType splitType) +inline std::vector specific_split(std::string_view str, std::vector&& delimiters, SplitType splitType) { switch(splitType) { diff --git a/Source/EbsdLib/Utilities/ModifiedLambertProjectionArray.cpp b/Source/EbsdLib/Utilities/ModifiedLambertProjectionArray.cpp index 1b733c4..ee5831b 100644 --- a/Source/EbsdLib/Utilities/ModifiedLambertProjectionArray.cpp +++ b/Source/EbsdLib/Utilities/ModifiedLambertProjectionArray.cpp @@ -458,10 +458,7 @@ void ModifiedLambertProjectionArray::printTuple(std::stringstream& out, size_t i // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- -void ModifiedLambertProjectionArray::printComponent(std::stringstream& out, size_t i, int j) const -{ - EBSD_METHOD_NOT_IMPLEMENTED() -} +void ModifiedLambertProjectionArray::printComponent(std::stringstream& out, size_t i, int j) const {EBSD_METHOD_NOT_IMPLEMENTED()} #ifdef EbsdLib_ENABLE_HDF5 std::string getNameOfClass() diff --git a/Source/Test/H5OINAReaderTest.cpp b/Source/Test/H5OINAReaderTest.cpp index 72da1ed..d80fc6f 100644 --- a/Source/Test/H5OINAReaderTest.cpp +++ b/Source/Test/H5OINAReaderTest.cpp @@ -30,10 +30,10 @@ class H5OINAReaderTest #endif } -#define H5OINA_CHECK_POINTERS(name, def, type) \ +#define H5OINA_CHECK_POINTERS(name, def, type) \ { \ type* ptr0 = reader->get##name##Pointer(); \ - void* ptr1 = reader->getPointerByName(def); \ + void* ptr1 = reader->getPointerByName(def); \ DREAM3D_REQUIRED(ptr0, ==, ptr1) \ } @@ -52,15 +52,14 @@ class H5OINAReaderTest DREAM3D_REQUIRED(err, ==, 0) H5OINA_CHECK_POINTERS(BandContrast, EbsdLib::H5OINA::BandContrast, uint8_t) - H5OINA_CHECK_POINTERS(BandSlope, EbsdLib::H5OINA::BandSlope,uint8_t) - H5OINA_CHECK_POINTERS(Bands, EbsdLib::H5OINA::Bands,uint8_t) - H5OINA_CHECK_POINTERS(Error, EbsdLib::H5OINA::Error,uint8_t) - H5OINA_CHECK_POINTERS(Euler, EbsdLib::H5OINA::Euler,float) - H5OINA_CHECK_POINTERS(MeanAngularDeviation, EbsdLib::H5OINA::MeanAngularDeviation,float) - H5OINA_CHECK_POINTERS(Phase, EbsdLib::H5OINA::Phase,uint8_t) - H5OINA_CHECK_POINTERS(X, EbsdLib::H5OINA::X,float) - H5OINA_CHECK_POINTERS(Y, EbsdLib::H5OINA::Y,float) - + H5OINA_CHECK_POINTERS(BandSlope, EbsdLib::H5OINA::BandSlope, uint8_t) + H5OINA_CHECK_POINTERS(Bands, EbsdLib::H5OINA::Bands, uint8_t) + H5OINA_CHECK_POINTERS(Error, EbsdLib::H5OINA::Error, uint8_t) + H5OINA_CHECK_POINTERS(Euler, EbsdLib::H5OINA::Euler, float) + H5OINA_CHECK_POINTERS(MeanAngularDeviation, EbsdLib::H5OINA::MeanAngularDeviation, float) + H5OINA_CHECK_POINTERS(Phase, EbsdLib::H5OINA::Phase, uint8_t) + H5OINA_CHECK_POINTERS(X, EbsdLib::H5OINA::X, float) + H5OINA_CHECK_POINTERS(Y, EbsdLib::H5OINA::Y, float) } // -----------------------------------------------------------------------------