BornAgain
1.19.0
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
RealSpace
{
23
//------------------------------------------------------------------------------
24
25
Widget3D::Widget3D
() : canvas(nullptr)
26
{
27
auto
box =
new
QHBoxLayout;
28
setLayout(box);
29
box->setMargin(0);
30
box->addWidget((
canvas
=
new
Canvas
));
31
}
32
33
Widget3D::~Widget3D
() =
default
;
34
35
Camera
&
Widget3D::cam
()
36
{
37
return
*
canvas
->
cam
();
38
}
39
40
void
Widget3D::setBackground
(QColor
const
& color)
41
{
42
canvas
->
setBgColor
(color);
43
}
44
45
void
Widget3D::setModel
(
Model
* model)
46
{
47
canvas
->
setModel
(
model
);
48
}
49
50
void
Widget3D::defaultView
()
51
{
52
canvas
->
defaultView
();
53
}
54
55
void
Widget3D::sideView
()
56
{
57
canvas
->
sideView
();
58
}
59
60
void
Widget3D::topView
()
61
{
62
canvas
->
topView
();
63
}
64
65
Model
*
Widget3D::model
()
66
{
67
return
canvas
->
getModel
();
68
}
69
70
//------------------------------------------------------------------------------
71
}
// namespace RealSpace
canvas.h
Defines Canvas class.
RealSpace::Camera
Definition:
camera.h:28
RealSpace::Canvas
Definition:
canvas.h:34
RealSpace::Canvas::getModel
Model * getModel()
Definition:
canvas.cpp:110
RealSpace::Canvas::topView
void topView()
Definition:
canvas.cpp:360
RealSpace::Canvas::setBgColor
void setBgColor(QColor const &)
Definition:
canvas.cpp:70
RealSpace::Canvas::cam
Camera * cam()
Definition:
canvas.h:59
RealSpace::Canvas::sideView
void sideView()
Definition:
canvas.cpp:334
RealSpace::Canvas::defaultView
void defaultView()
Definition:
canvas.cpp:315
RealSpace::Canvas::setModel
void setModel(Model *)
Definition:
canvas.cpp:92
RealSpace::Model
Definition:
model.h:28
RealSpace::Widget3D::canvas
Canvas * canvas
Definition:
widget.h:47
RealSpace::Widget3D::model
Model * model()
Definition:
widget.cpp:65
RealSpace::Widget3D::setModel
void setModel(Model *)
Definition:
widget.cpp:45
RealSpace::Widget3D::topView
void topView()
Definition:
widget.cpp:60
RealSpace::Widget3D::cam
Camera & cam()
Definition:
widget.cpp:35
RealSpace::Widget3D::Widget3D
Widget3D()
Definition:
widget.cpp:25
RealSpace::Widget3D::~Widget3D
~Widget3D()
RealSpace::Widget3D::setBackground
void setBackground(QColor const &)
Definition:
widget.cpp:40
RealSpace::Widget3D::defaultView
void defaultView()
Definition:
widget.cpp:50
RealSpace::Widget3D::sideView
void sideView()
Definition:
widget.cpp:55
model.h
Defines Model class.
RealSpace
Definition:
def.cpp:20
program.h
Defines Program class.
widget.h
Defines Widget class.
GUI
ba3d
widget.cpp
Generated by
1.9.1