Skip to content
Permalink
Browse files

Convert all orientation operations to double precision where possible (

…#916)

* Rewrite the OrientationTransform class using more C++ like style
The original version was a direct port of the Fortran codes where the output variable
is passed in as an argument. This rewrite will implement a C++ style of interface
where something is returned instead. This will allow operations to be chained together.

* Converting the Laue Ops classes to use double precision by default
* Updates for the templated MatrixMath class
* Fix color constant and remove unnecessary multiplications in MergeColonies
* Updating Hexagonal ops with some compiler error fixes
* Fix failing unit tests for Quaternion and Orientation Transformation
* Add missing include directive
* Remove test files at end of unit test where possible.

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
  • Loading branch information...
imikejackson committed Sep 13, 2019
1 parent c31a87d commit 1ab713bcdc39c19f51892443936ad0b93aee984e
Showing with 9,342 additions and 8,354 deletions.
  1. +11 −3 Source/EbsdLib/Test/CtfReaderTest.cpp
  2. +5 −37 Source/OrientationLib/CMakeLists.txt
  3. +737 −0 Source/OrientationLib/Core/Orientation.hpp
  4. 0 Source/OrientationLib/{OrientationMath → Core}/OrientationMath.cpp
  5. +0 −1 Source/OrientationLib/{OrientationMath → Core}/OrientationMath.h
  6. +2,234 −0 Source/OrientationLib/Core/OrientationTransformation.hpp
  7. +421 −0 Source/OrientationLib/Core/Quaternion.hpp
  8. +22 −0 Source/OrientationLib/Core/SourceList.cmake
  9. +10 −16 Source/OrientationLib/IO/AngleFileLoader.cpp
  10. +303 −358 Source/OrientationLib/LaueOps/CubicLowOps.cpp
  11. +44 −41 Source/OrientationLib/LaueOps/CubicLowOps.h
  12. +477 −613 Source/OrientationLib/LaueOps/CubicOps.cpp
  13. +44 −43 Source/OrientationLib/LaueOps/CubicOps.h
  14. +425 −447 Source/OrientationLib/LaueOps/HexagonalLowOps.cpp
  15. +43 −41 Source/OrientationLib/LaueOps/HexagonalLowOps.h
  16. +450 −493 Source/OrientationLib/LaueOps/HexagonalOps.cpp
  17. +40 −39 Source/OrientationLib/LaueOps/HexagonalOps.h
  18. +78 −83 Source/OrientationLib/LaueOps/LaueOps.cpp
  19. +63 −47 Source/OrientationLib/LaueOps/LaueOps.h
  20. +239 −257 Source/OrientationLib/LaueOps/MonoclinicOps.cpp
  21. +39 −36 Source/OrientationLib/LaueOps/MonoclinicOps.h
  22. +249 −278 Source/OrientationLib/LaueOps/OrthoRhombicOps.cpp
  23. +38 −39 Source/OrientationLib/LaueOps/OrthoRhombicOps.h
  24. +17 −21 Source/OrientationLib/LaueOps/SO3Sampler.cpp
  25. +2 −3 Source/OrientationLib/LaueOps/SO3Sampler.h
  26. +208 −237 Source/OrientationLib/LaueOps/TetragonalLowOps.cpp
  27. +42 −40 Source/OrientationLib/LaueOps/TetragonalLowOps.h
  28. +266 −304 Source/OrientationLib/LaueOps/TetragonalOps.cpp
  29. +42 −40 Source/OrientationLib/LaueOps/TetragonalOps.h
  30. +202 −224 Source/OrientationLib/LaueOps/TriclinicOps.cpp
  31. +39 −37 Source/OrientationLib/LaueOps/TriclinicOps.h
  32. +214 −231 Source/OrientationLib/LaueOps/TrigonalLowOps.cpp
  33. +40 −39 Source/OrientationLib/LaueOps/TrigonalLowOps.h
  34. +257 −287 Source/OrientationLib/LaueOps/TrigonalOps.cpp
  35. +42 −40 Source/OrientationLib/LaueOps/TrigonalOps.h
  36. +308 −279 Source/OrientationLib/OrientationMath/OrientationArray.hpp
  37. +103 −105 Source/OrientationLib/OrientationMath/OrientationConverter.hpp
  38. +0 −2,167 Source/OrientationLib/OrientationMath/OrientationTransforms.hpp
  39. +0 −40 Source/OrientationLib/OrientationMath/SourceList.cmake
  40. +3 −2 Source/OrientationLib/Test/CMakeLists.txt
  41. +14 −21 Source/OrientationLib/Test/IPFLegendTest.cpp
  42. +1 −3 Source/OrientationLib/Test/ODFTest.cpp
  43. +8 −12 Source/OrientationLib/Test/OrientationConverterTest.cpp
  44. +0 −45 Source/OrientationLib/Test/OrientationLibTest.cpp
  45. +209 −264 Source/OrientationLib/Test/{OrientationArrayTest.cpp → OrientationTest.cpp}
  46. +65 −87 Source/OrientationLib/Test/{OrientationTransformsTest.cpp → OrientationTransformationTest.cpp}
  47. +365 −0 Source/OrientationLib/Test/QuaternionTest.cpp
  48. +31 −32 Source/OrientationLib/Test/SO3SamplerTest.cpp
  49. +5 −5 Source/OrientationLib/Test/TestPrintFunctions.h
  50. +8 −6 Source/OrientationLib/Test/TextureTest.cpp
  51. +15 −20 Source/OrientationLib/Texture/StatsGen.hpp
  52. +41 −44 Source/OrientationLib/Texture/Texture.hpp
  53. +1 −1 Source/OrientationLib/Utilities/ModifiedLambertProjection.cpp
  54. +1 −1 Source/OrientationLib/Utilities/ModifiedLambertProjection3D.hpp
  55. +12 −11 Source/Plugins/ImportExport/ImportExportFilters/VisualizeGBCDGMT.cpp
  56. +5 −7 Source/Plugins/ImportExport/ImportExportFilters/VisualizeGBCDPoleFigure.cpp
  57. +8 −12 Source/Plugins/OrientationAnalysis/Documentation/OrientationAnalysisFilters/EbsdToH5Ebsd.md
  58. +6 −4 Source/Plugins/OrientationAnalysis/Gui/Widgets/AxisAngleWidget.cpp
  59. +2 −1 Source/Plugins/OrientationAnalysis/Gui/Widgets/CubochoricWidget.cpp
  60. +3 −1 Source/Plugins/OrientationAnalysis/Gui/Widgets/EulerWidget.cpp
  61. +2 −1 Source/Plugins/OrientationAnalysis/Gui/Widgets/HomochoricWidget.cpp
  62. +3 −1 Source/Plugins/OrientationAnalysis/Gui/Widgets/OmWidget.cpp
  63. +1 −1 Source/Plugins/OrientationAnalysis/Gui/Widgets/OrientationUtilityCalculator.cpp
  64. +8 −8 Source/Plugins/OrientationAnalysis/Gui/Widgets/QuatWidget.cpp
  65. +2 −1 Source/Plugins/OrientationAnalysis/Gui/Widgets/RodriguesWidget.cpp
  66. +5 −7 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/BadDataNeighborOrientationCheck.cpp
  67. +3 −3 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/ConvertOrientations.cpp
  68. +31 −41 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/EMsoftSO3Sampler.cpp
  69. +17 −17 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/EMsoftSO3Sampler.h
  70. +8 −9 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindAvgCAxes.cpp
  71. +0 −2 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindAvgCAxes.h
  72. +20 −21 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindAvgOrientations.cpp
  73. +0 −2 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindAvgOrientations.h
  74. +8 −10 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindBasalLoadingFactor.cpp
  75. +13 −15 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindBoundaryStrengths.cpp
  76. +10 −10 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindCAxisLocations.cpp
  77. +0 −2 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindCAxisLocations.h
  78. +6 −8 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindDistsToCharactGBs.cpp
  79. +17 −15 .../Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindFeatureNeighborCAxisMisalignments.cpp
  80. +15 −16 ...ce/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindFeatureNeighborCAxisMisalignments.h
  81. +9 −8 ...ugins/OrientationAnalysis/OrientationAnalysisFilters/FindFeatureReferenceCAxisMisorientations.cpp
  82. +0 −2 ...Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindFeatureReferenceCAxisMisorientations.h
  83. +12 −9 ...ce/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindFeatureReferenceMisorientations.cpp
  84. +0 −2 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindFeatureReferenceMisorientations.h
  85. +15 −17 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindGBCD.cpp
  86. +4 −9 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindGBCDMetricBased.cpp
  87. +3 −6 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindGBPDMetricBased.cpp
  88. +10 −7 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindKernelAvgMisorientations.cpp
  89. +0 −2 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindKernelAvgMisorientations.h
  90. +2 −5 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindMisorientations.cpp
  91. +19 −18 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindOrientationFieldCurl.cpp
  92. +16 −18 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindSchmids.cpp
  93. +0 −2 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindSchmids.h
  94. +20 −12 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindSlipTransmissionMetrics.cpp
  95. +0 −3 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindSlipTransmissionMetrics.h
  96. +59 −55 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindTwinBoundaries.cpp
  97. +0 −2 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindTwinBoundaries.h
  98. +5 −7 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/FindTwinBoundarySchmidFactors.cpp
  99. +10 −10 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/GenerateFZQuaternions.cpp
  100. +10 −18 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/GenerateFaceMisorientationColoring.cpp
  101. +7 −5 ...lugins/OrientationAnalysis/OrientationAnalysisFilters/GenerateFaceSchuhMisorientationColoring.cpp
  102. +3 −4 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/GenerateRodriguesColors.cpp
  103. +4 −7 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/NeighborOrientationCorrelation.cpp
  104. +16 −14 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/RotateEulerRefFrame.cpp
  105. +30 −19 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/YSChoiAbaqusReader.cpp
  106. +2 −1 Source/Plugins/OrientationAnalysis/OrientationAnalysisFilters/YSChoiAbaqusReader.h
  107. +45 −40 Source/Plugins/Reconstruction/ReconstructionFilters/AlignSectionsMisorientation.cpp
  108. +1 −3 Source/Plugins/Reconstruction/ReconstructionFilters/AlignSectionsMisorientation.h
  109. +11 −5 Source/Plugins/Reconstruction/ReconstructionFilters/AlignSectionsMutualInformation.cpp
  110. +9 −11 Source/Plugins/Reconstruction/ReconstructionFilters/CAxisSegmentFeatures.cpp
  111. +5 −9 Source/Plugins/Reconstruction/ReconstructionFilters/EBSDSegmentFeatures.cpp
  112. +0 −3 Source/Plugins/Reconstruction/ReconstructionFilters/EBSDSegmentFeatures.h
  113. +20 −21 Source/Plugins/Reconstruction/ReconstructionFilters/GroupMicroTextureRegions.cpp
  114. +0 −5 Source/Plugins/Reconstruction/ReconstructionFilters/GroupMicroTextureRegions.h
  115. +1 −1 Source/Plugins/Reconstruction/ReconstructionFilters/IdentifyMicroTextureRegions.cpp
  116. +59 −61 Source/Plugins/Reconstruction/ReconstructionFilters/MergeColonies.cpp
  117. +1 −2 Source/Plugins/Reconstruction/ReconstructionFilters/MergeColonies.h
  118. +10 −6 Source/Plugins/Reconstruction/ReconstructionFilters/MergeTwins.cpp
  119. +1 −5 Source/Plugins/Reconstruction/ReconstructionFilters/MergeTwins.h
  120. +2 −2 Source/Plugins/Reconstruction/ReconstructionFilters/VectorSegmentFeatures.cpp
  121. +7 −7 Source/Plugins/Sampling/SamplingFilters/RotateSampleRefFrame.cpp
  122. +1 −1 Source/Plugins/Statistics/StatisticsFilters/CorrelateValuesWithVectorDirection.cpp
  123. +5 −5 Source/Plugins/Statistics/StatisticsFilters/FindShapes.cpp
  124. +25 −23 Source/Plugins/Statistics/StatisticsFilters/GenerateEnsembleStatistics.cpp
  125. +0 −2 Source/Plugins/Statistics/StatisticsFilters/GenerateEnsembleStatistics.h
  126. +6 −5 Source/Plugins/SurfaceMeshing/SurfaceMeshingFilters/FindTriangleGeomShapes.cpp
  127. +10 −10 Source/Plugins/SyntheticBuilding/SyntheticBuildingFilters/AddOrientationNoise.cpp
  128. +24 −24 Source/Plugins/SyntheticBuilding/SyntheticBuildingFilters/InsertAtoms.cpp
  129. +3 −1 Source/Plugins/SyntheticBuilding/SyntheticBuildingFilters/InsertAtoms.h
  130. +17 −11 Source/Plugins/SyntheticBuilding/SyntheticBuildingFilters/InsertPrecipitatePhases.cpp
  131. +3 −6 Source/Plugins/SyntheticBuilding/SyntheticBuildingFilters/InsertPrecipitatePhases.h
  132. +7 −6 Source/Plugins/SyntheticBuilding/SyntheticBuildingFilters/JumbleOrientations.cpp
  133. +64 −63 Source/Plugins/SyntheticBuilding/SyntheticBuildingFilters/MatchCrystallography.cpp
  134. +1 −1 Source/Plugins/SyntheticBuilding/SyntheticBuildingFilters/MatchCrystallography.h
  135. +22 −16 Source/Plugins/SyntheticBuilding/SyntheticBuildingFilters/PackPrimaryPhases.cpp
  136. +0 −2 Source/Plugins/SyntheticBuilding/SyntheticBuildingFilters/PackPrimaryPhases.h
@@ -38,6 +38,8 @@

#include <cstring>

#include <QtCore/QFile>

#include "EbsdLib/HKL/CtfReader.h"

#include "UnitTestSupport.hpp"
@@ -208,20 +210,26 @@ class CtfReaderTest
int err = reader.readFile();
DREAM3D_REQUIRED(err, ==, 0)

QString header = reader.getOriginalHeader();
// QString header = reader.getOriginalHeader();

float* phi2Ptr = reinterpret_cast<float*>(reader.getPointerByName("Euler3"));
if(nullptr != phi2Ptr)
{
int total = reader.getXCells() * reader.getYCells() * reader.getZCells();
for(int i = 0; i < total; i++)
{
phi2Ptr[i] = phi2Ptr[i] + 30.0f;
phi2Ptr[i] = phi2Ptr[i] + 30.0F;
}
}

QString filePath = QString("%1/%2").arg(UnitTest::TestTempDir).arg("CTF_WriteFile_test.ctf");
reader.writeFile(filePath);
err = reader.writeFile(filePath);
DREAM3D_REQUIRE(err == 0);
if(REMOVE_TEST_FILES == 1)
{
bool removed = QFile::remove(filePath);
DREAM3D_REQUIRE(removed == true);
}
}

