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 48784bb5 authored by Jund Thomas's avatar Jund Thomas
Browse files

ajout visu pour bug particle

parent 2f6b2047
......@@ -84,6 +84,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="check_drawObstPredictionTri">
<property name="text">
<string>draw obstacles prediction tri</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="check_drawAgentsNeighborDist">
<property name="text">
......
......@@ -95,6 +95,7 @@ public:
bool drawAgentsNeighborDist ;
bool drawAgentsObstacleDist ;
bool drawAgentsPredictionTri ;
bool drawObstPredictionTri ;
bool draw_dart;
unsigned int dartSlider;
......@@ -135,6 +136,11 @@ public slots:
drawAgentsPredictionTri = b ;
updateGL() ;
}
void slot_drawObstPredictionTri(bool b)
{
drawObstPredictionTri = b ;
updateGL() ;
}
void slot_drawAgentsNeighborDist(bool b)
{
drawAgentsNeighborDist = b ;
......
......@@ -243,6 +243,7 @@ void MovingObstacle::computePrefVelocity()
// TODO Check position
void MovingObstacle::update()
{
assert(sim_->envMap_.map.getCurrentLevel() == sim_->envMap_.map.getMaxLevel()) ;
// general_belonging.clear();
PFP::VEC3 bary = 0;
......
......@@ -35,7 +35,7 @@ void Simulator::init(unsigned int config, int minSize, float dimension, bool ena
setupCircleScenario(100) ;
break ;
case 1 :
setupCorridorScenario(500, 25) ;
setupCorridorScenario(500, 2) ;
break ;
case 2 :
setupScenario(1000) ;
......
......@@ -42,6 +42,7 @@ SocialAgents::SocialAgents(int minSize, int iterations) :
drawAgentsNeighborDist(false),
drawAgentsObstacleDist(false),
drawAgentsPredictionTri(false),
drawObstPredictionTri(false),
draw_dart(false)
{
timer = new QTimer(this) ;
......@@ -70,6 +71,7 @@ void SocialAgents::initGUI()
setCallBack(dock.check_drawMovingObstacles, SIGNAL(toggled(bool)), SLOT(slot_drawMovingObstacles(bool))) ;
setCallBack(dock.check_drawAgents, SIGNAL(toggled(bool)), SLOT(slot_drawAgents(bool))) ;
setCallBack(dock.check_drawAgentsPredictionTri, SIGNAL(toggled(bool)), SLOT(slot_drawAgentsPredictionTri(bool))) ;
setCallBack(dock.check_drawObstPredictionTri, SIGNAL(toggled(bool)), SLOT(slot_drawObstPredictionTri(bool))) ;
setCallBack(dock.check_drawAgentsNeighborDist, SIGNAL(toggled(bool)), SLOT(slot_drawAgentsNeighborDist(bool))) ;
setCallBack(dock.check_drawAgentsObstacleDist, SIGNAL(toggled(bool)), SLOT(slot_drawAgentsObstacleDist(bool))) ;
setCallBack(dock.check_dart, SIGNAL(toggled(bool)), SLOT(slot_dart(bool))) ;
......@@ -306,6 +308,25 @@ void SocialAgents::cb_redraw()
renderPredictionTriangle(sim.envMap_, (*it)->part_.d, (*it)->getPosition()) ;
}
}
if (drawObstPredictionTri)
{
for (std::vector<MovingObstacle*>::iterator it = sim.movingObstacles_.begin() ; it != sim.movingObstacles_.end() ; ++it)
{
for(unsigned int i = 0 ; i < (*it)->nbVertices ; ++i)
{
CGoGN::Algo::MovingObjects::ParticleCell2D<PFP> p = *(*it)->parts_[i];
glColor3f(p.getState() / 3.0f, p.getState() % 2, p.getState()) ;
glLineWidth(1.0f) ;
renderPredictionTriangle(sim.envMap_, p.d, p.getPosition()) ;
if(p.getState()==VERTEX)
glBegin(GL_POINTS);
glVertex3fv(p.getPosition().data());
glEnd();
}
}
}
#endif
//draw the environment
......
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