Commit 2c939226 authored by Thomas's avatar Thomas
Browse files

export obstacles

parent 6ef4541e
#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 <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;
}
}
}
......@@ -315,7 +315,7 @@ void SocialAgents::animate()
std::ostringstream tmpNb;
tmpNb << std::setfill('0') << std::setw(4) << nbGenerated;
nbGenerated++;
oss << "./neighExpl/lightMyFire" << tmpNb.str() << ".pov";
oss << "./pourPeter/lightMyFire" << tmpNb.str() << ".pov";
std::string chaine = oss.str();
// VEC3 agPos = sim.agents_[0]->meanPos_;
// agPos[2] = agPos[1];
......@@ -734,7 +734,7 @@ bool SocialAgents::exportScenePov(PFP::MAP& map, PFP::TVEC3& position, const std
if(infoFaces)
{
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))
{
if(!m.isMarked(d))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment