2016-12-24 15:03:37 +00:00
|
|
|
#include "..\Header\MainWindow.h"
|
|
|
|
#include "..\Header\OglViewerWidget.h"
|
2017-01-28 15:54:36 +00:00
|
|
|
#include "..\Header\FileInterface.h"
|
2017-01-29 10:35:43 +00:00
|
|
|
#include "..\Header\OutputDevice.h"
|
2017-06-17 13:42:43 +00:00
|
|
|
#include "..\Header\SettingsManager.h"
|
2016-12-24 15:03:37 +00:00
|
|
|
#include <QSurfaceFormat>
|
2017-01-05 15:04:51 +00:00
|
|
|
#include <QSignalMapper>
|
2017-01-28 15:54:36 +00:00
|
|
|
#include <QToolButton>
|
2017-01-07 14:59:16 +00:00
|
|
|
#include <QFile>
|
2017-01-28 15:54:36 +00:00
|
|
|
#include <QFileDialog>
|
|
|
|
#include <QMessageBox>
|
|
|
|
#include <QPalette>
|
2017-01-16 13:24:30 +00:00
|
|
|
#include <QResizeEvent>
|
2017-06-18 11:15:23 +00:00
|
|
|
#include <QDirIterator>
|
|
|
|
#include <QFileInfo>
|
|
|
|
|
2016-12-31 15:18:35 +00:00
|
|
|
|
|
|
|
#define WINDOW_NAME "Mesh Viewer"
|
2016-12-24 15:03:37 +00:00
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
// constructor/destructor
|
|
|
|
|
2016-12-24 15:03:37 +00:00
|
|
|
MainWindow::MainWindow(QWidget *parent)
|
|
|
|
: QMainWindow(parent)
|
|
|
|
, ui(new Ui::MainWindowClass)
|
2017-01-16 13:24:30 +00:00
|
|
|
, m_output(new QLabel(this))
|
2017-01-28 15:54:36 +00:00
|
|
|
, m_curSeverity(0)
|
2017-01-22 14:41:08 +00:00
|
|
|
, m_infoWindow(new FileInfoWindow(this))
|
2016-12-24 15:03:37 +00:00
|
|
|
{
|
2017-01-28 15:54:36 +00:00
|
|
|
// setup window
|
2016-12-24 15:03:37 +00:00
|
|
|
ui->setupUi(this);
|
|
|
|
|
2016-12-31 15:18:35 +00:00
|
|
|
setWindowTitle(WINDOW_NAME);
|
|
|
|
setWindowIcon(QIcon(":/images/icon.ico"));
|
|
|
|
|
2017-01-29 10:35:43 +00:00
|
|
|
connect(OutputDevice::getInstance(this), &OutputDevice::sendMessage, this, &MainWindow::printMessage);
|
2017-01-29 14:19:20 +00:00
|
|
|
connect(OutputDevice::getInstance(this), &OutputDevice::sendFileInfo, this, &MainWindow::setFileInfo);
|
2017-01-28 15:54:36 +00:00
|
|
|
|
|
|
|
// setup opengl things
|
2016-12-24 15:03:37 +00:00
|
|
|
QSurfaceFormat format;
|
|
|
|
format.setDepthBufferSize(24);
|
|
|
|
QSurfaceFormat::setDefaultFormat(format);
|
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
// set default text to file info
|
|
|
|
m_fileInfo = "Filename: -\nMaterials: -\nVertices: -\nTriangle: -<detail>No file is open";
|
2017-01-07 14:59:16 +00:00
|
|
|
|
2017-06-18 11:15:23 +00:00
|
|
|
ui->dirDropDownList->addItem("BF1_ModTools", "C:/BF1_ModTools/Assets/Shipped Worlds/");
|
|
|
|
ui->dirDropDownList->addItem("BF2_ModTools", "C:/BF2_ModTools/assets/Sides/");
|
2017-05-31 02:37:17 +00:00
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
// add widgets to the window
|
|
|
|
setupWidgets();
|
2017-01-21 15:33:03 +00:00
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
// load stylesheet
|
2017-01-21 15:33:03 +00:00
|
|
|
QFile styleSheet(":/files/StyleSheet.txt");
|
|
|
|
styleSheet.open(QIODevice::ReadOnly);
|
|
|
|
this->setStyleSheet(styleSheet.readAll());
|
2017-01-29 10:35:43 +00:00
|
|
|
|
2017-06-18 11:15:23 +00:00
|
|
|
// setup dropdown
|
2017-06-17 13:42:43 +00:00
|
|
|
setupAssetLibrary();
|
2017-06-20 09:41:10 +00:00
|
|
|
connect(SettingsManager::getInstance(), &SettingsManager::dirsChanged, this, &MainWindow::setupAssetLibrary);
|
|
|
|
|
2017-01-29 10:35:43 +00:00
|
|
|
printMessage("MeshViewer by Anakin", 0);
|
2016-12-24 15:03:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
MainWindow::~MainWindow()
|
|
|
|
{
|
|
|
|
delete ui;
|
2017-01-16 13:24:30 +00:00
|
|
|
delete m_output;
|
2017-01-16 14:41:37 +00:00
|
|
|
delete m_infoWindow;
|
2016-12-31 15:18:35 +00:00
|
|
|
}
|
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
// functions
|
2017-01-05 15:04:51 +00:00
|
|
|
void MainWindow::setupWidgets()
|
|
|
|
{
|
2017-01-28 15:54:36 +00:00
|
|
|
// Ogl Viewer
|
2017-01-05 15:04:51 +00:00
|
|
|
OglViewerWidget* viewer = new OglViewerWidget(this);
|
|
|
|
setCentralWidget(viewer);
|
2017-01-30 10:31:37 +00:00
|
|
|
connect(this, &MainWindow::loadFile, viewer, &OglViewerWidget::loadFile);
|
2017-01-05 15:04:51 +00:00
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
// open file
|
2017-06-17 13:42:43 +00:00
|
|
|
QToolButton *openFileDialog = new QToolButton(this);
|
|
|
|
openFileDialog->setObjectName("openFile");
|
|
|
|
openFileDialog->setToolTip("open file");
|
|
|
|
connect(openFileDialog, &QToolButton::pressed, this, &MainWindow::openFileDialog);
|
|
|
|
ui->mainToolBar->addWidget(openFileDialog);
|
2017-01-05 15:04:51 +00:00
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
// screenshot
|
2017-01-22 11:25:59 +00:00
|
|
|
QToolButton *screenshot = new QToolButton(this);
|
|
|
|
screenshot->setObjectName("screenshot");
|
|
|
|
screenshot->setToolTip("take screenshot");
|
|
|
|
connect(screenshot, &QToolButton::pressed, this, &MainWindow::takeScreenShot);
|
|
|
|
ui->mainToolBar->addWidget(screenshot);
|
2017-01-11 15:28:51 +00:00
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
//////////////////////////////////////////////////
|
2017-01-09 15:34:54 +00:00
|
|
|
ui->mainToolBar->addSeparator();
|
|
|
|
|
2017-02-02 17:01:08 +00:00
|
|
|
// Free Camera
|
|
|
|
QToolButton *freeCamera = new QToolButton(this);
|
|
|
|
freeCamera->setObjectName("freeCamera");
|
|
|
|
freeCamera->setToolTip("free camera");
|
|
|
|
connect(freeCamera, &QToolButton::pressed, viewer, &OglViewerWidget::useFreeCamera);
|
|
|
|
ui->mainToolBar->addWidget(freeCamera);
|
|
|
|
|
|
|
|
// Orbital Camera
|
|
|
|
QToolButton *orbitCamera = new QToolButton(this);
|
|
|
|
orbitCamera->setObjectName("orbitalCamera");
|
|
|
|
orbitCamera->setToolTip("orbital camera");
|
|
|
|
connect(orbitCamera, &QToolButton::pressed, viewer, &OglViewerWidget::useOrbitCamera);
|
|
|
|
ui->mainToolBar->addWidget(orbitCamera);
|
|
|
|
|
|
|
|
// Move Camera
|
2017-02-04 16:42:44 +00:00
|
|
|
QToolButton *walkCamera = new QToolButton(this);
|
|
|
|
walkCamera->setObjectName("walkCamera");
|
|
|
|
walkCamera->setToolTip("walk camera");
|
|
|
|
connect(walkCamera, &QToolButton::pressed, viewer, &OglViewerWidget::useMoveCamera);
|
|
|
|
ui->mainToolBar->addWidget(walkCamera);
|
2017-01-05 15:04:51 +00:00
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
//////////////////////////////////////////////////
|
2017-01-09 15:34:54 +00:00
|
|
|
ui->mainToolBar->addSeparator();
|
2017-01-05 15:04:51 +00:00
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
// wireframe
|
2017-01-22 11:25:59 +00:00
|
|
|
QToolButton *wireframe = new QToolButton(this);
|
|
|
|
wireframe->setObjectName("wireframe");
|
|
|
|
wireframe->setToolTip("wireframe");
|
2017-01-16 13:24:30 +00:00
|
|
|
wireframe->setCheckable(true);
|
|
|
|
wireframe->setChecked(false);
|
2017-01-22 11:25:59 +00:00
|
|
|
connect(wireframe, &QToolButton::pressed, viewer, &OglViewerWidget::toggleWireframe);
|
|
|
|
ui->mainToolBar->addWidget(wireframe);
|
2017-01-16 13:24:30 +00:00
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
// light
|
2017-01-22 11:25:59 +00:00
|
|
|
QToolButton *light = new QToolButton(this);
|
|
|
|
light->setObjectName("light");
|
|
|
|
light->setToolTip("toggle light");
|
2017-01-18 16:01:43 +00:00
|
|
|
light->setCheckable(true);
|
|
|
|
light->setChecked(false);
|
2017-01-22 11:25:59 +00:00
|
|
|
connect(light, &QToolButton::pressed, viewer, &OglViewerWidget::toggleLight);
|
|
|
|
ui->mainToolBar->addWidget(light);
|
2017-01-18 16:01:43 +00:00
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
// settings
|
2017-01-23 15:09:06 +00:00
|
|
|
QToolButton *settings = new QToolButton(this);
|
|
|
|
settings->setObjectName("settings");
|
|
|
|
settings->setToolTip("settings");
|
|
|
|
connect(settings, &QToolButton::pressed, viewer, &OglViewerWidget::showSettings);
|
|
|
|
ui->mainToolBar->addWidget(settings);
|
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
//////////////////////////////////////////////////
|
2017-01-16 13:24:30 +00:00
|
|
|
ui->mainToolBar->addSeparator();
|
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
// fileinfo
|
2017-01-22 11:25:59 +00:00
|
|
|
QToolButton *fileInfo = new QToolButton(this);
|
|
|
|
fileInfo->setObjectName("fileInfo");
|
|
|
|
fileInfo->setToolTip("file info");
|
2017-01-28 15:54:36 +00:00
|
|
|
connect(fileInfo, &QToolButton::pressed, m_infoWindow, &FileInfoWindow::show);
|
2017-01-22 11:25:59 +00:00
|
|
|
ui->mainToolBar->addWidget(fileInfo);
|
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
// help
|
2017-01-22 11:25:59 +00:00
|
|
|
QToolButton *help = new QToolButton(this);
|
|
|
|
help->setObjectName("help");
|
|
|
|
help->setToolTip("help");
|
|
|
|
connect(help, &QToolButton::pressed, this, &MainWindow::aboutTool);
|
|
|
|
ui->mainToolBar->addWidget(help);
|
2017-01-21 15:33:03 +00:00
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
// output on screen
|
2017-01-16 13:24:30 +00:00
|
|
|
m_output->setObjectName("output");
|
|
|
|
m_output->setAlignment(Qt::AlignTop);
|
2017-01-28 15:54:36 +00:00
|
|
|
m_output->setText(m_fileInfo.left(m_fileInfo.indexOf("<detail>")));
|
2017-01-16 13:24:30 +00:00
|
|
|
m_output->raise();
|
2017-01-05 15:04:51 +00:00
|
|
|
}
|
|
|
|
|
2017-06-17 13:42:43 +00:00
|
|
|
void MainWindow::updateAssetTree(QString path)
|
2017-05-30 12:42:11 +00:00
|
|
|
{
|
2017-06-18 11:15:23 +00:00
|
|
|
ui->fileListWidget->clear();
|
|
|
|
m_Paths.clear();
|
2017-06-20 09:41:10 +00:00
|
|
|
QDirIterator itterator(path, QStringList() << "*.msh" << "*.MSH" << "*.mesh" << "*.MESH",
|
2017-06-18 11:15:23 +00:00
|
|
|
QDir::Files, QDirIterator::Subdirectories);
|
2017-04-30 13:05:21 +00:00
|
|
|
|
2017-06-18 11:15:23 +00:00
|
|
|
while (itterator.hasNext()) {
|
2017-06-20 09:41:10 +00:00
|
|
|
ui->fileListWidget->insertItem(0, new QListWidgetItem(itterator.fileName()));
|
|
|
|
m_Paths.prepend(itterator.fileInfo().absoluteFilePath());
|
|
|
|
itterator.next();
|
2017-06-18 11:15:23 +00:00
|
|
|
}
|
2017-04-30 13:05:21 +00:00
|
|
|
}
|
|
|
|
|
2017-06-17 13:42:43 +00:00
|
|
|
void MainWindow::openFileDialog()
|
2016-12-31 15:18:35 +00:00
|
|
|
{
|
2017-01-28 15:54:36 +00:00
|
|
|
QString fileName = QFileDialog::getOpenFileName(this, "Open File", "", "Mesh (*.msh)");
|
2017-06-17 13:42:43 +00:00
|
|
|
openFile(fileName);
|
2017-05-31 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
2017-06-17 13:42:43 +00:00
|
|
|
void MainWindow::openFile(QString fileName)
|
2017-05-31 02:37:17 +00:00
|
|
|
{
|
2017-01-28 15:54:36 +00:00
|
|
|
if(!fileName.isEmpty())
|
|
|
|
emit loadFile(fileName);
|
|
|
|
}
|
2017-01-07 14:59:16 +00:00
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
void MainWindow::takeScreenShot()
|
|
|
|
{
|
|
|
|
QString destination = QFileDialog::getSaveFileName(this, "Save as...", "", "PNG (*.png);; BMP (*.bmp);;TIFF (*.tiff, *.tif);;JPEG (*.jpg *jpeg)");
|
|
|
|
|
|
|
|
OglViewerWidget* viewer = dynamic_cast<OglViewerWidget*>(centralWidget());
|
|
|
|
if (!destination.isEmpty() && viewer != NULL)
|
|
|
|
viewer->grab().save(destination);
|
2016-12-31 15:18:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::aboutTool()
|
|
|
|
{
|
2017-01-04 13:35:27 +00:00
|
|
|
QFile file(":/files/about.txt");
|
|
|
|
file.open(QIODevice::ReadOnly);
|
|
|
|
QMessageBox* dialog = new QMessageBox(
|
|
|
|
QMessageBox::Question,
|
2016-12-31 15:18:35 +00:00
|
|
|
WINDOW_NAME,
|
2017-01-04 13:35:27 +00:00
|
|
|
QString(file.readAll()),
|
2016-12-31 15:18:35 +00:00
|
|
|
QMessageBox::StandardButton::Close,
|
|
|
|
this,
|
2017-01-07 14:59:16 +00:00
|
|
|
Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
|
2017-01-04 13:35:27 +00:00
|
|
|
|
|
|
|
file.close();
|
|
|
|
|
2016-12-31 15:18:35 +00:00
|
|
|
dialog->exec();
|
2017-01-07 14:59:16 +00:00
|
|
|
|
|
|
|
delete dialog;
|
|
|
|
}
|
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
void MainWindow::resizeEvent(QResizeEvent * e)
|
2017-01-11 15:28:51 +00:00
|
|
|
{
|
2017-01-28 15:54:36 +00:00
|
|
|
m_output->move(40, e->size().height() - 80);
|
2017-01-11 15:28:51 +00:00
|
|
|
}
|
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
// slots
|
|
|
|
|
2017-06-20 09:41:10 +00:00
|
|
|
void MainWindow::setupAssetLibrary()
|
|
|
|
{
|
|
|
|
// get all directories and put them in the dropdown.
|
|
|
|
while (ui->dirDropDownList->count() != 0)
|
|
|
|
ui->dirDropDownList->removeItem(0);
|
|
|
|
|
|
|
|
QStringList tmp_list = SettingsManager::getInstance()->getListOfDirs();
|
|
|
|
for (QString &it : tmp_list)
|
|
|
|
ui->dirDropDownList->addItem(it, it);
|
|
|
|
|
|
|
|
// choose the current path and display it.
|
|
|
|
if (ui->dirDropDownList->currentData().isValid())
|
|
|
|
updateAssetTree(ui->dirDropDownList->currentData().toString());
|
|
|
|
}
|
|
|
|
|
2017-06-18 11:15:23 +00:00
|
|
|
void MainWindow::on_fileListWidget_doubleClicked(const QModelIndex &index)
|
2017-05-31 02:37:17 +00:00
|
|
|
{
|
2017-06-18 11:15:23 +00:00
|
|
|
int slotVal = index.row();
|
|
|
|
QString clickedFile = m_Paths.at(slotVal);
|
2017-06-17 13:42:43 +00:00
|
|
|
openFile(clickedFile);
|
2017-05-31 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_dirDropDownList_currentTextChanged(const QString &arg1)
|
|
|
|
{
|
|
|
|
QString selectedDir;
|
|
|
|
selectedDir = ui->dirDropDownList->itemData(ui->dirDropDownList->currentIndex()).toString();
|
|
|
|
printMessage(arg1 + " : " + selectedDir, 0);
|
2017-06-17 13:42:43 +00:00
|
|
|
updateAssetTree(selectedDir);
|
2017-05-31 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
void MainWindow::printMessage(QString message, int severity)
|
2017-01-16 13:24:30 +00:00
|
|
|
{
|
2017-01-28 15:54:36 +00:00
|
|
|
if (!ui->statusBar->currentMessage().isEmpty() && severity < m_curSeverity)
|
|
|
|
return;
|
|
|
|
|
|
|
|
m_curSeverity = severity;
|
|
|
|
int time(0);
|
|
|
|
QPalette palette;
|
|
|
|
|
|
|
|
switch (severity)
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
time = 3000;
|
|
|
|
palette.setColor(QPalette::WindowText, Qt::darkYellow);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
time = 3000;
|
|
|
|
palette.setColor(QPalette::WindowText, Qt::red);
|
|
|
|
break;
|
|
|
|
case 0:
|
|
|
|
default:
|
|
|
|
time = 2000;
|
|
|
|
palette.setColor(QPalette::WindowText, Qt::black);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
ui->statusBar->setPalette(palette);
|
|
|
|
ui->statusBar->showMessage(message, time);
|
2017-01-16 13:24:30 +00:00
|
|
|
}
|
|
|
|
|
2017-01-15 11:26:15 +00:00
|
|
|
void MainWindow::setFileInfo(QString name, QVector<Material>* materials, int vertices, int triangle)
|
2017-01-07 14:59:16 +00:00
|
|
|
{
|
2017-01-28 15:54:36 +00:00
|
|
|
// save basic file information
|
2017-01-07 14:59:16 +00:00
|
|
|
m_fileInfo = QByteArray("Filename: ");
|
|
|
|
m_fileInfo += name;
|
|
|
|
m_fileInfo += "\nMaterials: ";
|
2017-01-15 11:26:15 +00:00
|
|
|
m_fileInfo += QByteArray::number(materials->size());
|
2017-01-07 14:59:16 +00:00
|
|
|
m_fileInfo += "\nVertices: ";
|
|
|
|
m_fileInfo += QByteArray::number(vertices);
|
|
|
|
m_fileInfo += "\nTriangle: ";
|
|
|
|
m_fileInfo += QByteArray::number(triangle);
|
|
|
|
m_fileInfo += "<detail>";
|
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
// add detailed information
|
2017-01-15 11:26:15 +00:00
|
|
|
for (auto& it : *materials)
|
2017-01-07 14:59:16 +00:00
|
|
|
{
|
2017-01-15 11:26:15 +00:00
|
|
|
m_fileInfo += it.name;
|
2017-01-07 14:59:16 +00:00
|
|
|
m_fileInfo += "\n";
|
2017-01-22 13:37:06 +00:00
|
|
|
|
|
|
|
m_fileInfo += "TX0D:\t\t";
|
2017-01-23 11:17:26 +00:00
|
|
|
if (it.tx0d.isEmpty())
|
2017-01-22 13:37:06 +00:00
|
|
|
m_fileInfo += "-";
|
2017-01-23 11:17:26 +00:00
|
|
|
else
|
|
|
|
m_fileInfo += it.tx0d;
|
|
|
|
m_fileInfo += "\n";
|
|
|
|
|
|
|
|
m_fileInfo += "TX1D:\t\t";
|
|
|
|
if (it.tx1d.isEmpty())
|
|
|
|
m_fileInfo += "-";
|
|
|
|
else
|
|
|
|
m_fileInfo += it.tx1d;
|
|
|
|
m_fileInfo += "\n";
|
|
|
|
|
|
|
|
m_fileInfo += "TX2D:\t\t";
|
|
|
|
if (it.tx2d.isEmpty())
|
|
|
|
m_fileInfo += "-";
|
|
|
|
else
|
|
|
|
m_fileInfo += it.tx2d;
|
|
|
|
m_fileInfo += "\n";
|
|
|
|
|
|
|
|
m_fileInfo += "TX3D:\t\t";
|
|
|
|
if (it.tx3d.isEmpty())
|
|
|
|
m_fileInfo += "-";
|
|
|
|
else
|
|
|
|
m_fileInfo += it.tx3d;
|
2017-01-22 13:37:06 +00:00
|
|
|
m_fileInfo += "\n";
|
|
|
|
|
|
|
|
m_fileInfo += "Flags:\t\t";
|
|
|
|
for (int i = 0; i < 8; i++)
|
|
|
|
{
|
|
|
|
if (it.flags[i])
|
|
|
|
m_fileInfo += "1";
|
|
|
|
else
|
|
|
|
m_fileInfo += "0";
|
|
|
|
}
|
|
|
|
m_fileInfo += "\n";
|
|
|
|
|
2017-01-22 14:41:08 +00:00
|
|
|
m_fileInfo += "Rendertype:\t";
|
|
|
|
m_fileInfo += QByteArray::number(it.rendertype);
|
2017-01-22 13:37:06 +00:00
|
|
|
m_fileInfo += "\n";
|
|
|
|
|
2017-01-22 14:41:08 +00:00
|
|
|
m_fileInfo += "Gloss:\t";
|
2017-01-22 13:37:06 +00:00
|
|
|
m_fileInfo += QByteArray::number(it.shininess);
|
2017-01-22 14:41:08 +00:00
|
|
|
m_fileInfo += "\tData0:\t";
|
|
|
|
m_fileInfo += QByteArray::number(it.dataValues[0]);
|
|
|
|
m_fileInfo += "\tData1:\t";
|
|
|
|
m_fileInfo += QByteArray::number(it.dataValues[1]);
|
2017-01-22 13:37:06 +00:00
|
|
|
m_fileInfo += "\n";
|
|
|
|
|
|
|
|
m_fileInfo += "Diffusecolor:\tR: ";
|
|
|
|
m_fileInfo += QByteArray::number(it.diffuseColor.x());
|
|
|
|
m_fileInfo += "\tG: ";
|
|
|
|
m_fileInfo += QByteArray::number(it.diffuseColor.y());
|
|
|
|
m_fileInfo += "\tB: ";
|
|
|
|
m_fileInfo += QByteArray::number(it.diffuseColor.z());
|
|
|
|
m_fileInfo += "\tA: ";
|
|
|
|
m_fileInfo += QByteArray::number(it.diffuseColor.w());
|
|
|
|
m_fileInfo += "\n";
|
|
|
|
|
|
|
|
m_fileInfo += "Ambientcolor:\tR: ";
|
|
|
|
m_fileInfo += QByteArray::number(it.ambientColor.x());
|
|
|
|
m_fileInfo += "\tG: ";
|
|
|
|
m_fileInfo += QByteArray::number(it.ambientColor.y());
|
|
|
|
m_fileInfo += "\tB: ";
|
|
|
|
m_fileInfo += QByteArray::number(it.ambientColor.z());
|
|
|
|
m_fileInfo += "\tA: ";
|
|
|
|
m_fileInfo += QByteArray::number(it.ambientColor.w());
|
|
|
|
m_fileInfo += "\n";
|
|
|
|
|
|
|
|
m_fileInfo += "Specularcolor:\tR: ";
|
|
|
|
m_fileInfo += QByteArray::number(it.specularColor.x());
|
|
|
|
m_fileInfo += "\tG: ";
|
|
|
|
m_fileInfo += QByteArray::number(it.specularColor.y());
|
|
|
|
m_fileInfo += " \tB: ";
|
|
|
|
m_fileInfo += QByteArray::number(it.specularColor.z());
|
|
|
|
m_fileInfo += " \tA: ";
|
|
|
|
m_fileInfo += QByteArray::number(it.specularColor.w());
|
|
|
|
m_fileInfo += "\n";
|
|
|
|
|
|
|
|
m_fileInfo += "-----------------------------------------------------------------\n";
|
2017-01-07 14:59:16 +00:00
|
|
|
}
|
2017-01-16 13:24:30 +00:00
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
// print basic information on screen
|
2017-01-16 13:24:30 +00:00
|
|
|
m_output->setText(m_fileInfo.left(m_fileInfo.indexOf("<detail>")));
|
2017-01-16 14:41:37 +00:00
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
// print basic and detailed information on info window
|
2017-01-16 14:41:37 +00:00
|
|
|
m_infoWindow->setBasicText(QString(m_fileInfo.left(m_fileInfo.indexOf("<detail>"))));
|
|
|
|
m_infoWindow->setDetailText(QString(m_fileInfo.right(m_fileInfo.size() - m_fileInfo.indexOf("<detail>") - 8)));
|
|
|
|
|
2017-01-04 13:35:27 +00:00
|
|
|
}
|