added icons

This commit is contained in:
Anakin 2017-01-09 16:34:54 +01:00
parent e41b831047
commit 77ffe7baf4
11 changed files with 23 additions and 10 deletions

View File

@ -16,7 +16,7 @@
<widget class="QWidget" name="centralWidget"/> <widget class="QWidget" name="centralWidget"/>
<widget class="QToolBar" name="mainToolBar"> <widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea"> <attribute name="toolBarArea">
<enum>TopToolBarArea</enum> <enum>LeftToolBarArea</enum>
</attribute> </attribute>
<attribute name="toolBarBreak"> <attribute name="toolBarBreak">
<bool>false</bool> <bool>false</bool>

View File

@ -9,4 +9,13 @@
<qresource prefix="/files"> <qresource prefix="/files">
<file>about.txt</file> <file>about.txt</file>
</qresource> </qresource>
<qresource prefix="/images/toolbar">
<file>placeholder.png</file>
<file>info.png</file>
<file>about.png</file>
<file>open.png</file>
<file>X.png</file>
<file>Y.png</file>
<file>Z.png</file>
</qresource>
</RCC> </RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -50,23 +50,25 @@ void MainWindow::setupWidgets()
OglViewerWidget* viewer = new OglViewerWidget(this); OglViewerWidget* viewer = new OglViewerWidget(this);
setCentralWidget(viewer); 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); connect(openFile, &QAction::triggered, this, &MainWindow::openFile);
ui->mainToolBar->addAction(openFile); ui->mainToolBar->addAction(openFile);
ui->mainToolBar->addSeparator();
QSignalMapper* signalMapper = new QSignalMapper(this); 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->setCheckable(true);
x->setChecked(true); x->setChecked(true);
ui->mainToolBar->addAction(x); 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->setCheckable(true);
y->setChecked(true); y->setChecked(true);
ui->mainToolBar->addAction(y); 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->setCheckable(true);
z->setChecked(true); z->setChecked(true);
ui->mainToolBar->addAction(z); ui->mainToolBar->addAction(z);
@ -81,12 +83,13 @@ void MainWindow::setupWidgets()
connect(signalMapper, SIGNAL(mapped(int)), viewer, SLOT(changeDirection(int))); 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); connect(fileInfo, &QAction::triggered, this, &MainWindow::aboutFile);
ui->mainToolBar->addAction(fileInfo); 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); connect(help, &QAction::triggered, this, &MainWindow::aboutTool);
ui->mainToolBar->addAction(help); ui->mainToolBar->addAction(help);

View File

@ -302,6 +302,10 @@ void MshFile::analyseModlChunks(Model * dataDestination, std::list<ChunkHeader*>
// geometry data // geometry data
else if (!strcmp("GEOM", it->name)) 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 // get all GEOM subchunks
std::list<ChunkHeader*> tmp_geomChunks; std::list<ChunkHeader*> tmp_geomChunks;
loadChunks(tmp_geomChunks, it->position, it->size); loadChunks(tmp_geomChunks, it->position, it->size);
@ -419,9 +423,6 @@ void MshFile::analyseSegmChunks(Model * dataDestination, std::list<ChunkHeader*>
// polygons (indices into vertex/uv list) // polygons (indices into vertex/uv list)
else if (!strcmp("STRP", it->name)) 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; // jump to the data section and read the size;
std::uint32_t tmp_size; std::uint32_t tmp_size;