BornAgain  1.19.79
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/View/Mask/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  if (!mask_value)
37  return Qt::NoBrush;
38  return QBrush(QColor(0, 0, 80)); // deep blue
39 }
40 
41 QPen MaskEditorHelper::getMaskPen(bool mask_value)
42 {
43  if (mask_value)
44  return QPen(QColor(165, 80, 76)); // dark red
45  return QPen(QColor(0, 140, 70)); // dark green
46 }
47 
48 QRectF MaskEditorHelper::getMarkerRectangle(const QPointF& pos)
49 {
50  QRectF result(0, 0, 7, 7);
51  result.moveCenter(pos);
52  return result;
53 }
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)