diff --git a/.clang-format b/.clang-format index 2f8961f9..01c041e0 100644 --- a/.clang-format +++ b/.clang-format @@ -1,12 +1,11 @@ --- -Language: Cpp -# BasedOnStyle: LLVM +Language: Cpp # AccessModifierOffset: -2 # AlignAfterOpenBracket: Align # AlignConsecutiveAssignments: false # AlignConsecutiveDeclarations: false # AlignEscapedNewlinesLeft: false -# AlignOperands: true +# AlignOperands: true # AlignTrailingComments: true # AllowAllParametersOfDeclarationOnNextLine: true # AllowShortBlocksOnASingleLine: false @@ -20,49 +19,45 @@ AllowShortFunctionsOnASingleLine: false AlwaysBreakTemplateDeclarations: true # BinPackArguments: true # BinPackParameters: true -BraceWrapping: - AfterClass: true +BraceWrapping: + AfterClass: true AfterControlStatement: true - AfterEnum: true - AfterFunction: true - AfterNamespace: true + AfterEnum: true + AfterFunction: true + AfterNamespace: true AfterObjCDeclaration: false - AfterStruct: true - AfterUnion: false - BeforeCatch: false - BeforeElse: true - IndentBraces: false + AfterStruct: true + AfterUnion: false + BeforeCatch: false + BeforeElse: true + IndentBraces: false #BreakBeforeBinaryOperators: None BreakBeforeBraces: Custom BreakBeforeTernaryOperators: false BreakConstructorInitializersBeforeComma: true -ColumnLimit: 200 -# CommentPragmas: '^ IWYU pragma:' +ColumnLimit: 200 +# CommentPragmas: '^ IWYU pragma:' # ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerIndentWidth: 0 # ContinuationIndentWidth: 4 # Cpp11BracedListStyle: true # DerivePointerAlignment: false -# DisableFormat: false +# DisableFormat: false # ExperimentalAutoDetectBinPacking: false -# ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] -SortIncludes: true -#IncludeBlocks: Regroup -IncludeCategories: - - Regex: '^(<|"(QtCore|QtWidgets|QtGui|QtNetwork)/)' - Priority: 5 - - Regex: '^"(SIMPL|llvm-c|clang|clang-c)/' - Priority: 100 - - Regex: '^"(SIMPLib/SIMPLib)' - Priority: 90 - - Regex: '.*' - Priority: 1000 +# ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] +# IncludeCategories: +# - Regex: '^"(llvm|llvm-c|clang|clang-c)/' +# Priority: 2 +# - Regex: '^(<|"(gtest|isl|json)/)' +# Priority: 3 +# - Regex: '.*' +# Priority: 1 # IndentCaseLabels: false -# IndentWidth: 2 +# IndentWidth: 2 # IndentWrappedFunctionNames: false # KeepEmptyLinesAtTheStartOfBlocks: true # MacroBlockBegin: '' -# MacroBlockEnd: '' +# MacroBlockEnd: '' # MaxEmptyLinesToKeep: 1 # NamespaceIndentation: None # ObjCBlockIndentWidth: 2 @@ -73,21 +68,22 @@ IncludeCategories: # PenaltyBreakFirstLessLess: 120 # PenaltyBreakString: 1000 # PenaltyExcessCharacter: 1000000 -# PenaltyReturnTypeOnItsOwnLine: 60 +PenaltyReturnTypeOnItsOwnLine: 100 PointerAlignment: Left -# ReflowComments: true +# ReflowComments: true +SortIncludes: true # SpaceAfterCStyleCast: false # SpaceBeforeAssignmentOperators: true SpaceBeforeParens: Never # SpaceInEmptyParentheses: false # SpacesBeforeTrailingComments: 1 -# SpacesInAngles: false +# SpacesInAngles: false # SpacesInContainerLiterals: true # SpacesInCStyleCastParentheses: false # SpacesInParentheses: false # SpacesInSquareBrackets: false -Standard: Cpp11 -TabWidth: 2 -UseTab: Never +SpaceAfterTemplateKeyword: true +Standard: c++20 +TabWidth: 2 +UseTab: Never ... - diff --git a/.clang-tidy b/.clang-tidy index aec8266d..6384629a 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,31 +1,56 @@ -Checks: '-*,modernize-use-nullptr,modernize-deprecated-headers,modernize-shrink-to-fit,modernize-use-bool-literals,modernize-use-default-member-init,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-override,modernize-use-equals-default,readability-avoid-const-params-in-decls,readability-braces-around-statements,readability-container-size-empty,readability-delete-null-pointer,readability-else-after-return,readability-implicit-bool-conversion,readability-redundant-control-flow,readability-redundant-declaration,readability-redundant-function-ptr-dereference,readability-redundant-member-init,readability-redundant-smartptr-get,readability-redundant-string-cstr,readability-redundant-string-init,readability-simplify-boolean-expr,readability-simplify-subscript-expr,readability-static-accessed-through-instance,readability-static-definition-in-anonymous-namespace,readability-string-compare,bugprone-unused-return-value' -WarningsAsErrors: '' -HeaderFilterRegex: '' -AnalyzeTemporaryDtors: false -FormatStyle: file -User: mjackson +--- +Checks: "-abseil-*, + bugprone-*, + -boost-*, + -cert-*, + clang-diagnostic-*, + -clang-diagnostic-documentation, + clang-analyzer-*, + cppcoreguidelines-*, + -cppcoreguidelines-avoid-magic-numbers, + -darwin-*, + -fuchsia-*, + -google-*, + -hicpp-*, + -linuxkernel-*, + -llvm-*, + misc-*, + modernize-*, + -modernize-use-trailing-return-type, + -modernize-use-nodiscard, + -modernize-use-auto, + -mpi-*, + -objc-*, + -openmp-*, + performance-*, + -portability-*, + readability-*, + -readability-function-cognitive-complexity, + -readability-function-size, + -readability-uppercase-literal-suffix, + -readability-magic-numbers" +WarningsAsErrors: '*' +HeaderFilterRegex: 'simplnx/.*\.hpp' +FormatStyle: file CheckOptions: - - key: google-readability-braces-around-statements.ShortStatementLines - value: '1' - - key: google-readability-function-size.StatementThreshold - value: '800' - - key: google-readability-namespace-comments.ShortNamespaceLines - value: '10' - - key: google-readability-namespace-comments.SpacesBeforeComments - value: '2' - - key: modernize-loop-convert.MaxCopySize - value: '16' - - key: modernize-loop-convert.MinConfidence - value: reasonable - - key: modernize-loop-convert.NamingStyle - value: CamelCase - - key: modernize-pass-by-value.IncludeStyle - value: llvm - - key: modernize-replace-auto-ptr.IncludeStyle - value: llvm - - key: modernize-use-default-member-init.IgnoreMacros - value: '1' - - key: modernize-use-default-member-init.UseAssignment - value: '1' - - key: modernize-use-nullptr.NullMacros - value: 'NULL' + cppcoreguidelines-macro-usage.AllowedRegexp: 'SIMPLNX_EXPORT|SIMPLNX_NO_EXPORT|SIMPLNX_DEPRECATED' + readability-identifier-naming.IgnoreMainLikeFunctions: 'false' + readability-identifier-naming.PrivateMemberPrefix: 'm_' + readability-identifier-naming.NamespaceCase: lower_case + readability-identifier-naming.ClassCase: CamelCase + readability-identifier-naming.ClassMethodCase: camelBack + readability-identifier-naming.PrivateMember: CamelCase + readability-identifier-naming.PublicMemberCase: CamelCase + readability-identifier-naming.StructCase: CamelCase + readability-identifier-naming.FunctionCase: camelBack + readability-identifier-naming.VariableCase: camelBack + readability-identifier-naming.GlobalVariableCase: CamelCase + readability-identifier-naming.GlobalConstantCase: CamelCase + readability-identifier-naming.GlobalConstantPrefix: 'k_' + readability-identifier-naming.GlobalFunctionCase: CamelCase + readability-identifier-naming.LocalPointerCase: camelBack + readability-identifier-naming.LocalPointerSuffix: 'Ptr' + readability-identifier-naming.TypeAliasCase: CamelCase + readability-identifier-naming.TypeAliasSuffix: 'Type' + readability-identifier-naming.MacroDefinitionCase: UPPER_CASE +... diff --git a/.gitignore b/.gitignore index b084e63c..62f5f959 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ __pycache__/ release debug Test/ProjectTest/Build +CMakeUserPresets.json # Python build-related files pyebsd/build/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 35056fec..12f1a29f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # set project's name -project(EbsdLibProj VERSION 1.0.39) +project(EbsdLibProj VERSION 1.0.40) # ---------- Setup output Directories ------------------------- set(CMAKE_LIBRARY_OUTPUT_DIRECTORY diff --git a/CMakePresets.json b/CMakePresets.json index 37d91603..fbcd53c4 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -27,7 +27,7 @@ }, "VCPKG_INSTALLED_DIR": { "type": "STRING", - "value": "${sourceDir}/../vcpkg-installed" + "value": "${sourceDir}/../vcpkg-installed-ebsd-lib" }, "VCPKG_MANIFEST_INSTALL": { "type": "BOOL", diff --git a/LaueNotes.md b/LaueNotes.md index eec2c86e..f1a9487f 100644 --- a/LaueNotes.md +++ b/LaueNotes.md @@ -6,10 +6,10 @@ There are several LaueOps classes that have incomplete implementations. This doc ### Texture::CalculateODFData() ### -| | Triclinic | Monoclinic | OrthoRhombic | Tetragonal_Low | Tetragonal_High | Trigonal_Low | Trigonal_High | Hexagonal_Low | Hexagonal_Low | Cubic_Low | Cubic_High | -|---|-----------|------------|--------------|----------------|-----------------|--------------|---------------|---------------|---------------|-----------|----------| -| getODFFZRod() | O | O | O | O | O | O | O | O | O | O | O | -| getOdfBin() | O | O | O | O | O | O | O | O | O | O | O | +| | Triclinic | Monoclinic | OrthoRhombic | Tetragonal_Low | Tetragonal_High | Trigonal_Low | Trigonal_High | Hexagonal_Low | Hexagonal_Low | Cubic_Low | Cubic_High | +|---------------|-----------|------------|--------------|----------------|-----------------|--------------|---------------|---------------|---------------|-----------|------------| +| getODFFZRod() | O | O | O | O | O | O | O | O | O | O | O | +| getOdfBin() | O | O | O | O | O | O | O | O | O | O | O | ### StatsGen::GenODFPlotData() ### diff --git a/README.md b/README.md index 2e512d07..c64aa3c5 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ EBSDLib is a C++ Library that can read EBSD Files from OEMs and perform basic EB library is to be able to convert between the seven orientation representations that are typically used through out materials science and engineering domains. -The DREAM.3D project ( [code repository](http://www.github.com/bluequartzsoftware/DREAM3D) and [web site](https://www.dream3d.io) ) uses this library for all of the EBSD processing. +The [DREAM.3D](https://dream3d.bluequartz.net) project and [DREAM3D-NX](https://www.dream3d.io) uses this library for all the EBSD processing. -## Supported EBSD OEM Data Files ## +## Supported EBSD OEM Data FilesDirectionalStatsTest + EDAX/AMETEK: .ang and HDF5 based file formats + Oxford Instruments: .ctf and .h5oina file formats @@ -14,17 +14,55 @@ The DREAM.3D project ( [code repository](http://www.github.com/bluequartzsoftwar Please have a look at the unit tests for examples on using the various readers. -## Orientation Representations ## - -| From/To | Euler | Orientation Matrix | Axis Angle | Rodrigues | Quaternion | Homochoric | Cubochoric | -| ------- |-------| ------- |------- |------- |------- |------- |------- | -|Euler| - | X | X | X | X | a | ah | -|Orientation Matrix| X | -- | X | e | X | a | ah | -|Axis Angle| o | X | -- | X | X | X | h | -|Rodrigues| o | a | X | -- | a | X | h | -|Quaternion| X | X | X | X | -- | X | h | -|Homochoric| ao | a | X | a | a | -- | X | -|Cubochoric| hao | ha | h | ha | ha | X | -- | +## Crystallographic Classes +| # | Point Group (H–M) | Rotation Point Group | Space Group No(s). | Schoenflies | Crystal system | Laue class | Laue Ops | +|---:|-------------------|----------------------|--------------------|---------------|----------------|-------------|------------------| +| 1 | 1 | 1 | 1 | C₁ | Triclinic | (\bar{1}) | TriclinicOps | +| 2 | (\bar{1}) | 1 | 2 | C(_i) | Triclinic | (\bar{1}) | | +| 3 | 2 | 2 | 3–5 | C₂ | Monoclinic | 2/m | | +| 4 | m | 1 | 6–9 | C(_s) | Monoclinic | 2/m | | +| 5 | 2/m | 2 | 10–15 | C(_{2h}) | Monoclinic | 2/m | MonoclinicOps | +| 6 | 222 | 222 | 16–24 | D₂ | Orthorhombic | mmm | | +| 7 | mm2 | 2 | 25–46 | C(_{2v}) | Orthorhombic | mmm | | +| 8 | mmm | 222 | 47–74 | D(_{2h}) | Orthorhombic | mmm | OrthorhombicOps | +| 9 | 4 | 4 | 75–80 | C₄ | Tetragonal | 4/m | | +| 10 | (\bar{4}) | 2 | 81–82 | S₄ | Tetragonal | 4/m | | +| 11 | 4/m | 4 | 83–88 | C(_{4h}) | Tetragonal | 4/m | TetragonalLowOps | +| 12 | 422 | 422 | 89–98 | D₄ | Tetragonal | 4/mmm | | +| 13 | 4mm | 4 | 99–110 | C(_{4v}) | Tetragonal | 4/mmm | | +| 14 | (\bar{4}2m) | 222 | 111–122 | D(_{2d}) | Tetragonal | 4/mmm | | +| 15 | 4/mmm | 422 | 123–142 | D(_{4h}) | Tetragonal | 4/mmm | TetragonalOps | +| 16 | 3 | 3 | 143–146 | C₃ | Trigonal | (\bar{3}) | | +| 17 | (\bar{3}) | 3 | 147–148 | C(_{3i}) (S₆) | Trigonal | (\bar{3}) | TrigonalLowOps | +| 18 | 32 | 32 | 149–155 | D₃ | Trigonal | (\bar{3}m) | | +| 19 | 3m | 3 | 156–161 | C(_{3v}) | Trigonal | (\bar{3}m) | | +| 20 | (\bar{3}m) | 32 | 162–167 | D(_{3d}) | Trigonal | (\bar{3}m) | TrigonalOps | +| 21 | 6 | 6 | 168–173 | C₆ | Hexagonal | 6/m | | +| 22 | (\bar{6}) | 3 | 174 | C(_{3h}) | Hexagonal | 6/m | | +| 23 | 6/m | 6 | 175–176 | C(_{6h}) | Hexagonal | 6/m | HexagonalLowOps | +| 24 | 622 | 622 | 177–182 | D₆ | Hexagonal | 6/mmm | | +| 25 | 6mm | 6 | 183–186 | C(_{6v}) | Hexagonal | 6/mmm | | +| 26 | (\bar{6}m2) | 32 | 187–190 | D(_{3h}) | Hexagonal | 6/mmm | | +| 27 | 6/mmm | 622 | 191–194 | D(_{6h}) | Hexagonal | 6/mmm | HexagonalOps | +| 28 | 23 | 23 | 195–199 | T | Cubic | m(\bar{3}) | | +| 29 | m(\bar{3}) | 23 | 200–206 | T(_h) | Cubic | m(\bar{3}) | CubicLowOps | +| 30 | 432 | 432 | 207–214 | O | Cubic | m(\bar{3})m | | +| 31 | (\bar{4}3m) | 23 | 215–220 | T(_d) | Cubic | m(\bar{3})m | | +| 32 | m(\bar{3})m | 432 | 221–230 | O(_h) | Cubic | m(\bar{3})m | CubicOps | + + +## Orientation TransformationsDirectionalStatsTest + +| From/To | Euler | Orientation Matrix | Axis Angle | Rodrigues | Quaternion | Homochoric | Cubochoric | Stereographic | +|--------------------|-------|--------------------|------------|-----------|------------|------------|------------|---------------| +| Euler | - | X | X | X | X | a | ah | q | +| Orientation Matrix | X | -- | X | e | X | a | ah | q | +| Axis Angle | o | X | -- | X | X | X | h | q | +| Rodrigues | o | a | X | -- | a | X | h | q | +| Quaternion | X | X | X | X | -- | X | h | q | +| Homochoric | ao | a | X | a | a | -- | X | q | +| Cubochoric | hao | ha | h | ha | ha | X | -- | q | +| Stereographic | a | a | X | X | a | X | hc | -- | **LEGEND**: X = Direct mathematical conversion between the representations lower case letters denote the conversion uses other more basic conversions. For @@ -38,13 +76,13 @@ library has selected to align with the AMETEK/EDAX output. The folder Data/IPF_Legend has premade IPF Legends for all the Laue classes. -## Quaternion Convention ## +## Quaternion ConventionDirectionalStatsTest -Please also note that by default EbsdLib organizes Quaternions as Vector-Scalar. If your quaternions -are layed out as Scalar-Vector there is an extra argument to some functions that you +Please also note that by default EbsdLib organizes Quaternions as Vector-Scalar (X,Y,Z,W). If your quaternions +are laid out as Scalar-Vector (w,x,y,z) there is an extra argument to some functions that you can set to allow the orientation transformations to accept this layout. -## Dependent Libraries ## +## Dependent LibrariesDirectionalStatsTest EbsdLib is dependent on: @@ -53,19 +91,19 @@ EbsdLib is dependent on: ## Optional Libraries + HDF5 1.10.4 (HDF5 is optional only if you want the HDF5 functionality) -+ Qt5 5.15.x (minimum) ++ Qt5 5.15.x (minimum: Optional) -## Rotation Convention ## +## Rotation ConventionDirectionalStatsTest By convention this library uses **Passive** rotations -## Citations ## +## CitationsDirectionalStatsTest D Rowenhorst, A D Rollett, G S Rohrer, M Groeber, M Jackson, P J Konijnenberg and M De Graef _et al_ 2015 _Modelling Simul. Mater. Sci. Eng._ **23** 083501 [DOI: https://doi.org/10.1088/0965-0393/23/8/083501](https://doi.org/10.1088/0965-0393/23/8/083501) -## Examples ## +## ExamplesDirectionalStatsTest If you want to transform an Euler angle into a Quaternion the following works: diff --git a/Source/Apps/eq_orientations.cpp b/Source/Apps/eq_orientations.cpp index 373d67fb..6997ce64 100644 --- a/Source/Apps/eq_orientations.cpp +++ b/Source/Apps/eq_orientations.cpp @@ -22,8 +22,8 @@ bool quaternionsAreClose(const QuatD& q1, const QuatD& q2, double tolerance = 1e int v1(QuatD q1, QuatD q2) { - q1 = q1.unitQuaternion(); - q2 = q2.unitQuaternion(); + q1 = q1.normalize(); + q2 = q2.normalize(); const QuatD q2Negate = -q2; LaueOps::Pointer cubicOps = LaueOps::GetAllOrientationOps()[1]; @@ -60,8 +60,8 @@ int v1(QuatD q1, QuatD q2) int v2(QuatD q1, QuatD q2) { double tolerance = 1e-6; - q1 = q1.unitQuaternion(); - q2 = q2.unitQuaternion(); + q1 = q1.normalize(); + q2 = q2.normalize(); LaueOps::Pointer cubicOps = LaueOps::GetAllOrientationOps()[1]; double minDiff = 1.0; @@ -132,9 +132,9 @@ std::vector ReadDoublesFromCSV(const std::string& filePath) int main(int argc, char* argv[]) { std::vector q = ReadDoublesFromCSV(argv[1]); - for(int i = 0; i < q.size(); i=i+8) + for(int i = 0; i < q.size(); i = i + 8) { - std::cout << (i/8) << ": "; - v2({q[i], q[i+1], q[i+2], q[i+3]}, {q[i+4], q[i+5], q[i+6], q[i+7]}); + std::cout << (i / 8) << ": "; + v2({q[i], q[i + 1], q[i + 2], q[i + 3]}, {q[i + 4], q[i + 5], q[i + 6], q[i + 7]}); } } diff --git a/Source/EbsdLib/Core/AbstractEbsdFields.cpp b/Source/EbsdLib/Core/AbstractEbsdFields.cpp index c8c286ac..b0606b71 100644 --- a/Source/EbsdLib/Core/AbstractEbsdFields.cpp +++ b/Source/EbsdLib/Core/AbstractEbsdFields.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Core/AbstractEbsdFields.h b/Source/EbsdLib/Core/AbstractEbsdFields.h index 122d5a79..b97a249d 100644 --- a/Source/EbsdLib/Core/AbstractEbsdFields.h +++ b/Source/EbsdLib/Core/AbstractEbsdFields.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Core/EbsdDataArray.cpp b/Source/EbsdLib/Core/EbsdDataArray.cpp index 63097478..cc0c62c2 100644 --- a/Source/EbsdLib/Core/EbsdDataArray.cpp +++ b/Source/EbsdLib/Core/EbsdDataArray.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Core/EbsdDataArray.hpp b/Source/EbsdLib/Core/EbsdDataArray.hpp index d4f1b5c0..43da0703 100644 --- a/Source/EbsdLib/Core/EbsdDataArray.hpp +++ b/Source/EbsdLib/Core/EbsdDataArray.hpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Core/EbsdLibConstants.h b/Source/EbsdLib/Core/EbsdLibConstants.h index 7403e64b..f4341e25 100644 --- a/Source/EbsdLib/Core/EbsdLibConstants.h +++ b/Source/EbsdLib/Core/EbsdLibConstants.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -283,7 +283,10 @@ inline constexpr double r24 = 4.8989794855663560; // sqrt(24) inline constexpr double tfit[16] = {1.00000000000188520, -0.50000000021948470, -0.0249999921275931260, -0.0039287015447813740, -0.00081527015354504380, -0.00020095004261197120, -0.000023979867760717560, -0.000082028689266058410, +0.000124487150420900920, -0.00017491142148225770, +0.00017034819341400540, -0.000120620650041168280, +0.0000597197058686608260, -0.000019807567239656470, +0.0000039537146842128740, -0.000000365550014397195440}; -inline constexpr double BP[6] = {0.0, 1.0, 0.5773502691896260, 0.4142135623730950, 0.0, 0.2679491924311230}; // used for Fundamental Zone determination in so3 module +inline constexpr double BP[12] = { + 0.0, 1.0, 0.577350269189626, 0.414213562373095, 0.0, 0.267949192431123, 0.0, 0.198912367379658, 0.0, 0.158384440324536, 0.0, 0.131652497587396}; // used for Fundamental Zone determination in so3 + // module + } // namespace LambertParametersType // Add some shortened namespace alias diff --git a/Source/EbsdLib/Core/EbsdLibDLLExport.h b/Source/EbsdLib/Core/EbsdLibDLLExport.h index cadbfbe0..c1fe4bb8 100644 --- a/Source/EbsdLib/Core/EbsdLibDLLExport.h +++ b/Source/EbsdLib/Core/EbsdLibDLLExport.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Core/EbsdMacros.h b/Source/EbsdLib/Core/EbsdMacros.h index d16019c7..462c7b4f 100644 --- a/Source/EbsdLib/Core/EbsdMacros.h +++ b/Source/EbsdLib/Core/EbsdMacros.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Core/EbsdSetGetMacros.h b/Source/EbsdLib/Core/EbsdSetGetMacros.h index d58a23bc..2a804241 100644 --- a/Source/EbsdLib/Core/EbsdSetGetMacros.h +++ b/Source/EbsdLib/Core/EbsdSetGetMacros.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Core/EbsdTransform.cpp b/Source/EbsdLib/Core/EbsdTransform.cpp index f965b870..4f4afb5e 100644 --- a/Source/EbsdLib/Core/EbsdTransform.cpp +++ b/Source/EbsdLib/Core/EbsdTransform.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Core/EbsdTransform.h b/Source/EbsdLib/Core/EbsdTransform.h index 2eb45248..ee69912d 100644 --- a/Source/EbsdLib/Core/EbsdTransform.h +++ b/Source/EbsdLib/Core/EbsdTransform.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Core/Orientation.hpp b/Source/EbsdLib/Core/Orientation.hpp index 55fb5d8e..792f9b15 100644 --- a/Source/EbsdLib/Core/Orientation.hpp +++ b/Source/EbsdLib/Core/Orientation.hpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Core/OrientationMath.cpp b/Source/EbsdLib/Core/OrientationMath.cpp index 93aa1d0f..7a386861 100644 --- a/Source/EbsdLib/Core/OrientationMath.cpp +++ b/Source/EbsdLib/Core/OrientationMath.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Core/OrientationMath.h b/Source/EbsdLib/Core/OrientationMath.h index bf504993..04d581c9 100644 --- a/Source/EbsdLib/Core/OrientationMath.h +++ b/Source/EbsdLib/Core/OrientationMath.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Core/OrientationTransformation.hpp b/Source/EbsdLib/Core/OrientationTransformation.hpp index 4b7c80d5..44c158aa 100644 --- a/Source/EbsdLib/Core/OrientationTransformation.hpp +++ b/Source/EbsdLib/Core/OrientationTransformation.hpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Core/Quaternion.hpp b/Source/EbsdLib/Core/Quaternion.hpp index 9b6f2f5d..59d62293 100644 --- a/Source/EbsdLib/Core/Quaternion.hpp +++ b/Source/EbsdLib/Core/Quaternion.hpp @@ -66,11 +66,15 @@ class Quaternion Quaternion& operator=(const Quaternion&) = default; Quaternion& operator=(Quaternion&&) noexcept = default; + /** + * @brief Creates a Quaternion that is an "Identity" + * @param size This MUST be 4 (this is for historical reasons) + */ Quaternion(size_type size) { if(size != 4) { - throw std::runtime_error("Quaternion Contructors needs argument of '4' for size."); + throw std::runtime_error("Quaternion Constructor needs argument of '4' for size."); } } @@ -100,6 +104,9 @@ class Quaternion // } // } + /** + * @brief Converts this quaternion to a Quaternion that uses a different primitve type such as float or double. + */ template && std::numeric_limits::has_infinity>> Quaternion to() const { @@ -449,7 +456,7 @@ class Quaternion } /** - * @brief heck if this is a unit quaternion + * @brief check if this is a unit quaternion * @param tolerance * @return */ @@ -459,11 +466,11 @@ class Quaternion } /** - * @brief UnitQuaternion (Normalize) Converts the quaternion into its normalized values (x/L, y/L, z/L, w/L) where "L" + * @brief Normalize: Converts the quaternion into its normalized values (x/L, y/L, z/L, w/L) where "L" * is the "length" of the quaternion * @return qr */ - Quaternion unitQuaternion() const + Quaternion normalize() const { T l = length(); return {m_X / l, m_Y / l, m_Z / l, m_W / l}; @@ -552,6 +559,35 @@ class Quaternion return rotatedVector; } + /** + * @brief Ensures this quaternion represents an orientation that is located in the northern hemisphere. + * + * NOTE: This is done IN PLACE!! + */ + void positiveOrientation() + { + if(m_W < static_cast(0.0)) + { + m_X = -m_X; + m_Y = -m_Y; + m_Z = -m_Z; + m_W = -m_W; + } + } + + /** + * @brief Returns a new quaternion that represents an orientation that is located in the northern hemisphere + * @return Copy of Quaternion + */ + Quaternion getPositiveOrientation() const + { + if(m_W < static_cast(0.0)) + { + return {-m_X, -m_Y, -m_Z, -m_W}; + } + return {m_X, m_Y, m_Z, m_W}; + } + private: T m_X = 0.0; T m_Y = 0.0; diff --git a/Source/EbsdLib/IO/AngleFileLoader.cpp b/Source/EbsdLib/IO/AngleFileLoader.cpp index b7ddd4a6..eaabfe8f 100644 --- a/Source/EbsdLib/IO/AngleFileLoader.cpp +++ b/Source/EbsdLib/IO/AngleFileLoader.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/AngleFileLoader.h b/Source/EbsdLib/IO/AngleFileLoader.h index 879711c2..8b16f480 100644 --- a/Source/EbsdLib/IO/AngleFileLoader.h +++ b/Source/EbsdLib/IO/AngleFileLoader.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/EbsdHeaderEntry.h b/Source/EbsdLib/IO/EbsdHeaderEntry.h index 3ee70a23..01ba43f5 100644 --- a/Source/EbsdLib/IO/EbsdHeaderEntry.h +++ b/Source/EbsdLib/IO/EbsdHeaderEntry.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/EbsdImporter.h b/Source/EbsdLib/IO/EbsdImporter.h index b60276dc..11639e3f 100644 --- a/Source/EbsdLib/IO/EbsdImporter.h +++ b/Source/EbsdLib/IO/EbsdImporter.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/EbsdReader.cpp b/Source/EbsdLib/IO/EbsdReader.cpp index 2de06475..719f4350 100644 --- a/Source/EbsdLib/IO/EbsdReader.cpp +++ b/Source/EbsdLib/IO/EbsdReader.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/EbsdReader.h b/Source/EbsdLib/IO/EbsdReader.h index c93368c2..d683615c 100644 --- a/Source/EbsdLib/IO/EbsdReader.h +++ b/Source/EbsdLib/IO/EbsdReader.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/H5EbsdVolumeInfo.cpp b/Source/EbsdLib/IO/H5EbsdVolumeInfo.cpp index 89ddede7..ae313131 100644 --- a/Source/EbsdLib/IO/H5EbsdVolumeInfo.cpp +++ b/Source/EbsdLib/IO/H5EbsdVolumeInfo.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/H5EbsdVolumeInfo.h b/Source/EbsdLib/IO/H5EbsdVolumeInfo.h index 168f290b..65dfff35 100644 --- a/Source/EbsdLib/IO/H5EbsdVolumeInfo.h +++ b/Source/EbsdLib/IO/H5EbsdVolumeInfo.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/H5EbsdVolumeReader.cpp b/Source/EbsdLib/IO/H5EbsdVolumeReader.cpp index d456ebd4..3097d599 100644 --- a/Source/EbsdLib/IO/H5EbsdVolumeReader.cpp +++ b/Source/EbsdLib/IO/H5EbsdVolumeReader.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/H5EbsdVolumeReader.h b/Source/EbsdLib/IO/H5EbsdVolumeReader.h index e736a02b..264ef7a3 100644 --- a/Source/EbsdLib/IO/H5EbsdVolumeReader.h +++ b/Source/EbsdLib/IO/H5EbsdVolumeReader.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/HKL/CtfConstants.h b/Source/EbsdLib/IO/HKL/CtfConstants.h index bf09021c..95116629 100644 --- a/Source/EbsdLib/IO/HKL/CtfConstants.h +++ b/Source/EbsdLib/IO/HKL/CtfConstants.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/HKL/CtfFields.cpp b/Source/EbsdLib/IO/HKL/CtfFields.cpp index 22d53b6c..0a55d90e 100644 --- a/Source/EbsdLib/IO/HKL/CtfFields.cpp +++ b/Source/EbsdLib/IO/HKL/CtfFields.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/HKL/CtfFields.h b/Source/EbsdLib/IO/HKL/CtfFields.h index 17274b4b..83a58f28 100644 --- a/Source/EbsdLib/IO/HKL/CtfFields.h +++ b/Source/EbsdLib/IO/HKL/CtfFields.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/HKL/CtfHeaderEntry.h b/Source/EbsdLib/IO/HKL/CtfHeaderEntry.h index 01c232ef..ef055cc9 100644 --- a/Source/EbsdLib/IO/HKL/CtfHeaderEntry.h +++ b/Source/EbsdLib/IO/HKL/CtfHeaderEntry.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/HKL/CtfPhase.cpp b/Source/EbsdLib/IO/HKL/CtfPhase.cpp index 666cf5ef..bfe4d4cf 100644 --- a/Source/EbsdLib/IO/HKL/CtfPhase.cpp +++ b/Source/EbsdLib/IO/HKL/CtfPhase.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/HKL/CtfPhase.h b/Source/EbsdLib/IO/HKL/CtfPhase.h index 6b52d0f2..305f6521 100644 --- a/Source/EbsdLib/IO/HKL/CtfPhase.h +++ b/Source/EbsdLib/IO/HKL/CtfPhase.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/HKL/CtfReader.cpp b/Source/EbsdLib/IO/HKL/CtfReader.cpp index a5e146a2..09b44ff7 100644 --- a/Source/EbsdLib/IO/HKL/CtfReader.cpp +++ b/Source/EbsdLib/IO/HKL/CtfReader.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/HKL/CtfReader.h b/Source/EbsdLib/IO/HKL/CtfReader.h index 248564e6..5b024b52 100644 --- a/Source/EbsdLib/IO/HKL/CtfReader.h +++ b/Source/EbsdLib/IO/HKL/CtfReader.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/HKL/DataParser.hpp b/Source/EbsdLib/IO/HKL/DataParser.hpp index e89e04c3..3554954a 100644 --- a/Source/EbsdLib/IO/HKL/DataParser.hpp +++ b/Source/EbsdLib/IO/HKL/DataParser.hpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/HKL/H5CtfImporter.cpp b/Source/EbsdLib/IO/HKL/H5CtfImporter.cpp index ee0d83ff..d3f209db 100644 --- a/Source/EbsdLib/IO/HKL/H5CtfImporter.cpp +++ b/Source/EbsdLib/IO/HKL/H5CtfImporter.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/HKL/H5CtfImporter.h b/Source/EbsdLib/IO/HKL/H5CtfImporter.h index be5b04ea..be8ced25 100644 --- a/Source/EbsdLib/IO/HKL/H5CtfImporter.h +++ b/Source/EbsdLib/IO/HKL/H5CtfImporter.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/HKL/H5CtfReader.cpp b/Source/EbsdLib/IO/HKL/H5CtfReader.cpp index b81567c0..0d91cf0a 100644 --- a/Source/EbsdLib/IO/HKL/H5CtfReader.cpp +++ b/Source/EbsdLib/IO/HKL/H5CtfReader.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/HKL/H5CtfReader.h b/Source/EbsdLib/IO/HKL/H5CtfReader.h index 54e8d719..b7e0d244 100644 --- a/Source/EbsdLib/IO/HKL/H5CtfReader.h +++ b/Source/EbsdLib/IO/HKL/H5CtfReader.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/HKL/H5CtfVolumeReader.cpp b/Source/EbsdLib/IO/HKL/H5CtfVolumeReader.cpp index 27d29724..0553cc75 100644 --- a/Source/EbsdLib/IO/HKL/H5CtfVolumeReader.cpp +++ b/Source/EbsdLib/IO/HKL/H5CtfVolumeReader.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/HKL/H5CtfVolumeReader.h b/Source/EbsdLib/IO/HKL/H5CtfVolumeReader.h index cb887acd..2bcddbe0 100644 --- a/Source/EbsdLib/IO/HKL/H5CtfVolumeReader.h +++ b/Source/EbsdLib/IO/HKL/H5CtfVolumeReader.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/TSL/AngConstants.h b/Source/EbsdLib/IO/TSL/AngConstants.h index a465b0b8..ad0b4672 100644 --- a/Source/EbsdLib/IO/TSL/AngConstants.h +++ b/Source/EbsdLib/IO/TSL/AngConstants.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/TSL/AngFields.cpp b/Source/EbsdLib/IO/TSL/AngFields.cpp index a50c202a..2cac7e32 100644 --- a/Source/EbsdLib/IO/TSL/AngFields.cpp +++ b/Source/EbsdLib/IO/TSL/AngFields.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/TSL/AngFields.h b/Source/EbsdLib/IO/TSL/AngFields.h index f4c244ff..12b3d88f 100644 --- a/Source/EbsdLib/IO/TSL/AngFields.h +++ b/Source/EbsdLib/IO/TSL/AngFields.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/TSL/AngHeaderEntry.h b/Source/EbsdLib/IO/TSL/AngHeaderEntry.h index e67e4329..f80637d5 100644 --- a/Source/EbsdLib/IO/TSL/AngHeaderEntry.h +++ b/Source/EbsdLib/IO/TSL/AngHeaderEntry.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/TSL/AngPhase.cpp b/Source/EbsdLib/IO/TSL/AngPhase.cpp index 446df278..53bbf2c1 100644 --- a/Source/EbsdLib/IO/TSL/AngPhase.cpp +++ b/Source/EbsdLib/IO/TSL/AngPhase.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/TSL/AngPhase.h b/Source/EbsdLib/IO/TSL/AngPhase.h index 6584e589..c94d70cd 100644 --- a/Source/EbsdLib/IO/TSL/AngPhase.h +++ b/Source/EbsdLib/IO/TSL/AngPhase.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/TSL/AngReader.cpp b/Source/EbsdLib/IO/TSL/AngReader.cpp index 17de0b1c..e1944446 100644 --- a/Source/EbsdLib/IO/TSL/AngReader.cpp +++ b/Source/EbsdLib/IO/TSL/AngReader.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/TSL/AngReader.h b/Source/EbsdLib/IO/TSL/AngReader.h index bf916ba4..390e36fb 100644 --- a/Source/EbsdLib/IO/TSL/AngReader.h +++ b/Source/EbsdLib/IO/TSL/AngReader.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/TSL/H5AngImporter.cpp b/Source/EbsdLib/IO/TSL/H5AngImporter.cpp index 556c1282..bbe0aba1 100644 --- a/Source/EbsdLib/IO/TSL/H5AngImporter.cpp +++ b/Source/EbsdLib/IO/TSL/H5AngImporter.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/TSL/H5AngImporter.h b/Source/EbsdLib/IO/TSL/H5AngImporter.h index 0fa62fa2..ec51df82 100644 --- a/Source/EbsdLib/IO/TSL/H5AngImporter.h +++ b/Source/EbsdLib/IO/TSL/H5AngImporter.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/TSL/H5AngReader.cpp b/Source/EbsdLib/IO/TSL/H5AngReader.cpp index 5e92ac2b..013a0eeb 100644 --- a/Source/EbsdLib/IO/TSL/H5AngReader.cpp +++ b/Source/EbsdLib/IO/TSL/H5AngReader.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/TSL/H5AngReader.h b/Source/EbsdLib/IO/TSL/H5AngReader.h index 7d6916cf..6216d9e4 100644 --- a/Source/EbsdLib/IO/TSL/H5AngReader.h +++ b/Source/EbsdLib/IO/TSL/H5AngReader.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/TSL/H5AngVolumeReader.cpp b/Source/EbsdLib/IO/TSL/H5AngVolumeReader.cpp index 4f332d5f..f9a82bdf 100644 --- a/Source/EbsdLib/IO/TSL/H5AngVolumeReader.cpp +++ b/Source/EbsdLib/IO/TSL/H5AngVolumeReader.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -343,12 +343,6 @@ int H5AngVolumeReader::loadData(int64_t xpoints, int64_t ypoints, int64_t zpoint xpointsslice = reader->getNumEvenCols(); ypointsslice = reader->getNumRows(); float* euler1Ptr = reader->getPhi1Pointer(); - if(nullptr == euler1Ptr) - { - setErrorCode(-99090); - setErrorMessage("Euler1 Pointer was nullptr from Reader"); - return getErrorCode(); - } float* euler2Ptr = reader->getPhiPointer(); float* euler3Ptr = reader->getPhi2Pointer(); float* xPtr = reader->getXPositionPointer(); diff --git a/Source/EbsdLib/IO/TSL/H5AngVolumeReader.h b/Source/EbsdLib/IO/TSL/H5AngVolumeReader.h index db83d0e6..fb572cf8 100644 --- a/Source/EbsdLib/IO/TSL/H5AngVolumeReader.h +++ b/Source/EbsdLib/IO/TSL/H5AngVolumeReader.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/TSL/H5OIMReader.cpp b/Source/EbsdLib/IO/TSL/H5OIMReader.cpp index a37bcd71..84388ebb 100644 --- a/Source/EbsdLib/IO/TSL/H5OIMReader.cpp +++ b/Source/EbsdLib/IO/TSL/H5OIMReader.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/IO/TSL/H5OIMReader.h b/Source/EbsdLib/IO/TSL/H5OIMReader.h index 55b9c246..d8afd7ab 100644 --- a/Source/EbsdLib/IO/TSL/H5OIMReader.h +++ b/Source/EbsdLib/IO/TSL/H5OIMReader.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/LaueOps/CubicLowOps.cpp b/Source/EbsdLib/LaueOps/CubicLowOps.cpp index a128bf8d..0e8a52ea 100644 --- a/Source/EbsdLib/LaueOps/CubicLowOps.cpp +++ b/Source/EbsdLib/LaueOps/CubicLowOps.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -236,7 +236,23 @@ std::string CubicLowOps::getRotationPointGroup() const } // ----------------------------------------------------------------------------- -// +int CubicLowOps::getPointGroup() const +{ + return 29; +} + +// ----------------------------------------------------------------------------- +bool CubicLowOps::isInsideFZ(const QuatD& quat) const +{ + return IsInsideFZ(quat, getFZType(), getAxisOrderingType()); +} + +// ----------------------------------------------------------------------------- +bool CubicLowOps::isInsideFZ(const OrientationD& rod) const +{ + return IsInsideFZ(rod, getFZType(), getAxisOrderingType()); +} + // ----------------------------------------------------------------------------- OrientationD CubicLowOps::calculateMisorientation(const QuatD& q1, const QuatD& q2) const { @@ -380,6 +396,13 @@ QuatF CubicLowOps::getNearestQuat(const QuatF& q1f, const QuatF& q2f) const return _calcNearestQuat(CubicLow::QuatSym, q1f.to(), q2f.to()).to(); } +QuatD CubicLowOps::getFZQuat(const QuatD& qr) const +{ + LaueOps::FZType fzType = laue_ops::FZtarray[getPointGroup() - 1]; + LaueOps::AxisOrderingType orderingType = laue_ops::FZoarray[getPointGroup() - 1]; + return ConvertToFZ(CubicLow::QuatSym, qr, fzType, orderingType); +} + // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- diff --git a/Source/EbsdLib/LaueOps/CubicLowOps.h b/Source/EbsdLib/LaueOps/CubicLowOps.h index e452c5d4..e23a7d7a 100644 --- a/Source/EbsdLib/LaueOps/CubicLowOps.h +++ b/Source/EbsdLib/LaueOps/CubicLowOps.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -122,7 +122,13 @@ class EbsdLib_EXPORT CubicLowOps : public LaueOps * @brief Returns the Rotation Point Group for the LaueClass. * @return */ - virtual std::string getRotationPointGroup() const override; + std::string getRotationPointGroup() const override; + + /** + * @brief Returns the Rotation Point Group for the LaueClass. + * @return + */ + int getPointGroup() const override; /** * @brief Returns the number of bins in each of the 3 dimensions @@ -165,6 +171,7 @@ class EbsdLib_EXPORT CubicLowOps : public LaueOps QuatD getNearestQuat(const QuatD& q1, const QuatD& q2) const override; QuatF getNearestQuat(const QuatF& q1f, const QuatF& q2f) const override; + QuatD getFZQuat(const QuatD& qr) const override; int getMisoBin(const OrientationType& rod) const override; bool inUnitTriangle(double eta, double chi) const override; OrientationType determineEulerAngles(double random[3], int choose) const override; @@ -239,6 +246,20 @@ class EbsdLib_EXPORT CubicLowOps : public LaueOps */ EbsdLib::UInt8ArrayType::Pointer generateIPFTriangleLegend(int imageDim, bool generateEntirePlane) const override; + /** + * @brief Returns if the given Quaternion is within the Rodrigues Fundamental Zone (RFZ) + * @param quat Input Quaternion + * @return + */ + bool isInsideFZ(const QuatD& quat) const override; + + /** + * @brief Returns if the given Rodrigues vector is within the Rodrigues Fundamental Zone (RFZ) + * @param rod Input Rodrigues Vector + * @return + */ + bool isInsideFZ(const OrientationD& rod) const override; + protected: public: CubicLowOps(const CubicLowOps&) = delete; // Copy Constructor Not Implemented diff --git a/Source/EbsdLib/LaueOps/CubicOps.cpp b/Source/EbsdLib/LaueOps/CubicOps.cpp index a7e36bd7..e6aa52a5 100644 --- a/Source/EbsdLib/LaueOps/CubicOps.cpp +++ b/Source/EbsdLib/LaueOps/CubicOps.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -315,6 +315,24 @@ std::string CubicOps::getRotationPointGroup() const return "432"; } +// ----------------------------------------------------------------------------- +int CubicOps::getPointGroup() const +{ + return 32; +} + +// ----------------------------------------------------------------------------- +bool CubicOps::isInsideFZ(const QuatD& quat) const +{ + return IsInsideFZ(quat, getFZType(), getAxisOrderingType()); +} + +// ----------------------------------------------------------------------------- +bool CubicOps::isInsideFZ(const OrientationD& rod) const +{ + return IsInsideFZ(rod, getFZType(), getAxisOrderingType()); +} + // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- @@ -721,7 +739,9 @@ QuatF CubicOps::getNearestQuat(const QuatF& q1f, const QuatF& q2f) const QuatD CubicOps::getFZQuat(const QuatD& qr) const { - return _calcQuatNearestOrigin(CubicHigh::QuatSym, qr); + LaueOps::FZType fzType = laue_ops::FZtarray[getPointGroup() - 1]; + LaueOps::AxisOrderingType orderingType = laue_ops::FZoarray[getPointGroup() - 1]; + return ConvertToFZ(CubicHigh::QuatSym, qr, fzType, orderingType); } // ----------------------------------------------------------------------------- diff --git a/Source/EbsdLib/LaueOps/CubicOps.h b/Source/EbsdLib/LaueOps/CubicOps.h index 9c5b9b28..02e85654 100644 --- a/Source/EbsdLib/LaueOps/CubicOps.h +++ b/Source/EbsdLib/LaueOps/CubicOps.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -121,7 +121,13 @@ class EbsdLib_EXPORT CubicOps : public LaueOps * @brief Returns the Rotation Point Group for the LaueClass. * @return */ - virtual std::string getRotationPointGroup() const override; + std::string getRotationPointGroup() const override; + + /** + * @brief Returns the Rotation Point Group for the LaueClass. + * @return + */ + int getPointGroup() const override; /** * @brief Returns the number of bins in each of the 3 dimensions @@ -286,6 +292,20 @@ class EbsdLib_EXPORT CubicOps : public LaueOps */ EbsdLib::UInt8ArrayType::Pointer generateIPFTriangleLegend(int imageDim, bool generateEntirePlane) const override; + /** + * @brief Returns if the given Quaternion is within the Rodrigues Fundamental Zone (RFZ) + * @param quat Input Quaternion + * @return + */ + bool isInsideFZ(const QuatD& quat) const override; + + /** + * @brief Returns if the given Rodrigues vector is within the Rodrigues Fundamental Zone (RFZ) + * @param rod Input Rodrigues Vector + * @return + */ + bool isInsideFZ(const OrientationD& rod) const override; + /** * @brief generates a misorientation coloring legend * @param angle diff --git a/Source/EbsdLib/LaueOps/HexagonalLowOps.cpp b/Source/EbsdLib/LaueOps/HexagonalLowOps.cpp index cb037a6c..b9cef754 100644 --- a/Source/EbsdLib/LaueOps/HexagonalLowOps.cpp +++ b/Source/EbsdLib/LaueOps/HexagonalLowOps.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -203,6 +203,24 @@ std::string HexagonalLowOps::getRotationPointGroup() const return "6"; } +// ----------------------------------------------------------------------------- +int HexagonalLowOps::getPointGroup() const +{ + return 23; +} + +// ----------------------------------------------------------------------------- +bool HexagonalLowOps::isInsideFZ(const QuatD& quat) const +{ + return IsInsideFZ(quat, getFZType(), getAxisOrderingType()); +} + +// ----------------------------------------------------------------------------- +bool HexagonalLowOps::isInsideFZ(const OrientationD& rod) const +{ + return IsInsideFZ(rod, getFZType(), getAxisOrderingType()); +} + OrientationD HexagonalLowOps::calculateMisorientation(const QuatD& q1, const QuatD& q2) const { return calculateMisorientationInternal(HexagonalLow::QuatSym, q1, q2); @@ -347,7 +365,9 @@ QuatF HexagonalLowOps::getNearestQuat(const QuatF& q1f, const QuatF& q2f) const // ----------------------------------------------------------------------------- QuatD HexagonalLowOps::getFZQuat(const QuatD& qr) const { - return _calcQuatNearestOrigin(HexagonalLow::QuatSym, qr); + LaueOps::FZType fzType = laue_ops::FZtarray[getPointGroup() - 1]; + LaueOps::AxisOrderingType orderingType = laue_ops::FZoarray[getPointGroup() - 1]; + return ConvertToFZ(HexagonalLow::QuatSym, qr, fzType, orderingType); } // ----------------------------------------------------------------------------- diff --git a/Source/EbsdLib/LaueOps/HexagonalLowOps.h b/Source/EbsdLib/LaueOps/HexagonalLowOps.h index b8f27606..41887ed3 100644 --- a/Source/EbsdLib/LaueOps/HexagonalLowOps.h +++ b/Source/EbsdLib/LaueOps/HexagonalLowOps.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -122,7 +122,13 @@ class EbsdLib_EXPORT HexagonalLowOps : public LaueOps * @brief Returns the Rotation Point Group for the LaueClass. * @return */ - virtual std::string getRotationPointGroup() const override; + std::string getRotationPointGroup() const override; + + /** + * @brief Returns the Rotation Point Group for the LaueClass. + * @return + */ + int getPointGroup() const override; /** * @brief Returns the number of bins in each of the 3 dimensions @@ -240,6 +246,20 @@ class EbsdLib_EXPORT HexagonalLowOps : public LaueOps */ EbsdLib::UInt8ArrayType::Pointer generateIPFTriangleLegend(int imageDim, bool generateEntirePlane) const override; + /** + * @brief Returns if the given Quaternion is within the Rodrigues Fundamental Zone (RFZ) + * @param quat Input Quaternion + * @return + */ + bool isInsideFZ(const QuatD& quat) const override; + + /** + * @brief Returns if the given Rodrigues vector is within the Rodrigues Fundamental Zone (RFZ) + * @param rod Input Rodrigues Vector + * @return + */ + bool isInsideFZ(const OrientationD& rod) const override; + protected: public: HexagonalLowOps(const HexagonalLowOps&) = delete; // Copy Constructor Not Implemented diff --git a/Source/EbsdLib/LaueOps/HexagonalOps.cpp b/Source/EbsdLib/LaueOps/HexagonalOps.cpp index 90b69dbc..b9724f28 100644 --- a/Source/EbsdLib/LaueOps/HexagonalOps.cpp +++ b/Source/EbsdLib/LaueOps/HexagonalOps.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -243,6 +243,24 @@ std::string HexagonalOps::getRotationPointGroup() const return "622"; } +// ----------------------------------------------------------------------------- +int HexagonalOps::getPointGroup() const +{ + return 27; +} + +// ----------------------------------------------------------------------------- +bool HexagonalOps::isInsideFZ(const QuatD& quat) const +{ + return IsInsideFZ(quat, getFZType(), getAxisOrderingType()); +} + +// ----------------------------------------------------------------------------- +bool HexagonalOps::isInsideFZ(const OrientationD& rod) const +{ + return IsInsideFZ(rod, getFZType(), getAxisOrderingType()); +} + // ----------------------------------------------------------------------------- OrientationD HexagonalOps::calculateMisorientation(const QuatD& q1, const QuatD& q2) const { @@ -391,7 +409,9 @@ QuatF HexagonalOps::getNearestQuat(const QuatF& q1f, const QuatF& q2f) const // ----------------------------------------------------------------------------- QuatD HexagonalOps::getFZQuat(const QuatD& qr) const { - return _calcQuatNearestOrigin(HexagonalHigh::QuatSym, qr); + LaueOps::FZType fzType = laue_ops::FZtarray[getPointGroup() - 1]; + LaueOps::AxisOrderingType orderingType = laue_ops::FZoarray[getPointGroup() - 1]; + return ConvertToFZ(HexagonalHigh::QuatSym, qr, fzType, orderingType); } // ----------------------------------------------------------------------------- diff --git a/Source/EbsdLib/LaueOps/HexagonalOps.h b/Source/EbsdLib/LaueOps/HexagonalOps.h index a81b4080..27efcc71 100644 --- a/Source/EbsdLib/LaueOps/HexagonalOps.h +++ b/Source/EbsdLib/LaueOps/HexagonalOps.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -122,7 +122,13 @@ class EbsdLib_EXPORT HexagonalOps : public LaueOps * @brief Returns the Rotation Point Group for the LaueClass. * @return */ - virtual std::string getRotationPointGroup() const override; + std::string getRotationPointGroup() const override; + + /** + * @brief Returns the Rotation Point Group for the LaueClass. + * @return + */ + int getPointGroup() const override; /** * @brief Returns the number of bins in each of the 3 dimensions @@ -240,6 +246,20 @@ class EbsdLib_EXPORT HexagonalOps : public LaueOps */ EbsdLib::UInt8ArrayType::Pointer generateIPFTriangleLegend(int imageDim, bool generateEntirePlane) const override; + /** + * @brief Returns if the given Quaternion is within the Rodrigues Fundamental Zone (RFZ) + * @param quat Input Quaternion + * @return + */ + bool isInsideFZ(const QuatD& quat) const override; + + /** + * @brief Returns if the given Rodrigues vector is within the Rodrigues Fundamental Zone (RFZ) + * @param rod Input Rodrigues Vector + * @return + */ + bool isInsideFZ(const OrientationD& rod) const override; + protected: public: HexagonalOps(const HexagonalOps&) = delete; // Copy Constructor Not Implemented diff --git a/Source/EbsdLib/LaueOps/LaueOps.cpp b/Source/EbsdLib/LaueOps/LaueOps.cpp index 5a1cfc1e..14728de5 100644 --- a/Source/EbsdLib/LaueOps/LaueOps.cpp +++ b/Source/EbsdLib/LaueOps/LaueOps.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -35,11 +35,6 @@ #include "LaueOps.h" -#include -#include -#include -#include - #include "EbsdLib/Core/EbsdLibConstants.h" #include "EbsdLib/Core/EbsdMacros.h" #include "EbsdLib/LaueOps/CubicLowOps.h" @@ -53,12 +48,17 @@ #include "EbsdLib/LaueOps/TriclinicOps.h" #include "EbsdLib/LaueOps/TrigonalLowOps.h" #include "EbsdLib/LaueOps/TrigonalOps.h" - #include "EbsdLib/Utilities/ColorTable.h" +#include // for std::max +#include +#include +#include +#include + /** -| Index | Verified | Class | Group | Num Sym Ops | -|-------|----------|-----------------|-------|-------------| +| Index | Verified | Class | Rotation Point Group | Num Sym Ops | +|-------|----------|-----------------|----------------------|-------------| | X | X | TriclinicOps | 1 | 1 | | X | X | MonoclinicOps | 2 | 2 | | X | X | Orthorhombic | 222 | 4 | @@ -72,24 +72,21 @@ | X | X | CubicOps | 432 | 24 | */ -namespace Detail +namespace { -// const static double m_OnePointThree = 1.33333333333f; - -// const static double sin_wmin_neg_1_over_2 = static_cast(std::sin(EbsdLib::Constants::k_ACosNeg1 / 2.0f)); -// const static double sin_wmin_pos_1_over_2 = static_cast(std::sin(EbsdLib::Constants::k_ACos1 / 2.0f)); -// const static double sin_of_acos_neg_1 = std::sin(EbsdLib::Constants::k_ACosNeg1); -// const static double sin_of_acos_pos_1 = std::sin(EbsdLib::Constants::k_ACos1); +// Based on P1830R1 +template +inline constexpr bool dependent_false = false; -// const double recip_sin_of_acos_neg_1 = 1.0f / sin_of_acos_neg_1; -// const double recip_sin_of_acos_pos_1 = 1.0f / sin_of_acos_pos_1; +// Based on std::to_underlying from c++23 +template +constexpr std::underlying_type_t to_underlying(Enum e) noexcept +{ + return static_cast>(e); +} -// const static double SinOfHalf = std::sin(0.5f); -// const static double CosOfHalf = cosf(0.5f); -// const static double SinOfZero = std::sin(0.0f); -// const static double CosOfZero = cosf(0.0f); -} // namespace Detail +} // namespace // ----------------------------------------------------------------------------- // @@ -101,11 +98,69 @@ LaueOps::LaueOps() = default; // ----------------------------------------------------------------------------- LaueOps::~LaueOps() = default; +// ----------------------------------------------------------------------------- +std::string LaueOps::FZTypeToString(const FZType value) +{ + switch(value) + { + case FZType::Anorthic: + return "Anorthic (Triclinic)"; + case FZType::Cyclic: + return "Cyclic"; + case FZType::Dihedral: + return "Dihedral"; + case FZType::Tetrahedral: + return "Tetrahedral"; + case FZType::Octahedral: + return "Octahedral"; + default: + return "Unknown FZType"; + } +} + +// ----------------------------------------------------------------------------- +std::string LaueOps::AxisOrderingTypeToString(const AxisOrderingType value) +{ + switch(value) + { + case AxisOrderingType::None: + return "None"; + case AxisOrderingType::TwoFold: + return "TwoFold"; + case AxisOrderingType::ThreeFold: + return "ThreeFold"; + case AxisOrderingType::FourFold: + return "FourFold"; + case AxisOrderingType::SixFold: + return "SixFold"; + case AxisOrderingType::EightFold: + return "EightFold"; + case AxisOrderingType::TenFold: + return "TenFold"; + case AxisOrderingType::TwelveFold: + return "TwelveFold"; + default: + return "Unknown AxisOrderingType"; + } +} + +// ----------------------------------------------------------------------------- +LaueOps::FZType LaueOps::getFZType() const +{ + return laue_ops::FZtarray[getPointGroup() - 1]; +} + +// ----------------------------------------------------------------------------- +LaueOps::AxisOrderingType LaueOps::getAxisOrderingType() const +{ + return laue_ops::FZoarray[getPointGroup() - 1]; +} + // ----------------------------------------------------------------------------- EbsdLib::Rgb LaueOps::computeIPFColor(double* eulers, double* refDir, bool degToRad) const { - EbsdLib::Matrix3X1D refDirection(refDir); + const EbsdLib::Matrix3X1D refDirection(refDir); double chi = 0.0f; double eta = 0.0f; double _rgb[3] = {0.0, 0.0, 0.0}; @@ -143,7 +198,7 @@ EbsdLib::Rgb LaueOps::computeIPFColor(double* eulers, double* refDir, bool degTo break; } - std::array angleLimits = getIpfColorAngleLimits(eta); + const std::array angleLimits = getIpfColorAngleLimits(eta); _rgb[0] = 1.0 - chi / angleLimits[2]; _rgb[2] = std::fabs(eta - angleLimits[0]) / (angleLimits[1] - angleLimits[0]); @@ -172,25 +227,277 @@ EbsdLib::Rgb LaueOps::computeIPFColor(double* eulers, double* refDir, bool degTo } // ----------------------------------------------------------------------------- -QuatD LaueOps::getFZQuat(const QuatD& qr) const +void LaueOps::RodriguesComposition(OrientationD sigma, OrientationD& rod) { - EBSD_METHOD_NOT_IMPLEMENTED() - return QuatD(); + OrientationD rho(3), rhomis(3); + rho[0] = -rod[0] * rod[3]; + rho[1] = -rod[1] * rod[3]; + rho[2] = -rod[2] * rod[3]; + + // perform the Rodrigues rotation composition with sigma to get rhomis + double denom = 1.0 + (sigma[0] * rho[0] + sigma[1] * rho[1] + sigma[2] * rho[2]); + if(denom == 0.0) + { + const double len = sqrt(sigma[0] * sigma[0] + sigma[1] * sigma[1] + sigma[2] * sigma[2]); + rod[0] = sigma[0] / len; + rod[1] = sigma[1] / len; + rod[2] = sigma[2] / len; + rod[3] = std::numeric_limits::infinity(); // set this to infinity + } + else + { + rhomis[0] = (rho[0] - sigma[0] + (rho[1] * sigma[2] - rho[2] * sigma[1])) / denom; + rhomis[1] = (rho[1] - sigma[1] + (rho[2] * sigma[0] - rho[0] * sigma[2])) / denom; + rhomis[2] = (rho[2] - sigma[2] + (rho[0] * sigma[1] - rho[1] * sigma[0])) / denom; + // revert rhomis to a four-component Rodrigues vector + double len = sqrt(rhomis[0] * rhomis[0] + rhomis[1] * rhomis[1] + rhomis[2] * rhomis[2]); + if(len != 0.0) + { + rod[0] = -rhomis[0] / len; + rod[1] = -rhomis[1] / len; + rod[2] = -rhomis[2] / len; + rod[3] = len; + } + else + { + rod[0] = 0.0; + rod[1] = 0.0; + rod[2] = 0.0; + rod[3] = 0.0; + } + } } // ----------------------------------------------------------------------------- -// +bool LaueOps::InsideCyclicFZ(const OrientationD& rod, FZType fzType, AxisOrderingType order) +{ + bool res = false; + bool doM = false; + + // if (M.has_value() && *M) + // doM = true; + + int32_t orderAsArrayIndex = to_underlying(order) - 1; + auto x = rod; // Make a copy of the input Rodrigues vector .r_copyd(); + + // Case: finite x(4) + if(x[3] != std::numeric_limits::infinity()) + { + if(doM) + { + if(fzType == FZType::Cyclic && order == AxisOrderingType::TwoFold) + { + // Check y-component vs tan(pi/2n) + res = std::abs(x[1] * x[3]) <= LPs::BP[orderAsArrayIndex]; + } + else + { + // Check z-component vs tan(pi/2n) + res = std::abs(x[2] * x[3]) <= LPs::BP[orderAsArrayIndex]; + } + } + else + { + if(fzType == FZType::Cyclic && order == AxisOrderingType::TwoFold) + { + res = std::abs(x[1] * x[3]) <= LPs::BP[orderAsArrayIndex]; + } + else + { + res = std::abs(x[2] * x[3]) <= LPs::BP[orderAsArrayIndex]; + } + } + } + // Case: infinite x(4) + else + { + if(doM) + { + if(fzType == FZType::Cyclic && order == AxisOrderingType::TwoFold) + { + if(x[1] == 0.0) + res = true; + } + else + { + if(x[2] == 0.0) + res = true; + } + } + else + { + if(fzType == FZType::Cyclic && order == AxisOrderingType::TwoFold) + { + if(x[1] == 0.0) + res = true; + } + else + { + if(x[2] == 0.0) + res = true; + } + } + } + + return res; +} + +// ----------------------------------------------------------------------------- +bool LaueOps::InsideDihedralFZ(const OrientationD& rod, const AxisOrderingType order) +{ + constexpr double eps = 1.0e-10; + + bool res = false; + bool c1 = false; + + if(rod[3] > LPs::rtt) // sqrt(3.0) + { + return false; + } + + if(AxisOrderingType::None == order) + { + return false; + } + + const std::array x = {rod[0], rod[1], rod[2], rod[3]}; // Make a copy of rod + const std::array r = {x[0] * x[3], x[1] * x[3], x[2] * x[3]}; + + // first, check the z-component vs. tan(pi/2n) (same as insideCyclicFZ) + const int32_t orderAsArrayIndex = to_underlying(order) - 1; + c1 = std::fabs(r[2]) <= (LPs::BP[orderAsArrayIndex] + eps); + res = false; + //! check the square boundary planes if c1=.TRUE. + if(c1) + { + constexpr double r1 = 1.0; + bool c2 = false; + switch(order) + { + case AxisOrderingType::TwoFold: { + c2 = (std::max({std::fabs(r[0]), std::fabs(r[1]), std::fabs(r[2])}) <= r1 + eps); + break; + } + case AxisOrderingType::ThreeFold: + c2 = std::fabs(LPs::srt * r[1] + 0.5 * r[0]) <= (r1 + eps); + c2 &= std::fabs(LPs::srt * r[1] - 0.5 * r[0]) <= (r1 + eps); + c2 &= std::fabs(r[0]) <= (r1 + eps); + break; + + case AxisOrderingType::FourFold: + c2 = (std::fabs(r[0]) <= r1) && (std::fabs(r[1]) <= r1); + c2 &= (LPs::r22 * std::fabs(r[0] + r[1]) <= r1) && (LPs::r22 * std::fabs(r[0] - r[1]) <= r1); + break; + + case AxisOrderingType::SixFold: + c2 = std::fabs(0.5 * r[0] + LPs::srt * r[1]) <= (r1 + eps); + c2 &= std::fabs(LPs::srt * r[0] + 0.5 * r[1]) <= (r1 + eps); + c2 &= std::fabs(LPs::srt * r[0] - 0.5 * r[1]) <= (r1 + eps); + c2 &= std::fabs(0.5 * r[0] - LPs::srt * r[1]) <= (r1 + eps); + c2 &= std::fabs(r[1]) <= (r1 + eps); + c2 &= std::fabs(r[0]) <= (r1 + eps); + break; + + default: + return false; + } + res = c2; + } + + return res; +} + +// ----------------------------------------------------------------------------- +bool LaueOps::InsideCubicFZ(const OrientationD& rod, const FZType fzType) +{ + bool res = false; + bool c1 = false; + bool c2 = false; + + constexpr double r1 = 1.0; + constexpr double eps = 1.0e-10; + + const std::array x = {rod[0], rod[1], rod[2], rod[3]}; // Make a copy of rod + const std::array r = {x[0] * x[3], x[1] * x[3], x[2] * x[3]}; + + // primary cube planes (only needed for octahedral case) + if(fzType == FZType::Octahedral) + { + double max = std::max({std::fabs(r[0]), std::fabs(r[1]), std::fabs(r[2])}); + c1 = (max - LPs::BP[4 - 1]) <= eps; + } + else + { + c1 = true; + } + + // octahedral truncation planes, both for tetrahedral and octahedral point groups + c2 = ((std::fabs(r[0]) + std::fabs(r[1]) + std::fabs(r[2])) - r1) <= eps; + + // if both c1 and c2, then the point is inside + if(c1 && c2) + { + res = true; + } + + return res; +} + +// ----------------------------------------------------------------------------- +bool LaueOps::IsInsideFZ(const OrientationD& rod, FZType fzType, AxisOrderingType order) +{ + bool insideFZ = false; + // dealing with 180 rotations is needed only for + // FZtypes 0 and 1; the other FZs are always finite. + switch(fzType) + { + case FZType::Anorthic: + insideFZ = true; // all points are inside the FZ + break; + case FZType::Cyclic: + insideFZ = InsideCyclicFZ(rod, fzType, order); // infinity is checked inside this function + break; + case FZType::Dihedral: + if(!std::isinf(rod[3])) + { + insideFZ = InsideDihedralFZ(rod, order); + } + break; + case FZType::Tetrahedral: + if(!std::isinf(rod[3])) + { + insideFZ = InsideCubicFZ(rod, FZType::Tetrahedral); + } + break; + case FZType::Octahedral: + if(!std::isinf(rod[3])) + { + insideFZ = InsideCubicFZ(rod, FZType::Octahedral); + } + break; + default: + insideFZ = false; + break; + } + return insideFZ; +} + +bool LaueOps::IsInsideFZ(const QuatD& quat, FZType fzType, AxisOrderingType order) +{ + const OrientationD rod = OrientationTransformation::qu2ro(quat.getPositiveOrientation()); + return IsInsideFZ(rod, fzType, order); +} + // ----------------------------------------------------------------------------- OrientationD LaueOps::calculateMisorientationInternal(const std::vector& quatsym, const QuatD& q1, const QuatD& q2) const { OrientationD axisAngleMin(0.0, 0.0, 0.0, std::numeric_limits::max()); - QuatD qc; - QuatD qr = q1 * (q2.conjugate()); + const QuatD qr = q1 * (q2.conjugate()); size_t numsym = quatsym.size(); // Loop through all the symmetry operators and find the Axis Angle with the smallest angular part. for(size_t i = 0; i < numsym; i++) { - qc = quatsym[i] * qr; + QuatD qc = quatsym[i] * qr; if(qc.w() < -1) { @@ -279,7 +586,6 @@ OrientationType LaueOps::_calcRodNearestOrigin(const std::vector& // ----------------------------------------------------------------------------- QuatD LaueOps::_calcNearestQuat(const std::vector& quatsym, const QuatD& q1, const QuatD& q2) const { - QuatD out; double dist = 0.0; double smallestdist = 1000000.0f; QuatD qmax; @@ -298,7 +604,7 @@ QuatD LaueOps::_calcNearestQuat(const std::vector& quatsym, const QuatD& qmax = qc; } } - out = qmax; + QuatD out = qmax; if(out.w() < 0) { out.negate(); @@ -306,37 +612,39 @@ QuatD LaueOps::_calcNearestQuat(const std::vector& quatsym, const QuatD& return out; } -QuatD LaueOps::_calcQuatNearestOrigin(const std::vector& quatsym, const QuatD& qr) const +QuatD LaueOps::ConvertToFZ(const std::vector& quatsym, const QuatD& qr, FZType fzType, AxisOrderingType order) { - double dist = 0.0; - double smallestdist = 1000000.0f; - QuatD qmax; + // Ensure the Quaternion is Normalized and the Scalar Part is positive + QuatD normalizedQuat = qr.getPositiveOrientation(); + OrientationD rod = OrientationTransformation::qu2ro(normalizedQuat); + + if(IsInsideFZ(rod, fzType, order)) + { + return normalizedQuat; + } + size_t numsym = quatsym.size(); for(size_t i = 0; i < numsym; i++) { QuatD qc = quatsym[i] * qr; + normalizedQuat = qc.getPositiveOrientation(); + rod = OrientationTransformation::qu2ro(normalizedQuat); - dist = 1 - (qc.w() * qc.w()); - if(dist < smallestdist) + if(normalizedQuat.w() < 1.0E5 && IsInsideFZ(rod, fzType, order)) { - smallestdist = dist; - qmax = qc; + return normalizedQuat; } } - QuatD out = qmax; - - if(out.w() < 0) - { - out.negate(); - } - return out; + // This should never happen so I guess returning a Qauaternion with all Infinity values is _a_ way to do it? + // Maybe we should throw an exception instead? Or return a std::optional() if we were using C++17 + return {std::numeric_limits::infinity(), std::numeric_limits::infinity(), std::numeric_limits::infinity(), std::numeric_limits::infinity()}; } int LaueOps::_calcMisoBin(double dim[3], double bins[3], double step[3], const OrientationType& ho) const { - int miso1bin = int((ho[0] + dim[0]) / step[0]); - int miso2bin = int((ho[1] + dim[1]) / step[1]); - int miso3bin = int((ho[2] + dim[2]) / step[2]); + int miso1bin = static_cast((ho[0] + dim[0]) / step[0]); + int miso2bin = static_cast((ho[1] + dim[1]) / step[1]); + int miso3bin = static_cast((ho[2] + dim[2]) / step[2]); if(miso1bin >= bins[0]) { miso1bin = static_cast(bins[0] - 1); @@ -376,13 +684,9 @@ void LaueOps::_calcDetermineHomochoricValues(double random[3], double init[3], d // ----------------------------------------------------------------------------- int LaueOps::_calcODFBin(double dim[3], double bins[3], double step[3], const OrientationType& ho) const { - int g1euler1bin; - int g1euler2bin; - int g1euler3bin; - int g1odfbin; - g1euler1bin = int((ho[0] + dim[0]) / step[0]); - g1euler2bin = int((ho[1] + dim[1]) / step[1]); - g1euler3bin = int((ho[2] + dim[2]) / step[2]); + int g1euler1bin = static_cast((ho[0] + dim[0]) / step[0]); + int g1euler2bin = static_cast((ho[1] + dim[1]) / step[1]); + int g1euler3bin = static_cast((ho[2] + dim[2]) / step[2]); if(g1euler1bin >= bins[0]) { g1euler1bin = static_cast(bins[0] - 1); @@ -407,7 +711,7 @@ int LaueOps::_calcODFBin(double dim[3], double bins[3], double step[3], const Or { g1euler3bin = 0; } - g1odfbin = static_cast((g1euler3bin * bins[0] * bins[1]) + (g1euler2bin * bins[0]) + (g1euler1bin)); + int g1odfbin = static_cast((g1euler3bin * bins[0] * bins[1]) + (g1euler2bin * bins[0]) + (g1euler1bin)); return g1odfbin; } @@ -440,13 +744,21 @@ std::vector LaueOps::GetAllOrientationOps() } // ----------------------------------------------------------------------------- -LaueOps::Pointer LaueOps::GetOrientationOpsFromSpaceGroupNumber(size_t sgNumber) +LaueOps::Pointer LaueOps::GetOrientationOpsFromSpaceGroupNumber(const size_t sgNumber) { + // There are only 230 Space Groups, so if the user asks for something outside of + // that range, then return a null pointer. If they are asking for this kind of + // value then there is something wrong in the calling code. + if(sgNumber > 230) + { + return LaueOps::NullPointer(); + } std::array sgpg = {1, 2, 3, 6, 10, 16, 25, 47, 75, 81, 83, 89, 99, 111, 123, 143, 147, 149, 156, 162, 168, 174, 175, 177, 183, 187, 191, 195, 200, 207, 215, 221}; std::array pgLaue = {1, 1, 2, 2, 2, 22, 22, 22, 4, 4, 4, 42, 42, 42, 42, 3, 3, 32, 32, 32, 6, 6, 6, 62, 62, 62, 62, 23, 23, 43, 43, 43}; size_t pgNumber = sgpg.size() - 1; - for(size_t i = 0; i < sgpg.size(); i++) + size_t i = 0; + for(i = 0; i < sgpg.size(); i++) { if(sgpg[i] > sgNumber) { @@ -455,8 +767,9 @@ LaueOps::Pointer LaueOps::GetOrientationOpsFromSpaceGroupNumber(size_t sgNumber) } } - size_t value = pgLaue.at(pgNumber); - switch(value) + // std::cout << "Space Group: " << sgNumber << " sgpg: " << i << " sgpg[i]: " << sgpg[i] << " pgNumber: " << pgNumber << " pgLaue[pgNumber]: " << pgLaue[pgNumber] << std::endl; + + switch(pgLaue.at(pgNumber)) { case 1: return TriclinicOps::New(); @@ -505,12 +818,12 @@ std::vector LaueOps::GetLaueNames() // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- -size_t LaueOps::getRandomSymmetryOperatorIndex(int numSymOps) const +size_t LaueOps::getRandomSymmetryOperatorIndex(const int numSymOps) const { using SizeTDistributionType = std::uniform_int_distribution; - const SizeTDistributionType::result_type rangeMin = 0; + constexpr SizeTDistributionType::result_type rangeMin = 0; const SizeTDistributionType::result_type rangeMax = static_cast(numSymOps - 1); std::random_device randomDevice; // Will be used to obtain a seed for the random number engine diff --git a/Source/EbsdLib/LaueOps/LaueOps.h b/Source/EbsdLib/LaueOps/LaueOps.h index c6f8007a..bc165b93 100644 --- a/Source/EbsdLib/LaueOps/LaueOps.h +++ b/Source/EbsdLib/LaueOps/LaueOps.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -43,7 +43,6 @@ #include "EbsdLib/Core/OrientationTransformation.hpp" #include "EbsdLib/Core/Quaternion.hpp" #include "EbsdLib/EbsdLib.h" -#include "EbsdLib/Math/Matrix3X1.hpp" #include "EbsdLib/Math/Matrix3X3.hpp" #include "EbsdLib/Utilities/PoleFigureUtilities.h" @@ -140,6 +139,12 @@ class EbsdLib_EXPORT LaueOps */ virtual std::string getRotationPointGroup() const = 0; + /** + * @brief returns the value of the crystallographic point group + * @return + */ + virtual int getPointGroup() const = 0; + /** * @brief Returns the number of bins in each of the 3 dimensions * @return @@ -179,6 +184,7 @@ class EbsdLib_EXPORT LaueOps /** * @brief Retrieves a specific Symmetry Operator for a giving index * @param i The index from the Symmetry Operator Array to retrieve + * @param g The g matrix * @return void or a Matrix3X3 object. */ virtual void getMatSymOp(int i, double g[3][3]) const = 0; @@ -208,10 +214,10 @@ class EbsdLib_EXPORT LaueOps * @param qr Input Quaternion * @return */ - virtual QuatD getFZQuat(const QuatD& qr) const; + virtual QuatD getFZQuat(const QuatD& qr) const = 0; /** - * @brief getMisoBin Returns the misorientation bin that the input Rodregues vector lies in. + * @brief getMisoBin Returns the misorientation bin that the input Rodrigues vector lies in. * @param rod * @return */ @@ -243,6 +249,8 @@ class EbsdLib_EXPORT LaueOps virtual void generateSphereCoordsFromEulers(EbsdLib::FloatArrayType* eulers, EbsdLib::FloatArrayType* c1, EbsdLib::FloatArrayType* c2, EbsdLib::FloatArrayType* c3) const = 0; + static void RodriguesComposition(OrientationD sigma, OrientationD& rod); + /** * @brief * @param eta Optional input value only needed for the "Cubic" Laue classes @@ -251,24 +259,24 @@ class EbsdLib_EXPORT LaueOps virtual std::array getIpfColorAngleLimits(double eta) const = 0; /** - * @brief generateIPFColor Generates an ARGB Color from a Euler Angle and Reference Direction + * @brief generateIPFColor Generates an ARGB Color from an Euler Angle and Reference Direction * @param eulers Pointer to the 3 component Euler Angle * @param refDir Pointer to the 3 Component Reference Direction - * @param rgb [output] The pointer to store the RGB value * @param convertDegrees Are the input angles in Degrees + * @return rgb [output] The pointer to store the RGB value */ virtual EbsdLib::Rgb generateIPFColor(double* eulers, double* refDir, bool convertDegrees) const = 0; /** - * @brief generateIPFColor Generates an ARGB Color from a Euler Angle and Reference Direction + * @brief generateIPFColor Generates an ARGB Color from an Euler Angle and Reference Direction * @param e0 First component of the Euler Angle * @param e1 Second component of the Euler Angle * @param e2 Third component of the Euler Angle * @param dir0 First component of the Reference Direction * @param dir1 Second component of the Reference Direction * @param dir2 Third component of the Reference Direction - * @param rgb [output] The pointer to store the RGB value * @param convertDegrees Are the input angles in Degrees + * @return rgb [output] The pointer to store the RGB value */ virtual EbsdLib::Rgb generateIPFColor(double e0, double e1, double e2, double dir0, double dir1, double dir2, bool convertDegrees) const = 0; @@ -277,14 +285,14 @@ class EbsdLib_EXPORT LaueOps * @param r1 First component of the Rodrigues Vector * @param r2 Second component of the Rodrigues Vector * @param r3 Third component of the Rodrigues Vector - * @param rgb [output] The pointer to store the RGB value + * @return rgb [output] The pointer to store the RGB value */ virtual EbsdLib::Rgb generateRodriguesColor(double r1, double r2, double r3) const = 0; /** * @brief generateMisorientationColor Generates a color based on the method developed by C. Schuh and S. Patala. * @param q A Quaternion representing the crystal direction - * @param refDir A Quaternion representing the sample reference direction + * @param refFrame A Quaternion representing the sample reference direction * @return A EbsdLib::Rgb value */ virtual EbsdLib::Rgb generateMisorientationColor(const QuatD& q, const QuatD& refFrame) const; @@ -292,9 +300,7 @@ class EbsdLib_EXPORT LaueOps /** * @brief generatePoleFigure This method will generate a number of pole figures for this crystal symmetry and the Euler * angles that are passed in. - * @param eulers The Euler Angles to generate the pole figure from. - * @param imageSize The size in Pixels of the final RGB Image. - * @param numColors The number of colors to use in the RGB Image. Less colors can give the effect of contouring. + * @param config The Pole Figure configuration struct * @return A std::vector of EbsdLib::UInt8ArrayType pointers where each one represents a 2D RGB array that can be used to initialize * an image object from other libraries and written out to disk. */ @@ -312,27 +318,175 @@ class EbsdLib_EXPORT LaueOps */ virtual EbsdLib::UInt8ArrayType::Pointer generateIPFTriangleLegend(int imageDim, bool generateEntirePlane) const = 0; + enum class FZType : int32_t + { + Anorthic = 0, // Triclinic + Cyclic = 1, + Dihedral = 2, + Tetrahedral = 3, + Octahedral = 4 + }; + + enum class AxisOrderingType : int32_t + { + None = 0, + TwoFold = 2, + ThreeFold = 3, + FourFold = 4, + SixFold = 6, + EightFold = 8, + TenFold = 10, + TwelveFold = 12 + }; + + /** + * @brief Returns the given enumeration value as a string + * @param value + * @return + */ + static std::string FZTypeToString(FZType value); + + /** + * @brief Returns the given enumeration value as a string + * @param value + * @return + */ + static std::string AxisOrderingTypeToString(AxisOrderingType value); + + /** + * @brief Returns the Fundamental Zone type + * @return + */ + FZType getFZType() const; + + /** + * @brief Returns the Axis Ordering Type + * @return + */ + AxisOrderingType getAxisOrderingType() const; + + /** + * @brief Determines if the given 4 component Rodrigues Vector is inside a cyclic fundamental zone. + * + * Be sure that the AxisOrderingType is NOT NONE otherwise undefined behavior will occur + * @param rod 4 Component Rodrigues Vector + * @param fzType + * @param fzType + * @param order The Axis Ordering Type + * @return + */ + static bool InsideCyclicFZ(const OrientationD& rod, FZType fzType, AxisOrderingType order); + + /** + * @brief Determines if the given 4 component Rodrigues Vector is inside a dihedral fundamental zone + * @param rod 4 Component Rodrigues Vector + * @param order The Axis Ordering Type + * @return + */ + static bool InsideDihedralFZ(const OrientationD& rod, AxisOrderingType order); + + /** + * @brief Determines if the given 4 component Rodrigues Vector is inside a cubic fundamental zone + * @param rod 4 Component Rodrigues Vector + * @param fzType The Fundamental Zone type + * @return + */ + static bool InsideCubicFZ(const OrientationD& rod, FZType fzType); + + /** + * @brief Determines if the given 4 component Rodrigues Vector is inside the fundamental zone + * @param rod 4 Component Rodrigues Vector + * @param fzType The Fundamental Zone type + * @param order The Axis Ordering Type + * @return + */ + static bool IsInsideFZ(const OrientationD& rod, FZType fzType, AxisOrderingType order); + + /** + * @brief Determines if the given Quaternion Vector is inside the fundamental zone. + * + * As part of this check, the passed in Quaternion is normalized before calling the Rodrigues + * version of this function. + * @param quat Input Quaternion + * @param fzType The Fundamental Zone type + * @param order The Axis Ordering Type + * @return + */ + static bool IsInsideFZ(const QuatD& quat, FZType fzType, AxisOrderingType order); + + /** + * @brief Returns if the given Quaternion is within the Rodrigues Fundamental Zone (RFZ) + * @param quat Input Quaternion + * @return + */ + virtual bool isInsideFZ(const QuatD& quat) const = 0; + + /** + * @brief Returns if the given Rodrigues vector is within the Rodrigues Fundamental Zone (RFZ) + * @param rod Input Rodrigues Vector + * @return + */ + virtual bool isInsideFZ(const OrientationD& rod) const = 0; + protected: LaueOps(); /** * @brief calculateMisorientationInternal - * @param quatsym The Symmetry Quarternions from the specific Laue class - * @param numsym The number of Symmetry Quaternions + * @param quatsym The Symmetry Quarternion from the specific Laue class * @param q1 Input Quaternion 1 * @param q2 Input Quaternion 2 * @return Returns Axis-Angle W form. */ virtual OrientationD calculateMisorientationInternal(const std::vector& quatsym, const QuatD& q1, const QuatD& q2) const; + /** + * @brief + * @param rodsym + * @param rod + * @return + */ OrientationType _calcRodNearestOrigin(const std::vector& rodsym, const OrientationType& rod) const; + /** + * @brief + * @param quatsym + * @param q1 + * @param q2 + * @return + */ QuatD _calcNearestQuat(const std::vector& quatsym, const QuatD& q1, const QuatD& q2) const; - QuatD _calcQuatNearestOrigin(const std::vector& quatsym, const QuatD& qr) const; - + /** + * @brief + * @param dim + * @param bins + * @param step + * @param homochoric + * @return + */ int _calcMisoBin(double dim[3], double bins[3], double step[3], const OrientationType& homochoric) const; + + /** + * @brief + * @param random + * @param init + * @param step + * @param phi + * @param r1 + * @param r2 + * @param r3 + */ void _calcDetermineHomochoricValues(double random[3], double init[3], double step[3], int32_t phi[3], double& r1, double& r2, double& r3) const; + + /** + * @brief + * @param dim + * @param bins + * @param step + * @param homochoric + * @return + */ int _calcODFBin(double dim[3], double bins[3], double step[3], const OrientationType& homochoric) const; /** @@ -341,12 +495,23 @@ class EbsdLib_EXPORT LaueOps * @param eulers * @param refDir * @param deg2Rad - * @param etaMin - * @param etaMax - * @param chiMax * @return */ - EbsdLib::Rgb computeIPFColor(double* eulers, double* refDir, bool deg2Rad) const; + EbsdLib::Rgb computeIPFColor(double* eulers, double* refDir, bool degToRad) const; + + /** + * @brief Converts in input Quaternion into a version that is inside the fundamental zone. + * + * As part of the algorithm, the Quaternion is normalized before any other orientation + * transformations are performed. If the scalar part of the Quaternion is negative, then + * the entire Quaternion is negated. + * @param quatsym The symmetry operators + * @param qr The input quaternion. Calling code does not need to normalize this first. + * @param fzType The type of fundamental zone + * @param order The Axis orider of the symmetry + * @return + */ + static QuatD ConvertToFZ(const std::vector& quatsym, const QuatD& qr, FZType fzType, AxisOrderingType order); public: LaueOps(const LaueOps&) = delete; // Copy Constructor Not Implemented @@ -354,3 +519,71 @@ class EbsdLib_EXPORT LaueOps LaueOps& operator=(const LaueOps&) = delete; // Copy Assignment Not Implemented LaueOps& operator=(LaueOps&&) = delete; // Move Assignment Not Implemented }; + +namespace laue_ops +{ + +constexpr std::array FZtarray = { + LaueOps::FZType::Anorthic, LaueOps::FZType::Anorthic, LaueOps::FZType::Cyclic, LaueOps::FZType::Cyclic, LaueOps::FZType::Cyclic, // 0-4 + LaueOps::FZType::Dihedral, LaueOps::FZType::Dihedral, LaueOps::FZType::Dihedral, LaueOps::FZType::Cyclic, LaueOps::FZType::Cyclic, // 5-9 + LaueOps::FZType::Cyclic, LaueOps::FZType::Dihedral, LaueOps::FZType::Dihedral, LaueOps::FZType::Dihedral, LaueOps::FZType::Dihedral, // 10-14 + LaueOps::FZType::Cyclic, LaueOps::FZType::Cyclic, LaueOps::FZType::Dihedral, LaueOps::FZType::Dihedral, LaueOps::FZType::Dihedral, // 15-19 + LaueOps::FZType::Cyclic, LaueOps::FZType::Cyclic, LaueOps::FZType::Cyclic, LaueOps::FZType::Dihedral, LaueOps::FZType::Dihedral, LaueOps::FZType::Dihedral, + LaueOps::FZType::Dihedral, LaueOps::FZType::Tetrahedral, LaueOps::FZType::Tetrahedral, LaueOps::FZType::Octahedral, LaueOps::FZType::Tetrahedral, LaueOps::FZType::Octahedral}; + +constexpr std::array FZoarray = {LaueOps::AxisOrderingType::None, LaueOps::AxisOrderingType::None, LaueOps::AxisOrderingType::TwoFold, + LaueOps::AxisOrderingType::TwoFold, LaueOps::AxisOrderingType::TwoFold, // 0-4 + LaueOps::AxisOrderingType::TwoFold, LaueOps::AxisOrderingType::TwoFold, LaueOps::AxisOrderingType::TwoFold, + LaueOps::AxisOrderingType::FourFold, LaueOps::AxisOrderingType::FourFold, // 5-9 + LaueOps::AxisOrderingType::FourFold, LaueOps::AxisOrderingType::FourFold, LaueOps::AxisOrderingType::FourFold, + LaueOps::AxisOrderingType::FourFold, LaueOps::AxisOrderingType::FourFold, // 10-14 + LaueOps::AxisOrderingType::ThreeFold, LaueOps::AxisOrderingType::ThreeFold, LaueOps::AxisOrderingType::ThreeFold, + LaueOps::AxisOrderingType::ThreeFold, LaueOps::AxisOrderingType::ThreeFold, // 15-19 + LaueOps::AxisOrderingType::SixFold, LaueOps::AxisOrderingType::SixFold, LaueOps::AxisOrderingType::SixFold, + LaueOps::AxisOrderingType::SixFold, LaueOps::AxisOrderingType::SixFold, LaueOps::AxisOrderingType::SixFold, + LaueOps::AxisOrderingType::SixFold, LaueOps::AxisOrderingType::None, LaueOps::AxisOrderingType::None, + LaueOps::AxisOrderingType::None, LaueOps::AxisOrderingType::None, LaueOps::AxisOrderingType::None}; + +} // namespace laue_ops + +/* + * @brief Master Table of Crystallographic Information + * This is formatted as a MarkDown with LaTeX formatting + +| # | Point Group (H–M) | Rotation Point Group | Space Group No(s). | Schoenflies | Crystal system | Laue class | Laue Ops | +| -: | ----------------- | -------------------- | ------------------ | ------------- | -------------- | ----------- | ---------| +| 1 | 1 | 1 | 1 | C₁ | Triclinic | (\bar{1}) | TriclinicOps | +| 2 | (\bar{1}) | 1 | 2 | C(_i) | Triclinic | (\bar{1}) | +| 3 | 2 | 2 | 3–5 | C₂ | Monoclinic | 2/m | +| 4 | m | 1 | 6–9 | C(_s) | Monoclinic | 2/m | +| 5 | 2/m | 2 | 10–15 | C(_{2h}) | Monoclinic | 2/m | MonoclinicOps | +| 6 | 222 | 222 | 16–24 | D₂ | Orthorhombic | mmm | +| 7 | mm2 | 2 | 25–46 | C(_{2v}) | Orthorhombic | mmm | +| 8 | mmm | 222 | 47–74 | D(_{2h}) | Orthorhombic | mmm | OrthorhombicOps | +| 9 | 4 | 4 | 75–80 | C₄ | Tetragonal | 4/m | +| 10 | (\bar{4}) | 2 | 81–82 | S₄ | Tetragonal | 4/m | +| 11 | 4/m | 4 | 83–88 | C(_{4h}) | Tetragonal | 4/m | TetragonalLowOps | +| 12 | 422 | 422 | 89–98 | D₄ | Tetragonal | 4/mmm | +| 13 | 4mm | 4 | 99–110 | C(_{4v}) | Tetragonal | 4/mmm | +| 14 | (\bar{4}2m) | 222 | 111–122 | D(_{2d}) | Tetragonal | 4/mmm | +| 15 | 4/mmm | 422 | 123–142 | D(_{4h}) | Tetragonal | 4/mmm | TetragonalOps | +| 16 | 3 | 3 | 143–146 | C₃ | Trigonal | (\bar{3}) | +| 17 | (\bar{3}) | 3 | 147–148 | C(_{3i}) (S₆) | Trigonal | (\bar{3}) | TrigonalLowOps | +| 18 | 32 | 32 | 149–155 | D₃ | Trigonal | (\bar{3}m) | +| 19 | 3m | 3 | 156–161 | C(_{3v}) | Trigonal | (\bar{3}m) | +| 20 | (\bar{3}m) | 32 | 162–167 | D(_{3d}) | Trigonal | (\bar{3}m) | TrigonalOps | +| 21 | 6 | 6 | 168–173 | C₆ | Hexagonal | 6/m | +| 22 | (\bar{6}) | 3 | 174 | C(_{3h}) | Hexagonal | 6/m | +| 23 | 6/m | 6 | 175–176 | C(_{6h}) | Hexagonal | 6/m | HexagonalLowOps | +| 24 | 622 | 622 | 177–182 | D₆ | Hexagonal | 6/mmm | +| 25 | 6mm | 6 | 183–186 | C(_{6v}) | Hexagonal | 6/mmm | +| 26 | (\bar{6}m2) | 32 | 187–190 | D(_{3h}) | Hexagonal | 6/mmm | +| 27 | 6/mmm | 622 | 191–194 | D(_{6h}) | Hexagonal | 6/mmm | HexagonalOps | +| 28 | 23 | 23 | 195–199 | T | Cubic | m(\bar{3}) | +| 29 | m(\bar{3}) | 23 | 200–206 | T(_h) | Cubic | m(\bar{3}) | CubicLowOps | +| 30 | 432 | 432 | 207–214 | O | Cubic | m(\bar{3})m | +| 31 | (\bar{4}3m) | 23 | 215–220 | T(_d) | Cubic | m(\bar{3})m | +| 32 | m(\bar{3})m | 432 | 221–230 | O(_h) | Cubic | m(\bar{3})m | CubicOps | + + +*/ diff --git a/Source/EbsdLib/LaueOps/MonoclinicOps.cpp b/Source/EbsdLib/LaueOps/MonoclinicOps.cpp index b1b4a087..8e671e3e 100644 --- a/Source/EbsdLib/LaueOps/MonoclinicOps.cpp +++ b/Source/EbsdLib/LaueOps/MonoclinicOps.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -176,6 +176,24 @@ std::string MonoclinicOps::getRotationPointGroup() const return "2"; } +// ----------------------------------------------------------------------------- +int MonoclinicOps::getPointGroup() const +{ + return 5; +} + +// ----------------------------------------------------------------------------- +bool MonoclinicOps::isInsideFZ(const QuatD& quat) const +{ + return IsInsideFZ(quat, getFZType(), getAxisOrderingType()); +} + +// ----------------------------------------------------------------------------- +bool MonoclinicOps::isInsideFZ(const OrientationD& rod) const +{ + return IsInsideFZ(rod, getFZType(), getAxisOrderingType()); +} + // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- @@ -286,6 +304,14 @@ QuatF MonoclinicOps::getNearestQuat(const QuatF& q1f, const QuatF& q2f) const return _calcNearestQuat(Monoclinic::QuatSym, q1f.to(), q2f.to()).to(); } +// ----------------------------------------------------------------------------- +QuatD MonoclinicOps::getFZQuat(const QuatD& qr) const +{ + LaueOps::FZType fzType = laue_ops::FZtarray[getPointGroup() - 1]; + LaueOps::AxisOrderingType orderingType = laue_ops::FZoarray[getPointGroup() - 1]; + return ConvertToFZ(Monoclinic::QuatSym, qr, fzType, orderingType); +} + // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- diff --git a/Source/EbsdLib/LaueOps/MonoclinicOps.h b/Source/EbsdLib/LaueOps/MonoclinicOps.h index 6f4658b0..64615b12 100644 --- a/Source/EbsdLib/LaueOps/MonoclinicOps.h +++ b/Source/EbsdLib/LaueOps/MonoclinicOps.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -121,7 +121,13 @@ class EbsdLib_EXPORT MonoclinicOps : public LaueOps * @brief Returns the Rotation Point Group for the LaueClass. * @return */ - virtual std::string getRotationPointGroup() const override; + std::string getRotationPointGroup() const override; + + /** + * @brief Returns the Rotation Point Group for the LaueClass. + * @return + */ + int getPointGroup() const override; /** * @brief Returns the number of bins in each of the 3 dimensions @@ -164,6 +170,7 @@ class EbsdLib_EXPORT MonoclinicOps : public LaueOps QuatD getNearestQuat(const QuatD& q1, const QuatD& q2) const override; QuatF getNearestQuat(const QuatF& q1f, const QuatF& q2f) const override; + QuatD getFZQuat(const QuatD& qr) const override; int getMisoBin(const OrientationType& rod) const override; bool inUnitTriangle(double eta, double chi) const override; OrientationType determineEulerAngles(double random[3], int choose) const override; @@ -238,6 +245,20 @@ class EbsdLib_EXPORT MonoclinicOps : public LaueOps */ EbsdLib::UInt8ArrayType::Pointer generateIPFTriangleLegend(int imageDim, bool generateEntirePlane) const override; + /** + * @brief Returns if the given Quaternion is within the Rodrigues Fundamental Zone (RFZ) + * @param quat Input Quaternion + * @return + */ + bool isInsideFZ(const QuatD& quat) const override; + + /** + * @brief Returns if the given Rodrigues vector is within the Rodrigues Fundamental Zone (RFZ) + * @param rod Input Rodrigues Vector + * @return + */ + bool isInsideFZ(const OrientationD& rod) const override; + protected: public: MonoclinicOps(const MonoclinicOps&) = delete; // Copy Constructor Not Implemented diff --git a/Source/EbsdLib/LaueOps/OrthoRhombicOps.cpp b/Source/EbsdLib/LaueOps/OrthoRhombicOps.cpp index 4973a840..441d21e4 100644 --- a/Source/EbsdLib/LaueOps/OrthoRhombicOps.cpp +++ b/Source/EbsdLib/LaueOps/OrthoRhombicOps.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -188,6 +188,24 @@ std::string OrthoRhombicOps::getRotationPointGroup() const return "222"; } +// ----------------------------------------------------------------------------- +int OrthoRhombicOps::getPointGroup() const +{ + return 8; +} + +// ----------------------------------------------------------------------------- +bool OrthoRhombicOps::isInsideFZ(const QuatD& quat) const +{ + return IsInsideFZ(quat, getFZType(), getAxisOrderingType()); +} + +// ----------------------------------------------------------------------------- +bool OrthoRhombicOps::isInsideFZ(const OrientationD& rod) const +{ + return IsInsideFZ(rod, getFZType(), getAxisOrderingType()); +} + OrientationD OrthoRhombicOps::calculateMisorientation(const QuatD& q1, const QuatD& q2) const { return calculateMisorientationInternal(OrthoRhombic::QuatSym, q1, q2); @@ -296,9 +314,12 @@ QuatF OrthoRhombicOps::getNearestQuat(const QuatF& q1f, const QuatF& q2f) const return _calcNearestQuat(OrthoRhombic::QuatSym, q1f.to(), q2f.to()).to(); } +// ----------------------------------------------------------------------------- QuatD OrthoRhombicOps::getFZQuat(const QuatD& qr) const { - return _calcQuatNearestOrigin(OrthoRhombic::QuatSym, qr); + LaueOps::FZType fzType = laue_ops::FZtarray[getPointGroup() - 1]; + LaueOps::AxisOrderingType orderingType = laue_ops::FZoarray[getPointGroup() - 1]; + return ConvertToFZ(OrthoRhombic::QuatSym, qr, fzType, orderingType); } // ----------------------------------------------------------------------------- diff --git a/Source/EbsdLib/LaueOps/OrthoRhombicOps.h b/Source/EbsdLib/LaueOps/OrthoRhombicOps.h index c80c3969..a8eb0125 100644 --- a/Source/EbsdLib/LaueOps/OrthoRhombicOps.h +++ b/Source/EbsdLib/LaueOps/OrthoRhombicOps.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -122,7 +122,13 @@ class EbsdLib_EXPORT OrthoRhombicOps : public LaueOps * @brief Returns the Rotation Point Group for the LaueClass. * @return */ - virtual std::string getRotationPointGroup() const override; + std::string getRotationPointGroup() const override; + + /** + * @brief Returns the Rotation Point Group for the LaueClass. + * @return + */ + int getPointGroup() const override; /** * @brief Returns the number of bins in each of the 3 dimensions @@ -241,6 +247,20 @@ class EbsdLib_EXPORT OrthoRhombicOps : public LaueOps */ EbsdLib::UInt8ArrayType::Pointer generateIPFTriangleLegend(int canvasDim, bool generateEntirePlane) const override; + /** + * @brief Returns if the given Quaternion is within the Rodrigues Fundamental Zone (RFZ) + * @param quat Input Quaternion + * @return + */ + bool isInsideFZ(const QuatD& quat) const override; + + /** + * @brief Returns if the given Rodrigues vector is within the Rodrigues Fundamental Zone (RFZ) + * @param rod Input Rodrigues Vector + * @return + */ + bool isInsideFZ(const OrientationD& rod) const override; + protected: public: OrthoRhombicOps(const OrthoRhombicOps&) = delete; // Copy Constructor Not Implemented diff --git a/Source/EbsdLib/LaueOps/TetragonalLowOps.cpp b/Source/EbsdLib/LaueOps/TetragonalLowOps.cpp index c6471c88..4ca871d8 100644 --- a/Source/EbsdLib/LaueOps/TetragonalLowOps.cpp +++ b/Source/EbsdLib/LaueOps/TetragonalLowOps.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -187,6 +187,24 @@ std::string TetragonalLowOps::getRotationPointGroup() const return "4"; } +// ----------------------------------------------------------------------------- +int TetragonalLowOps::getPointGroup() const +{ + return 11; +} + +// ----------------------------------------------------------------------------- +bool TetragonalLowOps::isInsideFZ(const QuatD& quat) const +{ + return IsInsideFZ(quat, getFZType(), getAxisOrderingType()); +} + +// ----------------------------------------------------------------------------- +bool TetragonalLowOps::isInsideFZ(const OrientationD& rod) const +{ + return IsInsideFZ(rod, getFZType(), getAxisOrderingType()); +} + OrientationD TetragonalLowOps::calculateMisorientation(const QuatD& q1, const QuatD& q2) const { return calculateMisorientationInternal(TetragonalLow::QuatSym, q1, q2); @@ -289,6 +307,14 @@ QuatF TetragonalLowOps::getNearestQuat(const QuatF& q1f, const QuatF& q2f) const return _calcNearestQuat(TetragonalLow::QuatSym, q1f.to(), q2f.to()).to(); } +// ----------------------------------------------------------------------------- +QuatD TetragonalLowOps::getFZQuat(const QuatD& qr) const +{ + LaueOps::FZType fzType = laue_ops::FZtarray[getPointGroup() - 1]; + LaueOps::AxisOrderingType orderingType = laue_ops::FZoarray[getPointGroup() - 1]; + return ConvertToFZ(TetragonalLow::QuatSym, qr, fzType, orderingType); +} + // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- diff --git a/Source/EbsdLib/LaueOps/TetragonalLowOps.h b/Source/EbsdLib/LaueOps/TetragonalLowOps.h index 0f7a6544..2736ad17 100644 --- a/Source/EbsdLib/LaueOps/TetragonalLowOps.h +++ b/Source/EbsdLib/LaueOps/TetragonalLowOps.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -122,7 +122,13 @@ class EbsdLib_EXPORT TetragonalLowOps : public LaueOps * @brief Returns the Rotation Point Group for the LaueClass. * @return */ - virtual std::string getRotationPointGroup() const override; + std::string getRotationPointGroup() const override; + + /** + * @brief Returns the Rotation Point Group for the LaueClass. + * @return + */ + int getPointGroup() const override; /** * @brief Returns the number of bins in each of the 3 dimensions @@ -165,6 +171,7 @@ class EbsdLib_EXPORT TetragonalLowOps : public LaueOps QuatD getNearestQuat(const QuatD& q1, const QuatD& q2) const override; QuatF getNearestQuat(const QuatF& q1f, const QuatF& q2f) const override; + QuatD getFZQuat(const QuatD& qr) const override; int getMisoBin(const OrientationType& rod) const override; bool inUnitTriangle(double eta, double chi) const override; OrientationType determineEulerAngles(double random[3], int choose) const override; @@ -240,6 +247,20 @@ class EbsdLib_EXPORT TetragonalLowOps : public LaueOps */ EbsdLib::UInt8ArrayType::Pointer generateIPFTriangleLegend(int imageDim, bool generateEntirePlane) const override; + /** + * @brief Returns if the given Quaternion is within the Rodrigues Fundamental Zone (RFZ) + * @param quat Input Quaternion + * @return + */ + bool isInsideFZ(const QuatD& quat) const override; + + /** + * @brief Returns if the given Rodrigues vector is within the Rodrigues Fundamental Zone (RFZ) + * @param rod Input Rodrigues Vector + * @return + */ + bool isInsideFZ(const OrientationD& rod) const override; + protected: public: TetragonalLowOps(const TetragonalLowOps&) = delete; // Copy Constructor Not Implemented diff --git a/Source/EbsdLib/LaueOps/TetragonalOps.cpp b/Source/EbsdLib/LaueOps/TetragonalOps.cpp index cdae5644..d83b6ba2 100644 --- a/Source/EbsdLib/LaueOps/TetragonalOps.cpp +++ b/Source/EbsdLib/LaueOps/TetragonalOps.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -213,6 +213,24 @@ std::string TetragonalOps::getRotationPointGroup() const return "422"; } +// ----------------------------------------------------------------------------- +int TetragonalOps::getPointGroup() const +{ + return 15; +} + +// ----------------------------------------------------------------------------- +bool TetragonalOps::isInsideFZ(const QuatD& quat) const +{ + return IsInsideFZ(quat, getFZType(), getAxisOrderingType()); +} + +// ----------------------------------------------------------------------------- +bool TetragonalOps::isInsideFZ(const OrientationD& rod) const +{ + return IsInsideFZ(rod, getFZType(), getAxisOrderingType()); +} + // ----------------------------------------------------------------------------- OrientationD TetragonalOps::calculateMisorientation(const QuatD& q1, const QuatD& q2) const { @@ -319,6 +337,14 @@ QuatF TetragonalOps::getNearestQuat(const QuatF& q1f, const QuatF& q2f) const return _calcNearestQuat(TetragonalHigh::QuatSym, q1f.to(), q2f.to()).to(); } +// ----------------------------------------------------------------------------- +QuatD TetragonalOps::getFZQuat(const QuatD& qr) const +{ + LaueOps::FZType fzType = laue_ops::FZtarray[getPointGroup() - 1]; + LaueOps::AxisOrderingType orderingType = laue_ops::FZoarray[getPointGroup() - 1]; + return ConvertToFZ(TetragonalHigh::QuatSym, qr, fzType, orderingType); +} + // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- diff --git a/Source/EbsdLib/LaueOps/TetragonalOps.h b/Source/EbsdLib/LaueOps/TetragonalOps.h index 4ae520e6..90ceeaf9 100644 --- a/Source/EbsdLib/LaueOps/TetragonalOps.h +++ b/Source/EbsdLib/LaueOps/TetragonalOps.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -122,7 +122,13 @@ class EbsdLib_EXPORT TetragonalOps : public LaueOps * @brief Returns the Rotation Point Group for the LaueClass. * @return */ - virtual std::string getRotationPointGroup() const override; + std::string getRotationPointGroup() const override; + + /** + * @brief Returns the Rotation Point Group for the LaueClass. + * @return + */ + int getPointGroup() const override; /** * @brief Returns the number of bins in each of the 3 dimensions @@ -165,6 +171,7 @@ class EbsdLib_EXPORT TetragonalOps : public LaueOps QuatD getNearestQuat(const QuatD& q1, const QuatD& q2) const override; QuatF getNearestQuat(const QuatF& q1f, const QuatF& q2f) const override; + QuatD getFZQuat(const QuatD& qr) const override; int getMisoBin(const OrientationType& rod) const override; bool inUnitTriangle(double eta, double chi) const override; OrientationType determineEulerAngles(double random[3], int choose) const override; @@ -240,6 +247,20 @@ class EbsdLib_EXPORT TetragonalOps : public LaueOps */ EbsdLib::UInt8ArrayType::Pointer generateIPFTriangleLegend(int imageDim, bool generateEntirePlane) const override; + /** + * @brief Returns if the given Quaternion is within the Rodrigues Fundamental Zone (RFZ) + * @param quat Input Quaternion + * @return + */ + bool isInsideFZ(const QuatD& quat) const override; + + /** + * @brief Returns if the given Rodrigues vector is within the Rodrigues Fundamental Zone (RFZ) + * @param rod Input Rodrigues Vector + * @return + */ + bool isInsideFZ(const OrientationD& rod) const override; + protected: public: TetragonalOps(const TetragonalOps&) = delete; // Copy Constructor Not Implemented diff --git a/Source/EbsdLib/LaueOps/TriclinicOps.cpp b/Source/EbsdLib/LaueOps/TriclinicOps.cpp index 499ea6e2..7e4733f8 100644 --- a/Source/EbsdLib/LaueOps/TriclinicOps.cpp +++ b/Source/EbsdLib/LaueOps/TriclinicOps.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -173,6 +173,24 @@ std::string TriclinicOps::getRotationPointGroup() const return "1"; } +// ----------------------------------------------------------------------------- +int TriclinicOps::getPointGroup() const +{ + return 2; +} + +// ----------------------------------------------------------------------------- +bool TriclinicOps::isInsideFZ(const QuatD& quat) const +{ + return IsInsideFZ(quat, getFZType(), getAxisOrderingType()); +} + +// ----------------------------------------------------------------------------- +bool TriclinicOps::isInsideFZ(const OrientationD& rod) const +{ + return IsInsideFZ(rod, getFZType(), getAxisOrderingType()); +} + // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- @@ -275,6 +293,14 @@ QuatF TriclinicOps::getNearestQuat(const QuatF& q1f, const QuatF& q2f) const return _calcNearestQuat(Triclinic::QuatSym, q1f.to(), q2f.to()).to(); } +// ----------------------------------------------------------------------------- +QuatD TriclinicOps::getFZQuat(const QuatD& qr) const +{ + LaueOps::FZType fzType = laue_ops::FZtarray[getPointGroup() - 1]; + LaueOps::AxisOrderingType orderingType = laue_ops::FZoarray[getPointGroup() - 1]; + return ConvertToFZ(Triclinic::QuatSym, qr, fzType, orderingType); +} + // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- diff --git a/Source/EbsdLib/LaueOps/TriclinicOps.h b/Source/EbsdLib/LaueOps/TriclinicOps.h index cfeeedb9..49301197 100644 --- a/Source/EbsdLib/LaueOps/TriclinicOps.h +++ b/Source/EbsdLib/LaueOps/TriclinicOps.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -122,7 +122,13 @@ class EbsdLib_EXPORT TriclinicOps : public LaueOps * @brief Returns the Rotation Point Group for the LaueClass. * @return */ - virtual std::string getRotationPointGroup() const override; + std::string getRotationPointGroup() const override; + + /** + * @brief Returns the Rotation Point Group for the LaueClass. + * @return + */ + int getPointGroup() const override; /** * @brief Returns the number of bins in each of the 3 dimensions @@ -165,6 +171,7 @@ class EbsdLib_EXPORT TriclinicOps : public LaueOps QuatD getNearestQuat(const QuatD& q1, const QuatD& q2) const override; QuatF getNearestQuat(const QuatF& q1f, const QuatF& q2f) const override; + QuatD getFZQuat(const QuatD& qr) const override; int getMisoBin(const OrientationType& rod) const override; bool inUnitTriangle(double eta, double chi) const override; OrientationType determineEulerAngles(double random[3], int choose) const override; @@ -240,6 +247,20 @@ class EbsdLib_EXPORT TriclinicOps : public LaueOps */ EbsdLib::UInt8ArrayType::Pointer generateIPFTriangleLegend(int imageDim, bool generateEntirePlane) const override; + /** + * @brief Returns if the given Quaternion is within the Rodrigues Fundamental Zone (RFZ) + * @param quat Input Quaternion + * @return + */ + bool isInsideFZ(const QuatD& quat) const override; + + /** + * @brief Returns if the given Rodrigues vector is within the Rodrigues Fundamental Zone (RFZ) + * @param rod Input Rodrigues Vector + * @return + */ + bool isInsideFZ(const OrientationD& rod) const override; + protected: public: TriclinicOps(const TriclinicOps&) = delete; // Copy Constructor Not Implemented diff --git a/Source/EbsdLib/LaueOps/TrigonalLowOps.cpp b/Source/EbsdLib/LaueOps/TrigonalLowOps.cpp index 1ac0c11e..2b01cbce 100644 --- a/Source/EbsdLib/LaueOps/TrigonalLowOps.cpp +++ b/Source/EbsdLib/LaueOps/TrigonalLowOps.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -185,6 +185,24 @@ std::string TrigonalLowOps::getRotationPointGroup() const return "3"; } +// ----------------------------------------------------------------------------- +int TrigonalLowOps::getPointGroup() const +{ + return 17; +} + +// ----------------------------------------------------------------------------- +bool TrigonalLowOps::isInsideFZ(const QuatD& quat) const +{ + return IsInsideFZ(quat, getFZType(), getAxisOrderingType()); +} + +// ----------------------------------------------------------------------------- +bool TrigonalLowOps::isInsideFZ(const OrientationD& rod) const +{ + return IsInsideFZ(rod, getFZType(), getAxisOrderingType()); +} + OrientationD TrigonalLowOps::calculateMisorientation(const QuatD& q1, const QuatD& q2) const { return calculateMisorientationInternal(TrigonalLow::QuatSym, q1, q2); @@ -320,6 +338,14 @@ QuatF TrigonalLowOps::getNearestQuat(const QuatF& q1f, const QuatF& q2f) const return _calcNearestQuat(TrigonalLow::QuatSym, q1f.to(), q2f.to()).to(); } +// ----------------------------------------------------------------------------- +QuatD TrigonalLowOps::getFZQuat(const QuatD& qr) const +{ + LaueOps::FZType fzType = laue_ops::FZtarray[getPointGroup() - 1]; + LaueOps::AxisOrderingType orderingType = laue_ops::FZoarray[getPointGroup() - 1]; + return ConvertToFZ(TrigonalLow::QuatSym, qr, fzType, orderingType); +} + // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- diff --git a/Source/EbsdLib/LaueOps/TrigonalLowOps.h b/Source/EbsdLib/LaueOps/TrigonalLowOps.h index 239d60b1..9e133af5 100644 --- a/Source/EbsdLib/LaueOps/TrigonalLowOps.h +++ b/Source/EbsdLib/LaueOps/TrigonalLowOps.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -123,7 +123,13 @@ class EbsdLib_EXPORT TrigonalLowOps : public LaueOps * @brief Returns the Rotation Point Group for the LaueClass. * @return */ - virtual std::string getRotationPointGroup() const override; + std::string getRotationPointGroup() const override; + + /** + * @brief Returns the Rotation Point Group for the LaueClass. + * @return + */ + int getPointGroup() const override; /** * @brief Returns the number of bins in each of the 3 dimensions @@ -166,6 +172,7 @@ class EbsdLib_EXPORT TrigonalLowOps : public LaueOps QuatD getNearestQuat(const QuatD& q1, const QuatD& q2) const override; QuatF getNearestQuat(const QuatF& q1f, const QuatF& q2f) const override; + QuatD getFZQuat(const QuatD& qr) const override; int getMisoBin(const OrientationType& rod) const override; bool inUnitTriangle(double eta, double chi) const override; OrientationType determineEulerAngles(double random[3], int choose) const override; @@ -242,6 +249,20 @@ class EbsdLib_EXPORT TrigonalLowOps : public LaueOps */ EbsdLib::UInt8ArrayType::Pointer generateIPFTriangleLegend(int imageDim, bool generateEntirePlane) const override; + /** + * @brief Returns if the given Quaternion is within the Rodrigues Fundamental Zone (RFZ) + * @param quat Input Quaternion + * @return + */ + bool isInsideFZ(const QuatD& quat) const override; + + /** + * @brief Returns if the given Rodrigues vector is within the Rodrigues Fundamental Zone (RFZ) + * @param rod Input Rodrigues Vector + * @return + */ + bool isInsideFZ(const OrientationD& rod) const override; + protected: public: TrigonalLowOps(const TrigonalLowOps&) = delete; // Copy Constructor Not Implemented diff --git a/Source/EbsdLib/LaueOps/TrigonalOps.cpp b/Source/EbsdLib/LaueOps/TrigonalOps.cpp index 38598fb0..7da9c631 100644 --- a/Source/EbsdLib/LaueOps/TrigonalOps.cpp +++ b/Source/EbsdLib/LaueOps/TrigonalOps.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -200,6 +200,24 @@ std::string TrigonalOps::getRotationPointGroup() const return "32"; } +// ----------------------------------------------------------------------------- +int TrigonalOps::getPointGroup() const +{ + return 20; +} + +// ----------------------------------------------------------------------------- +bool TrigonalOps::isInsideFZ(const QuatD& quat) const +{ + return IsInsideFZ(quat, getFZType(), getAxisOrderingType()); +} + +// ----------------------------------------------------------------------------- +bool TrigonalOps::isInsideFZ(const OrientationD& rod) const +{ + return IsInsideFZ(rod, getFZType(), getAxisOrderingType()); +} + OrientationD TrigonalOps::calculateMisorientation(const QuatD& q1, const QuatD& q2) const { return calculateMisorientationInternal(TrigonalHigh::QuatSym, q1, q2); @@ -341,6 +359,14 @@ QuatF TrigonalOps::getNearestQuat(const QuatF& q1f, const QuatF& q2f) const return _calcNearestQuat(TrigonalHigh::QuatSym, q1f.to(), q2f.to()).to(); } +// ----------------------------------------------------------------------------- +QuatD TrigonalOps::getFZQuat(const QuatD& qr) const +{ + LaueOps::FZType fzType = laue_ops::FZtarray[getPointGroup() - 1]; + LaueOps::AxisOrderingType orderingType = laue_ops::FZoarray[getPointGroup() - 1]; + return ConvertToFZ(TrigonalHigh::QuatSym, qr, fzType, orderingType); +} + // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- diff --git a/Source/EbsdLib/LaueOps/TrigonalOps.h b/Source/EbsdLib/LaueOps/TrigonalOps.h index f52b69f6..1828c7b0 100644 --- a/Source/EbsdLib/LaueOps/TrigonalOps.h +++ b/Source/EbsdLib/LaueOps/TrigonalOps.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -122,7 +122,13 @@ class EbsdLib_EXPORT TrigonalOps : public LaueOps * @brief Returns the Rotation Point Group for the LaueClass. * @return */ - virtual std::string getRotationPointGroup() const override; + std::string getRotationPointGroup() const override; + + /** + * @brief Returns the Rotation Point Group for the LaueClass. + * @return + */ + int getPointGroup() const override; /** * @brief Returns the number of bins in each of the 3 dimensions @@ -165,6 +171,7 @@ class EbsdLib_EXPORT TrigonalOps : public LaueOps QuatD getNearestQuat(const QuatD& q1, const QuatD& q2) const override; QuatF getNearestQuat(const QuatF& q1f, const QuatF& q2f) const override; + QuatD getFZQuat(const QuatD& qr) const override; int getMisoBin(const OrientationType& rod) const override; bool inUnitTriangle(double eta, double chi) const override; OrientationType determineEulerAngles(double random[3], int choose) const override; @@ -241,6 +248,20 @@ class EbsdLib_EXPORT TrigonalOps : public LaueOps */ EbsdLib::UInt8ArrayType::Pointer generateIPFTriangleLegend(int imageDim, bool generateEntirePlane) const override; + /** + * @brief Returns if the given Quaternion is within the Rodrigues Fundamental Zone (RFZ) + * @param quat Input Quaternion + * @return + */ + bool isInsideFZ(const QuatD& quat) const override; + + /** + * @brief Returns if the given Rodrigues vector is within the Rodrigues Fundamental Zone (RFZ) + * @param rod Input Rodrigues Vector + * @return + */ + bool isInsideFZ(const OrientationD& rod) const override; + protected: public: TrigonalOps(const TrigonalOps&) = delete; // Copy Constructor Not Implemented diff --git a/Source/EbsdLib/Math/EbsdLibMath.cpp b/Source/EbsdLib/Math/EbsdLibMath.cpp index 5b7491ed..3f29f9a5 100644 --- a/Source/EbsdLib/Math/EbsdLibMath.cpp +++ b/Source/EbsdLib/Math/EbsdLibMath.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Math/EbsdLibMath.h b/Source/EbsdLib/Math/EbsdLibMath.h index c4035061..fe4553e7 100644 --- a/Source/EbsdLib/Math/EbsdLibMath.h +++ b/Source/EbsdLib/Math/EbsdLibMath.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Math/EbsdLibRandom.cpp b/Source/EbsdLib/Math/EbsdLibRandom.cpp index 586a7f97..7f83bff9 100644 --- a/Source/EbsdLib/Math/EbsdLibRandom.cpp +++ b/Source/EbsdLib/Math/EbsdLibRandom.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Math/EbsdLibRandom.h b/Source/EbsdLib/Math/EbsdLibRandom.h index 69e6d74a..d85eeed1 100644 --- a/Source/EbsdLib/Math/EbsdLibRandom.h +++ b/Source/EbsdLib/Math/EbsdLibRandom.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Math/EbsdMatrixMath.cpp b/Source/EbsdLib/Math/EbsdMatrixMath.cpp index ff03c1fa..ef8b8cea 100644 --- a/Source/EbsdLib/Math/EbsdMatrixMath.cpp +++ b/Source/EbsdLib/Math/EbsdMatrixMath.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Math/EbsdMatrixMath.h b/Source/EbsdLib/Math/EbsdMatrixMath.h index 3719f128..3b01c90d 100644 --- a/Source/EbsdLib/Math/EbsdMatrixMath.h +++ b/Source/EbsdLib/Math/EbsdMatrixMath.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Math/GeometryMath.cpp b/Source/EbsdLib/Math/GeometryMath.cpp index b4086a1d..bd351a9b 100644 --- a/Source/EbsdLib/Math/GeometryMath.cpp +++ b/Source/EbsdLib/Math/GeometryMath.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Math/GeometryMath.h b/Source/EbsdLib/Math/GeometryMath.h index 2f318059..0efb9e5d 100644 --- a/Source/EbsdLib/Math/GeometryMath.h +++ b/Source/EbsdLib/Math/GeometryMath.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/OrientationMath/OrientationConverter.hpp b/Source/EbsdLib/OrientationMath/OrientationConverter.hpp index f96aa03a..407ff697 100644 --- a/Source/EbsdLib/OrientationMath/OrientationConverter.hpp +++ b/Source/EbsdLib/OrientationMath/OrientationConverter.hpp @@ -500,7 +500,7 @@ class ConvertRepresentation size_t outStride = OUTSTRIDE; \ std::vector cDims = {outStride}; \ DataArrayPointerType output = DataArrayType::CreateArray(nTuples, cDims, #OUT_ARRAY_NAME, true); \ - output->initializeWithZeros(); /* Intialize the array with Zeros */ \ + output->initializeWithZeros(); /* Initialize the array with Zeros */ \ T* outPtr = output->getPointer(0); \ tbb::parallel_for(tbb::blocked_range(0, nTuples), ConvertRepresentation>(inPtr, outPtr, inStride, outStride), tbb::auto_partitioner()); \ this->setOutputData(output); @@ -1820,7 +1820,7 @@ class StereographicConverter : public OrientationConverter void sanityCheckInputData() override { - /* Apparently there is no sanity check for Spbochoric, Odd. We place this + /* Apparently there is no sanity check for Stereographic, Odd. We place this * code here in case we come up with one, the parallel version is ready to * go */ diff --git a/Source/EbsdLib/Texture/StatsGen.hpp b/Source/EbsdLib/Texture/StatsGen.hpp index 813f0e87..5c2fa7d6 100644 --- a/Source/EbsdLib/Texture/StatsGen.hpp +++ b/Source/EbsdLib/Texture/StatsGen.hpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Texture/Texture.hpp b/Source/EbsdLib/Texture/Texture.hpp index 609aa22d..d1b45b8a 100644 --- a/Source/EbsdLib/Texture/Texture.hpp +++ b/Source/EbsdLib/Texture/Texture.hpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Texture/TexturePreset.cpp b/Source/EbsdLib/Texture/TexturePreset.cpp index cfc99441..d96ff228 100644 --- a/Source/EbsdLib/Texture/TexturePreset.cpp +++ b/Source/EbsdLib/Texture/TexturePreset.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Texture/TexturePreset.h b/Source/EbsdLib/Texture/TexturePreset.h index 1a4f847d..863ecea2 100644 --- a/Source/EbsdLib/Texture/TexturePreset.h +++ b/Source/EbsdLib/Texture/TexturePreset.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Utilities/ColorTable.h b/Source/EbsdLib/Utilities/ColorTable.h index c8566c89..e45999b0 100644 --- a/Source/EbsdLib/Utilities/ColorTable.h +++ b/Source/EbsdLib/Utilities/ColorTable.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Utilities/ColorUtilities.cpp b/Source/EbsdLib/Utilities/ColorUtilities.cpp index bed3c268..c3b7699b 100644 --- a/Source/EbsdLib/Utilities/ColorUtilities.cpp +++ b/Source/EbsdLib/Utilities/ColorUtilities.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Utilities/ColorUtilities.h b/Source/EbsdLib/Utilities/ColorUtilities.h index d8506284..21c74416 100644 --- a/Source/EbsdLib/Utilities/ColorUtilities.h +++ b/Source/EbsdLib/Utilities/ColorUtilities.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Utilities/ModifiedLambertProjection.cpp b/Source/EbsdLib/Utilities/ModifiedLambertProjection.cpp index ffb4bb6c..aa6017c0 100644 --- a/Source/EbsdLib/Utilities/ModifiedLambertProjection.cpp +++ b/Source/EbsdLib/Utilities/ModifiedLambertProjection.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Utilities/ModifiedLambertProjection.h b/Source/EbsdLib/Utilities/ModifiedLambertProjection.h index 8775503c..8048579f 100644 --- a/Source/EbsdLib/Utilities/ModifiedLambertProjection.h +++ b/Source/EbsdLib/Utilities/ModifiedLambertProjection.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Utilities/ModifiedLambertProjectionArray.cpp b/Source/EbsdLib/Utilities/ModifiedLambertProjectionArray.cpp index ee5831b8..06afcdfc 100644 --- a/Source/EbsdLib/Utilities/ModifiedLambertProjectionArray.cpp +++ b/Source/EbsdLib/Utilities/ModifiedLambertProjectionArray.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -41,9 +41,9 @@ #include "EbsdLib/Utilities/EbsdStringUtils.hpp" #ifdef EbsdLib_ENABLE_HDF5 -#include #include "H5Support/H5Lite.h" #include "H5Support/H5Utilities.h" +#include using namespace H5Support; #endif diff --git a/Source/EbsdLib/Utilities/ModifiedLambertProjectionArray.h b/Source/EbsdLib/Utilities/ModifiedLambertProjectionArray.h index 45802fd5..6869905b 100644 --- a/Source/EbsdLib/Utilities/ModifiedLambertProjectionArray.h +++ b/Source/EbsdLib/Utilities/ModifiedLambertProjectionArray.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Utilities/PoleFigureData.cpp b/Source/EbsdLib/Utilities/PoleFigureData.cpp index 26dedc8a..117e4003 100644 --- a/Source/EbsdLib/Utilities/PoleFigureData.cpp +++ b/Source/EbsdLib/Utilities/PoleFigureData.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Utilities/PoleFigureData.h b/Source/EbsdLib/Utilities/PoleFigureData.h index 5e4c9377..60a55bea 100644 --- a/Source/EbsdLib/Utilities/PoleFigureData.h +++ b/Source/EbsdLib/Utilities/PoleFigureData.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Utilities/PoleFigureUtilities.cpp b/Source/EbsdLib/Utilities/PoleFigureUtilities.cpp index 1b811f8c..09eda91a 100644 --- a/Source/EbsdLib/Utilities/PoleFigureUtilities.cpp +++ b/Source/EbsdLib/Utilities/PoleFigureUtilities.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/EbsdLib/Utilities/PoleFigureUtilities.h b/Source/EbsdLib/Utilities/PoleFigureUtilities.h index fd7dc63c..4ddeed08 100644 --- a/Source/EbsdLib/Utilities/PoleFigureUtilities.h +++ b/Source/EbsdLib/Utilities/PoleFigureUtilities.h @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/Test/AngImportTest.cpp b/Source/Test/AngImportTest.cpp index 5357a8d0..7cda5880 100644 --- a/Source/Test/AngImportTest.cpp +++ b/Source/Test/AngImportTest.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/Test/AngleFileLoaderTest.cpp b/Source/Test/AngleFileLoaderTest.cpp index 01a49445..d94292cf 100644 --- a/Source/Test/AngleFileLoaderTest.cpp +++ b/Source/Test/AngleFileLoaderTest.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/Test/CMakeLists.txt b/Source/Test/CMakeLists.txt index 58d81616..8cab3661 100644 --- a/Source/Test/CMakeLists.txt +++ b/Source/Test/CMakeLists.txt @@ -96,6 +96,7 @@ set(TEST_NAMES SO3SamplerTest TextureTest + ConvertToFundamentalZoneTest ) diff --git a/Source/Test/ConvertToFundamentalZoneTest.cpp b/Source/Test/ConvertToFundamentalZoneTest.cpp new file mode 100644 index 00000000..5db225db --- /dev/null +++ b/Source/Test/ConvertToFundamentalZoneTest.cpp @@ -0,0 +1,147 @@ +/* ============================================================================ + * Copyright (c) 2009-2016 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 following 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 + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#include "EbsdLib/Core/OrientationRepresentation.h" +#include "EbsdLib/Core/OrientationTransformation.hpp" +#include "EbsdLib/Core/Quaternion.hpp" +#include "EbsdLib/EbsdLib.h" +#include "EbsdLib/LaueOps/LaueOps.h" +#include "EbsdLib/Test/EbsdLibTestFileLocations.h" + +#include "TestPrintFunctions.h" +#include "UnitTestSupport.hpp" + +#include + +#include + +//clang-format off +namespace detail +{ +std::vector> k_TestRodrigues = {{0.55, 0.55, 0.20}, {0.55, 0.55, 0.35}, {0.55, 0.55, 0.5}, {0.55, 0.55, 0.75}, {0.0, 0.0, 0.75}, {0.0, 0.0, 1.25}, + {-0.25, -0.25, 0.20}, {-0.25, -0.25, 0.35}, {-0.25, -0.25, 0.49}, {-0.25, -0.25, 0.75}, {-0.25, -0.25, 0.51}, {0.0, -1.25, 0.20}, + {0.0, -1.25, 0.35}, {0.0, -1.25, 0.5}, {0.0, -1.25, 0.75}, {0.0, -1.25, 1.25}, {0.15, 0.30, 0.0}, {0.3, 0.6, 0.0}, + {0.375, 0.75, 0.0}, {0.45, 0.90, 0.0}, {0.4875, 0.975, 0.0}, {0.0, 1.1, 0.0}}; + +std::vector> k_FZValues = { + {true, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, true, true, true, false, false, false}, // 622 + {false, false, false, false, false, false, true, true, false, false, false, false, false, false, false, false, true, false, false, false, false, false}, // 432, + {true, false, false, false, false, false, true, false, false, false, false, true, false, false, false, false, true, true, true, true, true, true}, // 6, + {false, false, false, false, true, false, true, true, true, false, false, false, false, false, false, false, true, true, false, false, false, false}, // 23, + {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true}, // 1 + {true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false, true, true, true, true, true, false}, // 2, + {true, true, true, true, true, false, true, true, true, true, true, false, false, false, false, false, true, true, true, true, true, false}, // 222, + {true, true, false, false, false, false, true, true, false, false, false, true, true, false, false, false, true, true, true, true, true, true}, // 4, + {true, true, false, false, false, false, true, true, false, false, false, false, false, false, false, false, true, true, true, true, false, false}, // 422, + {true, true, true, false, false, false, true, true, true, false, true, true, true, true, false, false, true, true, true, true, true, true}, // 3, + {true, true, true, false, false, false, true, true, true, false, true, false, false, false, false, false, true, true, true, false, false, true} // ,32, +}; +//clang-format on + +} // namespace Detail + +class ConvertToFundamentalZoneTest +{ +public: + ConvertToFundamentalZoneTest() = default; + virtual ~ConvertToFundamentalZoneTest() = default; + + EBSD_GET_NAME_OF_CLASS_DECL(ConvertToFundamentalZoneTest) + + // ----------------------------------------------------------------------------- + void RemoveTestFiles() + { +#if REMOVE_TEST_FILES +// fs::remove(); +#endif + } + + static OrientationD convertRodrigues(const std::array& rod) + { + const float length = sqrt(rod[0] * rod[0] + rod[1] * rod[1] + rod[2] * rod[2]); + return {rod[0] / length, rod[1] / length, rod[2] / length, length}; + } + + void TestRodrigues() + { + auto ops = LaueOps::GetAllOrientationOps(); + std::cout << "############################################################\n"; + for(size_t opsIdx = 0; opsIdx < ops.size() - 1; ++opsIdx) // We ONLY want Cubic 432 rotation group + { + std::cout << "OpsIndex: " << opsIdx << " " << ops[opsIdx]->getRotationPointGroup() << ", " << ops[opsIdx]->getSymmetryName() << ", " << ops[opsIdx]->getPointGroup() << ", " + << ops[opsIdx]->FZTypeToString(ops[opsIdx]->getFZType()) << ", " << ops[opsIdx]->AxisOrderingTypeToString(ops[opsIdx]->getAxisOrderingType()) << std::endl; + const std::array& testValues = detail::k_FZValues[opsIdx]; + + for(size_t testIdx = 0; testIdx < testValues.size(); testIdx++) + { + // OrientationD testRod = OrientationTransformation::qu2ro(Detail::k_InputQuat); + std::array rod = detail::k_TestRodrigues[testIdx]; + OrientationD testRod = convertRodrigues(rod); + bool isInside = LaueOps::IsInsideFZ(testRod, ops[opsIdx]->getFZType(), ops[opsIdx]->getAxisOrderingType()); + + DREAM3D_REQUIRE_EQUAL(isInside, testValues[testIdx]) + // if(testValues[testIdx] != isInside) + // { + // std::stringstream ss; + // ss << testIdx << ": " << "(" << rod[0] << ", " << rod[1] << ", " << rod[2] << "), " << testValues[testIdx] << ", " << isInside; + // std::cout << ss.str() << std::endl; + // } + + if(!isInside) + { + QuatD quat = OrientationTransformation::ro2qu(testRod); + QuatD fzQuat = ops[opsIdx]->getFZQuat(quat); + OrientationD fzRod = OrientationTransformation::qu2ro(fzQuat); + isInside = LaueOps::IsInsideFZ(fzRod, ops[opsIdx]->getFZType(), ops[opsIdx]->getAxisOrderingType()); + DREAM3D_REQUIRE_EQUAL(isInside, true); + } + } + } + } + + // ----------------------------------------------------------------------------- + void operator()() + { + std::cout << "<===== Start " << getNameOfClass() << std::endl; + int err = EXIT_SUCCESS; + DREAM3D_REGISTER_TEST(TestRodrigues()) + } + +public: + ConvertToFundamentalZoneTest(const ConvertToFundamentalZoneTest&) = delete; // Copy Constructor Not Implemented + ConvertToFundamentalZoneTest(ConvertToFundamentalZoneTest&&) = delete; // Move Constructor Not Implemented + ConvertToFundamentalZoneTest& operator=(const ConvertToFundamentalZoneTest&) = delete; // Copy Assignment Not Implemented + ConvertToFundamentalZoneTest& operator=(ConvertToFundamentalZoneTest&&) = delete; // Move Assignment Not Implemented +}; diff --git a/Source/Test/CtfReaderTest.cpp b/Source/Test/CtfReaderTest.cpp index 13c448c8..32573533 100644 --- a/Source/Test/CtfReaderTest.cpp +++ b/Source/Test/CtfReaderTest.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without * modification, diff --git a/Source/Test/EdaxOIMReaderTest.cpp b/Source/Test/EdaxOIMReaderTest.cpp index 7e99a6d6..4b7095ac 100644 --- a/Source/Test/EdaxOIMReaderTest.cpp +++ b/Source/Test/EdaxOIMReaderTest.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/Test/IPFLegendTest.cpp b/Source/Test/IPFLegendTest.cpp index 6ff55dd8..442df32c 100644 --- a/Source/Test/IPFLegendTest.cpp +++ b/Source/Test/IPFLegendTest.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/Test/ODFTest.cpp b/Source/Test/ODFTest.cpp index 8889d74b..42df39d9 100644 --- a/Source/Test/ODFTest.cpp +++ b/Source/Test/ODFTest.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/Test/OrientationArrayTest.cpp b/Source/Test/OrientationArrayTest.cpp index 635b3e5c..64511a9c 100644 --- a/Source/Test/OrientationArrayTest.cpp +++ b/Source/Test/OrientationArrayTest.cpp @@ -307,7 +307,7 @@ class OrientationArrayTest void Test_qu_check() { QuatF quat(1.0, 1.0, 1.0, 0.0); - quat = quat.unitQuaternion(); + quat = quat.normalize(); { using TestType = FOrientArrayType; diff --git a/Source/Test/OrientationConverterTest.cpp b/Source/Test/OrientationConverterTest.cpp index 384a223d..17a06e04 100644 --- a/Source/Test/OrientationConverterTest.cpp +++ b/Source/Test/OrientationConverterTest.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/Test/OrientationMathTest.cpp b/Source/Test/OrientationMathTest.cpp index 00dcaf6e..c3f2a253 100644 --- a/Source/Test/OrientationMathTest.cpp +++ b/Source/Test/OrientationMathTest.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/Test/OrientationTest.cpp b/Source/Test/OrientationTest.cpp index aad12060..b83ab407 100644 --- a/Source/Test/OrientationTest.cpp +++ b/Source/Test/OrientationTest.cpp @@ -228,7 +228,7 @@ class OrientationTest void Test_qu_check() { QuatF quat(1.0, 1.0, 1.0, 0.0); - quat.unitQuaternion(); + quat.normalize(); { OrientationTransformation::ResultType result; diff --git a/Source/Test/OrientationTransformationTest.cpp b/Source/Test/OrientationTransformationTest.cpp index 63591c68..310fd76d 100644 --- a/Source/Test/OrientationTransformationTest.cpp +++ b/Source/Test/OrientationTransformationTest.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/Test/OrientationTransformsTest.cpp b/Source/Test/OrientationTransformsTest.cpp index 4199647a..e8fbf643 100644 --- a/Source/Test/OrientationTransformsTest.cpp +++ b/Source/Test/OrientationTransformsTest.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/Test/QuaternionTest.cpp b/Source/Test/QuaternionTest.cpp index 01793431..ef917900 100644 --- a/Source/Test/QuaternionTest.cpp +++ b/Source/Test/QuaternionTest.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -250,7 +250,7 @@ class QuaternionTest p.w() = 2.0f; float length = p.length(); DREAM3D_REQUIRE_EQUAL(length, 4.0); - p = p.unitQuaternion(); + p = p.normalize(); DREAM3D_REQUIRE_EQUAL(p.x(), 0.5) DREAM3D_REQUIRE_EQUAL(p.y(), 0.5) DREAM3D_REQUIRE_EQUAL(p.z(), 0.5) diff --git a/Source/Test/TestPrintFunctions.h b/Source/Test/TestPrintFunctions.h index 8b68772d..5d957ea9 100644 --- a/Source/Test/TestPrintFunctions.h +++ b/Source/Test/TestPrintFunctions.h @@ -60,6 +60,16 @@ void Print_RO(const T& om) printf("Ro:% 3.16f % 3.16f % 3.16f % 3.16f\n", om[0], om[1], om[2], om[3]); } +// ----------------------------------------------------------------------------- +template +void Print_RO3(const T& om) +{ + // if(om[3] != std::numeric_limits::infinity()) + // printf("Rodrigues vector : % 3.6f % 3.6f % 3.6f\n", om[0], om[1], om[2] ); + // else + printf("Ro:% 3.16f % 3.16f % 3.16f\n", om[0], om[1], om[2]); +} + // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- diff --git a/Source/Test/TextureTest.cpp b/Source/Test/TextureTest.cpp index 6ed94794..ab93bec6 100644 --- a/Source/Test/TextureTest.cpp +++ b/Source/Test/TextureTest.cpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/Source/Test/UnitTestSupport.hpp b/Source/Test/UnitTestSupport.hpp index e626c156..4ee413f3 100644 --- a/Source/Test/UnitTestSupport.hpp +++ b/Source/Test/UnitTestSupport.hpp @@ -1,5 +1,5 @@ /* ============================================================================ - * Copyright (c) 2009-2016 BlueQuartz Software, LLC + * Copyright (c) 2009-2025 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -367,12 +367,12 @@ bool AlmostEqualUlpsFinal(float* A, float* B, int maxUlps) #define DREAM3D_REQUIRE(P) \ { \ - bool b = (P); \ - if((b) == (false)) \ + const bool testValue = (P); \ + if((testValue) == (false)) \ { \ - std::string s("Your test required the following\n '"); \ - s = s.append(#P).append("'\n but this condition was not met."); \ - DREAM3D_TEST_THROW_EXCEPTION(s) \ + std::string message("Your test required the following\n '"); \ + message = message.append(#P).append("'\n but this condition was not met."); \ + DREAM3D_TEST_THROW_EXCEPTION(message) \ } \ } @@ -420,11 +420,11 @@ bool AlmostEqualUlpsFinal(float* A, float* B, int maxUlps) #define DREAM3D_REQUIRE_EQUAL(L, R) \ if((L) != (R)) \ { \ - std::string buf; \ - std::stringstream ss(buf); \ - ss << "Your test required the following\n '"; \ - ss << #L << " == " << #R << "'\n but this condition was not met.\n"; \ - ss << " " << L << "==" << R; \ + const std::string buf; \ + std::stringstream outStream(buf); \ + outStream << "Your test required the following\n '"; \ + outStream << #L << " == " << #R << "'\n but this condition was not met.\n"; \ + outStream << " " << L << "==" << R; \ DREAM3D_TEST_THROW_EXCEPTION(buf) \ }