diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 86221ba851..f9ff17d296 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -20,12 +20,9 @@ jobs: os: - ubuntu-20.04 cxx: - - g++-9 - g++-10 - clang++-10 include: - - cxx: g++-9 - cc: gcc-9 - cxx: g++-10 cc: gcc-10 - cxx: clang++-10 diff --git a/CMakeLists.txt b/CMakeLists.txt index 53e017ecd8..35cb04f916 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,7 +101,7 @@ list(APPEND CMAKE_MODULE_PATH ${simplnx_SOURCE_DIR}/cmake) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(SIMPLNX_DEBUG_POSTFIX "_d") diff --git a/cmake/Utility.cmake b/cmake/Utility.cmake index 9a0c6232f8..e20c4639e1 100644 --- a/cmake/Utility.cmake +++ b/cmake/Utility.cmake @@ -51,6 +51,8 @@ function(simplnx_enable_warnings) if(MSVC) target_compile_options(${ARG_TARGET} + PUBLIC + /Zc:__cplusplus # Enables the __cplusplus preprocessor macro to report an updated value for recent C++ language standards support. By default, Visual Studio always returns the value 199711L for the __cplusplus preprocessor macro. PRIVATE # Suppressed warnings /wd4275 # C4275: An exported class was derived from a class that wasn't exported. diff --git a/src/Plugins/OrientationAnalysis/CMakeLists.txt b/src/Plugins/OrientationAnalysis/CMakeLists.txt index 5e92d576a2..8a61f045ec 100644 --- a/src/Plugins/OrientationAnalysis/CMakeLists.txt +++ b/src/Plugins/OrientationAnalysis/CMakeLists.txt @@ -370,15 +370,15 @@ if(EXISTS "${DREAM3D_DATA_DIR}" AND SIMPLNX_DOWNLOAD_TEST_FILES) set_target_properties(Copy_${PLUGIN_NAME}_Small_IN100 PROPERTIES FOLDER ZZ_COPY_FILES) download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} - ARCHIVE_NAME 6_6_caxis_data.tar.gz - SHA512 6c3eefac62aecf3344de735c0df932dd9a2623653f39174ec72402c54e8911402ad9903ae2122bc23ff2dba8c94973b2882715908e1913973dff604b614a5293 + ARCHIVE_NAME caxis_data.tar.gz + SHA512 56468d3f248661c0d739d9acd5a1554abc700bf136586f698a313804536916850b731603d42a0b93aae47faf2f7ee49d4181b1c3e833f054df6f5c70b5e041dc ) add_custom_target(Copy_${PLUGIN_NAME}_CAxis_Data ALL - COMMAND ${CMAKE_COMMAND} -E tar xzf "${DREAM3D_DATA_DIR}/TestFiles/6_6_caxis_data.tar.gz" - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${DREAM3D_DATA_DIR}/TestFiles/6_6_caxis_data/Combo-EBSD-120130.osc_r0c0.ang" "${DATA_DEST_DIR}/OrientationAnalysis/Combo-EBSD-120130.osc_r0c0.ang" - COMMAND ${CMAKE_COMMAND} -E rm -rf "${DREAM3D_DATA_DIR}/TestFiles/6_6_caxis_data" + COMMAND ${CMAKE_COMMAND} -E tar xzf "${DREAM3D_DATA_DIR}/TestFiles/caxis_data.tar.gz" + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${DREAM3D_DATA_DIR}/TestFiles/caxis_data/Combo-EBSD-120130.osc_r0c0.ang" "${DATA_DEST_DIR}/OrientationAnalysis/Combo-EBSD-120130.osc_r0c0.ang" + COMMAND ${CMAKE_COMMAND} -E rm -rf "${DREAM3D_DATA_DIR}/TestFiles/caxis_data" WORKING_DIRECTORY "${DREAM3D_DATA_DIR}/TestFiles" - COMMENT "Copying ${PLUGIN_NAME}/6_6_caxis_data data into Binary Directory" + COMMENT "Copying ${PLUGIN_NAME}/caxis_data data into Binary Directory" DEPENDS Fetch_Remote_Data_Files # Make sure all remote files are downloaded before trying this COMMAND_EXPAND_LISTS VERBATIM diff --git a/src/Plugins/OrientationAnalysis/docs/ComputeFeatureNeighborCAxisMisalignmentsFilter.md b/src/Plugins/OrientationAnalysis/docs/ComputeFeatureNeighborCAxisMisalignmentsFilter.md index e2258ad92c..b2537304d5 100644 --- a/src/Plugins/OrientationAnalysis/docs/ComputeFeatureNeighborCAxisMisalignmentsFilter.md +++ b/src/Plugins/OrientationAnalysis/docs/ComputeFeatureNeighborCAxisMisalignmentsFilter.md @@ -12,6 +12,8 @@ This **Filter** determines, for each **Feature**, the C-axis misalignments with **NOTE:** Only features with identical phase values and a crystal structure of **Hexagonal_High** will be calculated. If two features have different phase values or a crystal structure that is *not* Hexagonal_High then a value of NaN is set for the misorientation. +Results from this filter can differ from its original version in DREAM3D 6.6 by around 0.0001. This version uses double precision in part of its calculation to improve agreement and accuracy between platforms (notably ARM). + % Auto generated parameter table will be inserted here ## Example Pipelines diff --git a/src/Plugins/OrientationAnalysis/docs/ComputeFeatureReferenceCAxisMisorientationsFilter.md b/src/Plugins/OrientationAnalysis/docs/ComputeFeatureReferenceCAxisMisorientationsFilter.md index 60e7c87d36..083e06d5c4 100644 --- a/src/Plugins/OrientationAnalysis/docs/ComputeFeatureReferenceCAxisMisorientationsFilter.md +++ b/src/Plugins/OrientationAnalysis/docs/ComputeFeatureReferenceCAxisMisorientationsFilter.md @@ -10,6 +10,8 @@ This **Filter** calculates the misorientation angle between the C-axis of each * This filter requires at least one Hexagonal crystal structure phase (Hexagonal-Low 6/m or Hexagonal-High 6/mmm). Although it is not recommended, you can give input data with mixed phase types and all non hexagonal phases will be skipped in the calculations. +Results from this filter can differ from its original version in DREAM3D 6.6 by around 0.0001. This version uses double precision in part of its calculation to improve agreement and accuracy between platforms (notably ARM). + % Auto generated parameter table will be inserted here ## Example Pipelines diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFeatureNeighborCAxisMisalignments.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFeatureNeighborCAxisMisalignments.cpp index 8803e0f278..e2cd290907 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFeatureNeighborCAxisMisalignments.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFeatureNeighborCAxisMisalignments.cpp @@ -73,10 +73,7 @@ Result<> ComputeFeatureNeighborCAxisMisalignments::operator()() std::vector> misalignmentLists; misalignmentLists.resize(totalFeatures); - float32 w = 0.0f; - Eigen::Vector3f c1{0.0f, 0.0f, 0.0f}; - Eigen::Vector3f c2{0.0f, 0.0f, 0.0f}; - const Eigen::Vector3f cAxis{0.0f, 0.0f, 1.0f}; + const Eigen::Vector3d cAxis{0.0, 0.0, 1.0}; usize hexNeighborListSize = 0; uint32 phase1 = 0, phase2 = 0; usize nName = 0; @@ -85,44 +82,43 @@ Result<> ComputeFeatureNeighborCAxisMisalignments::operator()() phase1 = crystalStructures[featurePhases[i]]; const usize quatTupleIndex1 = i * numQuatComps; - OrientationF oMatrix1 = - OrientationTransformation::qu2om({avgQuats[quatTupleIndex1], avgQuats[quatTupleIndex1 + 1], avgQuats[quatTupleIndex1 + 2], avgQuats[quatTupleIndex1 + 3]}); + OrientationD oMatrix1 = + OrientationTransformation::qu2om({avgQuats[quatTupleIndex1], avgQuats[quatTupleIndex1 + 1], avgQuats[quatTupleIndex1 + 2], avgQuats[quatTupleIndex1 + 3]}); // transpose the g matrix so when c-axis is multiplied by it // it will give the sample direction that the c-axis is along - c1 = OrientationMatrixToGMatrixTranspose(oMatrix1) * cAxis; + Eigen::Vector3d c1 = OrientationMatrixToGMatrixTranspose(oMatrix1) * cAxis; // normalize so that the dot product can be taken below without // dividing by the magnitudes (they would be 1) c1.normalize(); misalignmentLists[i].resize(neighborList[i].size(), -1.0f); for(usize j = 0; j < neighborList[i].size(); j++) { - w = std::numeric_limits::max(); nName = neighborList[i][j]; phase2 = crystalStructures[featurePhases[nName]]; hexNeighborListSize = neighborList[i].size(); if(phase1 == phase2 && (phase1 == EbsdLib::CrystalStructure::Hexagonal_High || phase1 == EbsdLib::CrystalStructure::Hexagonal_Low)) { const usize quatTupleIndex2 = nName * numQuatComps; - OrientationF oMatrix2 = - OrientationTransformation::qu2om({avgQuats[quatTupleIndex2], avgQuats[quatTupleIndex2 + 1], avgQuats[quatTupleIndex2 + 2], avgQuats[quatTupleIndex2 + 3]}); + OrientationD oMatrix2 = + OrientationTransformation::qu2om({avgQuats[quatTupleIndex2], avgQuats[quatTupleIndex2 + 1], avgQuats[quatTupleIndex2 + 2], avgQuats[quatTupleIndex2 + 3]}); // transpose the g matrix so when c-axis is multiplied by it // it will give the sample direction that the c-axis is along - c2 = OrientationMatrixToGMatrixTranspose(oMatrix2) * cAxis; + Eigen::Vector3d c2 = OrientationMatrixToGMatrixTranspose(oMatrix2) * cAxis; // normalize so that the dot product can be taken below without // dividing by the magnitudes (they would be 1) c2.normalize(); - w = ImageRotationUtilities::CosBetweenVectors(c1, c2); - w = std::clamp(w, -1.0f, 1.0f); - w = acosf(w); - if(w > (Constants::k_PiF / 2)) + float64 w = ImageRotationUtilities::CosBetweenVectors(c1, c2); + w = std::clamp(w, -1.0, 1.0); + w = std::acos(w); + if(w > (Constants::k_PiD / 2.0)) { - w = Constants::k_PiF - w; + w = Constants::k_PiD - w; } - misalignmentLists[i][j] = w * Constants::k_180OverPiF; + misalignmentLists[i][j] = static_cast(w * Constants::k_180OverPiD); if(m_InputValues->FindAvgMisals) { avgCAxisMisalignment[i] += misalignmentLists[i][j]; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFeatureReferenceCAxisMisorientations.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFeatureReferenceCAxisMisorientations.cpp index d39a2891e4..9b19499762 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFeatureReferenceCAxisMisorientations.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFeatureReferenceCAxisMisorientations.cpp @@ -10,7 +10,6 @@ #include "EbsdLib/Core/Orientation.hpp" #include "EbsdLib/Core/OrientationTransformation.hpp" #include "EbsdLib/Core/Quaternion.hpp" - #include #include @@ -78,11 +77,10 @@ Result<> ComputeFeatureReferenceCAxisMisorientations::operator()() const usize totalPoints = featureIds.getNumberOfTuples(); const usize totalFeatures = avgCAxes.getNumberOfTuples(); - const int32 avgMisComps = 3; + static constexpr usize k_AvgMisComps = 3; const usize numQuatComps = quats.getNumberOfComponents(); - std::vector avgMis(totalFeatures * avgMisComps, 0); + std::vector avgMis(totalFeatures * k_AvgMisComps, 0.0f); - float32 w = 0.0f; SizeVec3 uDims = m_DataStructure.getDataRefAs(m_InputValues->ImageGeometryPath).getDimensions(); // We have more points than can be allocated on a 32 bit machine. Assert Now. @@ -94,52 +92,44 @@ Result<> ComputeFeatureReferenceCAxisMisorientations::operator()() const auto xPoints = static_cast(uDims[0]); const auto yPoints = static_cast(uDims[1]); const auto zPoints = static_cast(uDims[2]); - int64 point = 0; - - Matrix3fR g1T; - g1T.fill(0.0f); - const Eigen::Vector3f cAxis{0.0f, 0.0f, 1.0f}; - Eigen::Vector3f c1{0.0f, 0.0f, 0.0f}; - Eigen::Vector3f avgCAxisMis = {0.0f, 0.0f, 0.0f}; - usize index = 0; + + const Eigen::Vector3d cAxis{0.0, 0.0, 1.0}; for(int64 col = 0; col < xPoints; col++) { for(int64 row = 0; row < yPoints; row++) { for(int64 plane = 0; plane < zPoints; plane++) { - point = (plane * xPoints * yPoints) + (row * xPoints) + col; - const auto quatTupleIndex = point * numQuatComps; - const auto crystalStructureType = crystalStructures[cellPhases[point]]; + int64 point = (plane * xPoints * yPoints) + (row * xPoints) + col; + const usize quatTupleIndex = point * numQuatComps; + const uint32 crystalStructureType = crystalStructures[cellPhases[point]]; const bool isHex = crystalStructureType == EbsdLib::CrystalStructure::Hexagonal_High || crystalStructureType == EbsdLib::CrystalStructure::Hexagonal_Low; if(featureIds[point] > 0 && cellPhases[point] > 0 && isHex) { - OrientationF oMatrix = - OrientationTransformation::qu2om>({quats[quatTupleIndex], quats[quatTupleIndex + 1], quats[quatTupleIndex + 2], quats[quatTupleIndex + 3]}); + OrientationD oMatrix = + OrientationTransformation::qu2om>({quats[quatTupleIndex], quats[quatTupleIndex + 1], quats[quatTupleIndex + 2], quats[quatTupleIndex + 3]}); // transpose the g matrices so when caxis is multiplied by it, it will give the sample direction that the caxis is along - g1T = OrientationMatrixToGMatrixTranspose(oMatrix); - c1 = g1T * cAxis; + Matrix3dR g1T = OrientationMatrixToGMatrixTranspose(oMatrix); + Eigen::Vector3d c1 = g1T * cAxis; // normalize so that the magnitude is 1 c1.normalize(); - avgCAxisMis[0] = avgCAxes[3 * featureIds[point]]; - avgCAxisMis[1] = avgCAxes[3 * featureIds[point] + 1]; - avgCAxisMis[2] = avgCAxes[3 * featureIds[point] + 2]; + Eigen::Vector3d avgCAxisMis = {avgCAxes[3 * featureIds[point]], avgCAxes[3 * featureIds[point] + 1], avgCAxes[3 * featureIds[point] + 2]}; // normalize so that the magnitude is 1 avgCAxisMis.normalize(); - w = ImageRotationUtilities::CosBetweenVectors(c1, avgCAxisMis); - w = std::clamp(w, -1.0f, 1.0f); - w = acosf(w); - w *= Constants::k_180OverPiF; - if(w > 90.0f) + float64 w = ImageRotationUtilities::CosBetweenVectors(c1, avgCAxisMis); + w = std::clamp(w, -1.0, 1.0); + w = std::acos(w); + w *= Constants::k_180OverPiD; + if(w > 90.0) { - w = 180.0f - w; + w = 180.0 - w; } - featRefCAxisMis[point] = w; - index = featureIds[point] * avgMisComps; + featRefCAxisMis[point] = static_cast(w); + usize index = featureIds[point] * k_AvgMisComps; avgMis[index]++; - avgMis[index + 1] += w; + avgMis[index + 1] += static_cast(w); } else { @@ -155,10 +145,10 @@ Result<> ComputeFeatureReferenceCAxisMisorientations::operator()() { m_MessageHandler(IFilter::Message::Type::Info, fmt::format("Working On Feature {} of {}", i, totalFeatures)); } - index = i * avgMisComps; + usize index = i * k_AvgMisComps; if(avgMis[index] == 0.0f) { - featAvgCAxisMis[i] = 0.0; + featAvgCAxisMis[i] = 0.0f; } else { @@ -170,19 +160,19 @@ Result<> ComputeFeatureReferenceCAxisMisorientations::operator()() for(usize j = 0; j < totalPoints; j++) { gNum = featureIds[j]; - avgMis[(gNum * avgMisComps) + 2] += ((featRefCAxisMis[j] - featAvgCAxisMis[gNum]) * (featRefCAxisMis[j] - featAvgCAxisMis[gNum])); + avgMis[(gNum * k_AvgMisComps) + 2] += ((featRefCAxisMis[j] - featAvgCAxisMis[gNum]) * (featRefCAxisMis[j] - featAvgCAxisMis[gNum])); } for(usize i = 1; i < totalFeatures; i++) { - index = i * avgMisComps; + usize index = i * k_AvgMisComps; if(avgMis[index] == 0.0f) { featStdevCAxisMis[i] = 0.0f; } else { - featStdevCAxisMis[i] = std::sqrt((1 / avgMis[index]) * avgMis[index + 2]); + featStdevCAxisMis[i] = std::sqrt((1.0f / avgMis[index]) * avgMis[index + 2]); } } diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBCDMetricBased.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBCDMetricBased.cpp index b3886c3b6e..166e7b142e 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBCDMetricBased.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBCDMetricBased.cpp @@ -91,12 +91,6 @@ class TrianglesSelector m_NSym = m_OrientationOps[m_Crystal]->getNumSymOps(); } - virtual ~TrianglesSelector() = default; - TrianglesSelector(const TrianglesSelector&) = default; - TrianglesSelector(TrianglesSelector&&) noexcept = delete; - TrianglesSelector& operator=(const TrianglesSelector&) = delete; - TrianglesSelector& operator=(TrianglesSelector&&) noexcept = delete; - void select(usize start, usize end) const { Eigen::Vector3d g1ea = {0.0, 0.0, 0.0}; @@ -270,12 +264,6 @@ class ProbeDistribution { } - virtual ~ProbeDistribution() = default; - ProbeDistribution(const ProbeDistribution&) = default; - ProbeDistribution(ProbeDistribution&&) noexcept = delete; - ProbeDistribution& operator=(const ProbeDistribution&) = delete; - ProbeDistribution& operator=(ProbeDistribution&&) noexcept = delete; - void probe(usize start, usize end) const { diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBPDMetricBased.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBPDMetricBased.cpp index 57c69a94e8..2ba0859225 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBPDMetricBased.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBPDMetricBased.cpp @@ -89,12 +89,6 @@ class TrianglesSelector m_NSym = m_OrientationOps[m_Crystal]->getNumSymOps(); } - virtual ~TrianglesSelector() = default; - TrianglesSelector(const TrianglesSelector&) = default; - TrianglesSelector(TrianglesSelector&&) noexcept = delete; - TrianglesSelector& operator=(const TrianglesSelector&) = delete; - TrianglesSelector& operator=(TrianglesSelector&&) noexcept = delete; - void select(usize start, usize end) const { Eigen::Vector3d g1ea = {0.0, 0.0, 0.0}; @@ -206,12 +200,6 @@ class ProbeDistribution m_NSym = m_OrientationOps[crystal]->getNumSymOps(); } - virtual ~ProbeDistribution() = default; - ProbeDistribution(const ProbeDistribution&) = default; - ProbeDistribution(ProbeDistribution&&) noexcept = delete; - ProbeDistribution& operator=(const ProbeDistribution&) = delete; - ProbeDistribution& operator=(ProbeDistribution&&) noexcept = delete; - void probe(usize start, usize end) const { for(usize ptIdx = start; ptIdx < end; ptIdx++) diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeQuaternionConjugate.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeQuaternionConjugate.cpp index 57b63a1de1..cb11bd6bde 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeQuaternionConjugate.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeQuaternionConjugate.cpp @@ -22,12 +22,6 @@ class ComputeQuaternionConjugateImpl , m_ShouldCancel(shouldCancel) { } - ComputeQuaternionConjugateImpl(const ComputeQuaternionConjugateImpl&) = default; // Copy Constructor - ComputeQuaternionConjugateImpl(ComputeQuaternionConjugateImpl&&) = delete; // Move Constructor Not Implemented - ComputeQuaternionConjugateImpl& operator=(const ComputeQuaternionConjugateImpl&) = delete; // Copy Assignment Not Implemented - ComputeQuaternionConjugateImpl& operator=(ComputeQuaternionConjugateImpl&&) = delete; // Move Assignment Not Implemented - - virtual ~ComputeQuaternionConjugateImpl() = default; void convert(size_t start, size_t end) const { diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ConvertQuaternion.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ConvertQuaternion.cpp index ec9a06b0d1..da0f6d2de1 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ConvertQuaternion.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ConvertQuaternion.cpp @@ -24,12 +24,6 @@ class ConvertQuaternionImpl , m_ShouldCancel(shouldCancel) { } - virtual ~ConvertQuaternionImpl() = default; - - ConvertQuaternionImpl(const ConvertQuaternionImpl&) = default; // Copy Constructor Default Implemented - ConvertQuaternionImpl(ConvertQuaternionImpl&&) = delete; // Move Constructor Not Implemented - ConvertQuaternionImpl& operator=(const ConvertQuaternionImpl&) = delete; // Copy Assignment Not Implemented - ConvertQuaternionImpl& operator=(ConvertQuaternionImpl&&) = delete; // Move Assignment Not Implemented void convert(size_t start, size_t end) const { diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/RodriguesConvertor.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/RodriguesConvertor.cpp index c47d239b6b..7f61ebbb01 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/RodriguesConvertor.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/RodriguesConvertor.cpp @@ -22,12 +22,6 @@ class RodriguesConvertorImpl , m_ShouldCancel(shouldCancel) { } - RodriguesConvertorImpl(const RodriguesConvertorImpl&) = default; // Copy Constructor - RodriguesConvertorImpl(RodriguesConvertorImpl&&) = delete; // Move Constructor Not Implemented - RodriguesConvertorImpl& operator=(const RodriguesConvertorImpl&) = delete; // Copy Assignment Not Implemented - RodriguesConvertorImpl& operator=(RodriguesConvertorImpl&&) = delete; // Move Assignment Not Implemented - - virtual ~RodriguesConvertorImpl() = default; void convert(size_t start, size_t end) const { diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Parameters/OEMEbsdScanSelectionParameter.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Parameters/OEMEbsdScanSelectionParameter.cpp index eede3d5a43..1fc0404efa 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Parameters/OEMEbsdScanSelectionParameter.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Parameters/OEMEbsdScanSelectionParameter.cpp @@ -123,7 +123,7 @@ Result OEMEbsdScanSelectionParameter::fromJson(const nlohmann::json& j { if(!jsonScanNames.is_array()) { - return MakeErrorResult(-6054, fmt::format("{}JSON value for key '{} / {}' is not an array", prefix, name())); + return MakeErrorResult(-6054, fmt::format("{}JSON value for key '{} / {}' is not an array", prefix, name(), k_ScanNames)); } const auto scanNameStrings = jsonScanNames.get>(); std::list scanNames; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Parameters/ReadH5EbsdFileParameter.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Parameters/ReadH5EbsdFileParameter.cpp index 60ae064d9e..27fb833804 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Parameters/ReadH5EbsdFileParameter.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Parameters/ReadH5EbsdFileParameter.cpp @@ -150,7 +150,7 @@ Result ReadH5EbsdFileParameter::fromJson(const nlohmann::json& json) c { if(!jsonDataPaths.is_array()) { - return MakeErrorResult(-6054, fmt::format("{}JSON value for key '{} / {}' is not an array", prefix, name())); + return MakeErrorResult(-6054, fmt::format("{}JSON value for key '{} / {}' is not an array", prefix, name(), k_HDF5DataPaths)); } auto dataPathStrings = jsonDataPaths.get>(); std::vector dataPaths; diff --git a/src/Plugins/OrientationAnalysis/test/CAxisSegmentFeaturesTest.cpp b/src/Plugins/OrientationAnalysis/test/CAxisSegmentFeaturesTest.cpp index 01a69d4fda..8dfc6b4230 100644 --- a/src/Plugins/OrientationAnalysis/test/CAxisSegmentFeaturesTest.cpp +++ b/src/Plugins/OrientationAnalysis/test/CAxisSegmentFeaturesTest.cpp @@ -21,10 +21,10 @@ const std::string k_ComputedCellFeatureData = "NX_CellFeatureData"; TEST_CASE("OrientationAnalysis::CAxisSegmentFeaturesFilter: Valid Filter Execution", "[OrientationAnalysis][CAxisSegmentFeaturesFilter]") { Application::GetOrCreateInstance()->loadPlugins(unit_test::k_BuildDir.view(), true); - const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "6_6_caxis_data.tar.gz", "6_6_caxis_data"); + const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "caxis_data.tar.gz", "caxis_data"); // Read Exemplar DREAM3D File Filter - auto exemplarFilePath = fs::path(fmt::format("{}/6_6_caxis_data/6_6_caxis_segment_features.dream3d", unit_test::k_TestFilesDir)); + auto exemplarFilePath = fs::path(fmt::format("{}/caxis_data/6_6_caxis_segment_features.dream3d", unit_test::k_TestFilesDir)); DataStructure dataStructure = UnitTest::LoadDataStructure(exemplarFilePath); // CAxis Segment Features Filter @@ -70,10 +70,10 @@ TEST_CASE("OrientationAnalysis::CAxisSegmentFeaturesFilter: Valid Filter Executi TEST_CASE("OrientationAnalysis::CAxisSegmentFeaturesFilter: Invalid Filter Execution", "[OrientationAnalysis][CAxisSegmentFeaturesFilter]") { Application::GetOrCreateInstance()->loadPlugins(unit_test::k_BuildDir.view(), true); - const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "6_6_caxis_data.tar.gz", "6_6_caxis_data"); + const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "caxis_data.tar.gz", "caxis_data"); // Read Exemplar DREAM3D File Filter - auto exemplarFilePath = fs::path(fmt::format("{}/6_6_caxis_data/6_6_find_caxis_data.dream3d", unit_test::k_TestFilesDir)); + auto exemplarFilePath = fs::path(fmt::format("{}/caxis_data/7_0_find_caxis_data.dream3d", unit_test::k_TestFilesDir)); DataStructure dataStructure = UnitTest::LoadDataStructure(exemplarFilePath); auto& crystalStructs = dataStructure.getDataRefAs(k_CrystalStructuresArrayPath); diff --git a/src/Plugins/OrientationAnalysis/test/CMakeLists.txt b/src/Plugins/OrientationAnalysis/test/CMakeLists.txt index 4e48073423..ae5d959ff8 100644 --- a/src/Plugins/OrientationAnalysis/test/CMakeLists.txt +++ b/src/Plugins/OrientationAnalysis/test/CMakeLists.txt @@ -120,7 +120,7 @@ if(EXISTS "${DREAM3D_DATA_DIR}" AND SIMPLNX_DOWNLOAD_TEST_FILES) download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} ARCHIVE_NAME 6_6_ImportH5Data.tar.gz SHA512 68cf620d28a515d04040d66c4f8fa9d8d46707c65138b366b47f40d1d56a36c40e2e2cd0c9d35168b68c2cb5b2ce95650fa2a0d4e6ffce980d0dd0654908f40d) download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} ARCHIVE_NAME 6_6_Small_IN100_GBCD.tar.gz SHA512 543e3bdcee24ff9e5cd80dfdedc39ceef1529e7172cebd01d8e5518292ffdf4e0eb2e79d75854cb3eaca5c60e19c861ca67f369e21b81c306edb66327f47a1e3) download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} ARCHIVE_NAME 6_6_align_sections_misorientation.tar.gz SHA512 2343654a8bcb344fcc613b6715c1e0b2c780fedbdf06cc8e5306b23f9d7908d5eef8faff7e3f0dd6f7ac734a1c6e2b376832bed38548288cd5e9e0af1b5602a8) - download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} ARCHIVE_NAME 6_6_caxis_data.tar.gz SHA512 6c3eefac62aecf3344de735c0df932dd9a2623653f39174ec72402c54e8911402ad9903ae2122bc23ff2dba8c94973b2882715908e1913973dff604b614a5293) + download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} ARCHIVE_NAME caxis_data.tar.gz SHA512 56468d3f248661c0d739d9acd5a1554abc700bf136586f698a313804536916850b731603d42a0b93aae47faf2f7ee49d4181b1c3e833f054df6f5c70b5e041dc) download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} ARCHIVE_NAME 6_6_ebsd_segment_features.tar.gz SHA512 acbb493a0668e0115ac49d4fedbbf7600759b9a66deb5d1004c2749a61d2bad2fcc60344bf72b2aeda5c8c098f458949dd1f8d58cb21682fa1393dfb7d0a1b84) download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} ARCHIVE_NAME 6_6_find_gbcd_metric_based.tar.gz SHA512 46032c758acc982eccaff38c3252a4f063b6ff5dc9ba3f33ed7f123c6f10771e1a2bdcbff8aab0fae7c91c03bb6025f49f0edbb085b3946b93b87980d31e4543) download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} ARCHIVE_NAME 6_6_stats_test.tar.gz SHA512 cb1d1c004ab5a3cb29cc10f7b6c291dd5819e57e303242b8162cd0b268dea24b1d3e5e3811ec4f5ee216179b6eb6b81c76ee7d37b7c49e83c6ab336147b4b14e) diff --git a/src/Plugins/OrientationAnalysis/test/ComputeAvgCAxesTest.cpp b/src/Plugins/OrientationAnalysis/test/ComputeAvgCAxesTest.cpp index 3b7c7e6244..6468f6770e 100644 --- a/src/Plugins/OrientationAnalysis/test/ComputeAvgCAxesTest.cpp +++ b/src/Plugins/OrientationAnalysis/test/ComputeAvgCAxesTest.cpp @@ -18,10 +18,10 @@ TEST_CASE("OrientationAnalysis::ComputeAvgCAxesFilter: Valid Filter Execution", { Application::GetOrCreateInstance()->loadPlugins(unit_test::k_BuildDir.view(), true); - const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "6_6_caxis_data.tar.gz", "6_6_caxis_data"); + const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "caxis_data.tar.gz", "caxis_data"); // Read Exemplar DREAM3D File Filter - auto exemplarFilePath = fs::path(fmt::format("{}/6_6_caxis_data/6_6_find_caxis_data.dream3d", unit_test::k_TestFilesDir)); + auto exemplarFilePath = fs::path(fmt::format("{}/caxis_data/7_0_find_caxis_data.dream3d", unit_test::k_TestFilesDir)); DataStructure dataStructure = UnitTest::LoadDataStructure(exemplarFilePath); // Instantiate the filter, a DataStructure object and an Arguments Object @@ -52,10 +52,10 @@ TEST_CASE("OrientationAnalysis::ComputeAvgCAxesFilter: Invalid Filter Execution" { Application::GetOrCreateInstance()->loadPlugins(unit_test::k_BuildDir.view(), true); - const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "6_6_caxis_data.tar.gz", "6_6_caxis_data"); + const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "caxis_data.tar.gz", "caxis_data"); // Read Exemplar DREAM3D File Filter - auto exemplarFilePath = fs::path(fmt::format("{}/6_6_caxis_data/6_6_find_caxis_data.dream3d", unit_test::k_TestFilesDir)); + auto exemplarFilePath = fs::path(fmt::format("{}/caxis_data/7_0_find_caxis_data.dream3d", unit_test::k_TestFilesDir)); DataStructure dataStructure = UnitTest::LoadDataStructure(exemplarFilePath); auto& crystalStructs = dataStructure.getDataRefAs(k_CrystalStructuresArrayPath); diff --git a/src/Plugins/OrientationAnalysis/test/ComputeCAxisLocationsTest.cpp b/src/Plugins/OrientationAnalysis/test/ComputeCAxisLocationsTest.cpp index 52dfb99053..5fd3a89132 100644 --- a/src/Plugins/OrientationAnalysis/test/ComputeCAxisLocationsTest.cpp +++ b/src/Plugins/OrientationAnalysis/test/ComputeCAxisLocationsTest.cpp @@ -18,10 +18,10 @@ TEST_CASE("OrientationAnalysis::ComputeCAxisLocationsFilter: Valid Filter Execut { Application::GetOrCreateInstance()->loadPlugins(unit_test::k_BuildDir.view(), true); - const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "6_6_caxis_data.tar.gz", "6_6_caxis_data"); + const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "caxis_data.tar.gz", "caxis_data"); // Read Exemplar DREAM3D File Filter - auto exemplarFilePath = fs::path(fmt::format("{}/6_6_caxis_data/6_6_find_caxis_data.dream3d", unit_test::k_TestFilesDir)); + auto exemplarFilePath = fs::path(fmt::format("{}/caxis_data/7_0_find_caxis_data.dream3d", unit_test::k_TestFilesDir)); DataStructure dataStructure = UnitTest::LoadDataStructure(exemplarFilePath); // Instantiate the filter, a DataStructure object and an Arguments Object @@ -50,10 +50,10 @@ TEST_CASE("OrientationAnalysis::ComputeCAxisLocationsFilter: InValid Filter Exec { Application::GetOrCreateInstance()->loadPlugins(unit_test::k_BuildDir.view(), true); - const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "6_6_caxis_data.tar.gz", "6_6_caxis_data"); + const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "caxis_data.tar.gz", "caxis_data"); // Read Exemplar DREAM3D File Filter - auto exemplarFilePath = fs::path(fmt::format("{}/6_6_caxis_data/6_6_find_caxis_data.dream3d", unit_test::k_TestFilesDir)); + auto exemplarFilePath = fs::path(fmt::format("{}/caxis_data/7_0_find_caxis_data.dream3d", unit_test::k_TestFilesDir)); DataStructure dataStructure = UnitTest::LoadDataStructure(exemplarFilePath); auto& crystalStructs = dataStructure.getDataRefAs(k_CrystalStructuresArrayPath); diff --git a/src/Plugins/OrientationAnalysis/test/ComputeFeatureNeighborCAxisMisalignmentsTest.cpp b/src/Plugins/OrientationAnalysis/test/ComputeFeatureNeighborCAxisMisalignmentsTest.cpp index 092f1e1ada..0f83d20d42 100644 --- a/src/Plugins/OrientationAnalysis/test/ComputeFeatureNeighborCAxisMisalignmentsTest.cpp +++ b/src/Plugins/OrientationAnalysis/test/ComputeFeatureNeighborCAxisMisalignmentsTest.cpp @@ -21,10 +21,10 @@ TEST_CASE("OrientationAnalysis::ComputeFeatureNeighborCAxisMisalignmentsFilter: { Application::GetOrCreateInstance()->loadPlugins(unit_test::k_BuildDir.view(), true); - const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "6_6_caxis_data.tar.gz", "6_6_caxis_data"); + const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "caxis_data.tar.gz", "caxis_data"); // Read Exemplar DREAM3D File Filter - auto exemplarFilePath = fs::path(fmt::format("{}/6_6_caxis_data/6_6_find_caxis_data.dream3d", unit_test::k_TestFilesDir)); + auto exemplarFilePath = fs::path(fmt::format("{}/caxis_data/7_0_find_caxis_data.dream3d", unit_test::k_TestFilesDir)); DataStructure dataStructure = UnitTest::LoadDataStructure(exemplarFilePath); // Instantiate the filter, a DataStructure object and an Arguments Object @@ -58,10 +58,10 @@ TEST_CASE("OrientationAnalysis::ComputeFeatureNeighborCAxisMisalignmentsFilter: { Application::GetOrCreateInstance()->loadPlugins(unit_test::k_BuildDir.view(), true); - const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "6_6_caxis_data.tar.gz", "6_6_caxis_data"); + const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "caxis_data.tar.gz", "caxis_data"); // Read Exemplar DREAM3D File Filter - auto exemplarFilePath = fs::path(fmt::format("{}/6_6_caxis_data/6_6_find_caxis_data.dream3d", unit_test::k_TestFilesDir)); + auto exemplarFilePath = fs::path(fmt::format("{}/caxis_data/7_0_find_caxis_data.dream3d", unit_test::k_TestFilesDir)); DataStructure dataStructure = UnitTest::LoadDataStructure(exemplarFilePath); // Instantiate the filter, a DataStructure object and an Arguments Object diff --git a/src/Plugins/OrientationAnalysis/test/ComputeFeatureReferenceCAxisMisorientationsTest.cpp b/src/Plugins/OrientationAnalysis/test/ComputeFeatureReferenceCAxisMisorientationsTest.cpp index 8e8f84957d..7f7f26504a 100644 --- a/src/Plugins/OrientationAnalysis/test/ComputeFeatureReferenceCAxisMisorientationsTest.cpp +++ b/src/Plugins/OrientationAnalysis/test/ComputeFeatureReferenceCAxisMisorientationsTest.cpp @@ -23,10 +23,10 @@ TEST_CASE("OrientationAnalysis::ComputeFeatureReferenceCAxisMisorientationsFilte { Application::GetOrCreateInstance()->loadPlugins(unit_test::k_BuildDir.view(), true); - const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "6_6_caxis_data.tar.gz", "6_6_caxis_data"); + const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "caxis_data.tar.gz", "caxis_data"); // Read Exemplar DREAM3D File Filter - auto exemplarFilePath = fs::path(fmt::format("{}/6_6_caxis_data/6_6_find_caxis_data.dream3d", unit_test::k_TestFilesDir)); + auto exemplarFilePath = fs::path(fmt::format("{}/caxis_data/7_0_find_caxis_data.dream3d", unit_test::k_TestFilesDir)); DataStructure dataStructure = UnitTest::LoadDataStructure(exemplarFilePath); // Instantiate the filter, a DataStructure object and an Arguments Object @@ -64,10 +64,10 @@ TEST_CASE("OrientationAnalysis::ComputeFeatureReferenceCAxisMisorientationsFilte { Application::GetOrCreateInstance()->loadPlugins(unit_test::k_BuildDir.view(), true); - const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "6_6_caxis_data.tar.gz", "6_6_caxis_data"); + const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "caxis_data.tar.gz", "caxis_data"); // Read Exemplar DREAM3D File Filter - auto exemplarFilePath = fs::path(fmt::format("{}/6_6_caxis_data/6_6_find_caxis_data.dream3d", unit_test::k_TestFilesDir)); + auto exemplarFilePath = fs::path(fmt::format("{}/caxis_data/7_0_find_caxis_data.dream3d", unit_test::k_TestFilesDir)); DataStructure dataStructure = UnitTest::LoadDataStructure(exemplarFilePath); auto& crystalStructs = dataStructure.getDataRefAs(k_CrystalStructuresArrayPath); diff --git a/src/Plugins/SimplnxCore/docs/FeatureFaceCurvatureFilter.md b/src/Plugins/SimplnxCore/docs/FeatureFaceCurvatureFilter.md index 78b887693e..65a019ee15 100644 --- a/src/Plugins/SimplnxCore/docs/FeatureFaceCurvatureFilter.md +++ b/src/Plugins/SimplnxCore/docs/FeatureFaceCurvatureFilter.md @@ -11,6 +11,8 @@ This **Filter** calculates *principal direction vectors* and the *principal curv Principal Curvatures 1 and 2 are the κ 1 and κ 2 from [1] and are the eigenvalues from the Wiengarten matrix. The Principal Directions 1 and 2 are the eigenvectors from the solution to the least squares fit algorithm. The Mean Curvature is (κ 1 + κ 2 ) / 2, while the Gaussian curvature is (κ 1 * κ 2 ). +The values of the principal directions can have their signs flipped. They are calculated using eigenvectors which are unique up to a sign. + *Note*: Computing the Weingarten matrix values is an experimental feature, and there is no guarantee at this time that the values are correct. ![Curvature Coloring of a Feature](Images/FeatureFaceCurvatureFilter.png) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeArrayStatistics.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeArrayStatistics.cpp index 96a8fccd2d..bd5f19b399 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeArrayStatistics.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeArrayStatistics.cpp @@ -52,13 +52,6 @@ class ComputeArrayStatisticsByIndexImpl { } - virtual ~ComputeArrayStatisticsByIndexImpl() = default; - - ComputeArrayStatisticsByIndexImpl(const ComputeArrayStatisticsByIndexImpl&) = default; // Copy Constructor Not Implemented - ComputeArrayStatisticsByIndexImpl(ComputeArrayStatisticsByIndexImpl&&) = delete; // Move Constructor Not Implemented - ComputeArrayStatisticsByIndexImpl& operator=(const ComputeArrayStatisticsByIndexImpl&) = delete; // Copy Assignment Not Implemented - ComputeArrayStatisticsByIndexImpl& operator=(ComputeArrayStatisticsByIndexImpl&&) = delete; // Move Assignment Not Implemented - void compute(usize start, usize end) const { std::chrono::steady_clock::time_point initialTime = std::chrono::steady_clock::now(); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeMomentInvariants2D.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeMomentInvariants2D.cpp index 6ac8b523dc..a80dc01c42 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeMomentInvariants2D.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeMomentInvariants2D.cpp @@ -23,12 +23,6 @@ class ComputeMomentInvariants2DImpl , m_MessageHandler(mesgHandler) { } - ~ComputeMomentInvariants2DImpl() = default; - - ComputeMomentInvariants2DImpl(const ComputeMomentInvariants2DImpl&) = default; // Copy Constructor defaulted - ComputeMomentInvariants2DImpl(ComputeMomentInvariants2DImpl&&) = delete; // Move Constructor Not Implemented - ComputeMomentInvariants2DImpl& operator=(const ComputeMomentInvariants2DImpl&) = delete; // Copy Assignment Not Implemented - ComputeMomentInvariants2DImpl& operator=(ComputeMomentInvariants2DImpl&&) = delete; // Move Assignment Not Implemented void convert(usize start, usize end) const { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CreateColorMap.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CreateColorMap.cpp index 4ab4226dca..6b3019886b 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CreateColorMap.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CreateColorMap.cpp @@ -64,12 +64,6 @@ class CreateColorMapImpl } } } - virtual ~CreateColorMapImpl() = default; - - CreateColorMapImpl(const CreateColorMapImpl&) = default; - CreateColorMapImpl(CreateColorMapImpl&&) noexcept = delete; - CreateColorMapImpl& operator=(const CreateColorMapImpl&) = delete; - CreateColorMapImpl& operator=(CreateColorMapImpl&&) noexcept = delete; template void convert(size_t start, size_t end) const diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PartitionGeometry.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PartitionGeometry.cpp index bb63b6a928..7a49fb8978 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PartitionGeometry.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PartitionGeometry.cpp @@ -25,11 +25,6 @@ class PartitionCellBasedGeometryImpl , m_ShouldCancel(shouldCancel) { } - ~PartitionCellBasedGeometryImpl() = default; - PartitionCellBasedGeometryImpl(const PartitionCellBasedGeometryImpl&) = default; // Copy Constructor default Implemented - PartitionCellBasedGeometryImpl(PartitionCellBasedGeometryImpl&&) = delete; // Move Constructor Not Implemented - PartitionCellBasedGeometryImpl& operator=(const PartitionCellBasedGeometryImpl&) = delete; // Copy Assignment Not Implemented - PartitionCellBasedGeometryImpl& operator=(PartitionCellBasedGeometryImpl&&) = delete; // Move Assignment Not Implemented // ----------------------------------------------------------------------------- void compute(size_t xStart, size_t xEnd, size_t yStart, size_t yEnd, size_t zStart, size_t zEnd) const @@ -96,11 +91,6 @@ class PartitionNodeBasedGeometryImpl , m_ShouldCancel(shouldCancel) { } - ~PartitionNodeBasedGeometryImpl() = default; - PartitionNodeBasedGeometryImpl(const PartitionNodeBasedGeometryImpl&) = default; // Copy Constructor default Implemented - PartitionNodeBasedGeometryImpl(PartitionNodeBasedGeometryImpl&&) = delete; // Move Constructor Not Implemented - PartitionNodeBasedGeometryImpl& operator=(const PartitionNodeBasedGeometryImpl&) = delete; // Copy Assignment Not Implemented - PartitionNodeBasedGeometryImpl& operator=(PartitionNodeBasedGeometryImpl&&) = delete; // Move Assignment Not Implemented // ----------------------------------------------------------------------------- void compute(size_t start, size_t end) const diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/QuickSurfaceMesh.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/QuickSurfaceMesh.cpp index 0372c20593..0fd83f9555 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/QuickSurfaceMesh.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/QuickSurfaceMesh.cpp @@ -80,12 +80,6 @@ struct GenerateTripleLinesImpl zP = udims[2]; } - ~GenerateTripleLinesImpl() = default; - GenerateTripleLinesImpl(const GenerateTripleLinesImpl&) = default; // Copy Constructor default Implemented - GenerateTripleLinesImpl(GenerateTripleLinesImpl&&) = delete; // Move Constructor Not Implemented - GenerateTripleLinesImpl& operator=(const GenerateTripleLinesImpl&) = delete; // Copy Assignment Not Implemented - GenerateTripleLinesImpl& operator=(GenerateTripleLinesImpl&&) = delete; // Move Assignment Not Implemented - void compute(usize zStart, usize zEnd, usize yStart, usize yEnd, usize xStart, usize xEnd) const { for(size_t k = zStart; k < zEnd; k++) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadVtkStructuredPoints.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadVtkStructuredPoints.cpp index 29a76889b9..28e86fd9ff 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadVtkStructuredPoints.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadVtkStructuredPoints.cpp @@ -258,7 +258,9 @@ Result<> ReadLine(std::istream& in, char* result, usize length) Result<> ReadString(std::istream& in, char* result, usize length) { in.width(length); - in >> result; + std::string temp; + in >> temp; + std::copy(temp.begin(), temp.end(), result); if(in.fail()) { if(in.eof()) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RemoveFlaggedEdges.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RemoveFlaggedEdges.cpp index 031b366d0f..2b1fb0b4eb 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RemoveFlaggedEdges.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RemoveFlaggedEdges.cpp @@ -28,12 +28,6 @@ class PopulateReducedGeometryEdgesImpl , m_NewVerticesIndex(newVerticesIndex) { } - ~PopulateReducedGeometryEdgesImpl() = default; - - PopulateReducedGeometryEdgesImpl(const PopulateReducedGeometryEdgesImpl&) = default; // Copy Constructor Not Implemented - PopulateReducedGeometryEdgesImpl(PopulateReducedGeometryEdgesImpl&&) = delete; // Move Constructor Not Implemented - PopulateReducedGeometryEdgesImpl& operator=(const PopulateReducedGeometryEdgesImpl&) = delete; // Copy Assignment Not Implemented - PopulateReducedGeometryEdgesImpl& operator=(PopulateReducedGeometryEdgesImpl&&) = delete; // Move Assignment Not Implemented void generate(usize start, usize end) const { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RemoveFlaggedFeatures.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RemoveFlaggedFeatures.cpp index 05e87b32b2..0878f261df 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RemoveFlaggedFeatures.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RemoveFlaggedFeatures.cpp @@ -368,7 +368,7 @@ Result<> RemoveFlaggedFeatures::operator()() std::vector minVoxels = {static_cast(bounds[index]), static_cast(bounds[index + 1]), static_cast(bounds[index + 2])}; std::vector maxVoxels = {static_cast(bounds[index + 3]), static_cast(bounds[index + 4]), static_cast(bounds[index + 5])}; - DataPath createdImgGeomPath({fmt::format(("{}-{:0" + paddingWidth + "d}"), m_InputValues->CreatedImageGeometryPrefix, i)}); + DataPath createdImgGeomPath({fmt::format(fmt::runtime("{}-{:0" + paddingWidth + "d}"), m_InputValues->CreatedImageGeometryPrefix, i)}); m_MessageHandler(IFilter::ProgressMessage{IFilter::Message::Type::Info, fmt::format("Now Extracting Feature {}", i)}); taskRunner.execute(RunCropImageGeometryImpl(m_DataStructure, getCancel(), m_InputValues->ImageGeometryPath, minVoxels, maxVoxels, createdImgGeomPath)); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ResampleImageGeom.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ResampleImageGeom.cpp index 6d451f7a28..40cf3d4680 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ResampleImageGeom.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ResampleImageGeom.cpp @@ -28,11 +28,6 @@ class ResampleImageGeomImpl , m_ShouldCancel(shouldCancel) { } - ~ResampleImageGeomImpl() = default; - ResampleImageGeomImpl(const ResampleImageGeomImpl&) = default; // Copy Constructor default Implemented - ResampleImageGeomImpl(ResampleImageGeomImpl&&) = delete; // Move Constructor Not Implemented - ResampleImageGeomImpl& operator=(const ResampleImageGeomImpl&) = delete; // Copy Assignment Not Implemented - ResampleImageGeomImpl& operator=(ResampleImageGeomImpl&&) = delete; // Move Assignment Not Implemented // ----------------------------------------------------------------------------- void compute(size_t xStart, size_t xEnd, size_t yStart, size_t yEnd, size_t zStart, size_t zEnd) const diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/TupleTransfer.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/TupleTransfer.cpp index a6584139a3..364811a48d 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/TupleTransfer.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/TupleTransfer.cpp @@ -52,10 +52,6 @@ void AddTupleTransferInstance(DataStructure& dataStructure, const DataPath& sele { tupleTransferFunctions.push_back(std::make_shared>(dataStructure, selectedDataPath, createdDataPath)); } - if(TemplateHelpers::CanDynamicCast>()(inputDataArray)) - { - tupleTransferFunctions.push_back(std::make_shared>(dataStructure, selectedDataPath, createdDataPath)); - } } } // namespace nx::core diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CopyFeatureArrayToElementArrayFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CopyFeatureArrayToElementArrayFilter.cpp index d4265c80c2..f7b233bb9e 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CopyFeatureArrayToElementArrayFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CopyFeatureArrayToElementArrayFilter.cpp @@ -32,12 +32,6 @@ class CopyFeatureArrayToElementArrayImpl { } - ~CopyFeatureArrayToElementArrayImpl() = default; - CopyFeatureArrayToElementArrayImpl(const CopyFeatureArrayToElementArrayImpl&) = default; // Copy Constructor Not Implemented - CopyFeatureArrayToElementArrayImpl(CopyFeatureArrayToElementArrayImpl&&) = delete; // Move Constructor Not Implemented - CopyFeatureArrayToElementArrayImpl& operator=(const CopyFeatureArrayToElementArrayImpl&) = delete; // Copy Assignment Not Implemented - CopyFeatureArrayToElementArrayImpl& operator=(CopyFeatureArrayToElementArrayImpl&&) = delete; // Move Assignment Not Implemented - void operator()(const Range& range) const { const DataArray& selectedFeatureArray = m_DataStructure.getDataRefAs>(m_SelectedFeatureArrayPath); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadVolumeGraphicsFileFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadVolumeGraphicsFileFilter.cpp index 41e18afc06..7e9243d39e 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadVolumeGraphicsFileFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadVolumeGraphicsFileFilter.cpp @@ -120,10 +120,10 @@ Result> ParseArray(const std::vector(k_VgiParseError, fmt::format(vgiParseErrorStr, parseUnit, tokens[index + 2]))}; + return {MakeErrorResult(k_VgiParseError, fmt::format(fmt::runtime(vgiParseErrorStr), parseUnit, tokens[index + 2]))}; } catch(const std::out_of_range& e) { - return {MakeErrorResult(k_VgiParseError, fmt::format(vgiOutOfRangeErrorStr, tokens[index + 2], parseUnit))}; + return {MakeErrorResult(k_VgiParseError, fmt::format(fmt::runtime(vgiOutOfRangeErrorStr), tokens[index + 2], parseUnit))}; } } diff --git a/src/Plugins/SimplnxCore/test/FeatureFaceCurvatureTest.cpp b/src/Plugins/SimplnxCore/test/FeatureFaceCurvatureTest.cpp index d3bb4369a8..8e287a2806 100644 --- a/src/Plugins/SimplnxCore/test/FeatureFaceCurvatureTest.cpp +++ b/src/Plugins/SimplnxCore/test/FeatureFaceCurvatureTest.cpp @@ -10,6 +10,13 @@ using namespace nx::core; namespace { +enum class FloatComparison +{ + Standard, + Absolute +}; + +template void CompareDataArrays(const DataStructure& dataStructure, const DataPath& arrayPath1, const DataPath& arrayPath2) { const auto* dataArray1 = dataStructure.getDataAs(arrayPath1); @@ -26,7 +33,15 @@ void CompareDataArrays(const DataStructure& dataStructure, const DataPath& array for(usize i = 0; i < length; i++) { - REQUIRE(UnitTest::CloseEnough(dataStore1[i], dataStore2[i])); + INFO(fmt::format("i = {} | d1 = {} | d2 = {}", i, dataStore1[i], dataStore2[i])); + if constexpr(ComparisonValue == FloatComparison::Standard) + { + REQUIRE(UnitTest::CloseEnough(dataStore1[i], dataStore2[i])); + } + else + { + REQUIRE(UnitTest::CloseEnoughAbs(dataStore1[i], dataStore2[i])); + } } } } // namespace @@ -83,38 +98,48 @@ TEST_CASE("SimplnxCore::FeatureFaceCurvatureFilter: Test Algorithm", "[FeatureFa SIMPLNX_RESULT_REQUIRE_VALID(executeResult.result); // Compare arrays - SECTION("Principal Curvature 1") { + INFO("Principal Curvature 1"); DataPath path1 = faceAttribMatrixPath.createChildPath("PrincipalCurvature1_D3D"); ::CompareDataArrays(dataStructure, path1, k_PrincipalCurvature1_Path); } - SECTION("Principal Curvature 2") { + INFO("Principal Curvature 2"); DataPath path1 = faceAttribMatrixPath.createChildPath("PrincipalCurvature2_D3D"); ::CompareDataArrays(dataStructure, path1, k_PrincipalCurvature2_Path); } - SECTION("Principal Direction 1") + /* + * The principal directions can be sign flipped. This is due to Eigen::SelfAdjointEigenSolver + * which returns unique eigenvectors up to a sign. + */ { + INFO("Principal Direction 1"); DataPath path1 = faceAttribMatrixPath.createChildPath("PrincipalDirection1_D3D"); - ::CompareDataArrays(dataStructure, path1, k_PrincipalDirection1_Path); + DataPath path2 = k_PrincipalDirection1_Path; + const auto* dataArray1 = dataStructure.getDataAs(path1); + const auto* dataArray2 = dataStructure.getDataAs(path2); + CompareDataArrays(dataStructure, path1, path2); } - SECTION("Principal Direction 2") { + INFO("Principal Direction 2"); DataPath path1 = faceAttribMatrixPath.createChildPath("PrincipalDirection2_D3D"); - ::CompareDataArrays(dataStructure, path1, k_PrincipalDirection2_Path); + DataPath path2 = k_PrincipalDirection2_Path; + const auto* dataArray1 = dataStructure.getDataAs(path1); + const auto* dataArray2 = dataStructure.getDataAs(path2); + CompareDataArrays(dataStructure, path1, path2); } - SECTION("Gaussian Curvatures") { + INFO("Gaussian Curvatures"); DataPath path1 = faceAttribMatrixPath.createChildPath("GaussianCurvatures"); ::CompareDataArrays(dataStructure, path1, k_GaussianCurvature_Path); } - SECTION("Mean Curvatures") { + INFO("Mean Curvatures"); DataPath path1 = faceAttribMatrixPath.createChildPath("MeanCurvatures"); ::CompareDataArrays(dataStructure, path1, k_MeanCurvature_Path); } diff --git a/src/nxrunner/src/CliObserver.cpp b/src/nxrunner/src/CliObserver.cpp index 9f9cc07003..7a7f80c9ea 100644 --- a/src/nxrunner/src/CliObserver.cpp +++ b/src/nxrunner/src/CliObserver.cpp @@ -15,11 +15,11 @@ PipelineObserver::PipelineObserver(Pipeline* pipeline) if(pipeline != nullptr) { startObservingNode(pipeline); - pipeline->getCancelledSignal().connect([=](void) { onCancelled(); }); - pipeline->getFilterProgressSignal().connect([=](AbstractPipelineNode* node, int32_t progress, int32_t max, const std::string& msg) { onFilterProgress(node, progress, max, msg); }); - pipeline->getFilterRunStateSignal().connect([=](AbstractPipelineNode* node, int32_t index, RunState state) { onRunStateChanged(node, state); }); - pipeline->getFilterUpdateSignal().connect([=](AbstractPipelineNode* node, int32 index, const std::string& msg) { onFilterUpdate(node, msg); }); - pipeline->getPipelineFaultSignal().connect([=](AbstractPipelineNode* node, FaultState state) { onFaultStateChanged(node, state); }); + pipeline->getCancelledSignal().connect([this](void) { onCancelled(); }); + pipeline->getFilterProgressSignal().connect([this](AbstractPipelineNode* node, int32_t progress, int32_t max, const std::string& msg) { onFilterProgress(node, progress, max, msg); }); + pipeline->getFilterRunStateSignal().connect([this](AbstractPipelineNode* node, int32_t index, RunState state) { onRunStateChanged(node, state); }); + pipeline->getFilterUpdateSignal().connect([this](AbstractPipelineNode* node, int32 index, const std::string& msg) { onFilterUpdate(node, msg); }); + pipeline->getPipelineFaultSignal().connect([this](AbstractPipelineNode* node, FaultState state) { onFaultStateChanged(node, state); }); } if(pipeline == nullptr) { diff --git a/src/simplnx/Filter/Actions/CreateVertexGeometryAction.hpp b/src/simplnx/Filter/Actions/CreateVertexGeometryAction.hpp index f87366aed6..43b315509a 100644 --- a/src/simplnx/Filter/Actions/CreateVertexGeometryAction.hpp +++ b/src/simplnx/Filter/Actions/CreateVertexGeometryAction.hpp @@ -108,7 +108,7 @@ class CreateVertexGeometryAction : public IDataCreationAction const auto vertices = dataStructure.getDataAs(m_InputVertices); if(m_ArrayHandlingType != ArrayHandlingType::Create && vertices == nullptr) { - return MakeErrorResult(-6105, fmt::format("{}Could not find vertices array at path '{}'", m_InputVertices.toString())); + return MakeErrorResult(-6105, fmt::format("{}Could not find vertices array at path '{}'", prefix, m_InputVertices.toString())); } // Create the VertexGeom diff --git a/src/simplnx/Filter/Parameters.cpp b/src/simplnx/Filter/Parameters.cpp index 952ffa1ff0..ce5973f238 100644 --- a/src/simplnx/Filter/Parameters.cpp +++ b/src/simplnx/Filter/Parameters.cpp @@ -10,7 +10,7 @@ auto& MapAt(ContainerT& container, std::string_view key, const char* message) auto iter = container.find(key); if(iter == container.cend()) { - throw std::invalid_argument(fmt::format(message, key)); + throw std::invalid_argument(fmt::format(fmt::runtime(message), key)); } return iter->second; } diff --git a/src/simplnx/Parameters/ChoicesParameter.cpp b/src/simplnx/Parameters/ChoicesParameter.cpp index 8b2cd758b7..0bc5fed710 100644 --- a/src/simplnx/Parameters/ChoicesParameter.cpp +++ b/src/simplnx/Parameters/ChoicesParameter.cpp @@ -14,7 +14,7 @@ struct fmt::formatter format_context::iterator format(const nx::core::Error& error, format_context& ctx) const { - return format_to(ctx.out(), "Error({}, {})", error.code, error.message); + return fmt::format_to(ctx.out(), "Error({}, {})", error.code, error.message); } }; diff --git a/src/simplnx/Parameters/Dream3dImportParameter.cpp b/src/simplnx/Parameters/Dream3dImportParameter.cpp index cf81018cdc..245434237b 100644 --- a/src/simplnx/Parameters/Dream3dImportParameter.cpp +++ b/src/simplnx/Parameters/Dream3dImportParameter.cpp @@ -100,7 +100,7 @@ Result Dream3dImportParameter::fromJson(const nlohmann::json& json) co { if(!jsonDataPaths.is_array()) { - return MakeErrorResult(-6, fmt::format("{}JSON value for key '{} / {}' is not an array", prefix, name())); + return MakeErrorResult(-6, fmt::format("{}JSON value for key '{} / {}' is not an array", prefix, name(), k_DataPathsKey)); } auto dataPathStrings = jsonDataPaths.get>(); std::vector dataPaths; diff --git a/src/simplnx/Parameters/ReadHDF5DatasetParameter.cpp b/src/simplnx/Parameters/ReadHDF5DatasetParameter.cpp index cfa7ddd4b2..78478a45b4 100644 --- a/src/simplnx/Parameters/ReadHDF5DatasetParameter.cpp +++ b/src/simplnx/Parameters/ReadHDF5DatasetParameter.cpp @@ -108,7 +108,7 @@ Result ReadHDF5DatasetParameter::fromJson(const nlohmann::json& json) { if(!jsonDataPaths.is_array()) { - return MakeErrorResult(-783, fmt::format("{}JSON value for key '{} / {}' is not an array", prefix, name())); + return MakeErrorResult(-783, fmt::format("{}JSON value for key '{} / {}' is not an array", prefix, name(), k_DataPathsKey)); } std::vector errors; for(const auto& jsonImportInfo : jsonDataPaths) diff --git a/src/simplnx/Plugin/PluginLoader.cpp b/src/simplnx/Plugin/PluginLoader.cpp index 747a18cd91..ef4d400b82 100644 --- a/src/simplnx/Plugin/PluginLoader.cpp +++ b/src/simplnx/Plugin/PluginLoader.cpp @@ -102,8 +102,7 @@ void PluginLoader::loadPlugin() if(m_Handle == nullptr) { fmt::print(SIMPLNX_TEXT("Could not load library '{}' with the following error:\n"), m_Path.c_str()); - fmt::print(GetErrorMessage()); - fmt::print("\n"); + fmt::print(SIMPLNX_TEXT("{}\n"), GetErrorMessage()); return; } @@ -112,7 +111,7 @@ void PluginLoader::loadPlugin() { unloadPlugin(); fmt::print(SIMPLNX_TEXT("Could not retrieve function \"" SIMPLNX_CREATE_PLUGIN_FUNC_NAME "\" from library '{}' with the following error:\n"), m_Path.c_str()); - fmt::print(GetErrorMessage()); + fmt::print(SIMPLNX_TEXT("{}\n"), GetErrorMessage()); return; } @@ -121,7 +120,7 @@ void PluginLoader::loadPlugin() { unloadPlugin(); fmt::print(SIMPLNX_TEXT("Could not retrieve function \"" SIMPLNX_DESTROY_PLUGIN_FUNC_NAME "\" from library '{}' with following error:\n"), m_Path.c_str()); - fmt::print(GetErrorMessage()); + fmt::print(SIMPLNX_TEXT("{}\n"), GetErrorMessage()); return; } @@ -138,7 +137,7 @@ void PluginLoader::unloadPlugin() if(!UnloadSharedLibrary(m_Handle)) { fmt::print(SIMPLNX_TEXT("The following error occurred while unloading library '{}':\n"), m_Path.c_str()); - fmt::print(GetErrorMessage()); + fmt::print(SIMPLNX_TEXT("{}\n"), GetErrorMessage()); } m_Handle = nullptr; } diff --git a/src/simplnx/Utilities/DataArrayUtilities.hpp b/src/simplnx/Utilities/DataArrayUtilities.hpp index 95a6b264c7..9bf725454d 100644 --- a/src/simplnx/Utilities/DataArrayUtilities.hpp +++ b/src/simplnx/Utilities/DataArrayUtilities.hpp @@ -987,7 +987,9 @@ class CopyTupleUsingIndexList { if(newDataStore.copyFrom(i, oldDataStore, oldIndexI, 1).invalid()) { - std::cout << fmt::format("Array copy failed: Source Array Name: {} Source Tuple Index: {}\nDest Array Name: {} Dest. Tuple Index {}\n\n", m_OldCellArray.getName(), oldIndexI, i); + std::cout << fmt::format("Array copy failed: Source Array Name: {} Source Tuple Index: {}\nDest Array Name: {} Dest. Tuple Index {}\n", m_OldCellArray.getName(), oldIndexI, + m_NewCellArray.getName(), i) + << std::endl; break; } } @@ -1256,7 +1258,8 @@ class CopyUsingIndexList if(!copySucceeded) { - std::cout << fmt::format("Array copy failed: Source Array Name: {} Source Tuple Index: {}\nDest Array Name: {} Dest. Tuple Index {}\n", m_InputCellArray->getName(), oldIndexI, i) + std::cout << fmt::format("Array copy failed: Source Array Name: {} Source Tuple Index: {}\nDest Array Name: {} Dest. Tuple Index {}\n", m_InputCellArray->getName(), oldIndexI, + m_DestCellArray->getName(), i) << std::endl; break; } @@ -1393,8 +1396,9 @@ class MapRectGridDataToImageData } if(!copySucceeded) { - std::cout << fmt::format("Array copy failed: Source Array Name: {} Source Tuple Index: {}\nDest Array Name: {} Dest. Tuple Index {}\n\n", m_InputCellArray->getName(), rectGridIndex, - imageIndex); + std::cout << fmt::format("Array copy failed: Source Array Name: {} Source Tuple Index: {}\nDest Array Name: {} Dest. Tuple Index {}\n", m_InputCellArray->getName(), rectGridIndex, + m_DestCellArray->getName(), imageIndex) + << std::endl; break; } diff --git a/src/simplnx/Utilities/ImageRotationUtilities.cpp b/src/simplnx/Utilities/ImageRotationUtilities.cpp index 712fbac877..aad749340c 100644 --- a/src/simplnx/Utilities/ImageRotationUtilities.cpp +++ b/src/simplnx/Utilities/ImageRotationUtilities.cpp @@ -44,20 +44,6 @@ FloatVec6 DetermineMinMaxCoords(const ImageGeom& imageGeometry, const Matrix4fR& return minMaxValues; } -//------------------------------------------------------------------------------ -float CosBetweenVectors(const Eigen::Vector3f& vectorA, const Eigen::Vector3f& vectorB) -{ - const float normA = vectorA.norm(); - const float normB = vectorB.norm(); - - if(normA == 0.0f || normB == 0.0f) - { - return 1.0f; - } - - return vectorA.dot(vectorB) / (normA * normB); -} - //------------------------------------------------------------------------------ float DetermineSpacing(const FloatVec3& spacing, const Eigen::Vector3f& axisNew) { diff --git a/src/simplnx/Utilities/ImageRotationUtilities.hpp b/src/simplnx/Utilities/ImageRotationUtilities.hpp index acc27d44c9..82d9169ffe 100644 --- a/src/simplnx/Utilities/ImageRotationUtilities.hpp +++ b/src/simplnx/Utilities/ImageRotationUtilities.hpp @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -107,11 +108,24 @@ SIMPLNX_EXPORT FloatVec6 DetermineMinMaxCoords(const ImageGeom& imageGeometry, c /** * @brief Finds the Cosine of the angle between 2 vectors + * @tparam T * @param vectorA * @param vectorB * @return */ -SIMPLNX_EXPORT float CosBetweenVectors(const Eigen::Vector3f& vectorA, const Eigen::Vector3f& vectorB); +template +T CosBetweenVectors(const Eigen::Vector3& vectorA, const Eigen::Vector3& vectorB) +{ + const T normA = vectorA.norm(); + const T normB = vectorB.norm(); + + if(normA == static_cast(0.0) || normB == static_cast(0.0)) + { + return static_cast(1.0); + } + + return vectorA.dot(vectorB) / (normA * normB); +} /** * @brief Function for determining new ImageGeom Spacing between points for scaling @@ -586,12 +600,6 @@ class ApplyTransformationToNodeGeometry , m_FilterCallback(filterCallback) { } - ~ApplyTransformationToNodeGeometry() = default; - - ApplyTransformationToNodeGeometry(const ApplyTransformationToNodeGeometry&) = default; // Copy Constructor Not Implemented - ApplyTransformationToNodeGeometry(ApplyTransformationToNodeGeometry&&) = delete; // Move Constructor Not Implemented - ApplyTransformationToNodeGeometry& operator=(const ApplyTransformationToNodeGeometry&) = delete; // Copy Assignment Not Implemented - ApplyTransformationToNodeGeometry& operator=(ApplyTransformationToNodeGeometry&&) = delete; // Move Assignment Not Implemented void convert(size_t start, size_t end) const { diff --git a/src/simplnx/Utilities/Parsing/HDF5/IO/DatasetIO.cpp b/src/simplnx/Utilities/Parsing/HDF5/IO/DatasetIO.cpp index daf79134db..83c314daa1 100644 --- a/src/simplnx/Utilities/Parsing/HDF5/IO/DatasetIO.cpp +++ b/src/simplnx/Utilities/Parsing/HDF5/IO/DatasetIO.cpp @@ -7,6 +7,7 @@ #include +#include #include #include diff --git a/src/simplnx/Utilities/Parsing/HDF5/Writers/DatasetWriter.cpp b/src/simplnx/Utilities/Parsing/HDF5/Writers/DatasetWriter.cpp index 129b7eb1a4..f905153a43 100644 --- a/src/simplnx/Utilities/Parsing/HDF5/Writers/DatasetWriter.cpp +++ b/src/simplnx/Utilities/Parsing/HDF5/Writers/DatasetWriter.cpp @@ -4,6 +4,7 @@ #include "fmt/format.h" +#include #include #include diff --git a/src/simplnx/Utilities/StringUtilities.hpp b/src/simplnx/Utilities/StringUtilities.hpp index 9a92915c82..18d9706298 100644 --- a/src/simplnx/Utilities/StringUtilities.hpp +++ b/src/simplnx/Utilities/StringUtilities.hpp @@ -38,6 +38,7 @@ #include #include +#include #include #include #include @@ -112,7 +113,7 @@ inline std::vector optimized_split(std::string_view str, nonstd::sp if constexpr(SplitTypeOptionsV::AllowEmptyInital) { - if(std::find(delimiters.cbegin(), delimiters.cend(), str[0]) != delimiters.cend()) + if(std::find(delimiters.begin(), delimiters.end(), str[0]) != delimiters.end()) { tokens.emplace_back(""); startPos++; @@ -121,7 +122,7 @@ inline std::vector optimized_split(std::string_view str, nonstd::sp if constexpr(!SplitTypeOptionsV::AllowEmptyFinal) { - if(std::find(delimiters.cbegin(), delimiters.cend(), str[str.size() - 1]) != delimiters.cend()) + if(std::find(delimiters.begin(), delimiters.end(), str[str.size() - 1]) != delimiters.end()) { endPos--; } @@ -129,10 +130,10 @@ inline std::vector optimized_split(std::string_view str, nonstd::sp if constexpr(!SplitTypeOptionsV::AllowConsecutiveAsEmpty) { - tokenize(startPos, endPos, delimiters.cbegin(), delimiters.cend(), tokens); + tokenize(startPos, endPos, delimiters.begin(), delimiters.end(), tokens); if constexpr(SplitTypeOptionsV::AllowEmptyFinal) { - if(std::find(delimiters.cbegin(), delimiters.cend(), str[str.size() - 1]) != delimiters.cend()) + if(std::find(delimiters.begin(), delimiters.end(), str[str.size() - 1]) != delimiters.end()) { tokens.emplace_back(""); } @@ -142,12 +143,12 @@ inline std::vector optimized_split(std::string_view str, nonstd::sp { if constexpr(!SplitTypeOptionsV::AllowEmptyInital) { - if(std::find(delimiters.cbegin(), delimiters.cend(), str[0]) != delimiters.cend()) + if(std::find(delimiters.begin(), delimiters.end(), str[0]) != delimiters.end()) { startPos++; } } - tokenize(startPos, endPos, delimiters.cbegin(), delimiters.cend(), tokens); + tokenize(startPos, endPos, delimiters.begin(), delimiters.end(), tokens); } tokens.shrink_to_fit(); diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8b431baa24..a79e55d501 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -49,6 +49,8 @@ target_link_libraries(simplnx_test simplnx::UnitTestCommon ) +simplnx_enable_warnings(TARGET simplnx_test) + #------------------------------------------------------------------------------ # Require that the test plugins are built before tests because some tests # require loading from those plugins but don't want to link to them. diff --git a/test/UnitTestCommon/include/simplnx/UnitTest/UnitTestCommon.hpp b/test/UnitTestCommon/include/simplnx/UnitTest/UnitTestCommon.hpp index 57fe21ffac..7de7ebcc22 100644 --- a/test/UnitTestCommon/include/simplnx/UnitTest/UnitTestCommon.hpp +++ b/test/UnitTestCommon/include/simplnx/UnitTest/UnitTestCommon.hpp @@ -298,6 +298,19 @@ bool CloseEnough(const K& a, const K& b, const K& epsilon = EPSILON) return (epsilon > fabs(a - b)); } +/** + * @brief closeEnough + * @param a + * @param b + * @param epsilon + * @return + */ +template +bool CloseEnoughAbs(const K& a, const K& b, const K& epsilon = EPSILON) +{ + return (epsilon > std::abs(std::abs(a) - std::abs(b))); +} + /** * @brief Loads a .dream3d file into a DataStructure. Checks are made to ensure the filepath does exist * @param filepath diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json index e1dc245782..9802084168 100644 --- a/vcpkg-configuration.json +++ b/vcpkg-configuration.json @@ -33,7 +33,7 @@ "zlib", "zstd" ], - "baseline": "91f2503b2158a684bfe6a524b344ad7028de9511" + "baseline": "e2836a9d0b7a26d5063b5e5a51a1b10b1246f4e8" } ] }