BornAgain  1.19.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 reflection and scattering
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 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_SAMPLE_SCATTERING_ZLIMITS_H
21 #define BORNAGAIN_SAMPLE_SCATTERING_ZLIMITS_H
22 
23 #include <iostream>
24 
25 //! Vertical extension of a particle, specified by bottom and top z coordinate.
27  double m_bottom;
28  double m_top;
29 };
30 
31 //! Helper class that represents a onesided limit
32 //!
33 //! @ingroup intern
34 
35 struct OneSidedLimit {
37  double m_value;
38 };
39 
40 //! Class that contains upper and lower limits of the z-coordinate for the slicing of
41 //! form factors.
42 //!
43 //! @ingroup intern
44 
45 class ZLimits {
46 public:
47  ZLimits();
48  ZLimits(double min, double max);
49  ZLimits(OneSidedLimit lower_limit, OneSidedLimit upper_limit);
50 
51  bool isFinite() const;
52 
53  OneSidedLimit lowerLimit() const;
54  OneSidedLimit upperLimit() const;
55 
56 private:
59 };
60 
61 OneSidedLimit MinLimit(const OneSidedLimit& left, const OneSidedLimit& right);
62 OneSidedLimit MaxLimit(const OneSidedLimit& left, const OneSidedLimit& right);
63 bool operator==(const OneSidedLimit& left, const OneSidedLimit& right);
64 bool operator!=(const OneSidedLimit& left, const OneSidedLimit& right);
65 
66 std::ostream& operator<<(std::ostream& ostr, const OneSidedLimit& limit);
67 
68 ZLimits ConvexHull(const ZLimits& left, const ZLimits& right);
69 bool operator==(const ZLimits& left, const ZLimits& right);
70 bool operator!=(const ZLimits& left, const ZLimits& right);
71 
72 std::ostream& operator<<(std::ostream& ostr, const ZLimits& limits);
73 
74 #endif // BORNAGAIN_SAMPLE_SCATTERING_ZLIMITS_H
75 #endif // USER_API
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:45
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:58
OneSidedLimit m_lower
Definition: ZLimits.h:57
ZLimits()
Definition: ZLimits.cpp:19
Helper class that represents a onesided limit.
Definition: ZLimits.h:35
double m_value
Definition: ZLimits.h:37
bool m_limitless
Definition: ZLimits.h:36
Vertical extension of a particle, specified by bottom and top z coordinate.
Definition: ZLimits.h:26
double m_top
Definition: ZLimits.h:28
double m_bottom
Definition: ZLimits.h:27