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 <oiViewerMainWindow.h>
15#include <QMenu>
16#include <QMenuBar>
17
18
19namespace gbLAB
20{
21
23 /* init */ viewerCount(0)
24 /* init */,tabWidget(new QTabWidget(this))
25 /* init */,newViewerAction(new QAction(tr("&New"), this))
26 {
27 resize(1920, 1080);
28
29 QMenu* viewertMenu=menuBar()->addMenu(tr("&Viewer"));
30 viewertMenu->addAction(newViewerAction);
31 connect(newViewerAction, &QAction::triggered, this, &oiViewerMainWindow::newViewerTab);
32
33 setCentralWidget(tabWidget);
34 }
35
37 {
38 try
39 {
40 tabWidget->addTab(new oiViewerVTKwidget(this), tr(std::string("Viewer "+std::to_string(viewerCount)).c_str()));
42 }
43 catch(const std::exception& e)
44 {
45 std::cout<<e.what()<<std::endl;
46 }
47 }
48
49} // namespace model
50#endif
51
52
53
54
55
56
57