libatomprobe
Library for Atom Probe Tomography (APT) computation
millerIndex.h
Go to the documentation of this file.
1 /* millterIndex.cpp : Miller index sequence generation
2  * Copyright (C) 2020 Daniel Haley
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef ATOMPROBE_MILLERINDEX_H
19 #define ATOMPROBE_MILLERINDEX_H
20 
22 
23 #include <vector>
24 
25 
26 namespace AtomProbe
27 {
28 enum
29 {
34 };
35 
36 
38 {
39  private:
40  //Miller indicies (h,k,l)
41  int idx[3];
42  public:
43  MILLER_TRIPLET(int a, int b, int c);
44 
45  int h() const;
46  int k() const;
47  int l() const;
48 
49  bool operator==(const MILLER_TRIPLET &m) const;
50 
51  //Divide hkl by GCD(h,k,l) to produce minimal numerical
52  // equivalent vector (ie [240] becomes [120])
53  void simplify();
54 
55  //Convert a miller triplet to the normal vector to said plane.
56  Point3D tripletToNormal(unsigned int h, unsigned int k, unsigned int l);
57  //Convert a miller triplet to the normal vector to said plane.
59 };
60 
61 #ifdef DEBUG
62 bool millerTest();
63 #endif
64 
65 }
66 
67 #endif
bool operator==(const MILLER_TRIPLET &m) const
Definition: millerIndex.cpp:88
MILLER_TRIPLET(int a, int b, int c)
Definition: millerIndex.cpp:55
Point3D tripletToNormal(unsigned int h, unsigned int k, unsigned int l)
A 3D point data class storage.
Definition: point3D.h:39