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
CGoGN
CGoGN
Commits
424530df
Commit
424530df
authored
Apr 27, 2012
by
Lionel Untereiner
Browse files
import / export choupi
parent
da676e6e
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/Algo/Export/export.h
View file @
424530df
...
...
@@ -134,8 +134,15 @@ bool exportPlyPTMgeneric(typename PFP::MAP& map, const typename PFP::TVEC3& posi
template
<
typename
PFP
>
bool
exportPLYPTM
(
typename
PFP
::
MAP
&
map
,
const
char
*
filename
,
const
typename
PFP
::
TVEC3
&
position
,
const
typename
PFP
::
TVEC3
frame
[
3
],
const
typename
PFP
::
TVEC3
colorPTM
[
6
],
const
FunctorSelect
&
good
=
allDarts
)
;
/**
* export meshes used at the workbench
* export just a list of vertices and edges connectivity
* @param map
* @param position
* @return
*/
template
<
typename
PFP
>
bool
exportChoupi
<
typename
PFP
::
MAP
&
map
,
const
typename
PFP
::
TVEC3
&
position
const
FunctorSelect
&
good
=
allDarts
)
;
bool
exportChoupi
(
typename
PFP
::
MAP
&
map
,
const
typename
PFP
::
TVEC3
&
position
,
const
char
*
filename
,
const
FunctorSelect
&
good
=
allDarts
)
;
}
// namespace Export
...
...
include/Algo/Export/export.hpp
View file @
424530df
...
...
@@ -918,6 +918,39 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P
return
true
;
}
template
<
typename
PFP
>
bool
exportChoupi
(
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
;
std
::
ofstream
out
(
filename
,
std
::
ios
::
out
)
;
if
(
!
out
.
good
())
{
CGoGNerr
<<
"Unable to open file "
<<
CGoGNendl
;
return
false
;
}
out
<<
map
.
getNbOrbits
(
VERTEX
)
<<
" "
<<
map
.
getNbOrbits
(
EDGE
)
<<
std
::
endl
;
TraversorV
<
typename
PFP
::
MAP
>
travV
(
map
);
for
(
Dart
dit
=
travV
.
begin
()
;
dit
!=
travV
.
end
()
;
dit
=
travV
.
next
())
{
out
<<
map
.
getEmbedding
(
VERTEX
,
dit
)
<<
" "
<<
position
[
dit
]
<<
std
::
endl
;
}
TraversorE
<
typename
PFP
::
MAP
>
travE
(
map
);
unsigned
int
indexE
=
0
;
for
(
Dart
dit
=
travE
.
begin
()
;
dit
!=
travE
.
end
()
;
dit
=
travE
.
next
())
{
out
<<
indexE
<<
" "
<<
map
.
getEmbedding
(
VERTEX
,
dit
)
<<
" "
<<
map
.
getEmbedding
(
VERTEX
,
map
.
phi2
(
dit
))
<<
std
::
endl
;
++
indexE
;
}
out
.
close
()
;
return
true
;
}
}
// namespace Export
}
// namespace Algo
...
...
include/Algo/Import/import.h
View file @
424530df
...
...
@@ -83,6 +83,15 @@ template <typename PFP>
bool
importMoka
(
typename
PFP
::
MAP
&
gmap
,
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
);
/**
* import a Choupi file
* @param map
* @param filename
* @return
*/
template
<
typename
PFP
>
bool
importChoupi
(
const
std
::
string
&
filename
,
const
std
::
vector
<
typename
PFP
::
VEC3
>&
tabV
,
const
std
::
vector
<
unsigned
int
>&
tabE
);
/*
* TODO a transformer en utilisant un MeshTableVolume.
*/
...
...
@@ -117,4 +126,6 @@ bool importTs(typename PFP::MAP& the_map, const std::string& filename, std::vect
#include
"Algo/Import/importTs.hpp"
#include
"Algo/Import/importNodeEle.hpp"
#include
"Algo/Import/importChoupi.hpp"
#endif
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