oILAB
Loading...
Searching...
No Matches
oiViewerMainWindow.cpp
Go to the documentation of this file.
1
/* This file is part of MODEL, the Mechanics Of Defect Evolution Library.
2
*
3
* Copyright (C) 2011 by Giacomo Po <gpo@ucla.edu>.
4
*
5
* model is distributed without any warranty under the
6
* GNU General Public License (GPL) v2 <http://www.gnu.org/licenses/>.
7
*/
8
9
#ifndef model_oiViewerMainWindow_cpp_
10
#define model_oiViewerMainWindow_cpp_
11
12
#include <iostream>
13
14
#include "../../include/Visualization/oiViewerMainWindow.h"
15
#include <QMenu>
16
#include <QMenuBar>
17
18
namespace
oILAB
{
19
20
oiViewerMainWindow::oiViewerMainWindow
()
21
:
/* init */
viewerCount(0)
22
/* init */
,
23
tabWidget(new QTabWidget(this))
24
/* init */
,
25
newViewerAction(new QAction(tr(
"&New"
), this)) {
26
resize(1920, 1080);
27
28
QMenu *viewertMenu = menuBar()->addMenu(tr(
"&Viewer"
));
29
viewertMenu->addAction(
newViewerAction
);
30
connect(
newViewerAction
, &QAction::triggered,
this
,
31
&
oiViewerMainWindow::newViewerTab
);
32
33
setCentralWidget(
tabWidget
);
34
}
35
36
void
oiViewerMainWindow::newViewerTab
()
37
{
38
try
39
{
40
tabWidget
->addTab(
new
oiViewerVTKwidget
(
this
), tr(std::string(
"Viewer "
+std::to_string(
viewerCount
)).c_str()));
41
viewerCount
++;
42
}
43
catch
(
const
std::exception& e)
44
{
45
std::cout<<e.what()<<std::endl;
46
}
47
}
48
49
}
// namespace oILAB
50
#endif
51
52
53
54
55
56
57
oILAB
Definition
BiCrystal.cpp:13
oILAB::oiViewerMainWindow::viewerCount
size_t viewerCount
Definition
oiViewerMainWindow.h:39
oILAB::oiViewerMainWindow::newViewerTab
void newViewerTab()
Definition
oiViewerMainWindow.cpp:36
oILAB::oiViewerMainWindow::oiViewerMainWindow
oiViewerMainWindow()
Definition
oiViewerMainWindow.cpp:20
oILAB::oiViewerMainWindow::newViewerAction
QAction * newViewerAction
Definition
oiViewerMainWindow.h:41
oILAB::oiViewerMainWindow::tabWidget
QTabWidget * tabWidget
Definition
oiViewerMainWindow.h:40
oILAB::oiViewerVTKwidget
Definition
oiViewerVTKwidget.h:29
src
Visualization
oiViewerMainWindow.cpp
Generated on Sat Mar 28 2026 00:15:05 for oILAB by
1.9.8