BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
ISelectionRule.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/Lattice/ISelectionRule.h
6 //! @brief Defines classes ISelectionRule, SimpleSelectionRule
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_SAMPLE_LATTICE_ISELECTIONRULE_H
16 #define BORNAGAIN_SAMPLE_LATTICE_ISELECTIONRULE_H
17 
18 #include <heinz/Vectors3D.h>
19 
20 //! Abstract base class for selection rules.
21 
23 public:
24  virtual ~ISelectionRule() = default;
25 
26  virtual ISelectionRule* clone() const = 0;
27 
28  virtual bool coordinateSelected(const I3& coordinate) const = 0;
29 };
30 
31 //! Selection rule (v*q)%modulus!=0, defined by vector v(a,b,c) and modulus.
32 
34 public:
35  SimpleSelectionRule(int a, int b, int c, int modulus);
36  ~SimpleSelectionRule() override = default;
37 
38  SimpleSelectionRule* clone() const override;
39 
40  bool coordinateSelected(const I3& coordinate) const override;
41 
42 private:
43  int m_a, m_b, m_c;
44  int m_mod;
45 };
46 
47 #endif // BORNAGAIN_SAMPLE_LATTICE_ISELECTIONRULE_H
Abstract base class for selection rules.
virtual ISelectionRule * clone() const =0
virtual bool coordinateSelected(const I3 &coordinate) const =0
virtual ~ISelectionRule()=default
Selection rule (v*q)modulus!=0, defined by vector v(a,b,c) and modulus.
SimpleSelectionRule(int a, int b, int c, int modulus)
SimpleSelectionRule * clone() const override
bool coordinateSelected(const I3 &coordinate) const override
~SimpleSelectionRule() override=default