Skip to content

Commit 0211591

Browse files
authored
BUG: Fixes issues when computing the FZ Quaternion from an input quaternion (#33)
* GIT: Update .gitignore with CMakeUserPresets.json * Update Copyright Years * BUG: Fixes issues when computing the FZ Quaternion from an input quaternion. The code is taken directly from the EMsoftOO code base. * API: Expand the GetFZQuat to each of the subclasses. - Fix issue in H5AngVolumeReader when not reading Euler Angles from a file - Added API to all LaueOps classes to return an orientation in the fundamental zone
1 parent 87dc3ef commit 0211591

130 files changed

Lines changed: 1628 additions & 344 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-format

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
---
2-
Language: Cpp
3-
# BasedOnStyle: LLVM
2+
Language: Cpp
43
# AccessModifierOffset: -2
54
# AlignAfterOpenBracket: Align
65
# AlignConsecutiveAssignments: false
76
# AlignConsecutiveDeclarations: false
87
# AlignEscapedNewlinesLeft: false
9-
# AlignOperands: true
8+
# AlignOperands: true
109
# AlignTrailingComments: true
1110
# AllowAllParametersOfDeclarationOnNextLine: true
1211
# AllowShortBlocksOnASingleLine: false
@@ -20,49 +19,45 @@ AllowShortFunctionsOnASingleLine: false
2019
AlwaysBreakTemplateDeclarations: true
2120
# BinPackArguments: true
2221
# BinPackParameters: true
23-
BraceWrapping:
24-
AfterClass: true
22+
BraceWrapping:
23+
AfterClass: true
2524
AfterControlStatement: true
26-
AfterEnum: true
27-
AfterFunction: true
28-
AfterNamespace: true
25+
AfterEnum: true
26+
AfterFunction: true
27+
AfterNamespace: true
2928
AfterObjCDeclaration: false
30-
AfterStruct: true
31-
AfterUnion: false
32-
BeforeCatch: false
33-
BeforeElse: true
34-
IndentBraces: false
29+
AfterStruct: true
30+
AfterUnion: false
31+
BeforeCatch: false
32+
BeforeElse: true
33+
IndentBraces: false
3534
#BreakBeforeBinaryOperators: None
3635
BreakBeforeBraces: Custom
3736
BreakBeforeTernaryOperators: false
3837
BreakConstructorInitializersBeforeComma: true
39-
ColumnLimit: 200
40-
# CommentPragmas: '^ IWYU pragma:'
38+
ColumnLimit: 200
39+
# CommentPragmas: '^ IWYU pragma:'
4140
# ConstructorInitializerAllOnOneLineOrOnePerLine: false
4241
ConstructorInitializerIndentWidth: 0
4342
# ContinuationIndentWidth: 4
4443
# Cpp11BracedListStyle: true
4544
# DerivePointerAlignment: false
46-
# DisableFormat: false
45+
# DisableFormat: false
4746
# ExperimentalAutoDetectBinPacking: false
48-
# ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
49-
SortIncludes: true
50-
#IncludeBlocks: Regroup
51-
IncludeCategories:
52-
- Regex: '^(<|"(QtCore|QtWidgets|QtGui|QtNetwork)/)'
53-
Priority: 5
54-
- Regex: '^"(SIMPL|llvm-c|clang|clang-c)/'
55-
Priority: 100
56-
- Regex: '^"(SIMPLib/SIMPLib)'
57-
Priority: 90
58-
- Regex: '.*'
59-
Priority: 1000
47+
# ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
48+
# IncludeCategories:
49+
# - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
50+
# Priority: 2
51+
# - Regex: '^(<|"(gtest|isl|json)/)'
52+
# Priority: 3
53+
# - Regex: '.*'
54+
# Priority: 1
6055
# IndentCaseLabels: false
61-
# IndentWidth: 2
56+
# IndentWidth: 2
6257
# IndentWrappedFunctionNames: false
6358
# KeepEmptyLinesAtTheStartOfBlocks: true
6459
# MacroBlockBegin: ''
65-
# MacroBlockEnd: ''
60+
# MacroBlockEnd: ''
6661
# MaxEmptyLinesToKeep: 1
6762
# NamespaceIndentation: None
6863
# ObjCBlockIndentWidth: 2
@@ -73,21 +68,22 @@ IncludeCategories:
7368
# PenaltyBreakFirstLessLess: 120
7469
# PenaltyBreakString: 1000
7570
# PenaltyExcessCharacter: 1000000
76-
# PenaltyReturnTypeOnItsOwnLine: 60
71+
PenaltyReturnTypeOnItsOwnLine: 100
7772
PointerAlignment: Left
78-
# ReflowComments: true
73+
# ReflowComments: true
74+
SortIncludes: true
7975
# SpaceAfterCStyleCast: false
8076
# SpaceBeforeAssignmentOperators: true
8177
SpaceBeforeParens: Never
8278
# SpaceInEmptyParentheses: false
8379
# SpacesBeforeTrailingComments: 1
84-
# SpacesInAngles: false
80+
# SpacesInAngles: false
8581
# SpacesInContainerLiterals: true
8682
# SpacesInCStyleCastParentheses: false
8783
# SpacesInParentheses: false
8884
# SpacesInSquareBrackets: false
89-
Standard: Cpp11
90-
TabWidth: 2
91-
UseTab: Never
85+
SpaceAfterTemplateKeyword: true
86+
Standard: c++20
87+
TabWidth: 2
88+
UseTab: Never
9289
...
93-

.clang-tidy

Lines changed: 55 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,56 @@
1-
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'
2-
WarningsAsErrors: ''
3-
HeaderFilterRegex: ''
4-
AnalyzeTemporaryDtors: false
5-
FormatStyle: file
6-
User: mjackson
1+
---
2+
Checks: "-abseil-*,
3+
bugprone-*,
4+
-boost-*,
5+
-cert-*,
6+
clang-diagnostic-*,
7+
-clang-diagnostic-documentation,
8+
clang-analyzer-*,
9+
cppcoreguidelines-*,
10+
-cppcoreguidelines-avoid-magic-numbers,
11+
-darwin-*,
12+
-fuchsia-*,
13+
-google-*,
14+
-hicpp-*,
15+
-linuxkernel-*,
16+
-llvm-*,
17+
misc-*,
18+
modernize-*,
19+
-modernize-use-trailing-return-type,
20+
-modernize-use-nodiscard,
21+
-modernize-use-auto,
22+
-mpi-*,
23+
-objc-*,
24+
-openmp-*,
25+
performance-*,
26+
-portability-*,
27+
readability-*,
28+
-readability-function-cognitive-complexity,
29+
-readability-function-size,
30+
-readability-uppercase-literal-suffix,
31+
-readability-magic-numbers"
32+
WarningsAsErrors: '*'
33+
HeaderFilterRegex: 'simplnx/.*\.hpp'
34+
FormatStyle: file
735
CheckOptions:
8-
- key: google-readability-braces-around-statements.ShortStatementLines
9-
value: '1'
10-
- key: google-readability-function-size.StatementThreshold
11-
value: '800'
12-
- key: google-readability-namespace-comments.ShortNamespaceLines
13-
value: '10'
14-
- key: google-readability-namespace-comments.SpacesBeforeComments
15-
value: '2'
16-
- key: modernize-loop-convert.MaxCopySize
17-
value: '16'
18-
- key: modernize-loop-convert.MinConfidence
19-
value: reasonable
20-
- key: modernize-loop-convert.NamingStyle
21-
value: CamelCase
22-
- key: modernize-pass-by-value.IncludeStyle
23-
value: llvm
24-
- key: modernize-replace-auto-ptr.IncludeStyle
25-
value: llvm
26-
- key: modernize-use-default-member-init.IgnoreMacros
27-
value: '1'
28-
- key: modernize-use-default-member-init.UseAssignment
29-
value: '1'
30-
- key: modernize-use-nullptr.NullMacros
31-
value: 'NULL'
36+
cppcoreguidelines-macro-usage.AllowedRegexp: 'SIMPLNX_EXPORT|SIMPLNX_NO_EXPORT|SIMPLNX_DEPRECATED'
37+
readability-identifier-naming.IgnoreMainLikeFunctions: 'false'
38+
readability-identifier-naming.PrivateMemberPrefix: 'm_'
39+
readability-identifier-naming.NamespaceCase: lower_case
40+
readability-identifier-naming.ClassCase: CamelCase
41+
readability-identifier-naming.ClassMethodCase: camelBack
42+
readability-identifier-naming.PrivateMember: CamelCase
43+
readability-identifier-naming.PublicMemberCase: CamelCase
44+
readability-identifier-naming.StructCase: CamelCase
45+
readability-identifier-naming.FunctionCase: camelBack
46+
readability-identifier-naming.VariableCase: camelBack
47+
readability-identifier-naming.GlobalVariableCase: CamelCase
48+
readability-identifier-naming.GlobalConstantCase: CamelCase
49+
readability-identifier-naming.GlobalConstantPrefix: 'k_'
50+
readability-identifier-naming.GlobalFunctionCase: CamelCase
51+
readability-identifier-naming.LocalPointerCase: camelBack
52+
readability-identifier-naming.LocalPointerSuffix: 'Ptr'
53+
readability-identifier-naming.TypeAliasCase: CamelCase
54+
readability-identifier-naming.TypeAliasSuffix: 'Type'
55+
readability-identifier-naming.MacroDefinitionCase: UPPER_CASE
56+
...

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ __pycache__/
3636
release
3737
debug
3838
Test/ProjectTest/Build
39+
CMakeUserPresets.json
3940

4041
# Python build-related files
4142
pyebsd/build/

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
1515
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
1616

1717
# set project's name
18-
project(EbsdLibProj VERSION 1.0.39)
18+
project(EbsdLibProj VERSION 1.0.40)
1919

2020
# ---------- Setup output Directories -------------------------
2121
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY

CMakePresets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
},
2828
"VCPKG_INSTALLED_DIR": {
2929
"type": "STRING",
30-
"value": "${sourceDir}/../vcpkg-installed"
30+
"value": "${sourceDir}/../vcpkg-installed-ebsd-lib"
3131
},
3232
"VCPKG_MANIFEST_INSTALL": {
3333
"type": "BOOL",

LaueNotes.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ There are several LaueOps classes that have incomplete implementations. This doc
66

77
### Texture::CalculateODFData() ###
88

9-
| | Triclinic | Monoclinic | OrthoRhombic | Tetragonal_Low | Tetragonal_High | Trigonal_Low | Trigonal_High | Hexagonal_Low | Hexagonal_Low | Cubic_Low | Cubic_High |
10-
|---|-----------|------------|--------------|----------------|-----------------|--------------|---------------|---------------|---------------|-----------|----------|
11-
| getODFFZRod() | O | O | O | O | O | O | O | O | O | O | O |
12-
| getOdfBin() | O | O | O | O | O | O | O | O | O | O | O |
9+
| | Triclinic | Monoclinic | OrthoRhombic | Tetragonal_Low | Tetragonal_High | Trigonal_Low | Trigonal_High | Hexagonal_Low | Hexagonal_Low | Cubic_Low | Cubic_High |
10+
|---------------|-----------|------------|--------------|----------------|-----------------|--------------|---------------|---------------|---------------|-----------|------------|
11+
| getODFFZRod() | O | O | O | O | O | O | O | O | O | O | O |
12+
| getOdfBin() | O | O | O | O | O | O | O | O | O | O | O |
1313

1414
### StatsGen::GenODFPlotData() ###
1515

README.md

Lines changed: 59 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,65 @@ EBSDLib is a C++ Library that can read EBSD Files from OEMs and perform basic EB
44
library is to be able to convert between the seven orientation representations that
55
are typically used through out materials science and engineering domains.
66

7-
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.
7+
The [DREAM.3D](https://dream3d.bluequartz.net) project and [DREAM3D-NX](https://www.dream3d.io) uses this library for all the EBSD processing.
88

9-
## Supported EBSD OEM Data Files ##
9+
## Supported EBSD OEM Data FilesDirectionalStatsTest
1010

1111
+ EDAX/AMETEK: .ang and HDF5 based file formats
1212
+ Oxford Instruments: .ctf and .h5oina file formats
1313
+ Bruker: HDF5 based file format
1414

1515
Please have a look at the unit tests for examples on using the various readers.
1616

17-
## Orientation Representations ##
18-
19-
| From/To | Euler | Orientation Matrix | Axis Angle | Rodrigues | Quaternion | Homochoric | Cubochoric |
20-
| ------- |-------| ------- |------- |------- |------- |------- |------- |
21-
|Euler| - | X | X | X | X | a | ah |
22-
|Orientation Matrix| X | -- | X | e | X | a | ah |
23-
|Axis Angle| o | X | -- | X | X | X | h |
24-
|Rodrigues| o | a | X | -- | a | X | h |
25-
|Quaternion| X | X | X | X | -- | X | h |
26-
|Homochoric| ao | a | X | a | a | -- | X |
27-
|Cubochoric| hao | ha | h | ha | ha | X | -- |
17+
## Crystallographic Classes
18+
| # | Point Group (H–M) | Rotation Point Group | Space Group No(s). | Schoenflies | Crystal system | Laue class | Laue Ops |
19+
|---:|-------------------|----------------------|--------------------|---------------|----------------|-------------|------------------|
20+
| 1 | 1 | 1 | 1 | C₁ | Triclinic | (\bar{1}) | TriclinicOps |
21+
| 2 | (\bar{1}) | 1 | 2 | C(_i) | Triclinic | (\bar{1}) | |
22+
| 3 | 2 | 2 | 3–5 | C₂ | Monoclinic | 2/m | |
23+
| 4 | m | 1 | 6–9 | C(_s) | Monoclinic | 2/m | |
24+
| 5 | 2/m | 2 | 10–15 | C(_{2h}) | Monoclinic | 2/m | MonoclinicOps |
25+
| 6 | 222 | 222 | 16–24 | D₂ | Orthorhombic | mmm | |
26+
| 7 | mm2 | 2 | 25–46 | C(_{2v}) | Orthorhombic | mmm | |
27+
| 8 | mmm | 222 | 47–74 | D(_{2h}) | Orthorhombic | mmm | OrthorhombicOps |
28+
| 9 | 4 | 4 | 75–80 | C₄ | Tetragonal | 4/m | |
29+
| 10 | (\bar{4}) | 2 | 81–82 | S₄ | Tetragonal | 4/m | |
30+
| 11 | 4/m | 4 | 83–88 | C(_{4h}) | Tetragonal | 4/m | TetragonalLowOps |
31+
| 12 | 422 | 422 | 89–98 | D₄ | Tetragonal | 4/mmm | |
32+
| 13 | 4mm | 4 | 99–110 | C(_{4v}) | Tetragonal | 4/mmm | |
33+
| 14 | (\bar{4}2m) | 222 | 111–122 | D(_{2d}) | Tetragonal | 4/mmm | |
34+
| 15 | 4/mmm | 422 | 123–142 | D(_{4h}) | Tetragonal | 4/mmm | TetragonalOps |
35+
| 16 | 3 | 3 | 143–146 | C₃ | Trigonal | (\bar{3}) | |
36+
| 17 | (\bar{3}) | 3 | 147–148 | C(_{3i}) (S₆) | Trigonal | (\bar{3}) | TrigonalLowOps |
37+
| 18 | 32 | 32 | 149–155 | D₃ | Trigonal | (\bar{3}m) | |
38+
| 19 | 3m | 3 | 156–161 | C(_{3v}) | Trigonal | (\bar{3}m) | |
39+
| 20 | (\bar{3}m) | 32 | 162–167 | D(_{3d}) | Trigonal | (\bar{3}m) | TrigonalOps |
40+
| 21 | 6 | 6 | 168–173 | C₆ | Hexagonal | 6/m | |
41+
| 22 | (\bar{6}) | 3 | 174 | C(_{3h}) | Hexagonal | 6/m | |
42+
| 23 | 6/m | 6 | 175–176 | C(_{6h}) | Hexagonal | 6/m | HexagonalLowOps |
43+
| 24 | 622 | 622 | 177–182 | D₆ | Hexagonal | 6/mmm | |
44+
| 25 | 6mm | 6 | 183–186 | C(_{6v}) | Hexagonal | 6/mmm | |
45+
| 26 | (\bar{6}m2) | 32 | 187–190 | D(_{3h}) | Hexagonal | 6/mmm | |
46+
| 27 | 6/mmm | 622 | 191–194 | D(_{6h}) | Hexagonal | 6/mmm | HexagonalOps |
47+
| 28 | 23 | 23 | 195–199 | T | Cubic | m(\bar{3}) | |
48+
| 29 | m(\bar{3}) | 23 | 200–206 | T(_h) | Cubic | m(\bar{3}) | CubicLowOps |
49+
| 30 | 432 | 432 | 207–214 | O | Cubic | m(\bar{3})m | |
50+
| 31 | (\bar{4}3m) | 23 | 215–220 | T(_d) | Cubic | m(\bar{3})m | |
51+
| 32 | m(\bar{3})m | 432 | 221–230 | O(_h) | Cubic | m(\bar{3})m | CubicOps |
52+
53+
54+
## Orientation TransformationsDirectionalStatsTest
55+
56+
| From/To | Euler | Orientation Matrix | Axis Angle | Rodrigues | Quaternion | Homochoric | Cubochoric | Stereographic |
57+
|--------------------|-------|--------------------|------------|-----------|------------|------------|------------|---------------|
58+
| Euler | - | X | X | X | X | a | ah | q |
59+
| Orientation Matrix | X | -- | X | e | X | a | ah | q |
60+
| Axis Angle | o | X | -- | X | X | X | h | q |
61+
| Rodrigues | o | a | X | -- | a | X | h | q |
62+
| Quaternion | X | X | X | X | -- | X | h | q |
63+
| Homochoric | ao | a | X | a | a | -- | X | q |
64+
| Cubochoric | hao | ha | h | ha | ha | X | -- | q |
65+
| Stereographic | a | a | X | X | a | X | hc | -- |
2866

2967
**LEGEND**: X = Direct mathematical conversion between the representations
3068
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.
3876

3977
The folder Data/IPF_Legend has premade IPF Legends for all the Laue classes.
4078

41-
## Quaternion Convention ##
79+
## Quaternion ConventionDirectionalStatsTest
4280

43-
Please also note that by default EbsdLib organizes Quaternions as Vector-Scalar. If your quaternions
44-
are layed out as Scalar-Vector there is an extra argument to some functions that you
81+
Please also note that by default EbsdLib organizes Quaternions as Vector-Scalar (X,Y,Z,W). If your quaternions
82+
are laid out as Scalar-Vector (w,x,y,z) there is an extra argument to some functions that you
4583
can set to allow the orientation transformations to accept this layout.
4684

47-
## Dependent Libraries ##
85+
## Dependent LibrariesDirectionalStatsTest
4886

4987
EbsdLib is dependent on:
5088

@@ -53,19 +91,19 @@ EbsdLib is dependent on:
5391
## Optional Libraries
5492

5593
+ HDF5 1.10.4 (HDF5 is optional only if you want the HDF5 functionality)
56-
+ Qt5 5.15.x (minimum)
94+
+ Qt5 5.15.x (minimum: Optional)
5795

58-
## Rotation Convention ##
96+
## Rotation ConventionDirectionalStatsTest
5997

6098
By convention this library uses **Passive** rotations
6199

62-
## Citations ##
100+
## CitationsDirectionalStatsTest
63101

64102
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
65103

66104
[DOI: https://doi.org/10.1088/0965-0393/23/8/083501](https://doi.org/10.1088/0965-0393/23/8/083501)
67105

68-
## Examples ##
106+
## ExamplesDirectionalStatsTest
69107

70108
If you want to transform an Euler angle into a Quaternion the following works:
71109

0 commit comments

Comments
 (0)