Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenFlipper-Free
Plugin-FileOBJ
Commits
0531538d
Commit
0531538d
authored
Feb 03, 2016
by
Martin Schultz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* fixed loading issue in obj loader
parent
2cdbe2d7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
14 deletions
+27
-14
FileOBJ.cc
FileOBJ.cc
+24
-14
FileOBJ.hh
FileOBJ.hh
+3
-0
No files found.
FileOBJ.cc
View file @
0531538d
...
...
@@ -120,7 +120,7 @@ FileOBJPlugin::FileOBJPlugin()
//-----------------------------------------------------------------------------------------------------
void
FileOBJPlugin
::
initializePlugin
()
{
void
FileOBJPlugin
::
initializePlugin
()
{
}
//-----------------------------------------------------------------------------------------------------
...
...
@@ -1742,26 +1742,18 @@ void FileOBJPlugin::checkTypes(QByteArray& _bufferedFile, QString _filename, OBJ
// If we do not have a gui, we will always use the last default
// If we need a gui and the triMeshHandling box is not generated (==0) we also use the last default
if
(
OpenFlipper
::
Options
::
gui
()
&&
triMeshHandling_
!=
0
){
QMessageBox
msgBox
;
QPushButton
*
detectButton
=
msgBox
.
addButton
(
tr
(
"Auto-Detect"
),
QMessageBox
::
ActionRole
);
QPushButton
*
triButton
=
msgBox
.
addButton
(
tr
(
"Open as triangle mesh"
),
QMessageBox
::
ActionRole
);
QPushButton
*
polyButton
=
msgBox
.
addButton
(
tr
(
"Open as poly mesh"
),
QMessageBox
::
ActionRole
);
if
(
OpenFlipper
::
Options
::
gui
()
&&
triMeshHandling_
!=
0
){
switch
(
triMeshHandling_
->
currentIndex
()
){
case
TYPEAUTODETECT
:
//Detect
break
;
case
TYPEASK
:
//ask
msgBox
.
setWindowTitle
(
tr
(
"Mesh types in file"
)
);
msgBox
.
setText
(
tr
(
"You are about to open a file containing one or more mesh types.
\n\n
Which mesh type should be used?"
)
);
msgBox
.
setDefaultButton
(
detectButton
);
msgBox
.
exec
();
if
(
msgBox
.
clickedButton
()
==
triButton
)
//LoadType t;
QMetaObject
::
invokeMethod
(
this
,
"handleTrimeshDialog"
,
Qt
::
BlockingQueuedConnection
);
if
(
trimeshOptions
==
OBJImporter
::
TRIMESH
)
_importer
.
forceMeshType
(
OBJImporter
::
TRIMESH
);
else
if
(
msgBox
.
clickedButton
()
==
polyButton
)
else
if
(
trimeshOptions
==
OBJImporter
::
POLYMESH
)
_importer
.
forceMeshType
(
OBJImporter
::
POLYMESH
);
break
;
...
...
@@ -1780,6 +1772,24 @@ void FileOBJPlugin::checkTypes(QByteArray& _bufferedFile, QString _filename, OBJ
}
void
FileOBJPlugin
::
handleTrimeshDialog
()
{
QMessageBox
msgBox
;
QPushButton
*
detectButton
=
msgBox
.
addButton
(
tr
(
"Auto-Detect"
),
QMessageBox
::
ActionRole
);
QPushButton
*
triButton
=
msgBox
.
addButton
(
tr
(
"Open as triangle mesh"
),
QMessageBox
::
ActionRole
);
QPushButton
*
polyButton
=
msgBox
.
addButton
(
tr
(
"Open as poly mesh"
),
QMessageBox
::
ActionRole
);
msgBox
.
setWindowTitle
(
tr
(
"Mesh types in file"
)
);
msgBox
.
setText
(
tr
(
"You are about to open a file containing one or more mesh types.
\n\n
Which mesh type should be used?"
)
);
msgBox
.
setDefaultButton
(
detectButton
);
msgBox
.
exec
();
if
(
msgBox
.
clickedButton
()
==
triButton
)
trimeshOptions
=
OBJImporter
::
TRIMESH
;
else
if
(
msgBox
.
clickedButton
()
==
polyButton
)
trimeshOptions
=
OBJImporter
::
POLYMESH
;
}
//-----------------------------------------------------------------------------------------------------
int
FileOBJPlugin
::
loadObject
(
QString
_filename
)
{
...
...
FileOBJ.hh
View file @
0531538d
...
...
@@ -147,6 +147,8 @@ class FileOBJPlugin : public QObject, BaseInterface, FileInterface, LoadSaveInte
void
slotHandleCheckBoxes
(
bool
_checked
);
void
handleTrimeshDialog
();
public
:
FileOBJPlugin
();
...
...
@@ -251,6 +253,7 @@ class FileOBJPlugin : public QObject, BaseInterface, FileInterface, LoadSaveInte
QString
textureIndexPropertyName_
;
bool
textureIndexPropFetched_
;
std
::
map
<
int
,
QString
>
texIndexFileMap_
;
OBJImporter
::
ObjectOptionsE
trimeshOptions
;
};
...
...
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