Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
C-Fu
OpenGL
Commits
cdd6ace7
Commit
cdd6ace7
authored
Jan 22, 2017
by
Anakin
Browse files
save rendertype,
evaluate rednertype specular, changed info window always on top
parent
91488c55
Changes
5
Hide whitespace changes
Inline
Side-by-side
QtMeshViewer/Form Files/FileInfoWindow.ui
View file @
cdd6ace7
...
...
@@ -26,73 +26,6 @@ Triangles: -</string>
</item>
<item>
<widget
class=
"QScrollArea"
name=
"scrollArea"
>
<property
name=
"palette"
>
<palette>
<active>
<colorrole
role=
"Base"
>
<brush
brushstyle=
"SolidPattern"
>
<color
alpha=
"255"
>
<red>
255
</red>
<green>
255
</green>
<blue>
255
</blue>
</color>
</brush>
</colorrole>
<colorrole
role=
"Window"
>
<brush
brushstyle=
"SolidPattern"
>
<color
alpha=
"255"
>
<red>
255
</red>
<green>
255
</green>
<blue>
255
</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole
role=
"Base"
>
<brush
brushstyle=
"SolidPattern"
>
<color
alpha=
"255"
>
<red>
255
</red>
<green>
255
</green>
<blue>
255
</blue>
</color>
</brush>
</colorrole>
<colorrole
role=
"Window"
>
<brush
brushstyle=
"SolidPattern"
>
<color
alpha=
"255"
>
<red>
255
</red>
<green>
255
</green>
<blue>
255
</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole
role=
"Base"
>
<brush
brushstyle=
"SolidPattern"
>
<color
alpha=
"255"
>
<red>
255
</red>
<green>
255
</green>
<blue>
255
</blue>
</color>
</brush>
</colorrole>
<colorrole
role=
"Window"
>
<brush
brushstyle=
"SolidPattern"
>
<color
alpha=
"255"
>
<red>
255
</red>
<green>
255
</green>
<blue>
255
</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property
name=
"autoFillBackground"
>
<bool>
false
</bool>
</property>
<property
name=
"widgetResizable"
>
<bool>
true
</bool>
</property>
...
...
QtMeshViewer/Header/FileInterface.h
View file @
cdd6ace7
...
...
@@ -50,6 +50,8 @@ struct Material {
float
shininess
=
80
;
bool
flags
[
8
]
=
{
false
};
bool
transparent
=
false
;
std
::
uint8_t
rendertype
=
0
;
std
::
uint8_t
dataValues
[
2
]
=
{
0
};
};
class
FileInterface
:
public
QObject
...
...
QtMeshViewer/Source/FileInfoWindow.cpp
View file @
cdd6ace7
...
...
@@ -7,7 +7,9 @@ FileInfoWindow::FileInfoWindow(QWidget *parent)
{
ui
->
setupUi
(
this
);
setWindowFlags
(
Qt
::
Tool
|
Qt
::
WindowStaysOnTopHint
|
Qt
::
NoDropShadowWindowHint
);
setWindowFlags
(
Qt
::
Tool
|
Qt
::
NoDropShadowWindowHint
);
ui
->
scrollArea
->
setStyleSheet
(
"background-color: #ffffff"
);
}
...
...
QtMeshViewer/Source/MainWindow.cpp
View file @
cdd6ace7
...
...
@@ -20,7 +20,7 @@ MainWindow::MainWindow(QWidget *parent)
,
ui
(
new
Ui
::
MainWindowClass
)
,
m_curSeverity
(
0
)
,
m_output
(
new
QLabel
(
this
))
,
m_infoWindow
(
new
FileInfoWindow
())
,
m_infoWindow
(
new
FileInfoWindow
(
this
))
{
ui
->
setupUi
(
this
);
...
...
@@ -233,12 +233,16 @@ void MainWindow::setFileInfo(QString name, QVector<Material>* materials, int ver
}
m_fileInfo
+=
"
\n
"
;
m_fileInfo
+=
"Rendertype:
\t
-
"
;
//TODO:
rendertype
m_fileInfo
+=
"Rendertype:
\t
"
;
m_fileInfo
+=
QByteArray
::
number
(
it
.
rendertype
);
m_fileInfo
+=
"
\n
"
;
m_fileInfo
+=
"
Shinine
ss:
\t
"
;
m_fileInfo
+=
"
Glo
ss:
\t
"
;
m_fileInfo
+=
QByteArray
::
number
(
it
.
shininess
);
m_fileInfo
+=
"
\t
Data0:
\t
"
;
m_fileInfo
+=
QByteArray
::
number
(
it
.
dataValues
[
0
]);
m_fileInfo
+=
"
\t
Data1:
\t
"
;
m_fileInfo
+=
QByteArray
::
number
(
it
.
dataValues
[
1
]);
m_fileInfo
+=
"
\n
"
;
m_fileInfo
+=
"Diffusecolor:
\t
R: "
;
...
...
QtMeshViewer/Source/MshFile.cpp
View file @
cdd6ace7
...
...
@@ -253,13 +253,16 @@ void MshFile::analyseMatdChunks(std::list<ChunkHeader*>& chunkList)
// attributes
else
if
(
!
strcmp
(
"ATRB"
,
it
->
name
))
{
// get pointer to current material
Material
*
curMat
=
&
m_materials
->
back
();
// read the attributes
m_file
.
seekg
(
it
->
position
);
std
::
uint8_t
flag
,
render
,
data
[
2
]
;
std
::
uint8_t
flag
;
m_file
.
read
(
F2V
(
flag
),
sizeof
(
flag
));
m_file
.
read
(
F2V
(
render
),
sizeof
(
render
));
m_file
.
read
(
F2V
(
data
[
0
]),
sizeof
(
data
[
0
]
));
m_file
.
read
(
F2V
(
data
[
1
]),
sizeof
(
data
[
1
]
));
m_file
.
read
(
F2V
(
curMat
->
render
type
),
sizeof
(
std
::
uint8_t
));
m_file
.
read
(
F2V
(
curMat
->
dataValues
[
0
]),
sizeof
(
std
::
uint8_t
));
m_file
.
read
(
F2V
(
curMat
->
dataValues
[
1
]),
sizeof
(
std
::
uint8_t
));
// flags
// 0: emissive
...
...
@@ -272,9 +275,9 @@ void MshFile::analyseMatdChunks(std::list<ChunkHeader*>& chunkList)
// 7: specular
for
(
unsigned
int
i
=
0
;
i
<
8
;
i
++
)
m_materials
->
back
().
flags
[
i
]
=
(
std
::
uint8_t
)(
flag
<<
(
7
-
i
))
>>
7
;
curMat
->
flags
[
i
]
=
(
std
::
uint8_t
)(
flag
<<
(
7
-
i
))
>>
7
;
m_materials
->
back
().
transparent
=
m_materials
->
back
().
flags
[
2
]
||
m_materials
->
back
().
flags
[
3
]
||
m_materials
->
back
().
flags
[
4
]
||
m_materials
->
back
().
flags
[
6
]
;
curMat
->
transparent
=
curMat
->
flags
[
2
]
||
curMat
->
flags
[
3
]
||
curMat
->
flags
[
4
]
||
curMat
->
flags
[
6
]
||
curMat
->
rendertype
==
4
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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