Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenFlipper-Free
OpenFlipper-Free
Commits
5330629f
Commit
5330629f
authored
Feb 11, 2016
by
Martin Schultz
Browse files
fixed ASK option for OM files
parent
bba78ffc
Changes
2
Show whitespace changes
Inline
Side-by-side
PluginCollection-FilePlugins/Plugin-FileOM/FileOM.cc
View file @
5330629f
...
...
@@ -187,18 +187,10 @@ int FileOMPlugin::loadObject(QString _filename) {
}
// Note: If in non-gui mode, we will never enter this case branch
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
()
==
polyButton
)
||
(
msgBox
.
clickedButton
()
==
detectButton
&&
!
triMesh
))
{
QMetaObject
::
invokeMethod
(
this
,
"handleTrimeshDialog"
,
Qt
::
BlockingQueuedConnection
);
if
((
trimeshOptions
==
TYPEPOLY
)
||
(
trimeshOptions
==
TYPEASK
&&
!
triMesh
))
{
PolyMeshObject
*
object
(
0
);
if
(
PluginFunctions
::
getObject
(
objectId
,
object
))
{
...
...
@@ -251,6 +243,24 @@ int FileOMPlugin::loadObject(QString _filename) {
return
objectId
;
};
void
FileOMPlugin
::
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
=
TYPETRIANGLE
;
else
if
(
msgBox
.
clickedButton
()
==
polyButton
)
trimeshOptions
=
TYPEPOLY
;
}
//-----------------------------------------------------------------------------------------------------
/// load a triangle-mesh with given filename
...
...
PluginCollection-FilePlugins/Plugin-FileOM/FileOM.hh
View file @
5330629f
...
...
@@ -100,6 +100,9 @@ class FileOMPlugin : public QObject, BaseInterface, FileInterface, LoadSaveInter
void
initializePlugin
();
/// Displays a dialog to ask how to load the mesh (triangle, polymesh , autodetect)
void
handleTrimeshDialog
();
/// Slot called when user wants to save the given Load options as default
void
slotLoadDefault
();
...
...
@@ -166,6 +169,7 @@ class FileOMPlugin : public QObject, BaseInterface, FileInterface, LoadSaveInter
QCheckBox
*
loadFaceColor_
;
QCheckBox
*
loadFaceNormal_
;
QPushButton
*
loadDefaultButton_
;
int
trimeshOptions
;
};
#endif //FILEOMPLUGIN_HH
Write
Preview
Supports
Markdown
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