diff --git a/Source/EbsdLib/LaueOps/CubicLowOps.cpp b/Source/EbsdLib/LaueOps/CubicLowOps.cpp index 0a46118..8fb12d2 100644 --- a/Source/EbsdLib/LaueOps/CubicLowOps.cpp +++ b/Source/EbsdLib/LaueOps/CubicLowOps.cpp @@ -51,6 +51,7 @@ #include "EbsdLib/Utilities/ColorTable.h" #include "EbsdLib/Utilities/ComputeStereographicProjection.h" #include "EbsdLib/Utilities/ModifiedLambertProjection.h" +#include "EbsdLib/Utilities/EbsdStringUtils.hpp" namespace CubicLow { @@ -221,7 +222,7 @@ std::array CubicLowOps::getOdfNumBins() const // ----------------------------------------------------------------------------- std::string CubicLowOps::getSymmetryName() const { - return "Cubic m-3 (Tetrahedral)"; /* Group 23*/ + return "Cubic m-3 (Th)"; /* Group 23*/ } // ----------------------------------------------------------------------------- @@ -928,7 +929,7 @@ EbsdLib::Rgb CubicLowOps::generateIPFColor(double phi1, double phi, double phi2, } if(getHasInversion() && p[2] < 0) { - p[0] = -p[0], p[1] = -p[1], p[2] = -p[2]; + p = p * -1.0; } chi = std::acos(p[2]); eta = std::atan2(p[1], p[0]); @@ -936,7 +937,6 @@ EbsdLib::Rgb CubicLowOps::generateIPFColor(double phi1, double phi, double phi2, { continue; } - break; } double etaMin = 0.0; @@ -955,7 +955,7 @@ EbsdLib::Rgb CubicLowOps::generateIPFColor(double phi1, double phi, double phi2, chiMax = acos(chiMax); _rgb[0] = 1.0 - chi / chiMax; - _rgb[2] = fabs(etaDeg - etaMin) / (etaMax - etaMin); + _rgb[2] = std::fabs(etaDeg - etaMin) / (etaMax - etaMin); _rgb[1] = 1 - _rgb[2]; _rgb[1] *= chi / chiMax; _rgb[2] *= chi / chiMax; @@ -963,6 +963,20 @@ EbsdLib::Rgb CubicLowOps::generateIPFColor(double phi1, double phi, double phi2, _rgb[1] = sqrt(_rgb[1]); _rgb[2] = sqrt(_rgb[2]); + double max = _rgb[0]; + if(_rgb[1] > max) + { + max = _rgb[1]; + } + if(_rgb[2] > max) + { + max = _rgb[2]; + } + + _rgb[0] = _rgb[0] / max; + _rgb[1] = _rgb[1] / max; + _rgb[2] = _rgb[2] / max; + return EbsdLib::RgbColor::dRgb(static_cast(_rgb[0] * 255), static_cast(_rgb[1] * 255), static_cast(_rgb[2] * 255), 255); } @@ -1161,7 +1175,8 @@ EbsdLib::UInt8ArrayType::Pointer CubicLowOps::generateIPFTriangleLegend(int imag { std::vector dims(1, 4); - EbsdLib::UInt8ArrayType::Pointer image = EbsdLib::UInt8ArrayType::CreateArray(imageDim * imageDim, dims, getSymmetryName() + " Triangle Legend", true); + std::string arrayName = EbsdStringUtils::replace(getSymmetryName(), "/", "_"); + EbsdLib::UInt8ArrayType::Pointer image = EbsdLib::UInt8ArrayType::CreateArray(imageDim * imageDim, dims, arrayName + " Triangle Legend", true); image->initializeWithValue(255); return image; } diff --git a/Source/EbsdLib/LaueOps/CubicOps.cpp b/Source/EbsdLib/LaueOps/CubicOps.cpp index 1e4adf0..4aab0e6 100644 --- a/Source/EbsdLib/LaueOps/CubicOps.cpp +++ b/Source/EbsdLib/LaueOps/CubicOps.cpp @@ -51,6 +51,8 @@ #include "EbsdLib/Math/GeometryMath.h" #include "EbsdLib/Utilities/ColorUtilities.h" #include "EbsdLib/Utilities/ComputeStereographicProjection.h" +#include "EbsdLib/Utilities/EbsdStringUtils.hpp" +#include "EbsdLib/Utilities/ColorTable.h" namespace CubicHigh { @@ -300,7 +302,7 @@ std::array CubicOps::getOdfNumBins() const // ----------------------------------------------------------------------------- std::string CubicOps::getSymmetryName() const { - return "Cubic m-3m"; /* Group 432 */ + return "Cubic m-3m (Oh)"; /* Group 432 */ } // ----------------------------------------------------------------------------- @@ -1716,7 +1718,8 @@ EbsdLib::Rgb CubicOps::generateIPFColor(double phi1, double phi, double phi2, do } EbsdLib::Matrix3X1D refDirection = {refDir0, refDir1, refDir2}; - double chi = 0.0f, eta = 0.0f; + double chi = 0.0f; + double eta = 0.0f; double _rgb[3] = {0.0, 0.0, 0.0}; OrientationType eu(phi1, phi, phi2); @@ -1735,7 +1738,7 @@ EbsdLib::Rgb CubicOps::generateIPFColor(double phi1, double phi, double phi2, do } if(getHasInversion() && p[2] < 0) { - p[0] = -p[0], p[1] = -p[1], p[2] = -p[2]; + p = p * -1.0; } chi = std::acos(p[2]); eta = std::atan2(p[1], p[0]); @@ -1988,7 +1991,8 @@ EbsdLib::UInt8ArrayType::Pointer CubicOps::generateIPFTriangleLegend(int imageDi { std::vector dims(1, 4); - EbsdLib::UInt8ArrayType::Pointer image = EbsdLib::UInt8ArrayType::CreateArray(imageDim * imageDim, dims, getSymmetryName() + " Triangle Legend", true); + std::string arrayName = EbsdStringUtils::replace(getSymmetryName(), "/", "_"); + EbsdLib::UInt8ArrayType::Pointer image = EbsdLib::UInt8ArrayType::CreateArray(imageDim * imageDim, dims, arrayName + " Triangle Legend", true); uint32_t* pixelPtr = reinterpret_cast(image->getPointer(0)); double indexConst1 = 0.414f / static_cast(imageDim); @@ -2014,7 +2018,7 @@ EbsdLib::UInt8ArrayType::Pointer CubicOps::generateIPFTriangleLegend(int imageDi EbsdLib::Rgb color; size_t idx = 0; - size_t yScanLineIndex = imageDim; // We use this to control where the data is drawn. Otherwise the image will come out flipped vertically + size_t yScanLineIndex = imageDim; // We use this to control where the data is drawn. Otherwise, the image will come out flipped vertically // Loop over every pixel in the image and project up to the sphere to get the angle and then figure out the RGB from // there. for(int32_t yIndex = 0; yIndex < imageDim; ++yIndex) diff --git a/Source/EbsdLib/LaueOps/HexagonalLowOps.cpp b/Source/EbsdLib/LaueOps/HexagonalLowOps.cpp index e3340c3..381bca6 100644 --- a/Source/EbsdLib/LaueOps/HexagonalLowOps.cpp +++ b/Source/EbsdLib/LaueOps/HexagonalLowOps.cpp @@ -51,6 +51,7 @@ #include "EbsdLib/Utilities/ColorTable.h" #include "EbsdLib/Utilities/ComputeStereographicProjection.h" #include "EbsdLib/Utilities/PoleFigureUtilities.h" +#include "EbsdLib/Utilities/EbsdStringUtils.hpp" namespace HexagonalLow { @@ -188,7 +189,7 @@ std::array HexagonalLowOps::getOdfNumBins() const // ----------------------------------------------------------------------------- std::string HexagonalLowOps::getSymmetryName() const { - return "Hexagonal 6/m"; + return "Hexagonal 6/m (C6h)"; } // ----------------------------------------------------------------------------- @@ -1471,7 +1472,8 @@ EbsdLib::UInt8ArrayType::Pointer HexagonalLowOps::generateIPFTriangleLegend(int { std::vector dims(1, 4); - EbsdLib::UInt8ArrayType::Pointer image = EbsdLib::UInt8ArrayType::CreateArray(imageDim * imageDim, dims, getSymmetryName() + " Triangle Legend", true); + std::string arrayName = EbsdStringUtils::replace(getSymmetryName(), "/", "_"); + EbsdLib::UInt8ArrayType::Pointer image = EbsdLib::UInt8ArrayType::CreateArray(imageDim * imageDim, dims, arrayName + " Triangle Legend", true); uint32_t* pixelPtr = reinterpret_cast(image->getPointer(0)); double xInc = 1.0 / static_cast(imageDim); @@ -1495,7 +1497,7 @@ EbsdLib::UInt8ArrayType::Pointer HexagonalLowOps::generateIPFTriangleLegend(int EbsdLib::Rgb color; size_t idx = 0; - size_t yScanLineIndex = imageDim - 1; // We use this to control where the data is drawn. Otherwise the image will come out flipped vertically + size_t yScanLineIndex = imageDim - 1; // We use this to control where the data is drawn. Otherwise, the image will come out flipped vertically // Loop over every pixel in the image and project up to the sphere to get the angle and then figure out the RGB from // there. for(int32_t yIndex = 0; yIndex < imageDim; ++yIndex) @@ -1513,7 +1515,7 @@ EbsdLib::UInt8ArrayType::Pointer HexagonalLowOps::generateIPFTriangleLegend(int { color = 0xFFFFFFF; } - else if(sumSquares > (rad - 2 * xInc) && sumSquares < (rad + 2 * xInc)) // Black Border line + else if(sumSquares > (rad - 2 * xInc) && sumSquares < (rad + 2 * xInc)) // Black Borderline { color = 0xFF000000; } diff --git a/Source/EbsdLib/LaueOps/HexagonalOps.cpp b/Source/EbsdLib/LaueOps/HexagonalOps.cpp index 87d14e6..96eac02 100644 --- a/Source/EbsdLib/LaueOps/HexagonalOps.cpp +++ b/Source/EbsdLib/LaueOps/HexagonalOps.cpp @@ -45,6 +45,7 @@ #include "EbsdLib/Utilities/ColorUtilities.h" #include "EbsdLib/Utilities/ComputeStereographicProjection.h" #include "EbsdLib/Utilities/PoleFigureUtilities.h" +#include "EbsdLib/Utilities/EbsdStringUtils.hpp" #ifdef EbsdLib_USE_PARALLEL_ALGORITHMS #include @@ -226,7 +227,7 @@ std::array HexagonalOps::getOdfNumBins() const // ----------------------------------------------------------------------------- std::string HexagonalOps::getSymmetryName() const { - return "Hexagonal 6/mmm"; + return "Hexagonal 6/mmm (D6h)"; } // ----------------------------------------------------------------------------- @@ -1284,7 +1285,8 @@ EbsdLib::Rgb HexagonalOps::generateIPFColor(double phi1, double phi, double phi2 } EbsdLib::Matrix3X1D refDirection = {refDir0, refDir1, refDir2}; - double chi = 0.0f, eta = 0.0f; + double chi = 0.0f; + double eta = 0.0f; double _rgb[3] = {0.0, 0.0, 0.0}; OrientationType eu(phi1, phi, phi2); @@ -1542,7 +1544,8 @@ std::vector HexagonalOps::generatePoleFigure(P EbsdLib::UInt8ArrayType::Pointer HexagonalOps::generateIPFTriangleLegend(int imageDim) const { std::vector dims(1, 4); - EbsdLib::UInt8ArrayType::Pointer image = EbsdLib::UInt8ArrayType::CreateArray(imageDim * imageDim, dims, getSymmetryName() + " Triangle Legend", true); + std::string arrayName = EbsdStringUtils::replace(getSymmetryName(), "/", "_"); + EbsdLib::UInt8ArrayType::Pointer image = EbsdLib::UInt8ArrayType::CreateArray(imageDim * imageDim, dims, arrayName + " Triangle Legend", true); uint32_t* pixelPtr = reinterpret_cast(image->getPointer(0)); double xInc = 1.0f / static_cast(imageDim); @@ -1567,7 +1570,7 @@ EbsdLib::UInt8ArrayType::Pointer HexagonalOps::generateIPFTriangleLegend(int ima EbsdLib::Rgb color; size_t idx = 0; size_t yScanLineIndex = imageDim - 1; // We use this to control where the data - // is drawn. Otherwise the image will come out flipped vertically + // is drawn. Otherwise, the image will come out flipped vertically // Loop over every pixel in the image and project up to the sphere to get the angle and then figure out the RGB from // there. for(int32_t yIndex = 0; yIndex < imageDim; ++yIndex) @@ -1585,7 +1588,7 @@ EbsdLib::UInt8ArrayType::Pointer HexagonalOps::generateIPFTriangleLegend(int ima { color = 0xFFFFFFFF; } - else if(sumSquares > (rad - 2 * xInc) && sumSquares < (rad + 2 * xInc)) // Black Border line + else if(sumSquares > (rad - 2 * xInc) && sumSquares < (rad + 2 * xInc)) // Black Borderline { color = 0xFF000000; } diff --git a/Source/EbsdLib/LaueOps/MonoclinicOps.cpp b/Source/EbsdLib/LaueOps/MonoclinicOps.cpp index f67edba..ba5f8a9 100644 --- a/Source/EbsdLib/LaueOps/MonoclinicOps.cpp +++ b/Source/EbsdLib/LaueOps/MonoclinicOps.cpp @@ -50,6 +50,7 @@ #include "EbsdLib/Math/EbsdLibMath.h" #include "EbsdLib/Utilities/ColorTable.h" #include "EbsdLib/Utilities/ComputeStereographicProjection.h" +#include "EbsdLib/Utilities/EbsdStringUtils.hpp" namespace Monoclinic { @@ -160,7 +161,7 @@ std::array MonoclinicOps::getOdfNumBins() const // ----------------------------------------------------------------------------- std::string MonoclinicOps::getSymmetryName() const { - return "Monoclinic 2/m"; + return "Monoclinic 2/m (C2h)"; } // ----------------------------------------------------------------------------- @@ -604,7 +605,8 @@ EbsdLib::Rgb MonoclinicOps::generateIPFColor(double phi1, double phi, double phi } EbsdLib::Matrix3X1D refDirection = {refDir0, refDir1, refDir2}; - double chi = 0.0f, eta = 0.0f; + double chi = 0.0f; + double eta = 0.0f; double _rgb[3] = {0.0, 0.0, 0.0}; OrientationType eu(phi1, phi, phi2); @@ -863,7 +865,8 @@ EbsdLib::UInt8ArrayType::Pointer MonoclinicOps::generateIPFTriangleLegend(int im { std::vector dims(1, 4); - EbsdLib::UInt8ArrayType::Pointer image = EbsdLib::UInt8ArrayType::CreateArray(imageDim * imageDim, dims, getSymmetryName() + " Triangle Legend", true); + std::string arrayName = EbsdStringUtils::replace(getSymmetryName(), "/", "_"); + EbsdLib::UInt8ArrayType::Pointer image = EbsdLib::UInt8ArrayType::CreateArray(imageDim * imageDim, dims, arrayName + " Triangle Legend", true); uint32_t* pixelPtr = reinterpret_cast(image->getPointer(0)); double xInc = 1.0f / static_cast(imageDim); @@ -884,7 +887,7 @@ EbsdLib::UInt8ArrayType::Pointer MonoclinicOps::generateIPFTriangleLegend(int im EbsdLib::Rgb color; size_t idx = 0; - size_t yScanLineIndex = 0; // We use this to control where the data is drawn. Otherwise the image will come out flipped vertically + size_t yScanLineIndex = 0; // We use this to control where the data is drawn. Otherwise, the image will come out flipped vertically // Loop over every pixel in the image and project up to the sphere to get the angle and then figure out the RGB from // there. for(int32_t yIndex = 0; yIndex < imageDim; ++yIndex) @@ -902,12 +905,12 @@ EbsdLib::UInt8ArrayType::Pointer MonoclinicOps::generateIPFTriangleLegend(int im { color = 0xFFFFFFFF; } - else if(sumSquares > (rad - 2 * xInc) && sumSquares < (rad + 2 * xInc)) // Black Border line + else if(sumSquares > (rad - 2 * xInc) && sumSquares < (rad + 2 * xInc)) // Black Borderline { color = 0xFF000000; } - else if(xIndex == 0) // Black Border line + else if(xIndex == 0) // Black Borderline { color = 0xFF000000; } diff --git a/Source/EbsdLib/LaueOps/OrthoRhombicOps.cpp b/Source/EbsdLib/LaueOps/OrthoRhombicOps.cpp index 4db8f04..3e02e2c 100644 --- a/Source/EbsdLib/LaueOps/OrthoRhombicOps.cpp +++ b/Source/EbsdLib/LaueOps/OrthoRhombicOps.cpp @@ -50,6 +50,7 @@ #include "EbsdLib/Utilities/ColorTable.h" #include "EbsdLib/Utilities/ComputeStereographicProjection.h" #include "EbsdLib/Utilities/PoleFigureUtilities.h" +#include "EbsdLib/Utilities/EbsdStringUtils.hpp" namespace OrthoRhombic { @@ -171,7 +172,7 @@ std::array OrthoRhombicOps::getOdfNumBins() const // ----------------------------------------------------------------------------- std::string OrthoRhombicOps::getSymmetryName() const { - return "OrthoRhombic mmm"; + return "Orthorhombic mmm (D2h)"; } // ----------------------------------------------------------------------------- @@ -615,7 +616,8 @@ EbsdLib::Rgb OrthoRhombicOps::generateIPFColor(double phi1, double phi, double p } EbsdLib::Matrix3X1D refDirection = {refDir0, refDir1, refDir2}; - double chi = 0.0f, eta = 0.0f; + double chi = 0.0f; + double eta = 0.0f; double _rgb[3] = {0.0, 0.0, 0.0}; OrientationType eu(phi1, phi, phi2); @@ -871,7 +873,8 @@ EbsdLib::UInt8ArrayType::Pointer OrthoRhombicOps::generateIPFTriangleLegend(int { std::vector dims(1, 4); - EbsdLib::UInt8ArrayType::Pointer image = EbsdLib::UInt8ArrayType::CreateArray(imageDim * imageDim, dims, getSymmetryName() + " Triangle Legend", true); + std::string arrayName = EbsdStringUtils::replace(getSymmetryName(), "/", "_"); + EbsdLib::UInt8ArrayType::Pointer image = EbsdLib::UInt8ArrayType::CreateArray(imageDim * imageDim, dims, arrayName + " Triangle Legend", true); uint32_t* pixelPtr = reinterpret_cast(image->getPointer(0)); double xInc = 1.0f / static_cast(imageDim); @@ -892,7 +895,7 @@ EbsdLib::UInt8ArrayType::Pointer OrthoRhombicOps::generateIPFTriangleLegend(int EbsdLib::Rgb color; size_t idx = 0; - size_t yScanLineIndex = 0; // We use this to control where the data is drawn. Otherwise the image will come out flipped vertically + size_t yScanLineIndex = 0; // We use this to control where the data is drawn. Otherwise, the image will come out flipped vertically // Loop over every pixel in the image and project up to the sphere to get the angle and then figure out the RGB from // there. for(int32_t yIndex = 0; yIndex < imageDim; ++yIndex) diff --git a/Source/EbsdLib/LaueOps/TetragonalLowOps.cpp b/Source/EbsdLib/LaueOps/TetragonalLowOps.cpp index d883ae0..a021c03 100644 --- a/Source/EbsdLib/LaueOps/TetragonalLowOps.cpp +++ b/Source/EbsdLib/LaueOps/TetragonalLowOps.cpp @@ -50,6 +50,7 @@ #include "EbsdLib/Utilities/ColorTable.h" #include "EbsdLib/Utilities/ComputeStereographicProjection.h" #include "EbsdLib/Utilities/PoleFigureUtilities.h" +#include "EbsdLib/Utilities/EbsdStringUtils.hpp" namespace TetragonalLow { @@ -171,7 +172,7 @@ std::array TetragonalLowOps::getOdfNumBins() const // ----------------------------------------------------------------------------- std::string TetragonalLowOps::getSymmetryName() const { - return "Tetragonal 4/m"; + return "Tetragonal 4/m (C4h)"; } // ----------------------------------------------------------------------------- @@ -606,7 +607,8 @@ EbsdLib::Rgb TetragonalLowOps::generateIPFColor(double phi1, double phi, double } EbsdLib::Matrix3X1D refDirection = {refDir0, refDir1, refDir2}; - double chi = 0.0f, eta = 0.0f; + double chi = 0.0f; + double eta = 0.0f; double _rgb[3] = {0.0, 0.0, 0.0}; OrientationType eu(phi1, phi, phi2); @@ -865,7 +867,8 @@ EbsdLib::UInt8ArrayType::Pointer TetragonalLowOps::generateIPFTriangleLegend(int { std::vector dims(1, 4); - EbsdLib::UInt8ArrayType::Pointer image = EbsdLib::UInt8ArrayType::CreateArray(imageDim * imageDim, dims, getSymmetryName() + " Triangle Legend", true); + std::string arrayName = EbsdStringUtils::replace(getSymmetryName(), "/", "_"); + EbsdLib::UInt8ArrayType::Pointer image = EbsdLib::UInt8ArrayType::CreateArray(imageDim * imageDim, dims, arrayName + " Triangle Legend", true); uint32_t* pixelPtr = reinterpret_cast(image->getPointer(0)); double xInc = 1.0f / static_cast(imageDim); @@ -886,7 +889,7 @@ EbsdLib::UInt8ArrayType::Pointer TetragonalLowOps::generateIPFTriangleLegend(int EbsdLib::Rgb color; size_t idx = 0; - size_t yScanLineIndex = 0; // We use this to control where the data is drawn. Otherwise the image will come out flipped vertically + size_t yScanLineIndex = 0; // We use this to control where the data is drawn. Otherwise, the image will come out flipped vertically // Loop over every pixel in the image and project up to the sphere to get the angle and then figure out the RGB from // there. for(int32_t yIndex = 0; yIndex < imageDim; ++yIndex) diff --git a/Source/EbsdLib/LaueOps/TetragonalOps.cpp b/Source/EbsdLib/LaueOps/TetragonalOps.cpp index 1d81406..3d50784 100644 --- a/Source/EbsdLib/LaueOps/TetragonalOps.cpp +++ b/Source/EbsdLib/LaueOps/TetragonalOps.cpp @@ -51,6 +51,7 @@ #include "EbsdLib/Utilities/ColorTable.h" #include "EbsdLib/Utilities/ComputeStereographicProjection.h" #include "EbsdLib/Utilities/PoleFigureUtilities.h" +#include "EbsdLib/Utilities/EbsdStringUtils.hpp" namespace TetragonalHigh { @@ -197,7 +198,7 @@ std::array TetragonalOps::getOdfNumBins() const // ----------------------------------------------------------------------------- std::string TetragonalOps::getSymmetryName() const { - return "Tetragonal 4/mmm"; + return "Tetragonal 4/mmm (D4h)"; ; } @@ -655,7 +656,8 @@ EbsdLib::Rgb TetragonalOps::generateIPFColor(double phi1, double phi, double phi } EbsdLib::Matrix3X1D refDirection = {refDir0, refDir1, refDir2}; - double chi = 0.0f, eta = 0.0f; + double chi = 0.0f; + double eta = 0.0f; double _rgb[3] = {0.0, 0.0, 0.0}; OrientationType eu(phi1, phi, phi2); @@ -914,7 +916,8 @@ EbsdLib::UInt8ArrayType::Pointer TetragonalOps::generateIPFTriangleLegend(int im { std::vector dims(1, 4); - EbsdLib::UInt8ArrayType::Pointer image = EbsdLib::UInt8ArrayType::CreateArray(imageDim * imageDim, dims, getSymmetryName() + " Triangle Legend", true); + std::string arrayName = EbsdStringUtils::replace(getSymmetryName(), "/", "_"); + EbsdLib::UInt8ArrayType::Pointer image = EbsdLib::UInt8ArrayType::CreateArray(imageDim * imageDim, dims, arrayName + " Triangle Legend", true); uint32_t* pixelPtr = reinterpret_cast(image->getPointer(0)); double xInc = 1.0f / static_cast(imageDim); @@ -935,7 +938,7 @@ EbsdLib::UInt8ArrayType::Pointer TetragonalOps::generateIPFTriangleLegend(int im EbsdLib::Rgb color; size_t idx = 0; - size_t yScanLineIndex = 0; // We use this to control where the data is drawn. Otherwise the image will come out flipped vertically + size_t yScanLineIndex = 0; // We use this to control where the data is drawn. Otherwise, the image will come out flipped vertically // Loop over every pixel in the image and project up to the sphere to get the angle and then figure out the RGB from // there. for(int32_t yIndex = 0; yIndex < imageDim; ++yIndex) diff --git a/Source/EbsdLib/LaueOps/TriclinicOps.cpp b/Source/EbsdLib/LaueOps/TriclinicOps.cpp index df2afd8..019236c 100644 --- a/Source/EbsdLib/LaueOps/TriclinicOps.cpp +++ b/Source/EbsdLib/LaueOps/TriclinicOps.cpp @@ -51,6 +51,7 @@ #include "EbsdLib/Utilities/ColorTable.h" #include "EbsdLib/Utilities/ComputeStereographicProjection.h" #include "EbsdLib/Utilities/PoleFigureUtilities.h" +#include "EbsdLib/Utilities/EbsdStringUtils.hpp" namespace Triclinic { @@ -154,7 +155,7 @@ std::array TriclinicOps::getOdfNumBins() const // ----------------------------------------------------------------------------- std::string TriclinicOps::getSymmetryName() const { - return "Triclinic -1"; + return "Triclinic -1 (Ci)"; } // ----------------------------------------------------------------------------- @@ -595,7 +596,8 @@ EbsdLib::Rgb TriclinicOps::generateIPFColor(double phi1, double phi, double phi2 } EbsdLib::Matrix3X1D refDirection = {refDir0, refDir1, refDir2}; - double chi = 0.0f, eta = 0.0f; + double chi = 0.0f; + double eta = 0.0f; double _rgb[3] = {0.0, 0.0, 0.0}; OrientationType eu(phi1, phi, phi2); @@ -853,7 +855,8 @@ EbsdLib::UInt8ArrayType::Pointer TriclinicOps::generateIPFTriangleLegend(int ima { std::vector dims(1, 4); - EbsdLib::UInt8ArrayType::Pointer image = EbsdLib::UInt8ArrayType::CreateArray(imageDim * imageDim, dims, getSymmetryName() + " Triangle Legend", true); + std::string arrayName = EbsdStringUtils::replace(getSymmetryName(), "/", "_"); + EbsdLib::UInt8ArrayType::Pointer image = EbsdLib::UInt8ArrayType::CreateArray(imageDim * imageDim, dims, arrayName + " Triangle Legend", true); uint32_t* pixelPtr = reinterpret_cast(image->getPointer(0)); double xInc = 1.0f / static_cast(imageDim); @@ -874,7 +877,7 @@ EbsdLib::UInt8ArrayType::Pointer TriclinicOps::generateIPFTriangleLegend(int ima EbsdLib::Rgb color; size_t idx = 0; - size_t yScanLineIndex = 0; // We use this to control where the data is drawn. Otherwise the image will come out flipped vertically + size_t yScanLineIndex = 0; // We use this to control where the data is drawn. Otherwise, the image will come out flipped vertically // Loop over every pixel in the image and project up to the sphere to get the angle and then figure out the RGB from // there. for(int32_t yIndex = 0; yIndex < imageDim; ++yIndex) @@ -892,7 +895,7 @@ EbsdLib::UInt8ArrayType::Pointer TriclinicOps::generateIPFTriangleLegend(int ima { color = 0xFFFFFFFF; } - else if(sumSquares > (rad - 2 * xInc) && sumSquares < (rad + 2 * xInc)) // Black Border line + else if(sumSquares > (rad - 2 * xInc) && sumSquares < (rad + 2 * xInc)) // Black Borderline { color = 0xFF000000; } diff --git a/Source/EbsdLib/LaueOps/TrigonalLowOps.cpp b/Source/EbsdLib/LaueOps/TrigonalLowOps.cpp index 2f207d5..8c7436f 100644 --- a/Source/EbsdLib/LaueOps/TrigonalLowOps.cpp +++ b/Source/EbsdLib/LaueOps/TrigonalLowOps.cpp @@ -52,6 +52,7 @@ #include "EbsdLib/Math/EbsdLibMath.h" #include "EbsdLib/Utilities/ColorTable.h" #include "EbsdLib/Utilities/ComputeStereographicProjection.h" +#include "EbsdLib/Utilities/EbsdStringUtils.hpp" namespace TrigonalLow { @@ -170,7 +171,7 @@ std::array TrigonalLowOps::getOdfNumBins() const // ----------------------------------------------------------------------------- std::string TrigonalLowOps::getSymmetryName() const { - return "Trigonal -3"; + return "Trigonal -3 (C3i)"; } // ----------------------------------------------------------------------------- @@ -644,7 +645,8 @@ EbsdLib::Rgb TrigonalLowOps::generateIPFColor(double phi1, double phi, double ph } EbsdLib::Matrix3X1D refDirection = {refDir0, refDir1, refDir2}; - double chi = 0.0f, eta = 0.0f; + double chi = 0.0f; + double eta = 0.0f; double _rgb[3] = {0.0, 0.0, 0.0}; OrientationType eu(phi1, phi, phi2); @@ -903,7 +905,8 @@ EbsdLib::UInt8ArrayType::Pointer TrigonalLowOps::generateIPFTriangleLegend(int i { std::vector dims(1, 4); - EbsdLib::UInt8ArrayType::Pointer image = EbsdLib::UInt8ArrayType::CreateArray(imageDim * imageDim, dims, getSymmetryName() + " Triangle Legend", true); + std::string arrayName = EbsdStringUtils::replace(getSymmetryName(), "/", "_"); + EbsdLib::UInt8ArrayType::Pointer image = EbsdLib::UInt8ArrayType::CreateArray(imageDim * imageDim, dims, arrayName + " Triangle Legend", true); uint32_t* pixelPtr = reinterpret_cast(image->getPointer(0)); double xInc = 1.0f / static_cast(imageDim); @@ -927,7 +930,7 @@ EbsdLib::UInt8ArrayType::Pointer TrigonalLowOps::generateIPFTriangleLegend(int i EbsdLib::Rgb color; size_t idx = 0; - size_t yScanLineIndex = 0; // We use this to control where the data is drawn. Otherwise the image will come out flipped vertically + size_t yScanLineIndex = 0; // We use this to control where the data is drawn. Otherwise, the image will come out flipped vertically // Loop over every pixel in the image and project up to the sphere to get the angle and then figure out the RGB from // there. for(int32_t yIndex = 0; yIndex < imageDim; ++yIndex) @@ -945,7 +948,7 @@ EbsdLib::UInt8ArrayType::Pointer TrigonalLowOps::generateIPFTriangleLegend(int i { color = 0xFFFFFFFF; } - else if(fabs(y - yInc) <= yInc && x >= 0.0) // Black Border line + else if(fabs(y - yInc) <= yInc && x >= 0.0) // Black Borderline { color = 0xFF000000; } @@ -957,7 +960,7 @@ EbsdLib::UInt8ArrayType::Pointer TrigonalLowOps::generateIPFTriangleLegend(int i { color = 0xFF000000; } - else if(sumSquares > (rad - 2 * xInc) && sumSquares < (rad + 2 * xInc)) // Black Border line on circle + else if(sumSquares > (rad - 2 * xInc) && sumSquares < (rad + 2 * xInc)) // Black Borderline on circle { color = 0xFF000000; } diff --git a/Source/EbsdLib/LaueOps/TrigonalOps.cpp b/Source/EbsdLib/LaueOps/TrigonalOps.cpp index 95c0a99..5e1f072 100644 --- a/Source/EbsdLib/LaueOps/TrigonalOps.cpp +++ b/Source/EbsdLib/LaueOps/TrigonalOps.cpp @@ -51,6 +51,7 @@ #include "EbsdLib/Utilities/ColorTable.h" #include "EbsdLib/Utilities/ComputeStereographicProjection.h" #include "EbsdLib/Utilities/PoleFigureUtilities.h" +#include "EbsdLib/Utilities/EbsdStringUtils.hpp" namespace TrigonalHigh { @@ -186,7 +187,7 @@ std::array TrigonalOps::getOdfNumBins() const // ----------------------------------------------------------------------------- std::string TrigonalOps::getSymmetryName() const { - return "Trigonal 3m"; + return "Trigonal -3m (D3d)"; } // ----------------------------------------------------------------------------- // @@ -662,7 +663,8 @@ EbsdLib::Rgb TrigonalOps::generateIPFColor(double phi1, double phi, double phi2, } EbsdLib::Matrix3X1D refDirection = {refDir0, refDir1, refDir2}; - double chi = 0.0f, eta = 0.0f; + double chi = 0.0f; + double eta = 0.0f; double _rgb[3] = {0.0, 0.0, 0.0}; OrientationType eu(phi1, phi, phi2); @@ -916,7 +918,8 @@ EbsdLib::UInt8ArrayType::Pointer TrigonalOps::generateIPFTriangleLegend(int imag { std::vector dims(1, 4); - EbsdLib::UInt8ArrayType::Pointer image = EbsdLib::UInt8ArrayType::CreateArray(imageDim * imageDim, dims, getSymmetryName() + " Triangle Legend", true); + std::string arrayName = EbsdStringUtils::replace(getSymmetryName(), "/", "_"); + EbsdLib::UInt8ArrayType::Pointer image = EbsdLib::UInt8ArrayType::CreateArray(imageDim * imageDim, dims, arrayName + " Triangle Legend", true); uint32_t* pixelPtr = reinterpret_cast(image->getPointer(0)); double xInc = 1.0f / static_cast(imageDim); @@ -940,7 +943,7 @@ EbsdLib::UInt8ArrayType::Pointer TrigonalOps::generateIPFTriangleLegend(int imag EbsdLib::Rgb color; size_t idx = 0; - size_t yScanLineIndex = 0; // We use this to control where the data is drawn. Otherwise the image will come out flipped vertically + size_t yScanLineIndex = 0; // We use this to control where the data is drawn. Otherwise, the image will come out flipped vertically // Loop over every pixel in the image and project up to the sphere to get the angle and then figure out the RGB from // there. for(int32_t yIndex = 0; yIndex < imageDim; ++yIndex) @@ -958,7 +961,7 @@ EbsdLib::UInt8ArrayType::Pointer TrigonalOps::generateIPFTriangleLegend(int imag { color = 0xFFFFFFFF; } - else if(sumSquares > (rad - 2 * xInc) && sumSquares < (rad + 2 * xInc)) // Black Border line + else if(sumSquares > (rad - 2 * xInc) && sumSquares < (rad + 2 * xInc)) // Black Borderline { color = 0xFF000000; }