Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
OpenGL
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
C-Fu
OpenGL
Commits
b58b7c47
Commit
b58b7c47
authored
Jan 05, 2017
by
Anakin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some buttons added
parent
44e36b8b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
6 deletions
+66
-6
QtMeshViewer/Header/MainWindow.h
QtMeshViewer/Header/MainWindow.h
+2
-0
QtMeshViewer/Header/OglViewerWidget.h
QtMeshViewer/Header/OglViewerWidget.h
+3
-0
QtMeshViewer/Source/GeometryEngine.cpp
QtMeshViewer/Source/GeometryEngine.cpp
+1
-1
QtMeshViewer/Source/MainWindow.cpp
QtMeshViewer/Source/MainWindow.cpp
+51
-5
QtMeshViewer/Source/OglViewerWidget.cpp
QtMeshViewer/Source/OglViewerWidget.cpp
+9
-0
No files found.
QtMeshViewer/Header/MainWindow.h
View file @
b58b7c47
...
...
@@ -14,6 +14,8 @@ public:
private:
Ui
::
MainWindowClass
*
ui
;
int
m_curSeverity
;
void
setupWidgets
();
private
slots
:
void
openFile
();
...
...
QtMeshViewer/Header/OglViewerWidget.h
View file @
b58b7c47
...
...
@@ -57,5 +57,8 @@ private:
private
slots
:
void
resetView
();
public
slots
:
void
changeDirection
(
int
direction
);
};
QtMeshViewer/Source/GeometryEngine.cpp
View file @
b58b7c47
...
...
@@ -126,7 +126,7 @@ void GeometryEngine::loadTexture(const char* filePath, const char* fileName)
img
=
loadTga
((
std
::
string
(
filePath
)
+
std
::
string
(
fileName
)).
c_str
(),
loadSuccess
);
//TODO: emit if not successfull
if
(
!
loadSuccess
)
if
(
loadSuccess
)
{
QString
msg
=
"WARNING: texture not found or corrupted: "
;
msg
+=
QString
(
fileName
);
...
...
QtMeshViewer/Source/MainWindow.cpp
View file @
b58b7c47
...
...
@@ -5,6 +5,8 @@
#include <QFileDialog>
#include <QFile>
#include <QPalette>
#include <QAction>
#include <QSignalMapper>
#include "..\Header\FileInterface.h"
#define WINDOW_NAME "Mesh Viewer"
...
...
@@ -19,15 +21,11 @@ MainWindow::MainWindow(QWidget *parent)
setWindowTitle
(
WINDOW_NAME
);
setWindowIcon
(
QIcon
(
":/images/icon.ico"
));
ui
->
mainToolBar
->
addAction
(
"Open File"
,
this
,
&
MainWindow
::
openFile
);
ui
->
mainToolBar
->
addAction
(
"File Info"
,
this
,
&
MainWindow
::
aboutFile
);
ui
->
mainToolBar
->
addAction
(
"Help"
,
this
,
&
MainWindow
::
aboutTool
);
QSurfaceFormat
format
;
format
.
setDepthBufferSize
(
24
);
QSurfaceFormat
::
setDefaultFormat
(
format
);
set
CentralWidget
(
new
OglViewerWidget
(
this
)
);
set
upWidgets
(
);
ui
->
statusBar
->
showMessage
(
"MeshViewer by Anakin"
,
0
);
}
...
...
@@ -43,6 +41,54 @@ void MainWindow::openFile()
emit
loadFile
(
fileName
.
toStdString
().
c_str
());
}
void
MainWindow
::
setupWidgets
()
{
OglViewerWidget
*
viewer
=
new
OglViewerWidget
(
this
);
setCentralWidget
(
viewer
);
QAction
*
openFile
=
new
QAction
(
"Open file"
,
this
);
connect
(
openFile
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
openFile
);
ui
->
mainToolBar
->
addAction
(
openFile
);
QSignalMapper
*
signalMapper
=
new
QSignalMapper
(
this
);
QAction
*
x
=
new
QAction
(
"X"
,
this
);
x
->
setCheckable
(
true
);
x
->
setChecked
(
true
);
ui
->
mainToolBar
->
addAction
(
x
);
QAction
*
y
=
new
QAction
(
"Y"
,
this
);
y
->
setCheckable
(
true
);
y
->
setChecked
(
true
);
ui
->
mainToolBar
->
addAction
(
y
);
QAction
*
z
=
new
QAction
(
"Z"
,
this
);
z
->
setCheckable
(
true
);
z
->
setChecked
(
true
);
ui
->
mainToolBar
->
addAction
(
z
);
connect
(
x
,
SIGNAL
(
triggered
()),
signalMapper
,
SLOT
(
map
()));
connect
(
y
,
SIGNAL
(
triggered
()),
signalMapper
,
SLOT
(
map
()));
connect
(
z
,
SIGNAL
(
triggered
()),
signalMapper
,
SLOT
(
map
()));
signalMapper
->
setMapping
(
x
,
1
);
signalMapper
->
setMapping
(
y
,
2
);
signalMapper
->
setMapping
(
z
,
3
);
connect
(
signalMapper
,
SIGNAL
(
mapped
(
int
)),
viewer
,
SLOT
(
changeDirection
(
int
)));
QAction
*
fileInfo
=
new
QAction
(
"File info"
,
this
);
connect
(
fileInfo
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
aboutFile
);
ui
->
mainToolBar
->
addAction
(
fileInfo
);
QAction
*
help
=
new
QAction
(
"Help"
,
this
);
connect
(
help
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
aboutTool
);
ui
->
mainToolBar
->
addAction
(
help
);
}
void
MainWindow
::
aboutFile
()
{
QMessageBox
*
dialog
=
new
QMessageBox
(
QMessageBox
::
Information
,
...
...
QtMeshViewer/Source/OglViewerWidget.cpp
View file @
b58b7c47
...
...
@@ -211,3 +211,12 @@ void OglViewerWidget::resetView()
m_translation
=
{
0.0
,
0.0
,
DEFAULT_Z_DISTANCE
};
update
();
}
/////////////////////////////////////////////////////////////////////////
// public slots
void
OglViewerWidget
::
changeDirection
(
int
direction
)
{
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment