| 1 |
rtomiyasu |
33 |
#ifndef _REFLECTION_CONDITION_HH_ |
| 2 |
|
|
#define _REFLECTION_CONDITION_HH_ |
| 3 |
|
|
|
| 4 |
|
|
#include "../RietveldAnalysisTypes.hh" |
| 5 |
|
|
#include <assert.h> |
| 6 |
|
|
|
| 7 |
|
|
class BravaisType; |
| 8 |
|
|
|
| 9 |
|
|
// Declaration of a struct to store information about reflection conditions |
| 10 |
|
|
class DataReflectionConditions |
| 11 |
|
|
{ |
| 12 |
|
|
public: |
| 13 |
|
|
enum eAxisOrder{ AXIS_ABC, AXIS_CAB, AXIS_BCA, AXIS_BAC, AXIS_CBA, AXIS_ACB }; |
| 14 |
|
|
|
| 15 |
|
|
private: |
| 16 |
|
|
string type; |
| 17 |
|
|
string str_conditions; |
| 18 |
|
|
bool (*is_not_extinct)(const Int4& h, const Int4& k, const Int4& l); |
| 19 |
|
|
eAxisOrder axis_order; |
| 20 |
|
|
|
| 21 |
|
|
public: |
| 22 |
|
|
DataReflectionConditions(const string& arg1, const string& arg2, bool(*arg3)(const Int4& h, const Int4& k, const Int4& l), const eAxisOrder arg4 = AXIS_ABC) |
| 23 |
|
|
{ |
| 24 |
|
|
type = arg1; |
| 25 |
|
|
str_conditions = arg2; |
| 26 |
|
|
is_not_extinct = arg3; |
| 27 |
|
|
axis_order = arg4; |
| 28 |
|
|
} |
| 29 |
|
|
|
| 30 |
|
|
string putShortStringType() const; |
| 31 |
|
|
inline const string& putStringType() const { return type; }; |
| 32 |
|
|
inline const string& putStringConditions() const { return str_conditions; }; |
| 33 |
|
|
inline bool isNotExtinct(const Int4& h, const Int4& k, const Int4& l) const |
| 34 |
|
|
{ |
| 35 |
|
|
if( axis_order == AXIS_ABC ) return (*is_not_extinct)(h, k, l); |
| 36 |
|
|
if( axis_order == AXIS_CAB ) return (*is_not_extinct)(k, l, h); |
| 37 |
|
|
if( axis_order == AXIS_BCA ) return (*is_not_extinct)(l, h, k); |
| 38 |
|
|
if( axis_order == AXIS_BAC ) return (*is_not_extinct)(k, h, l); |
| 39 |
|
|
if( axis_order == AXIS_CBA ) return (*is_not_extinct)(l, k, h); |
| 40 |
|
|
if( axis_order == AXIS_ACB ) return (*is_not_extinct)(h, l, k); |
| 41 |
|
|
assert(false); |
| 42 |
|
|
return true; |
| 43 |
|
|
} |
| 44 |
|
|
}; |
| 45 |
|
|
|
| 46 |
|
|
Int4 putNumberOfTypesOfSystematicAbsences(const BravaisType& type); |
| 47 |
|
|
|
| 48 |
|
|
// Declaration of a function to get information about reflection conditions. |
| 49 |
|
|
const DataReflectionConditions& putInformationOnReflectionConditions(const BravaisType& brav_type, const Int4& irc_type); |
| 50 |
|
|
|
| 51 |
|
|
#endif |