Commit 27608aa1 authored by Thomas's avatar Thomas
Browse files

ajout export svg et amélioration export povray

parent b3b10bd1
......@@ -32,6 +32,7 @@ add_executable( socialAgentsD
../src/env_map.cpp
../src/agent.cpp
../src/simulator.cpp
../src/gl2ps.c
)
target_link_libraries( socialAgentsD
......
......@@ -29,6 +29,7 @@ add_executable( socialAgents
../src/env_map.cpp
../src/agent.cpp
../src/simulator.cpp
../src/gl2ps.c
)
target_link_libraries( socialAgents
......
......@@ -14,6 +14,8 @@ class Agent
public:
Agent(Simulator* sim, const VEC3& position, Dart d);
VEC3 getPosition();
void updateAgentNeighbors();
void updateObstacleNeighbors();
......@@ -59,6 +61,9 @@ public:
VEC3 newVelocity_;
VEC3 prefVelocity_;
VEC3 meanSpeed_;
VEC3 meanPos_;
Simulator* sim_;
};
......
......@@ -54,6 +54,33 @@ void renderAgent(Agent* agent, bool showNeighborDist = false, bool showObstacleD
glVertex3f(pos[0] + (cosT[i] * radius), pos[1] + (sinT[i] * radius), 0.01f);
glEnd();
VEC3 dir = agent->velocity_;
dir.normalize();
//draw the speed vector
VEC3 base(0,0,1);
VEC3 myAxisRot = base^dir;
myAxisRot.normalize();
float myRot = acos(base*dir);
glPushMatrix();
glTranslatef(pos[0],pos[1],pos[2]);
// glRotatef(myRot,myAxisRot[0],myAxisRot[1],myAxisRot[2]);
Geom::Matrix44f myMat;
myMat.identity();
Geom::rotate<float>(myAxisRot[0],myAxisRot[1],myAxisRot[2],-myRot,myMat);
glMultMatrixf(&myMat(0,0));
glColor3f(0.0,0.0,0.0);
glLineWidth(5.0f);
glBegin(GL_LINES);
glVertex3f(0.,0.,0.0);
glVertex3f(0.,0.,agent->radius_*2.0f);
glEnd();
glPopMatrix();
if(showNeighborDist)
{
radius = sqrt(agent->neighborDistSq_);
......
/*
* GL2PS, an OpenGL to PostScript Printing Library
* Copyright (C) 1999-2009 C. Geuzaine
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of either:
*
* a) the GNU Library General Public License as published by the Free
* Software Foundation, either version 2 of the License, or (at your
* option) any later version; or
*
* b) the GL2PS License as published by Christophe Geuzaine, either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either
* the GNU Library General Public License or the GL2PS License for
* more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library in the file named "COPYING.LGPL";
* if not, write to the Free Software Foundation, Inc., 675 Mass Ave,
* Cambridge, MA 02139, USA.
*
* You should have received a copy of the GL2PS License with this
* library in the file named "COPYING.GL2PS"; if not, I will be glad
* to provide one.
*
* For the latest info about gl2ps and a full list of contributors,
* see http://www.geuz.org/gl2ps/.
*
* Please report all bugs and problems to <gl2ps@geuz.org>.
*/
#ifndef __GL2PS_H__
#define __GL2PS_H__
#include <stdio.h>
#include <stdlib.h>
/* Define GL2PSDLL at compile time to build a Windows DLL */
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
# if defined(_MSC_VER)
# pragma warning(disable:4115)
# pragma warning(disable:4996)
# endif
# include <windows.h>
# if defined(GL2PSDLL)
# if defined(GL2PSDLL_EXPORTS)
# define GL2PSDLL_API __declspec(dllexport)
# else
# define GL2PSDLL_API __declspec(dllimport)
# endif
# else
# define GL2PSDLL_API
# endif
#else
# define GL2PSDLL_API
#endif
#if defined(__APPLE__) || defined(HAVE_OPENGL_GL_H)
# include <OpenGL/gl.h>
#else
# include <GL/gl.h>
#endif
/* Support for compressed PostScript/PDF/SVG and for embedded PNG
images in SVG */
#if defined(HAVE_ZLIB) || defined(HAVE_LIBZ)
# define GL2PS_HAVE_ZLIB
# if defined(HAVE_LIBPNG) || defined(HAVE_PNG)
# define GL2PS_HAVE_LIBPNG
# endif
#endif
/* Version number */
#define GL2PS_MAJOR_VERSION 1
#define GL2PS_MINOR_VERSION 3
#define GL2PS_PATCH_VERSION 5
#define GL2PS_EXTRA_VERSION ""
#define GL2PS_VERSION (GL2PS_MAJOR_VERSION + \
0.01 * GL2PS_MINOR_VERSION + \
0.0001 * GL2PS_PATCH_VERSION)
#define GL2PS_COPYRIGHT "(C) 1999-2009 C. Geuzaine"
/* Output file formats (the values and the ordering are important!) */
#define GL2PS_PS 0
#define GL2PS_EPS 1
#define GL2PS_TEX 2
#define GL2PS_PDF 3
#define GL2PS_SVG 4
#define GL2PS_PGF 5
/* Sorting algorithms */
#define GL2PS_NO_SORT 1
#define GL2PS_SIMPLE_SORT 2
#define GL2PS_BSP_SORT 3
/* Message levels and error codes */
#define GL2PS_SUCCESS 0
#define GL2PS_INFO 1
#define GL2PS_WARNING 2
#define GL2PS_ERROR 3
#define GL2PS_NO_FEEDBACK 4
#define GL2PS_OVERFLOW 5
#define GL2PS_UNINITIALIZED 6
/* Options for gl2psBeginPage */
#define GL2PS_NONE 0
#define GL2PS_DRAW_BACKGROUND (1<<0)
#define GL2PS_SIMPLE_LINE_OFFSET (1<<1)
#define GL2PS_SILENT (1<<2)
#define GL2PS_BEST_ROOT (1<<3)
#define GL2PS_OCCLUSION_CULL (1<<4)
#define GL2PS_NO_TEXT (1<<5)
#define GL2PS_LANDSCAPE (1<<6)
#define GL2PS_NO_PS3_SHADING (1<<7)
#define GL2PS_NO_PIXMAP (1<<8)
#define GL2PS_USE_CURRENT_VIEWPORT (1<<9)
#define GL2PS_COMPRESS (1<<10)
#define GL2PS_NO_BLENDING (1<<11)
#define GL2PS_TIGHT_BOUNDING_BOX (1<<12)
/* Arguments for gl2psEnable/gl2psDisable */
#define GL2PS_POLYGON_OFFSET_FILL 1
#define GL2PS_POLYGON_BOUNDARY 2
#define GL2PS_LINE_STIPPLE 3
#define GL2PS_BLEND 4
/* Text alignment (o=raster position; default mode is BL):
+---+ +---+ +---+ +---+ +---+ +---+ +-o-+ o---+ +---o
| o | o | | o | | | | | | | | | | | |
+---+ +---+ +---+ +-o-+ o---+ +---o +---+ +---+ +---+
C CL CR B BL BR T TL TR */
#define GL2PS_TEXT_C 1
#define GL2PS_TEXT_CL 2
#define GL2PS_TEXT_CR 3
#define GL2PS_TEXT_B 4
#define GL2PS_TEXT_BL 5
#define GL2PS_TEXT_BR 6
#define GL2PS_TEXT_T 7
#define GL2PS_TEXT_TL 8
#define GL2PS_TEXT_TR 9
typedef GLfloat GL2PSrgba[4];
#if defined(__cplusplus)
extern "C" {
#endif
GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer,
GLint viewport[4], GLint format, GLint sort,
GLint options, GLint colormode,
GLint colorsize, GL2PSrgba *colormap,
GLint nr, GLint ng, GLint nb, GLint buffersize,
FILE *stream, const char *filename);
GL2PSDLL_API GLint gl2psEndPage(void);
GL2PSDLL_API GLint gl2psSetOptions(GLint options);
GL2PSDLL_API GLint gl2psGetOptions(GLint *options);
GL2PSDLL_API GLint gl2psBeginViewport(GLint viewport[4]);
GL2PSDLL_API GLint gl2psEndViewport(void);
GL2PSDLL_API GLint gl2psText(const char *str, const char *fontname,
GLshort fontsize);
GL2PSDLL_API GLint gl2psTextOpt(const char *str, const char *fontname,
GLshort fontsize, GLint align, GLfloat angle);
GL2PSDLL_API GLint gl2psSpecial(GLint format, const char *str);
GL2PSDLL_API GLint gl2psDrawPixels(GLsizei width, GLsizei height,
GLint xorig, GLint yorig,
GLenum format, GLenum type, const void *pixels);
GL2PSDLL_API GLint gl2psEnable(GLint mode);
GL2PSDLL_API GLint gl2psDisable(GLint mode);
GL2PSDLL_API GLint gl2psPointSize(GLfloat value);
GL2PSDLL_API GLint gl2psLineWidth(GLfloat value);
GL2PSDLL_API GLint gl2psBlendFunc(GLenum sfactor, GLenum dfactor);
/* undocumented */
GL2PSDLL_API GLint gl2psDrawImageMap(GLsizei width, GLsizei height,
const GLfloat position[3],
const unsigned char *imagemap);
GL2PSDLL_API const char *gl2psGetFileExtension(GLint format);
GL2PSDLL_API const char *gl2psGetFormatDescription(GLint format);
#if defined(__cplusplus)
}
#endif
#endif /* __GL2PS_H__ */
......@@ -33,10 +33,14 @@
#include "simulator.h"
#include "env_render.h"
#include "gl2ps.h"
#include "Algo/Export/exportPov.h"
#include "Algo/Render/GL1/map_glRender.h"
#include "Algo/Render/GL1/topo_render.h"
using namespace CGoGN ;
typedef PFP::MAP MAP;
......@@ -52,7 +56,7 @@ public:
void animate();
// bool exportScenePov(PFP::MAP& map, PFP::TVEC3& position, const std::string& filename, PFP::VEC3 cameraPos, PFP::VEC3 cameraLook, PFP::VEC3 translate, float angle_X, float angle_Y, float angle_Z,const FunctorSelect& good = SelectorTrue());
bool exportScenePov(PFP::MAP& map, PFP::TVEC3& position, const std::string& filename, PFP::VEC3 cameraPos, PFP::VEC3 cameraLook, PFP::VEC3 translate, float angle_X, float angle_Y, float angle_Z,const FunctorSelect& good = SelectorTrue());
void myKeyboard(unsigned char keycode, int x, int y);
......
......@@ -18,6 +18,11 @@ Agent::Agent(Simulator* sim, const VEC3& position, Dart d) :
rangeSq_ = (timeHorizonObst_ * maxSpeed_ + radius_) * (timeHorizonObst_ * maxSpeed_ + radius_);
}
VEC3 Agent::getPosition()
{
return part_.m_position;
}
bool agentSort(const std::pair<float, Agent*>& a1, const std::pair<float, Agent*>& a2)
{
return a1.first < a2.first;
......@@ -72,6 +77,14 @@ void Agent::update()
velocity_[1] = newVelocity_[1];
VEC3 target = part_.m_position + (velocity_ * sim_->timeStep_);
meanSpeed_ *= 3.0f;
meanSpeed_ += velocity_;
meanSpeed_ /= 4.0f;
meanPos_ *= 9.0f;
meanPos_ += part_.m_position;
meanPos_ /= 10.0f;
part_.move(target);
}
......
......@@ -41,7 +41,7 @@ Dart EnvMap::getBelongingCell(const PFP::VEC3& pos)
void EnvMap::init()
{
float sideSize = 70.0f;
unsigned int nbSquares = 25;
unsigned int nbSquares = 5;
CityGenerator::generateCity<PFP>(map, position, obstacleMark, buildingMark, sideSize, nbSquares);
// CityGenerator::simplifyFreeSpace<PFP>(map, position, obstacleMark, buildingMark);
map.init();
......
This diff is collapsed.
#include "simulator.h"
Simulator::Simulator() : globalTime_(0.0f), timeStep_(0.25f)
Simulator::Simulator() : globalTime_(0.0f), timeStep_(0.05f)
{
srand(10);
envMap_.init();
......
......@@ -96,11 +96,11 @@ void MyGlutWin::myRedraw()
//draw the environment
if(visu == 0)
{
glEnable(GL_LIGHTING);
glColor3f(1.0f ,1.0f ,1.0f);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
Algo::Render::GL1::renderTriQuadPoly<PFP>(sim.envMap_.map, Algo::Render::GL1::FLAT, 1.0, sim.envMap_.position, sim.envMap_.normal);
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
// glEnable(GL_LIGHTING);
// glColor3f(1.0f ,1.0f ,1.0f);
// glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
// Algo::Render::GL1::renderTriQuadPoly<PFP>(sim.envMap_.map, Algo::Render::GL1::FLAT, 1.0, sim.envMap_.position, sim.envMap_.normal);
// glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
glDisable(GL_LIGHTING);
glColor3f(0.0f, 0.0f, 0.0f);
......@@ -205,25 +205,34 @@ void MyGlutWin::animate()
std::ostringstream tmpNb;
tmpNb << std::setfill('0') << std::setw(4) << nbGenerated;
nbGenerated++;
oss << "./helicoid3/exportTransZoomHelicoid" << tmpNb.str() << ".pov";
oss << "./planSerre/exportSceneOle" << tmpNb.str() << ".pov";
std::string chaine = oss.str();
VEC3 agPos = sim.agents_[0]->meanPos_;
agPos[2] = agPos[1];
agPos[1] = 0.0f;
VEC3 camPos(agPos);
camPos = camPos+VEC3(-10-0.05*nbGenerated,10+0.05*nbGenerated,log(1.0f+nbGenerated/700.0f));
VEC3 camLook(agPos);
exportScenePov(sim.envMap_.map,sim.envMap_.position,chaine,camPos,camLook,VEC3(0.0f,0,0),0,0,0);
// exportScenePov(sim.envMap_.map,sim.envMap_.position,chaine,VEC3(43,762,65),VEC3(0,762,0),VEC3(1.0f,0,0),0,0,0);
// exportScenePov(sim.envMap_.map,sim.envMap_.position,chaine,VEC3(43,762,65+(1500.0f*float(nbGenerated)/400.0f)),VEC3(0,762,0),VEC3(1.0f,0,0),0,0,0);
if(nbGenerated == 400)
if(nbGenerated == 700)
{
std::cout << "enough .pov generated" << std::endl;
exit(0);
}
}
}
/*
bool MyGlutWin::exportScenePov(PFP::MAP& map, PFP::TVEC3& position, const std::string& filename, PFP::VEC3 cameraPos, PFP::VEC3 cameraLook, PFP::VEC3 translate, float angle_X, float angle_Y, float angle_Z,const FunctorSelect& good)
{
static const bool draft=true;
static const bool highlightAgent=false;
static const bool wireDisplay=false;
uint highlightAgentNo=0;
int highlightAgentNo=-1;
std::ofstream out(filename.c_str(), std::ios::out);
if (!out.good()) {
......@@ -235,12 +244,13 @@ bool MyGlutWin::exportScenePov(PFP::MAP& map, PFP::TVEC3& position, const std::s
float angleY = angle_Y;
float angleZ = angle_Z;
//view the agent from an upper position
if(highlightAgent) {
cameraLook = sim.agents_[highlightAgentNo]->position_;
VEC3 goalV = (sim.goals[highlightAgentNo] - sim.agents_[highlightAgentNo]->position_);
goalV.normalize();
Agent * agent = sim.agents_[highlightAgentNo];
cameraLook = agent->getPosition();
VEC3 goalV = (agent->goals_[agent->curGoal_] - agent->getPosition());
goalV.normalize();
cameraPos = cameraLook - goalV*50.0f;
// cameraPos[2]+= 100.0f;
float tmp = cameraPos[1];
cameraPos[1] = cameraPos[2]+400.0f;
cameraPos[2] = tmp;
......@@ -250,123 +260,146 @@ bool MyGlutWin::exportScenePov(PFP::MAP& map, PFP::TVEC3& position, const std::s
}
//define the camera position
out << "camera { location <" << cameraPos[0] << "," << cameraPos[1] << "," << cameraPos[2]+100.0f << "> look_at <" << cameraLook[0] << "," << cameraLook[1] << "," << cameraLook[2] <<"> ";
// if(highlightAgent) {
// out << "translate <" << translate[0] << "," << translate[1] << "," << translate[2] << "> " << std::endl;
// out << "rotate <" << angleX << "," << angleY << "," << angleZ << "> }" << std::endl;
// }
out << "#include \"sombrero2_highres_POV_geom.inc\"" << std::endl;
out << "#include \"sombrero2_lowres_POV_geom.inc\"" << std::endl;
out << "#include \"sombrero3_highres_POV_geom.inc\"" << std::endl;
out << "#include \"transforms.inc\"" << std::endl;
out << "camera { location <" << cameraPos[0] << "," << cameraPos[1] << "," << cameraPos[2] << "> look_at <" << cameraLook[0] << "," << cameraLook[1] << "," << cameraLook[2] <<"> ";
if(highlightAgent) {
out << "translate <" << translate[0] << "," << translate[1] << "," << translate[2] << "> " << std::endl;
out << "rotate <" << angleX << "," << angleY << "," << angleZ << "> }" << std::endl;
}
out << "}" << std::endl;
//set a "infinite" plane
// out << "plane { y, -1 pigment { color rgb 1 } }" << std::endl;
//set a sky sphere
out << "sphere { <0, 0, 0>, 5000";
out << "texture{ pigment { color rgb <1, 1, 1>} finish { ambient 1 diffuse 0 } } }" << std::endl;
//put some lights
out << "light_source { <" << cameraPos[0] << "," << cameraPos[1]+200 << "," << cameraPos[2] << "> color rgb 0.45}" << std::endl;
// out << "light_source { <-800, 800, -800> color rgb 0.25 }"<< std::endl;
//set a high quality rendering
out << "global_settings {" << std::endl;
out << "radiosity {" << std::endl;
out << "pretrace_start 0.08 pretrace_end 0.04" << std::endl;
out << "count 500 nearest_count 10 error_bound 0.15 recursion_limit 1 low_error_factor 0.2 gray_threshold 0.0 minimum_reuse 0.015 brightness 1 adc_bailout 0.01/2 normal off media off} max_trace_level 255}" << std::endl;
if(draft)
out << "count 10 nearest_count 10 error_bound 0.25 recursion_limit 1 low_error_factor 0.2 gray_threshold 0.0 minimum_reuse 0.015 brightness 1.4 adc_bailout 0.01/2 normal off media off} max_trace_level 5}" << std::endl;
else
out << "count 300 nearest_count 10 error_bound 0.10 recursion_limit 1 low_error_factor 0.2 gray_threshold 0.0 minimum_reuse 0.015 brightness 1.4 adc_bailout 0.01/2 normal off media off} max_trace_level 60}" << std::endl;
if(draft)
for(unsigned int i = 0; i< sim.agents_.size() ; ++i) {
VEC3 pBase(sim.agents_[i]->getPosition());
VEC3 posR(pBase);
VEC3 dir = sim.agents_[i]->velocity_;
dir.normalize();
dir *= 5.0f;
out << "cylinder {" << std::endl;
out << "<0,0,0>, <" << dir[0] << "," << dir[1] << "," << dir[2] << ">,0.05" << std::endl;
out << "translate <" << posR[0] << "," << posR[1] << "," << posR[2]+1+4*0.0638297872 << "> " << std::endl;
out << "rotate <" << angleX-90 << "," << angleY << "," << angleZ << "> " << std::endl;
out << "texture{ pigment{ color rgb<0.5,0.5,1.0>} finish { ambient rgb 0.1 brilliance 0.5 } }" << std::endl;
out << "}" << std::endl;
}
for(unsigned int i = 0; i< sim.agents_.size() ; ++i) {
out << "cylinder {" << std::endl;
Geom::Plane3D<PFP::REAL> pl = Algo::Geometry::trianglePlane<PFP>(sim.envMap_.map,sim.agents_[i]->part_.d,sim.envMap_.position);
VEC3 pBase(sim.agents_[i]->position_);
VEC3 posR;
pl.normal() = -1.0f*pl.normal();
VEC3 dir(0.0f,0.0f,-1.0f);
pBase[2]=100000.0f;
Geom::intersectPlaneRay<VEC3,Geom::Plane3D<PFP::REAL> >(pl,pBase,dir,posR);
// VEC3 posR(sim.agents_[i]->position_[0],sim.agents_[i]->position_[1],0);
out << "<" << posR[0] << "," << posR[2]+0.05 << "," << posR[1] << ">, " << std::endl;
out << "<" << posR[0] << "," << posR[2]+(sim.agents_[i]->radius_*5.0f) << "," << posR[1] << ">, " << std::endl;
out << sim.agents_[i]->radius_ << std::endl;
if(highlightAgent) {
if(i==highlightAgentNo) {
out << "texture{ pigment{ color rgb<0.5,1.0,0.5>} finish { ambient rgb 0.1 brilliance 0.5 } }" << std::endl;
}
else {
Agent * ag = sim.agents_[highlightAgentNo];
bool found = false;
for(std::vector<std::pair<float, size_t> >::iterator it = ag->agentNeighbors_.begin();!found && it != ag->agentNeighbors_.end();++it) {
if((*it).second==i)
found=true;
}
if(found) {
// std::cout << "trouve voisin" << std::endl;
out << "texture{ pigment{ color rgb<0.5.0,0.5,0.0>} finish { ambient rgb 0.1 brilliance 0.5 } }" << std::endl;
}
else {
out << "texture{ pigment{ color rgb<0.5,0.5.0,0.5>} finish { ambient rgb 0.1 brilliance 0.5 } }" << std::endl;
}
}
int typeOfAgent=0;
if(draft) {
typeOfAgent=2;
out << "object {" << " sombrero2_lowres_ " << std::endl;
}
else {
if(i<(sim.agents_.size()/2))
out << "texture{ pigment{ color rgb<0.5,1.0,0.5>} finish { ambient rgb 0.1 brilliance 0.5 } }" << std::endl;
else
out << "texture{ pigment{ color rgb<0.5,0.5,1.0>} finish { ambient rgb 0.1 brilliance 0.5 } }" << std::endl;
if(i==highlightAgentNo) {
typeOfAgent=0;
}
if(i%3!=0) {
typeOfAgent=1;
out << "object {" << " sombrero2_highres_ " << std::endl;
out << "object {" << " sombrero2_lowres_ " << std::endl;
}
else {
typeOfAgent=0;
out << "object {" << " sombrero3_highres_ " << std::endl;
}
}
VEC3 pBase(sim.agents_[i]->getPosition());
VEC3 posR(pBase);
// VEC3 dir = sim.agents_[i]->velocity_;
VEC3 dir = sim.agents_[i]->meanSpeed_;
dir.normalize();
VEC3 base(0,-1,0);
VEC3 axisRot = base^dir;
int sign = axisRot[2] > 0 ? 1 : -1;
//57,2957795 : conversion from radian to degree
float myRot = acos(-dir[1])*57.2957795f;
out << "scale 0.0638297872" << std::endl;
out << "rotate <0,0," << sign*myRot << ">"<< std::endl;
// out << "translate <" << posR[0] << "," << posR[1] << "," << posR[2]+1+typeOfAgent*4*0.0638297872 << "> " << std::endl;
out << "translate <" << posR[0] << "," << posR[1] << "," << posR[2] << "> " << std::endl;
out << "rotate <" << angleX-90 << "," << angleY << "," << angleZ << "> " << std::endl;
out << "translate <" << translate[0] << "," << translate[1] << "," << translate[2] << ">" << std::endl;
out << "rotate <" << angleX << "," << angleY << "," << angleZ << "> " << std::endl;
out << "}" << std::endl;
}
if(highlightAgent) {
DartMarkerStore highlight(map);
Agent * ag = sim.agents_[highlightAgentNo];
for(Dart d=map.begin();d!=map.end();map.next(d)) {
if(!highlight.isMarked(d)) {
PFP::AGENTS listAgentInCell = sim.envMap_.agentvect[d];
if(std::find(listAgentInCell.begin(), listAgentInCell.end(), ag)!=listAgentInCell.end()) {
highlight.markOrbit(FACE_ORBIT,d);
}
}
}
SelectorMarked sm(highlight);
SelectorUnmarked sum(highlight);
Algo::ExportPov::exportMeshPlain<PFP>(out,map,position,"facesHighlighted",sm);
Algo::ExportPov::exportMeshPlain<PFP>(out,map,position,"myMesh",sum);
out << "object {facesHighlighted" << std::endl;
out << "translate <" << translate[0] << "," << translate[1] << "," << translate[2] << ">" << std::endl;
out << "rotate <" << angleX << "," << angleY << "," << angleZ << "> " << std::endl;
out << "texture{ pigment{ color rgb<0.4667,0.709,0.996>} finish { ambient rgb 0.35 brilliance 0.5 } } }" << std::endl;
}
else {
Algo::ExportPov::exportMeshPlain<PFP>(out,map,position,"myMesh",good);
}
if(!draft) {
if(highlightAgent) {
//find the cells to highlight
DartMarkerStore highlight(map);
Agent * ag = sim.agents_[highlightAgentNo];
for(Dart d=map.begin();d!=map.end();map.next(d)) {
if(!highlight.isMarked(d)) {
PFP::AGENTS listAgentInCell = sim.envMap_.agentvect[d];
if(std::find(listAgentInCell.begin(), listAgentInCell.end(), ag)!=listAgentInCell.end()) {
highlight.markOrbit(FACE_ORBIT,d);
}
}
}
SelectorMarked sm(highlight);
SelectorUnmarked sum(highlight);
Algo::ExportPov::exportMeshPlain<PFP>(out,map,position,"facesHighlighted",sm);
Algo::ExportPov::exportMeshPlain<PFP>(out,map,position,"myMesh",sum);
out << "object {facesHighlighted" << std::endl;
out << "translate <" << translate[0] << "," << translate[1] << "," << translate[2] << ">" << std::endl;
out << "rotate <" << angleX << "," << angleY << "," << angleZ << "> " << std::endl;
out << "texture{ pigment{ color rgb<0.4667,0.709,0.996>} finish { ambient rgb 0.35 brilliance 0.5 } } }" << std::endl;
}
else {
Algo::ExportPov::exportMeshPlain<PFP>(out,map,position,"myMesh",good);
}
if(wireDisplay) {
Algo::ExportPov::exportMeshWire<PFP>(out,map,position,"myMeshWire",good);
out << "object {myMeshWire" << std::endl;
if(wireDisplay) {
Algo::ExportPov::exportMeshWire<PFP>(out,map,position,"myMeshWire",good);
out << "object {myMeshWire" << std::endl;
out << "translate <" << translate[0] << "," << translate[1] << "," << translate[2] << ">" << std::endl;