BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
A rectangle, for use in detector masks.
Edges are along the coordinate axes.
Definition at line 25 of file Rectangle.h.
Public Member Functions | |
Rectangle (double xlow, double ylow, double xup, double yup, bool inverted=false) | |
Rectangle * | clone () const override |
bool | contains (const Bin1D &binx, const Bin1D &biny) const override |
Returns true if area defined by two bins is inside or on border of polygon (more precisely, if mid point of two bins satisfy this condition). More... | |
bool | contains (double x, double y) const override |
Returns true if point with given coordinates is inside or on border of the shape. More... | |
double | getArea () const |
double | getXlow () const |
double | getXup () const |
double | getYlow () const |
double | getYup () const |
void | setInverted (bool inverted=true) |
virtual void | transferToCPP () |
Used for Python overriding of clone (see swig/tweaks.py) More... | |
Protected Member Functions | |
virtual void | print (std::ostream &ostr) const |
Private Attributes | |
bool | m_inverted |
const char *const | m_name |
double | m_xlow |
double | m_xup |
double | m_ylow |
double | m_yup |
Rectangle::Rectangle | ( | double | xlow, |
double | ylow, | ||
double | xup, | ||
double | yup, | ||
bool | inverted = false |
||
) |
xlow | x-coordinate of lower left corner |
ylow | y-coordinate of lower left corner |
xup | x-coordinate of upper right corner |
yup | y-coordinate of upper right corner |
inverted | swap inside/outside |
Definition at line 23 of file Rectangle.cpp.
References m_xlow, m_xup, m_ylow, and m_yup.
Referenced by clone().
|
inlineoverridevirtual |
Implements IShape2D.
Definition at line 28 of file Rectangle.h.
References Rectangle(), m_inverted, m_xlow, m_xup, m_ylow, and m_yup.
Returns true if area defined by two bins is inside or on border of polygon (more precisely, if mid point of two bins satisfy this condition).
Implements IShape2D.
Definition at line 56 of file Rectangle.cpp.
References Bin1D::center(), and contains().
|
overridevirtual |
Returns true if point with given coordinates is inside or on border of the shape.
Implements IShape2D.
Definition at line 50 of file Rectangle.cpp.
References m_inverted, m_xlow, and m_ylow.
Referenced by contains().
double Rectangle::getArea | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprotectedvirtualinherited |
void Rectangle::setInverted | ( | bool | inverted = true | ) |
Definition at line 45 of file Rectangle.cpp.
References m_inverted.
|
inlinevirtualinherited |
Used for Python overriding of clone (see swig/tweaks.py)
Definition at line 32 of file ICloneable.h.
|
private |
Definition at line 47 of file Rectangle.h.
Referenced by clone(), contains(), and setInverted().
|
privateinherited |
Definition at line 52 of file IShape2D.h.
Referenced by IShape2D::print().
|
private |
Definition at line 46 of file Rectangle.h.
Referenced by Rectangle(), clone(), contains(), getArea(), and getXlow().
|
private |
Definition at line 46 of file Rectangle.h.
Referenced by Rectangle(), clone(), getArea(), and getXup().
|
private |
Definition at line 46 of file Rectangle.h.
Referenced by Rectangle(), clone(), contains(), getArea(), and getYlow().
|
private |
Definition at line 46 of file Rectangle.h.
Referenced by Rectangle(), clone(), getArea(), and getYup().