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
Thomas Pitiot
CGoGN
Commits
c4a630cd
Commit
c4a630cd
authored
Jun 06, 2012
by
Kenneth Vanhoey
Browse files
update on import/export of ply data
parent
f639e248
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
include/Algo/Export/export.hpp
View file @
c4a630cd
...
...
@@ -281,9 +281,12 @@ bool exportPLYnew(typename PFP::MAP& map, const std::vector<typename PFP::TVEC3*
{
// ascii vertices
for
(
unsigned
int
i
=
0
;
i
<
vertices
.
size
();
++
i
)
{
for
(
typename
std
::
vector
<
typename
PFP
::
TVEC3
*
>::
const_iterator
attrHandler
=
attributeHandlers
.
begin
()
;
attrHandler
!=
attributeHandlers
.
end
()
;
++
attrHandler
)
if
((
*
attrHandler
)
->
isValid
()
&&
(
*
attrHandler
)
->
getOrbit
()
==
VERTEX
)
out
<<
(
*
(
*
attrHandler
))[
vertices
[
i
]]
<<
std
::
endl
;
out
<<
(
*
(
*
attrHandler
))[
vertices
[
i
]]
;
out
<<
std
::
endl
;
}
// ascii faces
for
(
unsigned
int
i
=
0
;
i
<
facesSize
.
size
();
++
i
)
...
...
@@ -299,17 +302,19 @@ bool exportPLYnew(typename PFP::MAP& map, const std::vector<typename PFP::TVEC3*
// binary vertices
for
(
unsigned
int
i
=
0
;
i
<
vertices
.
size
();
++
i
)
for
(
typename
std
::
vector
<
typename
PFP
::
TVEC3
*>::
const_iterator
attrHandler
=
attributeHandlers
.
begin
()
;
attrHandler
!=
attributeHandlers
.
end
()
;
++
attrHandler
)
{
if
((
*
attrHandler
)
->
isValid
()
&&
(
*
attrHandler
)
->
getOrbit
()
==
VERTEX
)
{
const
typename
PFP
::
VEC3
&
v
=
(
*
(
*
attrHandler
))[
vertices
[
i
]]
;
out
.
write
((
char
*
)(
&
(
v
[
0
])),
sizeof
(
v
))
;
}
}
// binary faces
for
(
unsigned
int
i
=
0
;
i
<
facesSize
.
size
();
++
i
)
{
uint8_t
nbe
=
facesSize
[
i
]
;
out
.
write
((
char
*
)(
&
nbe
),
sizeof
(
u
nsigned
char
))
;
out
.
write
((
char
*
)(
&
nbe
),
sizeof
(
u
int8_t
))
;
out
.
write
((
char
*
)(
&
(
facesIdx
[
i
][
0
])),
facesSize
[
i
]
*
sizeof
(
facesIdx
[
i
][
0
]))
;
}
}
...
...
include/Algo/Import/import2tables.h
View file @
c4a630cd
...
...
@@ -52,7 +52,7 @@ namespace Import
namespace
ImportSurfacique
{
enum
ImportType
{
UNKNOWNSURFACE
,
TRIAN
,
TRIANBGZ
,
MESHBIN
,
PLY
,
/*PLYPTM, PLYSLFgeneric, PLYSLFgenericBin,
*/
OFF
,
OBJ
,
VRML
,
AHEM
};
enum
ImportType
{
UNKNOWNSURFACE
,
TRIAN
,
TRIANBGZ
,
MESHBIN
,
PLY
,
/*PLYPTM,
*/
PLYSLFgeneric
,
PLYSLFgenericBin
,
OFF
,
OBJ
,
VRML
,
AHEM
};
}
namespace
ImportVolumique
...
...
@@ -115,10 +115,10 @@ public:
bool
importPly
(
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
);
/*
bool importPlyPTM(const std::string& filename, std::vector<std::string>& attrNames);
//
bool importPlyPTM(const std::string& filename, std::vector<std::string>& attrNames);
bool
importPlySLFgeneric
(
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
);
bool
importPlySLFgenericBin
(
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
);
*/
#ifdef WITH_ASSIMP
bool
importASSIMP
(
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
);
#endif
...
...
include/Algo/Import/import2tablesSurface.hpp
View file @
c4a630cd
This diff is collapsed.
Click to expand it.
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