-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
63 lines (53 loc) · 2.24 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <QApplication>
#include <QGLWidget>
#include <QFontDatabase>
#include <QMainWindow>
#include <QToolBar>
#include <app/Global.h>
#include <app/GraphicsView.h>
int main(int argc, char** argv)
{
QApplication app(argc, argv);
#ifdef _WIN32
if(QFontDatabase::addApplicationFont(QString::fromStdString("C:/develop/doctorate/sources/app_schedule3d/SegoeUI.ttf")) != -1)
#else
if(QFontDatabase::addApplicationFont(QString::fromStdString("/home/potato/Develop/doctorate/sources/app_schedule3d/SegoeUI.ttf")) != -1)
#endif
{
QFont defaultFont(QString::fromStdString("Segoe UI"), 9, QFont::Normal);
defaultFont.setStyleStrategy(QFont::PreferAntialias);
QApplication::setFont(defaultFont);
}
#ifdef _WIN32
QString schedule1 = "C:/develop/doctorate/sources/app_schedule3d/schedule1.txt";
QString schedule2 = "C:/develop/doctorate/sources/app_schedule3d/schedule2.txt";
// QString schedule1 = "d:/develop/doctorate/sources/app_schedule3d/schedule1.txt";
// QString schedule2 = "d:/develop/doctorate/sources/app_schedule3d/schedule2.txt";
#else
QString schedule1 = "/home/potato/Develop/doctorate/sources/app_schedule3d/schedule1.txt";
QString schedule2 = "/home/potato/Develop/doctorate/sources/app_schedule3d/schedule2.txt";
#endif
app::Global::settings = new QSettings("settings.ini", QSettings::IniFormat);
app::Global::toolbar = new QToolBar();
app::Global::loader = new app::ModelLoader();
app::Global::renderer = new app::Renderer();
app::Global::glscene = new app::OpenGLScene();
app::Global::camera = new app::Camera();
app::Global::selection = new app::Selection();
app::Global::hierarchy = new app::Hierarchy();
app::Global::overlay = new app::Overlay();
app::Global::schedule1 = new app::Schedule(schedule1);
app::Global::schedule2 = new app::Schedule(schedule2);
app::Global::explodedview = new app::ExplodedView();
app::Global::analysis = new app::Analysis();
auto view = new app::GraphicsView();
view->setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
view->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
view->setScene(app::Global::glscene);
auto mw = new QMainWindow();
mw->addToolBar(Qt::TopToolBarArea, app::Global::toolbar);
mw->setCentralWidget(view);
mw->resize(1024, 768);
mw->show();
return app.exec();
}