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
26
Widget3D::Widget3D
()
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
37
Camera
&
Widget3D::cam
()
38
{
39
return
*
canvas
->
cam
();
40
}
41
42
void
Widget3D::setBackground
(QColor
const
& color)
43
{
44
canvas
->
setBgColor
(color);
45
}
46
47
void
Widget3D::setModel
(
Model
* model)
48
{
49
canvas
->
setModel
(
model
);
50
}
51
52
void
Widget3D::defaultView
()
53
{
54
canvas
->
defaultView
();
55
}
56
57
void
Widget3D::sideView
()
58
{
59
canvas
->
sideView
();
60
}
61
62
void
Widget3D::topView
()
63
{
64
canvas
->
topView
();
65
}
66
67
Model
*
Widget3D::model
()
68
{
69
return
canvas
->
getModel
();
70
}
71
72
//------------------------------------------------------------------------------
73
74
}
// namespace GUI::RealSpace
canvas.h
Defines Canvas class.
GUI::RealSpace::Camera
Definition:
camera.h:28
GUI::RealSpace::Canvas
Definition:
canvas.h:34
GUI::RealSpace::Canvas::topView
void topView()
Definition:
canvas.cpp:363
GUI::RealSpace::Canvas::defaultView
void defaultView()
Definition:
canvas.cpp:317
GUI::RealSpace::Canvas::sideView
void sideView()
Definition:
canvas.cpp:336
GUI::RealSpace::Canvas::getModel
Model * getModel()
Definition:
canvas.cpp:112
GUI::RealSpace::Canvas::cam
Camera * cam()
Definition:
canvas.h:59
GUI::RealSpace::Canvas::setBgColor
void setBgColor(QColor const &)
Definition:
canvas.cpp:72
GUI::RealSpace::Canvas::setModel
void setModel(Model *)
Definition:
canvas.cpp:94
GUI::RealSpace::Model
Definition:
model.h:27
GUI::RealSpace::Widget3D::~Widget3D
~Widget3D() override
GUI::RealSpace::Widget3D::setBackground
void setBackground(QColor const &)
Definition:
widget.cpp:42
GUI::RealSpace::Widget3D::setModel
void setModel(Model *)
Definition:
widget.cpp:47
GUI::RealSpace::Widget3D::Widget3D
Widget3D()
Definition:
widget.cpp:26
GUI::RealSpace::Widget3D::cam
Camera & cam()
Definition:
widget.cpp:37
GUI::RealSpace::Widget3D::canvas
Canvas * canvas
Definition:
widget.h:46
GUI::RealSpace::Widget3D::topView
void topView()
Definition:
widget.cpp:62
GUI::RealSpace::Widget3D::sideView
void sideView()
Definition:
widget.cpp:57
GUI::RealSpace::Widget3D::defaultView
void defaultView()
Definition:
widget.cpp:52
GUI::RealSpace::Widget3D::model
Model * model()
Definition:
widget.cpp:67
model.h
Defines Model class.
GUI::RealSpace
Definition:
def.cpp:20
program.h
Defines Program class.
widget.h
Defines Widget class.
GUI
ba3d
widget.cpp
Generated by
1.9.1