BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
MaskEditorHelper.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/MaskWidgets/MaskEditorHelper.cpp
6 //! @brief Implements class MaskEditorHelper
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 
16 #include <QBrush>
17 #include <QColor>
18 #include <QPen>
19 #include <QRectF>
20 
22 {
23  QBrush result;
24  result.setStyle(Qt::SolidPattern);
25  result.setColor(QColor(226, 235, 244));
26  return result;
27 }
28 
30 {
31  return QPen(QColor(99, 162, 217));
32 }
33 
34 QBrush MaskEditorHelper::getMaskBrush(bool mask_value)
35 {
36  QBrush result;
37  result.setStyle(Qt::SolidPattern);
38  if (mask_value) {
39  result.setColor(QColor(209, 109, 97)); // deep red
40  } else {
41  result.setColor(QColor(0, 213, 106)); // deep green
42  }
43  return result;
44 }
45 
46 QPen MaskEditorHelper::getMaskPen(bool mask_value)
47 {
48  if (mask_value) {
49  return QPen(QColor(165, 80, 76)); // dark red
50  } else {
51  return QPen(QColor(0, 140, 70)); // dark green
52  }
53 }
54 
55 QRectF MaskEditorHelper::getMarkerRectangle(const QPointF& pos)
56 {
57  QRectF result(0, 0, 7, 7);
58  result.moveCenter(pos);
59  return result;
60 }
Defines class MaskEditorHelper.
static QBrush getMaskBrush(bool mask_value)
static QPen getSelectionMarkerPen()
static QBrush getSelectionMarkerBrush()
static QPen getMaskPen(bool mask_value)
static QRectF getMarkerRectangle(const QPointF &pos)