diff --git a/QtMeshViewer/Form Files/MainWindow.ui b/QtMeshViewer/Form Files/MainWindow.ui index 01cc077..a9b1e77 100644 --- a/QtMeshViewer/Form Files/MainWindow.ui +++ b/QtMeshViewer/Form Files/MainWindow.ui @@ -16,7 +16,7 @@ - TopToolBarArea + LeftToolBarArea false diff --git a/QtMeshViewer/Resources/Resources.qrc b/QtMeshViewer/Resources/Resources.qrc index 020bab0..c4b92d4 100644 --- a/QtMeshViewer/Resources/Resources.qrc +++ b/QtMeshViewer/Resources/Resources.qrc @@ -9,4 +9,13 @@ about.txt + + placeholder.png + info.png + about.png + open.png + X.png + Y.png + Z.png + diff --git a/QtMeshViewer/Resources/X.png b/QtMeshViewer/Resources/X.png new file mode 100644 index 0000000..1faf6ac Binary files /dev/null and b/QtMeshViewer/Resources/X.png differ diff --git a/QtMeshViewer/Resources/Y.png b/QtMeshViewer/Resources/Y.png new file mode 100644 index 0000000..f702556 Binary files /dev/null and b/QtMeshViewer/Resources/Y.png differ diff --git a/QtMeshViewer/Resources/Z.png b/QtMeshViewer/Resources/Z.png new file mode 100644 index 0000000..6e3483e Binary files /dev/null and b/QtMeshViewer/Resources/Z.png differ diff --git a/QtMeshViewer/Resources/about.png b/QtMeshViewer/Resources/about.png new file mode 100644 index 0000000..5a97eff Binary files /dev/null and b/QtMeshViewer/Resources/about.png differ diff --git a/QtMeshViewer/Resources/info.png b/QtMeshViewer/Resources/info.png new file mode 100644 index 0000000..56af5b3 Binary files /dev/null and b/QtMeshViewer/Resources/info.png differ diff --git a/QtMeshViewer/Resources/open.png b/QtMeshViewer/Resources/open.png new file mode 100644 index 0000000..dc8662e Binary files /dev/null and b/QtMeshViewer/Resources/open.png differ diff --git a/QtMeshViewer/Resources/placeholder.png b/QtMeshViewer/Resources/placeholder.png new file mode 100644 index 0000000..9e73a63 Binary files /dev/null and b/QtMeshViewer/Resources/placeholder.png differ diff --git a/QtMeshViewer/Source/MainWindow.cpp b/QtMeshViewer/Source/MainWindow.cpp index 6dc14b5..ba7763f 100644 --- a/QtMeshViewer/Source/MainWindow.cpp +++ b/QtMeshViewer/Source/MainWindow.cpp @@ -50,23 +50,25 @@ void MainWindow::setupWidgets() OglViewerWidget* viewer = new OglViewerWidget(this); setCentralWidget(viewer); - QAction *openFile = new QAction("Open file", this); + QAction *openFile = new QAction(QIcon(":/images/toolbar/open.png"), "Open file", this); connect(openFile, &QAction::triggered, this, &MainWindow::openFile); ui->mainToolBar->addAction(openFile); + ui->mainToolBar->addSeparator(); + QSignalMapper* signalMapper = new QSignalMapper(this); - QAction *x = new QAction("X", this); + QAction *x = new QAction(QIcon(":/images/toolbar/X.png"), "X", this); x->setCheckable(true); x->setChecked(true); ui->mainToolBar->addAction(x); - QAction *y = new QAction("Y", this); + QAction *y = new QAction(QIcon(":/images/toolbar/Y.png"), "Y", this); y->setCheckable(true); y->setChecked(true); ui->mainToolBar->addAction(y); - QAction *z = new QAction("Z", this); + QAction *z = new QAction(QIcon(":/images/toolbar/Z.png"), "Z", this); z->setCheckable(true); z->setChecked(true); ui->mainToolBar->addAction(z); @@ -81,12 +83,13 @@ void MainWindow::setupWidgets() connect(signalMapper, SIGNAL(mapped(int)), viewer, SLOT(changeDirection(int))); + ui->mainToolBar->addSeparator(); - QAction *fileInfo = new QAction("File info", this); + QAction *fileInfo = new QAction(QIcon(":/images/toolbar/info.png"), "File info", this); connect(fileInfo, &QAction::triggered, this, &MainWindow::aboutFile); ui->mainToolBar->addAction(fileInfo); - QAction *help = new QAction("Help", this); + QAction *help = new QAction(QIcon(":/images/toolbar/about.png"), "Help", this); connect(help, &QAction::triggered, this, &MainWindow::aboutTool); ui->mainToolBar->addAction(help); diff --git a/QtMeshViewer/Source/MshFile.cpp b/QtMeshViewer/Source/MshFile.cpp index 03e6511..c3aa5a1 100644 --- a/QtMeshViewer/Source/MshFile.cpp +++ b/QtMeshViewer/Source/MshFile.cpp @@ -302,6 +302,10 @@ void MshFile::analyseModlChunks(Model * dataDestination, std::list // geometry data else if (!strcmp("GEOM", it->name)) { + // don't get null, bone, shadowMesh and hidden mesh indices + if (m_currentType == null || m_currentType == bone || m_currentType == shadowMesh || m_currentRenderFlag == 1) + continue; + // get all GEOM subchunks std::list tmp_geomChunks; loadChunks(tmp_geomChunks, it->position, it->size); @@ -419,9 +423,6 @@ void MshFile::analyseSegmChunks(Model * dataDestination, std::list // polygons (indices into vertex/uv list) else if (!strcmp("STRP", it->name)) { - // don't get null, bone, shadowMesh and hidden mesh indices - if (m_currentType == null || m_currentType == bone || m_currentType == shadowMesh || m_currentRenderFlag == 1) - continue; // jump to the data section and read the size; std::uint32_t tmp_size;