Commit 5f104e46 authored by Anakin's avatar Anakin

gui changes

parent a9485902
...@@ -20,6 +20,11 @@ ...@@ -20,6 +20,11 @@
<file>Z.png</file> <file>Z.png</file>
<file>screenshot.png</file> <file>screenshot.png</file>
<file>wireframe.png</file> <file>wireframe.png</file>
<file>light.png</file> <file>light_off.png</file>
<file>light_on.png</file>
<file>solid.png</file>
<file>X_disabled.png</file>
<file>Y_disabled.png</file>
<file>Z_disabled.png</file>
</qresource> </qresource>
</RCC> </RCC>
QToolButton#test123 { QToolButton {
color: #000000; image: url(:/images/toolbar/placeholder.png);
border-style: none;
padding: 2px;
width: 22px;
height: 22px;
} }
QToolButton:checked { QToolButton:checked {
background-color: #ffffff; image: url(:/images/toolbar/placeholder.png);
border-style: inset; border-style: none;
border-width: 1px; padding: 2px;
border-radius: 5px; width: 22px;
border-color: #b3b3b3; height: 22px;
min-height: 25px
} }
QToolButton:hover { QToolButton:hover {
border-style: solid; border-style: solid;
padding: 1px;
border-width: 1px; border-width: 1px;
border-radius: 5px; border-radius: 5px;
border-color: #a4daff; border-color: #a4daff;
min-height: 25px min-height: 25px
} }
QToolButton#openFile {
image: url(:/images/toolbar/open.png);
}
QToolButton#screenshot {
image: url(:/images/toolbar/screenshot.png);
}
QToolButton#x {
image: url(:/images/toolbar/X_disabled.png);
}
QToolButton#x:checked {
image: url(:/images/toolbar/X.png);
}
QToolButton#y {
image: url(:/images/toolbar/Y_disabled.png);
}
QToolButton#y:checked {
image: url(:/images/toolbar/Y.png);
}
QToolButton#z {
image: url(:/images/toolbar/Z_disabled.png);
}
QToolButton#z:checked {
image: url(:/images/toolbar/Z.png);
}
QToolButton#wireframe {
image: url(:/images/toolbar/solid.png);
}
QToolButton#wireframe:checked {
image: url(:/images/toolbar/wireframe.png);
}
QToolButton#light {
image: url(:/images/toolbar/light_off.png);
}
QToolButton#light:checked {
image: url(:/images/toolbar/light_on.png);
}
QToolButton#fileInfo {
image: url(:/images/toolbar/info.png);
}
QToolButton#help {
image: url(:/images/toolbar/about.png);
}
QtMeshViewer/Resources/X.png

3.5 KB | W: | H:

QtMeshViewer/Resources/X.png

932 Bytes | W: | H:

QtMeshViewer/Resources/X.png
QtMeshViewer/Resources/X.png
QtMeshViewer/Resources/X.png
QtMeshViewer/Resources/X.png
  • 2-up
  • Swipe
  • Onion skin
QtMeshViewer/Resources/Y.png

3.45 KB | W: | H:

QtMeshViewer/Resources/Y.png

885 Bytes | W: | H:

QtMeshViewer/Resources/Y.png
QtMeshViewer/Resources/Y.png
QtMeshViewer/Resources/Y.png
QtMeshViewer/Resources/Y.png
  • 2-up
  • Swipe
  • Onion skin
QtMeshViewer/Resources/Z.png

3.45 KB | W: | H:

QtMeshViewer/Resources/Z.png

884 Bytes | W: | H:

QtMeshViewer/Resources/Z.png
QtMeshViewer/Resources/Z.png
QtMeshViewer/Resources/Z.png
QtMeshViewer/Resources/Z.png
  • 2-up
  • Swipe
  • Onion skin
QtMeshViewer/Resources/about.png

3.45 KB | W: | H:

QtMeshViewer/Resources/about.png

883 Bytes | W: | H:

QtMeshViewer/Resources/about.png
QtMeshViewer/Resources/about.png
QtMeshViewer/Resources/about.png
QtMeshViewer/Resources/about.png
  • 2-up
  • Swipe
  • Onion skin
QtMeshViewer/Resources/info.png

3.43 KB | W: | H:

QtMeshViewer/Resources/info.png

859 Bytes | W: | H:

QtMeshViewer/Resources/info.png
QtMeshViewer/Resources/info.png
QtMeshViewer/Resources/info.png
QtMeshViewer/Resources/info.png
  • 2-up
  • Swipe
  • Onion skin
QtMeshViewer/Resources/open.png

3.45 KB | W: | H:

QtMeshViewer/Resources/open.png

879 Bytes | W: | H:

