Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit 2e9afbf1 authored by Thomas Jund's avatar Thomas Jund
Browse files

merge

parents bec66d87 72b44877
......@@ -5,6 +5,7 @@ project(SocialAgents)
#add_definitions(-DSPATIAL_HASHING)
SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/../../CGoGN CACHE STRING "CGoGN root dir")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
include(${CGoGN_ROOT_DIR}/apps_cmake.txt)
add_subdirectory(${CMAKE_SOURCE_DIR}/Release Release)
......
......@@ -10,6 +10,7 @@ ENDIF (WIN32)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/Release
# ${CMAKE_CURRENT_SOURCE_DIR}
../include
......
......@@ -221,7 +221,7 @@ void update_registration(Obstacle * o);
void register_pop(Obstacle* o, int n);
void resetPartSubdiv(Obstacle* o);
void resetObstPartInFace(Obstacle* o, Dart d);// empeche de viser une dart ayant disparu
void resetPart(MovingObstacle * mo, Dart d); // empeche de viser une dart ayant disparu pour les voisins
void resetPart(Obstacle * mo, Dart d); // empeche de viser une dart ayant disparu pour les voisins
void displayMO(Obstacle * o);
/**************************************
......@@ -285,6 +285,17 @@ inline void EnvMap::pushAgentInCells(Agent* agent, Dart d)
{
assert(map.getCurrentLevel() == map.getMaxLevel()) ;
// assert(std::find(agentvect[d].begin(), agentvect[d].end(), agent) == agentvect[d].end());
// map.check();
// TraversorF<PFP::MAP> tF(map);
// for(Dart ddd = tF.begin() ; ddd != tF.end() ; ddd = tF.next())
// {
// if(std::find(agentvect[ddd].begin(), agentvect[ddd].end(), agent) != agentvect[ddd].end())
// std::cout <<agent << " SO WRONG ADD" <<ddd.index<< std::endl;
//
// if(std::find(neighborAgentvect[ddd].begin(), neighborAgentvect[ddd].end(), agent) != neighborAgentvect[ddd].end())
// std::cout <<agent<< " SO SO WRONG ADD" <<ddd.index<< std::endl;
// }
addElementToVector<Agent*>(agentvect[d],agent);
// agentvect[d].push_back(agent) ;
......@@ -296,7 +307,11 @@ inline void EnvMap::pushAgentInCells(Agent* agent, Dart d)
Dart ddd = map.alpha1(map.alpha1(dd)) ;
while (ddd != dd)
{
addElementToVector<Agent*>(neighborAgentvect[ddd],agent);
if (!map.isBoundaryMarked2(ddd))
{
addElementToVector<Agent*>(neighborAgentvect[ddd],agent);
}
// neighborAgentvect[ddd].push_back(agent) ;
// nbAgentsIncrease(ddd);
ddd = map.alpha1(ddd) ;
......@@ -319,12 +334,25 @@ inline void EnvMap::popAgentInCells(Agent* agent, Dart d)
Dart ddd = map.alpha1(map.alpha1(dd)) ;
while (ddd != dd)
{
removeElementFromVector<Agent*>(neighborAgentvect[ddd], agent) ;
if (!map.isBoundaryMarked2(ddd))
{
removeElementFromVector<Agent*>(neighborAgentvect[ddd], agent) ;
}
// nbAgentsDecrease(ddd) ;
ddd = map.alpha1(ddd) ;
}
dd = map.phi1(dd) ;
} while (dd != d) ;
// TraversorF<PFP::MAP> tF(map);
// for(Dart ddd = tF.begin() ; ddd != tF.end() ; ddd = tF.next())
// {
// if(std::find(agentvect[ddd].begin(), agentvect[ddd].end(), agent) != agentvect[ddd].end())
// std::cout <<agent << " SO WRONG" <<ddd.index<< std::endl;
//
// if(std::find(neighborAgentvect[ddd].begin(), neighborAgentvect[ddd].end(), agent) != neighborAgentvect[ddd].end())
// std::cout <<agent<< " SO SO WRONG " <<ddd.index<< std::endl;
// }
}
......@@ -338,7 +366,7 @@ inline void EnvMap::addObstAsNeighbor (Obstacle * o, const std::vector<Dart>& b
neighbor_cells->clear();
CellMarkerMemo<FACE> memo_mark(map);
CellMarkerMemo<FACE> OneRingMark(map);
memo_mark.unmarkAll();
for (std::vector<Dart>::const_iterator it =belonging_cells.begin();it<belonging_cells.end();++it)
memo_mark.mark(*it);
......@@ -347,8 +375,13 @@ inline void EnvMap::addObstAsNeighbor (Obstacle * o, const std::vector<Dart>& b
Dart first =NIL;
Dart d=NIL;
Dart dd=NIL;
// CGoGNout<<"beg : "<<(*it)<<CGoGNendl;
//boucle pour trouver une face du voisinage de l'obstacle ne contenant pas l'obstacle
/////////////////////////////////////////////boucle pour trouver une face du voisinage de l'obstacle ne contenant pas l'obstacle
// CGoGNout<<"debut neighbors cellules : ";
// for (std::vector<Dart>::const_iterator it =belonging_cells.begin();it<belonging_cells.end();++it)
// CGoGNout<<(*it).index<<" ; ";
// CGoGNout<<CGoGNendl;
do
{
beg = *it;
......@@ -382,16 +415,6 @@ inline void EnvMap::addObstAsNeighbor (Obstacle * o, const std::vector<Dart>& b
}
find_next(o,&d, memo_mark);
if(d==NIL)
{
CGoGNout<<"cellule de début : "<<first<<CGoGNendl;
CGoGNout<<"cellules markées OneRing : "<<CGoGNendl;
std::vector<Dart> v=OneRingMark.get_markedCells();
for(std::vector<Dart>::iterator it=v.begin();it<v.end();++it)
{
CGoGNout<<(*it).index<<CGoGNendl;
}
}
// CGoGNout<<"d : "<<d<<CGoGNendl;
}while(!map.sameFace(d,first));
}
......
......@@ -221,30 +221,30 @@ inline void renderAgent(EnvMap& m, Agent* agent, bool showNeighborDist = false,
//show goals
if (renderPath)
{
glLineWidth(3.0f) ;
glBegin(GL_LINE_STRIP) ;
for (std::vector<VEC3>::iterator it = (agent->goals_.begin()) ; it != agent->goals_.end() ;
++it)
{
glVertex3f((*it)[0], (*it)[1], agent->agentNo) ;
}
glVertex3f((*(agent->goals_.begin()))[0], (*(agent->goals_.begin()))[1], (*(agent->goals_.begin()))[2]) ;
glEnd() ;
glLineWidth(1.0f) ;
glPointSize(5.0f) ;
glBegin(GL_POINTS) ;
VEC3 g = agent->goals_[agent->curGoal_];
glVertex3fv(g.data()) ;
glEnd() ;
glPointSize(1.0f) ;
glBegin(GL_LINES);
VEC3 p = agent->getPosition();
glVertex3fv(p.data()) ;
glVertex3fv(g.data()) ;
glEnd();
// glLineWidth(3.0f) ;
// glBegin(GL_LINE_STRIP) ;
// for (std::vector<VEC3>::iterator it = (agent->goals_.begin()) ; it != agent->goals_.end() ;
// ++it)
// {
// glVertex3f((*it)[0], (*it)[1], agent->agentNo) ;
// }
//
// glVertex3f((*(agent->goals_.begin()))[0], (*(agent->goals_.begin()))[1], (*(agent->goals_.begin()))[2]) ;
// glEnd() ;
// glLineWidth(1.0f) ;
//
// glPointSize(5.0f) ;
// glBegin(GL_POINTS) ;
// VEC3 g = agent->goals_[agent->curGoal_];
// glVertex3fv(g.data()) ;
// glEnd() ;
// glPointSize(1.0f) ;
//
// glBegin(GL_LINES);
// VEC3 p = agent->getPosition();
// glVertex3fv(p.data()) ;
// glVertex3fv(g.data()) ;
// glEnd();
}
if (showNeighborDist)
......
......@@ -16,7 +16,6 @@
#include "shaderCustomTex.h"
#include "Algo/Import/importObjTex.h"
using namespace std;
//#define EXPORTING2
......
......@@ -27,8 +27,8 @@ class MovingMesh;
class MovingObstacle
{
public:
MovingObstacle(Simulator* sim, int index, std::vector<PFP::VEC3> pos, std::vector<VEC3> goals, bool rigid, bool spin, Dart d=NIL, ArticulatedObstacle * art=NULL, int indParent=-1);
MovingObstacle(Simulator* sim, int index, std::vector<PFP::VEC3> pos, std::vector<VEC3> goals, bool rigid, bool spin,int curGoal=0, Dart d=NIL, ArticulatedObstacle * art=NULL, int indParent=-1);
void initGL();
void draw();
......@@ -39,11 +39,10 @@ public:
bool is_inside (VEC3 p);
void computePrefVelocity();
void computeNewVelocity();
std::vector<Dart> getMemoCross(const VEC3& pos, const VEC3& dest, Dart& d1);
std::vector<Dart> getMemoCross(const VEC3& pos, const VEC3& dest, Dart& d1,Dart& d2);
VEC3 getDilatedPosition(unsigned int ind); //vertex position with velocity dilatation
VEC3 getPosition(unsigned int ind); // vertex position
void update();
PFP::REAL computeMVC(PFP::VEC3 p, Dart vertex);
......@@ -55,9 +54,7 @@ public:
unsigned int nbVertices;
CGoGN::Algo::Surface::MovingObjects::ParticleCell2DMemo<PFP> *registering_part;
// std::vector<PFP::VEC3> vertices;
CGoGN::Algo::Surface::MovingObjects::ParticleCell2D<PFP>* * parts_;
PFP::MAP map;
VertexAttribute<VEC3> position;
......@@ -86,8 +83,6 @@ public:
// std::vector<float> verticesAngle;
// float rigidity;
// float gravity_dist;
VEC3 center;
int index;
int max_x_ind;
......@@ -113,7 +108,6 @@ public:
static float neighborDist_;
static float neighborDistSq_;
static float maxSpeed_;
// float obstacle_range;
static float timeHorizonObst_;
float velocity_factor;
float color1;
......@@ -127,10 +121,11 @@ public:
bool rigid_;
bool spinning;
ArticulatedObstacle * parent;
int index_parent;
MovingMesh* mm_;
Agent* ag_;
int index_parent;
VertexAttribute<NoMathIONameAttribute<std::vector<PFP::REAL> > > mvc_;
};
......
......@@ -27,8 +27,8 @@ struct PFP : public PFP_STANDARD
struct PFP2 : public PFP_STANDARD
{
// definition de la carte
// typedef EmbeddedMap2 MAP ;
typedef Algo::Surface::IHM::ImplicitHierarchicalMap MAP ;
typedef EmbeddedMap2 MAP ;
// typedef Algo::Surface::IHM::ImplicitHierarchicalMap MAP ;
} ;
typedef PFP::VEC3 VEC3 ;
......
......@@ -80,7 +80,7 @@ public:
class Simulator
{
public:
Simulator(unsigned int config, unsigned int minSize, unsigned int nbAgent=1000, unsigned int nbObst=20) ;
Simulator(unsigned int config, unsigned int minSize, unsigned int nbAgent=1000, unsigned int nbObst=20, bool resolution =true) ;
~Simulator() ;
......@@ -112,7 +112,6 @@ public:
bool importAgents(std::string filename) ;
bool exportAgents(std::string filename) ;
void swapAgentsGoals() ;
Geom::BoundingBox<VEC3> getAgentsBB() ;
......
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>219</width>
<height>457</height>
<height>684</height>
</rect>
</property>
<property name="windowTitle">
......@@ -112,7 +112,7 @@
</property>
</widget>
</item>
<item>
<item>
<widget class="QCheckBox" name="check_drawObstPath">
<property name="text">
<string>draw obst path</string>
......@@ -149,6 +149,16 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkAgent">
<property name="text">
<string>Agents n°</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="AgentSelect"/>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
......
......@@ -64,7 +64,7 @@ class SocialAgents : public Utils::QT::SimpleQT
Q_OBJECT
public:
SocialAgents(unsigned int config, unsigned int minSize, unsigned int nbAgent , unsigned int nbObst , unsigned int iterations) ;
SocialAgents(unsigned int config, unsigned int minSize, unsigned int nbAgent , unsigned int nbObst ,bool resolution, unsigned int iterations) ;
void initGUI() ;
......@@ -89,8 +89,6 @@ public:
void cb_keyPress(int keycode) ;
//RENDERING
// Utils::Drawer * dCD;
Geom::Vec4f colDif ;
Geom::Vec4f colSpec ;
Geom::Vec4f colClear ;
......@@ -116,6 +114,7 @@ public:
Utils::ShaderFlat* m_flatShader_scenary;
#endif
#ifdef EXPORTING_OBJ
PFP2::MAP mapAgent;
VertexAttribute<VEC3> positionAgent;
......@@ -131,7 +130,6 @@ public:
Algo::Surface::Import::OBJModel<PFP2> m_objAgent;
unsigned int m_nbIndicesAgent;
#endif
//agents
Utils::VBO* m_agentsVBO;
Utils::PointSprite* m_sprite;
......@@ -189,7 +187,7 @@ public:
bool render_anim ;
int visu ;
Utils::Drawer* m_ds;
bool drawEnvLines ;
bool drawEnvFaces ;
bool drawEnvTopo ;
......@@ -203,9 +201,11 @@ public:
bool drawObstPredictionTri ;
bool drawObstPath ;
bool draw_dart;
bool target_Agent;
bool draw_posX;
bool draw_elipse;
unsigned int dartSlider;
unsigned int agentSlider;
int posXSlider;
int posYSlider;
......@@ -352,4 +352,14 @@ public slots:
draw_elipse = b;
updateGL();
}
void slot_Agent(bool b)
{
target_Agent = b ;
updateGL() ;
}
void slot_AgentSlider(int i)
{
agentSlider = i ;
updateGL() ;
}
} ;
......@@ -69,6 +69,7 @@ Agent::Agent(Simulator* sim, const VEC3& start, const VEC3& goal) :
void Agent::init(const VEC3& start, const VEC3& goal)
{
//#ifdef EXPORTING_OBJ
// std::vector<std::string> attrNames ;
// m_obj.import("./meshRessources/Mexicainlowres2.obj",attrNames);
......@@ -95,9 +96,17 @@ void Agent::init(const VEC3& start, const VEC3& goal)
goals_.push_back(start) ;
float ratio = (80.0f + rand() % 20) / 100.0f ;
maxSpeed_ = averageMaxSpeed_ * ratio ; // from 80% to 100% of averageMaxSpeed_
color1 = 1.0f * ratio ; // red = high speed agents
color2 = 1.0f * 5 * (1 - ratio) ; // green = low speed agents
color3 = 0 ;
// color1 = 1.0f * ratio ; // red = high speed agents
// color2 = 1.0f * 5 * (1 - ratio) ; // green = low speed agents
// color3 = 0 ;
color1 = 1.0f ; // red = high speed agents
color2 = 0.0f; // green = low speed agents
color3 = 0.0f ;
// if (agentNo==0)
// {
// color1=0;
// color2 = 1.0f;
// }
for (unsigned int i=0 ; i<4 ; ++i) meanVelocity_[i].set(0) ;
agentNeighbors_.reserve(maxNeighbors_ * 2) ;
obstacleNeighbors_.reserve(maxNeighbors_ * 2) ;
......@@ -105,6 +114,7 @@ void Agent::init(const VEC3& start, const VEC3& goal)
movingObstacles_ = new MovingObstacle* [maxMovingObstacles_];
nb_mos=0;
agentNo = cptAgent++ ;
// CGoGNout<<this<<" = agent n°"<<agentNo<<CGoGNendl;
}
void Agent::initGL()
......@@ -202,6 +212,8 @@ void Agent::draw()
//-----------------------------------------------------------------
//-----------------------------------------------------------------
VEC3 Agent::getPosition()
{
#ifdef SPATIAL_HASHING
......@@ -342,7 +354,7 @@ void Agent::updateObstacleNeighbors()
if ((movingObstacleNeighbors_.size() < maxMovingObstacles_ || distSq < maxDistMovingObst)
&& distSq < rangeSq_)
{
if (Geom::testOrientation2D(part_.getPosition(), (*it)->p1, (*it)->p2) == Geom::RIGHT)
// if (Geom::testOrientation2D(part_.getPosition(), (*it)->p1, (*it)->p2) == Geom::RIGHT)
{
if (distSq > maxDistMovingObst)
......@@ -380,7 +392,7 @@ void Agent::updateObstacleNeighbors()
if ((movingObstacleNeighbors_.size() < maxNeighbors_ || distSq < maxDistMovingObst)
&&distSq < rangeSq_)
{
if (Geom::testOrientation2D(part_.getPosition(), (*it)->p1, (*it)->p2) == Geom::RIGHT)
// if (Geom::testOrientation2D(part_.getPosition(), (*it)->p1, (*it)->p2) == Geom::RIGHT)
{
if (distSq > maxDistMovingObst) maxDistMovingObst = distSq ;
......@@ -392,6 +404,17 @@ void Agent::updateObstacleNeighbors()
}
}
// if (obstacleNeighbors_.size() > maxNeighbors_)
// {
// sim_->nbSorts++ ;
// std::sort(obstacleNeighbors_.begin(), obstacleNeighbors_.end(), obstacleSort) ;
// }
// if (movingObstacleNeighbors_.size() > maxNeighbors_)
// {
// sim_->nbSorts++ ;
// std::sort(movingObstacleNeighbors_.begin(), movingObstacleNeighbors_.end(), obstacleSort) ;
// }
// if (obstacleNeighbors_.size() > maxNeighbors_)
// {
// sim_->nbSorts++ ;
......@@ -472,6 +495,7 @@ void Agent::update()
VEC3 axisRot = base ^ dir ;
int sign = axisRot[2] > 0 ? 1 : -1 ;
//57,2957795 : conversion from radian to degree
float myRot = acos(-dir[1]);
const VEC3 displ = getPosition();
......@@ -487,7 +511,6 @@ void Agent::update()
Geom::rotateZ(myRot,m_transfo);
Geom::translate(displ[0],displ[1],displ[2],m_transfo);
m_transfo.transpose();
previousPos = getPosition();
previousRot = myRot;
......@@ -636,7 +659,7 @@ void Agent::computePrefVelocity()
// Si l'agent arrive à proximité de l'objectif,
// alors il passe à l'objectif suivant
if (goalDist2 < 100*radius_*radius_)
if (goalDist2 < radius_*radius_*100.0f)
{
curGoal_ = (curGoal_ + 1) % goals_.size() ;
goalVector = goals_[curGoal_] - getPosition() ;
......@@ -692,7 +715,6 @@ static int moAppend(MovingObstacle **moving_obstacles, int nb_mos, int max, Movi
//-----------------------------------------------------------------
//-----------------------------------------------------------------
// Search for the best new velocity.
void Agent::computeNewVelocity()
{
// The objective is to compute the sum of forces exerted on the agent.
......@@ -712,7 +734,6 @@ void Agent::computeNewVelocity()
// double ag_mass = average_mass*(1 + rand*mass_var); // valeurs uniformement réparties entre min et max
double ag_mass = 50.0;
/*
rand = 2.0*drand48()-1.0; // compris entre -1 et 1
radius_ = average_radius + rand*radius_var; // valeurs uniformement réparties entre min et max
......@@ -930,30 +951,29 @@ void Agent::computeNewVelocity()
newVelocity_ = velocity_tmp;
//------- color depending on velocity -------------------------------
double vmax = 0.5*maxSpeed_;
VEC3 min_vx_color(1.0,0.0,0.0); // agents going towards the positive xs are red
VEC3 max_vx_color(0.0,0.1,0.1); // agents going towards the negative xs are cyan
VEC3 min_vy_color(0.0,1.0,0.0);
VEC3 max_vy_color(1.0,0.0,1.1);
double alpha_x = (newVelocity_[0]+vmax) / (2*vmax);
double alpha_y = (newVelocity_[1]+vmax) / (2*vmax);
double tmp_color1 =
abs(alpha_x-0.5)*(alpha_x * max_vx_color[0] + (1-alpha_x)*min_vx_color[0]) +
abs(alpha_y-0.5)*(alpha_y * max_vy_color[0] + (1-alpha_y)*min_vy_color[0]);
double tmp_color2 =
abs(alpha_x-0.5)*(alpha_x * max_vx_color[1] + (1-alpha_x)*min_vx_color[1]) +
abs(alpha_y-0.5)*(alpha_y * max_vy_color[1] + (1-alpha_y)*min_vy_color[1]);
double tmp_color3 =
abs(alpha_x-0.5)*(alpha_x * max_vx_color[2] + (1-alpha_x)*min_vx_color[2]) +
abs(alpha_y-0.5)*(alpha_y * max_vy_color[2] + (1-alpha_y)*min_vy_color[2]);
float blend = 0.1;
color1 = blend*tmp_color1 + (1-blend)*color1;
color2 = blend*tmp_color2 + (1-blend)*color2;
color3 = blend*tmp_color3 + (1-blend)*color3;
// double vmax = 0.5*maxSpeed_;
// VEC3 min_vx_color(1.0,0.0,0.0); // agents going towards the positive xs are red
// VEC3 max_vx_color(0.0,0.1,0.1); // agents going towards the negative xs are cyan
// VEC3 min_vy_color(0.0,1.0,0.0);
// VEC3 max_vy_color(1.0,0.0,1.1);
//
// double alpha_x = (newVelocity_[0]+vmax) / (2*vmax);
// double alpha_y = (newVelocity_[1]+vmax) / (2*vmax);
//
// double tmp_color1 =
// abs(alpha_x-0.5)*(alpha_x * max_vx_color[0] + (1-alpha_x)*min_vx_color[0]) +
// abs(alpha_y-0.5)*(alpha_y * max_vy_color[0] + (1-alpha_y)*min_vy_color[0]);
// double tmp_color2 =
// abs(alpha_x-0.5)*(alpha_x * max_vx_color[1] + (1-alpha_x)*min_vx_color[1]) +
// abs(alpha_y-0.5)*(alpha_y * max_vy_color[1] + (1-alpha_y)*min_vy_color[1]);
// double tmp_color3 =
// abs(alpha_x-0.5)*(alpha_x * max_vx_color[2] + (1-alpha_x)*min_vx_color[2]) +
// abs(alpha_y-0.5)*(alpha_y * max_vy_color[2] + (1-alpha_y)*min_vy_color[2]);
//
// float blend = 0.1;
// color1 = blend*tmp_color1 + (1-blend)*color1;
// color2 = blend*tmp_color2 + (1-blend)*color2;
// color3 = blend*tmp_color3 + (1-blend)*color3;
}
//-----------------------------------------------------------------
......
......@@ -4,13 +4,13 @@ ArticulatedObstacle::ArticulatedObstacle(Simulator* sim, int index, int currentI
{
this->index=index;
nbBodyPart = size;
MovingObstacle * mo4= new MovingObstacle(sim,currentIndex+1 ,pos[0],goals,true,this,0);
MovingObstacle * mo4= new MovingObstacle(sim,currentIndex+1 ,pos[0],goals,true,true,1, NIL,this,0);
members.push_back(mo4);
for(int i =1; i<nbBodyPart; i++)
{
std::vector<VEC3> goal;
goal.push_back(members[i-1]->center);
MovingObstacle * mo4= new MovingObstacle(sim,currentIndex+1+i ,pos[i],goal, true, true, NIL, this,i);
MovingObstacle * mo4= new MovingObstacle(sim,currentIndex+1+i ,pos[i],goal, true, true,0, NIL, this,i);
members.push_back(mo4);
}
......
......@@ -791,11 +791,15 @@ void EnvMap::pushObstacleInCells(Obstacle * o)// réenregistre l'obstacle en que
{
int n = o->index;
VEC3 p1 = o->p1;
VEC3 p2 = o->p2;
Dart d1=NIL;
Dart d2=NIL;
std::vector<Dart> memo;
memo = mo->getMemoCross(o->p1,o->p2,d1);
d2=mo->registering_part->d;
d1=mo->parts_[n]->d;
memo = mo->getMemoCross(p1,p2,d1,d2);
if(map.sameFace(d1,d2))
{
......@@ -803,6 +807,7 @@ void EnvMap::pushObstacleInCells(Obstacle * o)// réenregistre l'obstacle en que
}
else
{
pushObstacleInCells(o, n, memo);
}
}
......@@ -811,18 +816,19 @@ void EnvMap::pushObstacleInCells(Obstacle * o)// réenregistre l'obstacle en que
Dart EnvMap::popAndPushObstacleInCells(Obstacle* o, int n)// maj de l'enregistrement
{
MovingObstacle * mo = o->mo;
VEC3 p1 = o->p1;
VEC3 p2 = o->p2;
Dart d1=NIL;
Dart d2=NIL;
std::vector<Dart> memo;
d1=mo->parts_[n]->d;
// bool modif=false;
// if(p1->crossCell != CGoGN::Algo::MovingObjects::NO_CROSS
// || p2->crossCell != CGoGN::Algo::MovingObjects::NO_CROSS)
// {
memo = mo->getMemoCross(o->p1,o->p2,d1);
d2=mo->registering_part->d;
memo = mo->getMemoCross(p1,p2,d1,d2);
// memo.sort();
// modif=true;
// }
......@@ -859,9 +865,9 @@ void EnvMap::pushObstacleInOneRingCells(Obstacle * o, Dart d, int n)
addElementToVector<Obstacle*>(obstvect[d],o);
mo->belonging_cells[n].clear();
// mo->belonging_cells[n].clear();
mo->belonging_cells[n].push_back(d);
mo->neighbor_cells[n].clear();
// mo->neighbor_cells[n].clear();
Dart dd = d;