BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
widget.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/ba3d/widget.cpp
6 //! @brief Implement Widget class
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 #include "GUI/ba3d/widget.h"
16 #include "GUI/ba3d/model/model.h"
17 #include "GUI/ba3d/view/canvas.h"
18 #include "GUI/ba3d/view/program.h"
19 
20 #include <QBoxLayout>
21 
22 namespace GUI::RealSpace {
23 
24 //------------------------------------------------------------------------------
25 
27  : canvas(nullptr)
28 {
29  auto* box = new QHBoxLayout;
30  setLayout(box);
31  box->setMargin(0);
32  box->addWidget((canvas = new Canvas));
33 }
34 
35 Widget3D::~Widget3D() = default;
36 
38 {
39  return *canvas->cam();
40 }
41 
42 void Widget3D::setBackground(QColor const& color)
43 {
44  canvas->setBgColor(color);
45 }
46 
48 {
50 }
51 
53 {
55 }
56 
58 {
59  canvas->sideView();
60 }
61 
63 {
64  canvas->topView();
65 }
66 
68 {
69  return canvas->getModel();
70 }
71 
72 //------------------------------------------------------------------------------
73 
74 } // namespace GUI::RealSpace
Defines Canvas class.
Camera * cam()
Definition: canvas.h:59
void setBgColor(QColor const &)
Definition: canvas.cpp:72
void setModel(Model *)
Definition: canvas.cpp:94
void setBackground(QColor const &)
Definition: widget.cpp:42
void setModel(Model *)
Definition: widget.cpp:47
Defines Model class.
Defines Program class.
Defines Widget class.