// -----------------------------------------------------------------------------
@@ -1,37 +1,4 @@
# ============================================================================
# Copyright (c) 2009-2015 BlueQuartz Software, LLC
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# Neither the name of BlueQuartz Software, the US Air Force, nor the names of its
# contributors may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# The code contained herein was partially funded by the followig contracts:
# United States Air Force Prime Contract FA8650-07-D-5800
# United States Air Force Prime Contract FA8650-10-D-5210
# United States Prime Contract Navy N00173-07-C-2068
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

# set project's name
PROJECT(OrientationLib VERSION ${DREAM3DProj_VERSION_MAJOR}.${DREAM3DProj_VERSION_MINOR})

@@ -138,9 +105,10 @@ cmp_IDE_GENERATED_PROPERTIES("Generated" "${OrientationLib_Generated_CMP_SRCS}"


#-- Include all the Source Files
include( ${OrientationLib_SOURCE_DIR}/Core/SourceList.cmake)
include( ${OrientationLib_SOURCE_DIR}/IO/SourceList.cmake)
include( ${OrientationLib_SOURCE_DIR}/LaueOps/SourceList.cmake)
include( ${OrientationLib_SOURCE_DIR}/OrientationMath/SourceList.cmake)
include( ${OrientationLib_SOURCE_DIR}/IO/SourceList.cmake)
include( ${OrientationLib_SOURCE_DIR}/Texture/SourceList.cmake)
include( ${OrientationLib_SOURCE_DIR}/Utilities/SourceList.cmake)

@@ -167,6 +135,8 @@ cmp_IDE_SOURCE_PROPERTIES( "" "${OrientationLib_HDRS}" "${OrientationLib_SRCS}"
set(OrientationLib_PROJECT_SRCS
${OrientationLib_SRCS}
${OrientationLib_HDRS}
${OrientationLib_Core_HDRS}
${OrientationLib_Core_SRCS}
${OrientationLib_LaueOps_HDRS}
${OrientationLib_LaueOps_SRCS}
${OrientationLib_OrientationMath_HDRS}
@@ -181,8 +151,6 @@ set(OrientationLib_PROJECT_SRCS
${OrientationLib_Generated_CMP_SRCS}
)



add_library(${PROJECT_NAME} ${LIB_TYPE} ${OrientationLib_PROJECT_SRCS})
CMP_AddDefinitions(TARGET ${PROJECT_NAME})
#-- Configure Target Specific Include Directories

0 comments on commit 1ab713b

Please sign in to comment.
You can’t perform that action at this time.