QtMeshViewer/Resources/open.png
QtMeshViewer/Resources/open.png
QtMeshViewer/Resources/open.png
QtMeshViewer/Resources/open.png
  • 2-up
  • Swipe
  • Onion skin
QtMeshViewer/Resources/placeholder.png

3.51 KB | W: | H:

QtMeshViewer/Resources/placeholder.png

940 Bytes | W: | H:

QtMeshViewer/Resources/placeholder.png
QtMeshViewer/Resources/placeholder.png
QtMeshViewer/Resources/placeholder.png
QtMeshViewer/Resources/placeholder.png
  • 2-up
  • Swipe
  • Onion skin
QtMeshViewer/Resources/screenshot.png

3.55 KB | W: | H:

QtMeshViewer/Resources/screenshot.png

982 Bytes | W: | H:

QtMeshViewer/Resources/screenshot.png
QtMeshViewer/Resources/screenshot.png
QtMeshViewer/Resources/screenshot.png
QtMeshViewer/Resources/screenshot.png
  • 2-up
  • Swipe
  • Onion skin
QtMeshViewer/Resources/wireframe.png

3.47 KB | W: | H:

QtMeshViewer/Resources/wireframe.png

898 Bytes | W: | H:

QtMeshViewer/Resources/wireframe.png
QtMeshViewer/Resources/wireframe.png
QtMeshViewer/Resources/wireframe.png
QtMeshViewer/Resources/wireframe.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <QSizePolicy> #include <QSizePolicy>
#include <QFont> #include <QFont>
#include <QResizeEvent> #include <QResizeEvent>
#include <QToolButton>
#include "..\Header\FileInterface.h" #include "..\Header\FileInterface.h"
#define WINDOW_NAME "Mesh Viewer" #define WINDOW_NAME "Mesh Viewer"
...@@ -32,7 +33,7 @@ MainWindow::MainWindow(QWidget *parent) ...@@ -32,7 +33,7 @@ MainWindow::MainWindow(QWidget *parent)
setupWidgets(); setupWidgets();
ui->statusBar->showMessage("MeshViewer by Anakin", 0); printMessage("MeshViewer by Anakin", 0);
m_fileInfo += "Filename: -\nMaterials: -\nVertices: -\nTriangle: -<detail>No file is open"; m_fileInfo += "Filename: -\nMaterials: -\nVertices: -\nTriangle: -<detail>No file is open";
...@@ -61,36 +62,46 @@ void MainWindow::setupWidgets() ...@@ -61,36 +62,46 @@ void MainWindow::setupWidgets()
setCentralWidget(viewer); setCentralWidget(viewer);
connect(viewer, &OglViewerWidget::sendMessage, this, &MainWindow::printMessage); connect(viewer, &OglViewerWidget::sendMessage, this, &MainWindow::printMessage);
QAction *openFile = new QAction(QIcon(":/images/toolbar/open.png"), "Open file", this); QToolButton *openFile = new QToolButton(this);
connect(openFile, &QAction::triggered, this, &MainWindow::openFile); openFile->setObjectName("openFile");
ui->mainToolBar->addAction(openFile); openFile->setToolTip("open file");
connect(openFile, &QToolButton::pressed, this, &MainWindow::openFile);
ui->mainToolBar->addWidget(openFile);
QAction *screenShot = new QAction(QIcon(":/images/toolbar/screenshot.png"), "Screenshot", this); QToolButton *screenshot = new QToolButton(this);
connect(screenShot, &QAction::triggered, this, &MainWindow::takeScreenShot); screenshot->setObjectName("screenshot");
ui->mainToolBar->addAction(screenShot); screenshot->setToolTip("take screenshot");
connect(screenshot, &QToolButton::pressed, this, &MainWindow::takeScreenShot);
ui->mainToolBar->addWidget(screenshot);
ui->mainToolBar->addSeparator(); ui->mainToolBar->addSeparator();
QSignalMapper* signalMapper = new QSignalMapper(this); QSignalMapper* signalMapper = new QSignalMapper(this);
QAction *x = new QAction(QIcon(":/images/toolbar/X.png"), "X", this); QToolButton *x = new QToolButton(this);
x->setObjectName("x");
x->setToolTip("x-direction");
x->setCheckable(true); x->setCheckable(true);
x->setChecked(true); x->setChecked(true);
ui->mainToolBar->addAction(x); ui->mainToolBar->addWidget(x);
QAction *y = new QAction(QIcon(":/images/toolbar/Y.png"), "Y", this); QToolButton *y = new QToolButton(this);
y->setObjectName("y");
y->setToolTip("y-direction");
y->setCheckable(true); y->setCheckable(true);
y->setChecked(true); y->setChecked(true);
ui->mainToolBar->addAction(y); ui->mainToolBar->addWidget(y);
QAction *z = new QAction(QIcon(":/images/toolbar/Z.png"), "Z", this); QToolButton *z = new QToolButton(this);
z->setObjectName("z");
z->setToolTip("z-direction");
z->setCheckable(true); z->setCheckable(true);
z->setChecked(true); z->setChecked(true);
ui->mainToolBar->addAction(z); ui->mainToolBar->addWidget(z);
connect(x, SIGNAL(triggered()), signalMapper, SLOT(map())); connect(x, SIGNAL(pressed()), signalMapper, SLOT(map()));
connect(y, SIGNAL(triggered()), signalMapper, SLOT(map())); connect(y, SIGNAL(pressed()), signalMapper, SLOT(map()));
connect(z, SIGNAL(triggered()), signalMapper, SLOT(map())); connect(z, SIGNAL(pressed()), signalMapper, SLOT(map()));
signalMapper->setMapping(x, 1); signalMapper->setMapping(x, 1);
signalMapper->setMapping(y, 2); signalMapper->setMapping(y, 2);
...@@ -100,32 +111,35 @@ void MainWindow::setupWidgets() ...@@ -100,32 +111,35 @@ void MainWindow::setupWidgets()
ui->mainToolBar->addSeparator(); ui->mainToolBar->addSeparator();
QAction *wireframe = new QAction(QIcon(":/images/toolbar/wireframe.png"), "Wireframe", this); QToolButton *wireframe = new QToolButton(this);
wireframe->setObjectName("wireframe");
wireframe->setToolTip("wireframe");
wireframe->setCheckable(true); wireframe->setCheckable(true);
wireframe->setChecked(false); wireframe->setChecked(false);
connect(wireframe, &QAction::triggered, viewer, &OglViewerWidget::toggleWireframe); connect(wireframe, &QToolButton::pressed, viewer, &OglViewerWidget::toggleWireframe);
ui->mainToolBar->addAction(wireframe); ui->mainToolBar->addWidget(wireframe);
QAction *light = new QAction(QIcon(":/images/toolbar/light.png"), "Light", this); QToolButton *light = new QToolButton(this);
light->setObjectName("light");
light->setToolTip("toggle light");
light->setCheckable(true); light->setCheckable(true);
light->setChecked(false); light->setChecked(false);
connect(light, &QAction::triggered, viewer, &OglViewerWidget::toggleLight); connect(light, &QToolButton::pressed, viewer, &OglViewerWidget::toggleLight);
ui->mainToolBar->addAction(light); ui->mainToolBar->addWidget(light);
ui->mainToolBar->addSeparator(); ui->mainToolBar->addSeparator();
QAction *fileInfo = new QAction(QIcon(":/images/toolbar/info.png"), "File info", this); QToolButton *fileInfo = new QToolButton(this);
connect(fileInfo, &QAction::triggered, this, &MainWindow::aboutFile); fileInfo->setObjectName("fileInfo");
ui->mainToolBar->addAction(fileInfo); fileInfo->setToolTip("file info");
connect(fileInfo, &QToolButton::pressed, this, &MainWindow::aboutFile);
QAction *help = new QAction(QIcon(":/images/toolbar/about.png"), "Help", this); ui->mainToolBar->addWidget(fileInfo);
connect(help, &QAction::triggered, this, &MainWindow::aboutTool);
ui->mainToolBar->addAction(help); QToolButton *help = new QToolButton(this);
help->setObjectName("help");
QAction *test = new QAction(this); help->setToolTip("help");
test->setCheckable(true); connect(help, &QToolButton::pressed, this, &MainWindow::aboutTool);
test->setObjectName("test123"); ui->mainToolBar->addWidget(help);
ui->mainToolBar->addAction(test);
m_output->setObjectName("output"); m_output->setObjectName("output");
m_output->setStyleSheet("QLabel#output{color : white; min-width: 400px; min-height: 50px;}"); m_output->setStyleSheet("QLabel#output{color : white; min-width: 400px; min-height: 50px;}");
......
...@@ -572,6 +572,7 @@ void MshFile::analyseClthChunks(Model * dataDestination, std::list<ChunkHeader*> ...@@ -572,6 +572,7 @@ void MshFile::analyseClthChunks(Model * dataDestination, std::list<ChunkHeader*>
for (auto& it : chunkList) for (auto& it : chunkList)
{ {
// texture name // texture name
//TODO: change this
if (!strcmp("CTEX", it->name)) if (!strcmp("CTEX", it->name))
{ {
// read the texture name // read the texture name
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment