BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
DesignerHelper.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/SampleDesigner/DesignerHelper.h
6 //! @brief Defines class DesignerHelper
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_GUI_COREGUI_VIEWS_SAMPLEDESIGNER_DESIGNERHELPER_H
16 #define BORNAGAIN_GUI_COREGUI_VIEWS_SAMPLEDESIGNER_DESIGNERHELPER_H
17 
18 #include <QColor>
19 #include <QGradient>
20 #include <QGraphicsItem>
21 #include <QRect>
22 
23 //! collection of static methods with SampleDesigner geometry settings
25 public:
26  static int layerWidth();
27  static int layerHeight();
28  static QColor getDefaultLayerColor();
29 
30  static QRectF getDefaultMultiLayerRect();
31 
32  static QRectF getParticleLayoutBoundingRect();
33 
35 
36  static QColor getDefaultParticleColor();
37  static QRectF getParticleBoundingRect();
38 
39  static QColor getDefaultTransformationColor();
40  static QRectF getTransformationBoundingRect();
41 
42  static QColor getDefaultMaterialColor();
43 
44  static QGradient getLayerGradient(const QColor& color, const QRectF& rect);
45  static QGradient getDecorationGradient(const QColor& color, const QRectF& rect);
46 
47  static QPixmap getSceneBackground();
48  static QPixmap getPixmapLayer();
49  static QPixmap getPixmapMultiLayer();
50  static QPixmap getPixmapParticleLayout();
51  static QPixmap getPixmapInterferenceFunction();
52  static QPixmap getPixmapParticle();
53 
54  static QColor getRandomColor();
55 
56  //! sort graphics item according they y-coordinate
57  static bool sort_layers(QGraphicsItem* left, QGraphicsItem* right);
58 
59  //! non-linear conversion of layer's thickness in nanometers to screen size
60  //! to have reasonable graphics representation of layer in the form of QRect
61  static int nanometerToScreen(double nanometer);
62 
63  //! returns default bounding rectangle for given IvView name
64  static QRectF getDefaultBoundingRect(const QString& name);
65 
66  //! returns default color for IView with given name
67  static QColor getDefaultColor(const QString& name);
68 
69  //! returns Mime pixmap for givew IView name
70  static QPixmap getMimePixmap(const QString& name);
71 
72  //! returns system dependent font size
73  static int getHeaderFontSize();
74  static int getSectionFontSize();
75  static int getLabelFontSize();
76  static int getPortFontSize();
77  static int getPythonEditorFontSize();
78 };
79 
80 #endif // BORNAGAIN_GUI_COREGUI_VIEWS_SAMPLEDESIGNER_DESIGNERHELPER_H
collection of static methods with SampleDesigner geometry settings
static QPixmap getSceneBackground()
static QRectF getParticleLayoutBoundingRect()
static QRectF getInterferenceFunctionBoundingRect()
static int getPythonEditorFontSize()
static QRectF getParticleBoundingRect()
static QPixmap getPixmapParticleLayout()
static QRectF getDefaultBoundingRect(const QString &name)
returns default bounding rectangle for given IvView name
static bool sort_layers(QGraphicsItem *left, QGraphicsItem *right)
sort graphics item according they y-coordinate
static QPixmap getPixmapInterferenceFunction()
static QColor getDefaultMaterialColor()
static QPixmap getMimePixmap(const QString &name)
returns Mime pixmap for givew IView name
static QGradient getDecorationGradient(const QColor &color, const QRectF &rect)
static QColor getDefaultParticleColor()
static int getHeaderFontSize()
returns system dependent font size
static QColor getRandomColor()
static QGradient getLayerGradient(const QColor &color, const QRectF &rect)
static int getLabelFontSize()
static int layerWidth()
static int layerHeight()
static QPixmap getPixmapParticle()
static QRectF getDefaultMultiLayerRect()
static QColor getDefaultLayerColor()
static int nanometerToScreen(double nanometer)
non-linear conversion of layer's thickness in nanometers to screen size to have reasonable graphics r...
static int getPortFontSize()
static QColor getDefaultColor(const QString &name)
returns default color for IView with given name
static QRectF getTransformationBoundingRect()
static int getSectionFontSize()
static QPixmap getPixmapLayer()
static QColor getDefaultTransformationColor()
static QPixmap getPixmapMultiLayer()
QString const & name(EShape k)
Definition: particles.cpp:21
static constexpr double nanometer
Internal unit for lengths.
Definition: Units.h:33