Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
David Cazier
CGoGN
Commits
6508e859
Commit
6508e859
authored
Apr 25, 2012
by
Kenneth Vanhoey
Browse files
supports both ascii and binary export (question asked to user)
parent
00b254b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Apps/Examples/viewer.cpp
View file @
6508e859
...
...
@@ -237,7 +237,7 @@ void Viewer::importMesh(std::string& filename)
updateGLMatrices
()
;
}
void
Viewer
::
exportMesh
(
std
::
string
&
filename
)
void
Viewer
::
exportMesh
(
std
::
string
&
filename
,
bool
askExportMode
)
{
size_t
pos
=
filename
.
rfind
(
"."
)
;
// position of "." in filename
std
::
string
extension
=
filename
.
substr
(
pos
)
;
...
...
@@ -247,7 +247,9 @@ void Viewer::exportMesh(std::string& filename)
else
if
(
extension
.
compare
(
0
,
4
,
std
::
string
(
".ply"
))
==
0
)
{
int
ascii
=
0
;
Utils
::
QT
::
inputValues
(
Utils
::
QT
::
VarCombo
(
"binary mode;ascii mode"
,
ascii
,
"Save in"
))
;
if
(
askExportMode
)
Utils
::
QT
::
inputValues
(
Utils
::
QT
::
VarCombo
(
"binary mode;ascii mode"
,
ascii
,
"Save in"
))
;
std
::
vector
<
PFP
::
TVEC3
*>
attributes
;
attributes
.
push_back
(
&
position
)
;
Algo
::
Export
::
exportPLYnew
<
PFP
>
(
myMap
,
attributes
,
filename
.
c_str
(),
!
ascii
,
allDarts
)
;
...
...
@@ -327,7 +329,7 @@ int main(int argc, char **argv)
{
std
::
string
filenameExp
(
argv
[
2
])
;
std
::
cout
<<
"Exporting "
<<
filename
<<
" as "
<<
filenameExp
<<
" ... "
<<
std
::
flush
;
sqt
.
exportMesh
(
filenameExp
)
;
sqt
.
exportMesh
(
filenameExp
,
false
)
;
std
::
cout
<<
"done!"
<<
std
::
endl
;
return
(
0
)
;
...
...
Apps/Examples/viewer.h
View file @
6508e859
...
...
@@ -118,7 +118,7 @@ public:
void
cb_Save
()
;
void
importMesh
(
std
::
string
&
filename
)
;
void
exportMesh
(
std
::
string
&
filename
);
void
exportMesh
(
std
::
string
&
filename
,
bool
askExportMode
=
true
);
public
slots
:
void
slot_drawVertices
(
bool
b
)
;
...
...
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