BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ZLimits.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/Scattering/ZLimits.h
6 //! @brief Defines class ZLimits.
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_CORE_SCATTERING_ZLIMITS_H
16 #define BORNAGAIN_CORE_SCATTERING_ZLIMITS_H
17 
18 #include <iostream>
19 
20 //! Vertical extension of a particle, specified by bottom and top z coordinate.
22  double m_bottom;
23  double m_top;
24 };
25 
26 //! Helper class that represents a onesided limit
27 //!
28 //! @ingroup intern
29 
30 struct OneSidedLimit {
32  double m_value;
33 };
34 
35 //! Class that contains upper and lower limits of the z-coordinate for the slicing of
36 //! form factors.
37 //!
38 //! @ingroup intern
39 
40 class ZLimits
41 {
42 public:
43  ZLimits();
44  ZLimits(double min, double max);
45  ZLimits(OneSidedLimit lower_limit, OneSidedLimit upper_limit);
46 
47  bool isFinite() const;
48 
49  OneSidedLimit lowerLimit() const;
50  OneSidedLimit upperLimit() const;
51 
52 private:
55 };
56 
57 OneSidedLimit MinLimit(const OneSidedLimit& left, const OneSidedLimit& right);
58 OneSidedLimit MaxLimit(const OneSidedLimit& left, const OneSidedLimit& right);
59 bool operator==(const OneSidedLimit& left, const OneSidedLimit& right);
60 bool operator!=(const OneSidedLimit& left, const OneSidedLimit& right);
61 
62 std::ostream& operator<<(std::ostream& ostr, const OneSidedLimit& limit);
63 
64 ZLimits ConvexHull(const ZLimits& left, const ZLimits& right);
65 bool operator==(const ZLimits& left, const ZLimits& right);
66 bool operator!=(const ZLimits& left, const ZLimits& right);
67 
68 std::ostream& operator<<(std::ostream& ostr, const ZLimits& limits);
69 
70 #endif // BORNAGAIN_CORE_SCATTERING_ZLIMITS_H
OneSidedLimit MinLimit(const OneSidedLimit &left, const OneSidedLimit &right)
Definition: ZLimits.cpp:49
ZLimits ConvexHull(const ZLimits &left, const ZLimits &right)
Definition: ZLimits.cpp:82
OneSidedLimit MaxLimit(const OneSidedLimit &left, const OneSidedLimit &right)
Definition: ZLimits.cpp:56
bool operator!=(const BasicVector3D< T > &a, const BasicVector3D< T > &b)
Comparison of two vectors for inequality.
bool operator==(const BasicVector3D< T > &a, const BasicVector3D< T > &b)
Comparison of two vectors for equality.
std::ostream & operator<<(std::ostream &os, const BasicVector3D< T > &a)
Output to stream.
Class that contains upper and lower limits of the z-coordinate for the slicing of form factors.
Definition: ZLimits.h:41
OneSidedLimit lowerLimit() const
Definition: ZLimits.cpp:39
OneSidedLimit upperLimit() const
Definition: ZLimits.cpp:44
bool isFinite() const
Definition: ZLimits.cpp:32
OneSidedLimit m_upper
Definition: ZLimits.h:54
OneSidedLimit m_lower
Definition: ZLimits.h:53
ZLimits()
Definition: ZLimits.cpp:19
Helper class that represents a onesided limit.
Definition: ZLimits.h:30
double m_value
Definition: ZLimits.h:32
bool m_limitless
Definition: ZLimits.h:31
Vertical extension of a particle, specified by bottom and top z coordinate.
Definition: ZLimits.h:21
double m_top
Definition: ZLimits.h:23
double m_bottom
Definition: ZLimits.h:22