Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
CGoGN
CGoGN
Commits
23ed036a
Commit
23ed036a
authored
Mar 02, 2012
by
Kenneth Vanhoey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
export pour SLF generique (rangement à venir)
parent
a06adb1c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
11 deletions
+18
-11
include/Algo/Export/export.h
include/Algo/Export/export.h
+2
-2
include/Algo/Export/export.hpp
include/Algo/Export/export.hpp
+13
-9
include/Algo/Import/import2tablesSurface.hpp
include/Algo/Import/import2tablesSurface.hpp
+3
-0
No files found.
include/Algo/Export/export.h
View file @
23ed036a
...
...
@@ -76,7 +76,7 @@ bool exportTrian(typename PFP::MAP& map, const typename PFP::TVEC3& position, ch
* @return true
*/
template
<
typename
PFP
>
bool
exportPlySLFgeneric
(
typename
PFP
::
MAP
&
map
,
const
char
*
filename
,
const
typename
PFP
::
TVEC3
&
position
,
const
unsigned
int
&
nbCoefs
,
const
FunctorSelect
&
good
=
allDarts
)
;
bool
exportPlySLFgeneric
(
typename
PFP
::
MAP
&
map
,
const
typename
PFP
::
TVEC3
&
position
,
const
char
*
filename
,
const
FunctorSelect
&
good
=
allDarts
)
;
/**
* export the map into a PLYSLF file (K. Vanhoey generic format).
...
...
@@ -91,7 +91,7 @@ bool exportPlySLFgeneric(typename PFP::MAP& map, const char* filename, const typ
* @return true
*/
template
<
typename
PFP
>
bool
exportPlyPTMgeneric
(
typename
PFP
::
MAP
&
map
,
const
char
*
filename
,
const
typename
PFP
::
TVEC3
&
position
,
const
unsigned
int
&
nbCoefs
,
const
FunctorSelect
&
good
=
allDarts
)
;
bool
exportPlyPTMgeneric
(
typename
PFP
::
MAP
&
map
,
const
typename
PFP
::
TVEC3
&
position
,
const
char
*
filename
,
const
unsigned
int
&
nbCoefs
,
const
FunctorSelect
&
good
=
allDarts
)
;
/**
* export the map into a PLYPTMgeneric file (K. Vanhoey generic format)
...
...
include/Algo/Export/export.hpp
View file @
23ed036a
...
...
@@ -180,7 +180,7 @@ bool exportOFF(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons
}
template
<
typename
PFP
>
bool
exportPlyPTMgeneric
(
typename
PFP
::
MAP
&
map
,
const
char
*
filename
,
const
typename
PFP
::
TVEC3
&
position
,
const
FunctorSelect
&
good
)
bool
exportPlyPTMgeneric
(
typename
PFP
::
MAP
&
map
,
const
typename
PFP
::
TVEC3
&
position
,
const
char
*
filename
,
const
FunctorSelect
&
good
)
{
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
VEC3
VEC3
;
...
...
@@ -322,7 +322,7 @@ bool exportPlyPTMgeneric(typename PFP::MAP& map, const char* filename, const typ
}
template
<
typename
PFP
>
bool
exportPlySLFgeneric
(
typename
PFP
::
MAP
&
map
,
const
char
*
filename
,
const
typename
PFP
::
TVEC3
&
position
,
const
unsigned
int
&
nbCoefs
,
const
FunctorSelect
&
good
)
bool
exportPlySLFgeneric
(
typename
PFP
::
MAP
&
map
,
const
typename
PFP
::
TVEC3
&
position
,
const
char
*
filename
,
const
FunctorSelect
&
good
)
{
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
VEC3
VEC3
;
...
...
@@ -375,21 +375,25 @@ bool exportPlySLFgeneric(typename PFP::MAP& map, const char* filename, const typ
}
TVEC3
frame
[
3
]
;
TVEC3
coefs
[
nbCoefs
]
;
std
::
vector
<
TVEC3
>
coefs
;
frame
[
0
]
=
map
.
template
getAttribute
<
VEC3
>(
VERTEX
,
"frame_T"
)
;
frame
[
1
]
=
map
.
template
getAttribute
<
VEC3
>(
VERTEX
,
"frame_B"
)
;
frame
[
2
]
=
map
.
template
getAttribute
<
VEC3
>(
VERTEX
,
"frame_N"
)
;
for
(
unsigned
i
=
0
;
i
<
nbCoefs
;
++
i
)
{
unsigned
int
i
=
0
;
do
{
std
::
stringstream
name
;
name
<<
"SLFcoefs_"
<<
i
;
coefs
[
i
]
=
map
.
template
getAttribute
<
VEC3
>(
VERTEX
,
name
.
str
())
;
}
name
<<
"SLFcoefs_"
<<
i
++
;
coefs
.
push_back
(
map
.
template
getAttribute
<
VEC3
>(
VERTEX
,
name
.
str
()))
;
}
while
(
coefs
[
i
-
1
].
isValid
())
;
const
unsigned
int
nbCoefs
=
i
-
1
;
// last valid one is i-2
for
(
unsigned
int
coefI
=
0
;
coefI
<
nbCoefs
;
++
coefI
)
assert
(
coefs
[
coefI
].
isValid
())
;
std
::
string
file
(
filename
)
;
size_t
pos
=
file
.
rfind
(
"."
)
;
// position of "." in filename
std
::
cout
<<
file
<<
" ; "
<<
pos
<<
std
::
endl
;
std
::
string
extension
=
file
.
substr
(
pos
)
;
out
<<
"ply"
<<
std
::
endl
;
...
...
include/Algo/Import/import2tablesSurface.hpp
View file @
23ed036a
...
...
@@ -58,6 +58,9 @@ ImportSurfacique::ImportType MeshTablesSurface<PFP>::getFileType(const std::stri
if ((filename.rfind(".plyptm")!=std::string::npos) || (filename.rfind(".PLYGEN")!=std::string::npos))
return ImportSurfacique::PLYPTM;
if ((filename.rfind(".plyPTMext")!=std::string::npos) || (filename.rfind(".plySHreal")!=std::string::npos))
return ImportSurfacique::PLYSLFgeneric;
if ((filename.rfind(".ply")!=std::string::npos) || (filename.rfind(".PLY")!=std::string::npos))
return ImportSurfacique::PLY;
...
...
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