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
SocialAgents3D
Commits
2c939226
Commit
2c939226
authored
Jul 01, 2011
by
Thomas
Browse files
export obstacles
parent
6ef4541e
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/exportObstacles.h
0 → 100644
View file @
2c939226
#ifndef EXPORT_OBSTACLE
#define EXPORT_OBSTACLE
namespace
CGoGN
{
namespace
ExportScene
{
template
<
typename
PFP
>
bool
exportSceneToFile
(
typename
PFP
::
MAP
&
map
,
const
typename
PFP
::
TVEC3
&
position
,
CellMarker
&
obstacle
,
std
::
string
&
filename
);
}
}
#include
"exportObstacles.hpp"
#endif
include/exportObstacles.hpp
0 → 100644
View file @
2c939226
#include
<iostream>
namespace
CGoGN
{
namespace
ExportScene
{
template
<
typename
PFP
>
bool
exportSceneToFile
(
typename
PFP
::
MAP
&
map
,
const
typename
PFP
::
TVEC3
&
position
,
CellMarker
&
obstacle
,
std
::
string
&
filename
)
{
std
::
ofstream
out
(
filename
.
c_str
(),
std
::
ios
::
out
);
if
(
!
out
.
good
())
{
std
::
cerr
<<
"(export) Unable to open file "
<<
filename
<<
std
::
endl
;
return
false
;
}
CellMarker
f
(
map
,
FACE
);
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
{
if
(
obstacle
.
isMarked
(
d
)
&&
obstacle
.
isMarked
(
map
.
phi1
(
d
))
&&
!
f
.
isMarked
(
d
))
{
f
.
mark
(
d
);
Dart
dd
=
d
;
do
{
out
<<
position
[
dd
]
<<
std
::
endl
;
dd
=
map
.
phi1
(
dd
);
}
while
(
dd
!=
d
);
out
<<
std
::
endl
;
}
}
out
.
close
();
return
true
;
}
}
}
src/viewer.cpp
View file @
2c939226
...
@@ -315,7 +315,7 @@ void SocialAgents::animate()
...
@@ -315,7 +315,7 @@ void SocialAgents::animate()
std
::
ostringstream
tmpNb
;
std
::
ostringstream
tmpNb
;
tmpNb
<<
std
::
setfill
(
'0'
)
<<
std
::
setw
(
4
)
<<
nbGenerated
;
tmpNb
<<
std
::
setfill
(
'0'
)
<<
std
::
setw
(
4
)
<<
nbGenerated
;
nbGenerated
++
;
nbGenerated
++
;
oss
<<
"./
neighExpl
/lightMyFire"
<<
tmpNb
.
str
()
<<
".pov"
;
oss
<<
"./
pourPeter
/lightMyFire"
<<
tmpNb
.
str
()
<<
".pov"
;
std
::
string
chaine
=
oss
.
str
();
std
::
string
chaine
=
oss
.
str
();
// VEC3 agPos = sim.agents_[0]->meanPos_;
// VEC3 agPos = sim.agents_[0]->meanPos_;
// agPos[2] = agPos[1];
// agPos[2] = agPos[1];
...
@@ -734,7 +734,7 @@ bool SocialAgents::exportScenePov(PFP::MAP& map, PFP::TVEC3& position, const std
...
@@ -734,7 +734,7 @@ bool SocialAgents::exportScenePov(PFP::MAP& map, PFP::TVEC3& position, const std
if
(
infoFaces
)
if
(
infoFaces
)
{
{
CellMarker
m
(
sim
.
envMap_
.
map
,
FACE
);
CellMarker
m
(
sim
.
envMap_
.
map
,
FACE
);
m
.
unmarkAll
();
//
m.unmarkAll();
for
(
Dart
d
=
sim
.
envMap_
.
map
.
begin
()
;
d
!=
sim
.
envMap_
.
map
.
end
()
;
sim
.
envMap_
.
map
.
next
(
d
))
for
(
Dart
d
=
sim
.
envMap_
.
map
.
begin
()
;
d
!=
sim
.
envMap_
.
map
.
end
()
;
sim
.
envMap_
.
map
.
next
(
d
))
{
{
if
(
!
m
.
isMarked
(
d
))
if
(
!
m
.
isMarked
(
d
))
...
...
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