Commit 300f655d authored by Thomas Pitiot 's avatar Thomas Pitiot

clean debug

parent 289da2a2
......@@ -2,7 +2,7 @@
#define ENV_MAP_H
//#define DEBUG_affichage
#define DEBUG_affichage
//#define DEBUG
#include <iostream>
......
......@@ -23,7 +23,7 @@ EnvMap::EnvMap()
void EnvMap::init(int argc, char **argv)
{
maxCellRay = 1.0f;
maxCellRay = 2.0f;
mapMinX=0;
mapMaxX=0;
mapMinY=0;
......@@ -427,7 +427,7 @@ void EnvMap::FirstRegistrationTriangle(Triangle * o)// réenregistre l'Triangle
if (mo != NULL)
{
#ifdef DEBUG_affichage
CGoGNout<<"First Registration Triangle "<<o->d<<CGoGNendl;
CGoGNout<<"First Registration Triangle "<<o->cell<<CGoGNendl;
#endif
CellMarkerMemo<MAP, VOLUME> inside(map);
CellMarkerMemo<MAP, VOLUME> neighbor(map);
......@@ -501,7 +501,7 @@ void EnvMap::markNeighbors(CellMarkerMemo<MAP,VOLUME> * memo_mark, CellMarkerMem
void EnvMap::popAndPushTriangle(Triangle* o)// maj de l'enregistrement
{
#ifdef DEBUG_affichage
CGoGNout<<"pop&push arete "<<o->index<<CGoGNendl;
CGoGNout<<"pop&push arete "<<o->indexTri<<CGoGNendl;
#endif
popTriangle(o);
FirstRegistrationTriangle(o);
......@@ -776,7 +776,7 @@ bool EnvMap::subdivideVolume(Dart dglobal, bool OneLevelDifference)
std::chrono::duration<double> duration_triangle= (endPushTriangle - startPush);
std::chrono::duration<double> duration_segment= (endPush - endPushSegmentNeighbors);
std::chrono::duration<double> duration_segmentNeighbor= (endPushSegmentNeighbors - endPushTriangle);
if(duration_triangle.count()>0.035)std::cout << "push triangle duration : " << duration_triangle.count() << "s\n";
if(duration_triangle.count()>0.035)std::cout << "push triangle duration : " << duration_triangle.count() << "s\n";
if(duration_push.count()>0.035)std::cout << "push duration : " << duration_push.count() << "\n dont pour les segments présents : "<<duration_segment.count() <<"s\n et pour les voisins :"<<duration_segmentNeighbor.count() <<"s\n";
......@@ -807,25 +807,25 @@ void EnvMap::resetPartSubdiv(Segment* o)
mo->getParticule(o->indexPart1)->CGoGN::Algo::MovingObjects::ParticleBase<PFP>::move(Algo::Surface::Geometry::volumeCentroid<PFP,VertexAttribute<VEC3,MAP>>(map,d1,position)) ;
mo->getParticule(o->indexPart1)->reset_positionFace();
#ifdef DEBUG_affichage
CGoGNout<<"part1 moved to centroid ,d : "<< mo->getParticule(o->indexPart1]->getPosition()<<" || "<<mo->parts_[o->indexPart1)->getCell()<<CGoGNendl;
CGoGNout<<"part1 moved to centroid ,d : "<< mo->getParticule(o->indexPart1)->getPosition()<<" || "<<mo->parts_[o->indexPart1]->getCell()<<CGoGNendl;
#endif
mo->getParticule(o->indexPart1)->setState(VOLUME) ;
mo->getParticule(o->indexPart1)->move(pos) ;
#ifdef DEBUG_affichage
CGoGNout<<"part1 moved in the end (destination, arrivée,d) : "<<pos<<" || "<< mo->getParticule(o->indexPart1]->getPosition()<<" || "<<mo->parts_[o->indexPart1)->getCell()<<CGoGNendl;
CGoGNout<<"part1 moved in the end (destination, arrivée,d) : "<<pos<<" || "<< mo->getParticule(o->indexPart1)->getPosition()<<" || "<<mo->parts_[o->indexPart1]->getCell()<<CGoGNendl;
#endif
mo->getParticule(o->indexPart2)->CGoGN::Algo::MovingObjects::ParticleBase<PFP>::move(Algo::Surface::Geometry::volumeCentroid<PFP,VertexAttribute<VEC3,MAP>>(map,d2,position)) ;
mo->getParticule(o->indexPart2)->reset_positionFace();
#ifdef DEBUG_affichage
CGoGNout<<"part2 moved to centroid ,d : "<< mo->getParticule(o->indexPart2]->getPosition()<<" || "<<mo->parts_[o->indexPart2)->getCell()<<CGoGNendl;
CGoGNout<<"part2 moved to centroid ,d : "<< mo->getParticule(o->indexPart2)->getPosition()<<" || "<<mo->parts_[o->indexPart2]->getCell()<<CGoGNendl;
#endif
mo->getParticule(o->indexPart2)->setState(VOLUME) ;
mo->getParticule(o->indexPart2)->move(pos2) ;
#ifdef DEBUG_affichage
CGoGNout<<"part2 moved in the end (destination, arrivée,d) : "<<pos2<<" || "<< mo->getParticule(o->indexPart2]->getPosition()<<" || "<<mo->parts_[o->indexPart2)->getCell()<<CGoGNendl;
CGoGNout<<"part2 moved in the end (destination, arrivée,d) : "<<pos2<<" || "<< mo->getParticule(o->indexPart2)->getPosition()<<" || "<<mo->parts_[o->indexPart2]->getCell()<<CGoGNendl;
#endif
}
......@@ -855,46 +855,46 @@ void EnvMap::resetPartSubdiv(Triangle * o)
Dart d3 = p3->getCell();
#ifdef DEBUG_affichage
CGoGNout<<"Reset part subdiv (index articul , segment ,ind1, pos1, d1, ind2, pos2, d2) : "<<mo->index_articulated<<" || "<<o->index<<" || "<<o->indexPart1<<" || "<<pos<<" || "<<d1<<" || "<<o->indexPart2<<" || "<<pos2<<" || "<<d2<<CGoGNendl;
CGoGNout<<"Faces centroids : "<<Algo::Surface::Geometry::volumeCentroid<PFP,VertexAttribute<VEC3,MAP>>(map,d1,position)<<" || "<<Algo::Surface::Geometry::volumeCentroid<PFP,VertexAttribute<VEC3,MAP>>(map,d2,position)<<CGoGNendl;
CGoGNout<<"Reset part subdiv (index triangle, pos1, d1, pos2, d2, pos3, d3) : "<<o->indexTri<<" || "<<pos<<" || "<<d1<<" || "<<pos2<<" || "<<d2<<" || "<<pos3<<" || "<<d3<<CGoGNendl;
CGoGNout<<"Faces centroids : "<<Algo::Surface::Geometry::volumeCentroid<PFP,VertexAttribute<VEC3,MAP>>(map,d1,position)<<" || "<<Algo::Surface::Geometry::volumeCentroid<PFP,VertexAttribute<VEC3,MAP>>(map,d2,position)<<" || "<<Algo::Surface::Geometry::volumeCentroid<PFP,VertexAttribute<VEC3,MAP>>(map,d3,position)<<CGoGNendl;
#endif
p->CGoGN::Algo::MovingObjects::ParticleBase<PFP>::move(Algo::Surface::Geometry::volumeCentroid<PFP,VertexAttribute<VEC3,MAP>>(map,d1,position)) ;
p->reset_positionFace(); // attention avec les particules 3D on doit mettre a jour la position_face !!!
#ifdef DEBUG_affichage
CGoGNout<<"part1 moved to centroid ,d : "<< p->getPosition()<<" || "<<p->d<<CGoGNendl;
CGoGNout<<"on a reset face part1 moved to centroid ,d : "<< p->getPosition()<<" || "<<p->getCell()<<CGoGNendl;
#endif
p->setState(VOLUME) ;
p->move(pos) ;
#ifdef DEBUG_affichage
CGoGNout<<"part1 moved in the end (destination, arrivée,d) : "<<pos<<" || "<< p->getPosition()<<" || "<<p->d<<CGoGNendl;
CGoGNout<<"part1 moved in the end (destination, arrivée,d) : "<<pos<<" || "<< p->getPosition()<<" || "<<p->getCell()<<CGoGNendl;
#endif
p2->CGoGN::Algo::MovingObjects::ParticleBase<PFP>::move(Algo::Surface::Geometry::volumeCentroid<PFP,VertexAttribute<VEC3,MAP>>(map,d2,position)) ;
p2->reset_positionFace();
#ifdef DEBUG_affichage
CGoGNout<<"part2 moved to centroid ,d : "<< p2->getPosition()<<" || "<<p2->d<<CGoGNendl;
CGoGNout<<"on a reset face part2 moved to centroid ,d : "<< p2->getPosition()<<" || "<<p2->getCell()<<CGoGNendl;
#endif
p2->setState(VOLUME) ;
p2->move(pos2) ;
#ifdef DEBUG_affichage
CGoGNout<<"part2 moved in the end (destination, arrivée,d) : "<<pos2<<" || "<< p2->getPosition()<<" || "<<p2->d<<CGoGNendl;
CGoGNout<<"part2 moved in the end (destination, arrivée,d) : "<<pos2<<" || "<< p2->getPosition()<<" || "<<p2->getCell()<<CGoGNendl;
#endif
p3->CGoGN::Algo::MovingObjects::ParticleBase<PFP>::move(Algo::Surface::Geometry::volumeCentroid<PFP,VertexAttribute<VEC3,MAP>>(map,d3,position)) ;
p3->reset_positionFace();
#ifdef DEBUG_affichage
CGoGNout<<"part3 moved to centroid ,d : "<< p3->getPosition()<<" || "<<p3->d<<CGoGNendl;
CGoGNout<<"on a reset face part3 moved to centroid ,d : "<< p3->getPosition()<<" || "<<p3->getCell()<<CGoGNendl;
#endif
p3->setState(VOLUME) ;
p3->move(pos3) ;
#ifdef DEBUG_affichage
CGoGNout<<"part3 moved in the end (destination, arrivée,d) : "<<pos3<<" || "<< p3->getPosition()<<" || "<<p3->d<<CGoGNendl;
CGoGNout<<"part3 moved in the end (destination, arrivée,d) : "<<pos3<<" || "<< p3->getPosition()<<" || "<<p3->getCell()<<CGoGNendl;
#endif
}
......
......@@ -120,33 +120,13 @@ void Needle::createEdge(int index)
if(index>0)
{
(Segments_[index-1])->indexPart2=index+1;
#ifdef DEBUG_affichage
CGoGNout << "segment modifié : "<<index-1<<" nouvelle particule : "<< index+1 << CGoGNendl;
CGoGNout << "etat particules : "<< CGoGNendl;
for(auto particule : parts_)
{
CGoGNout << "particule (position, dart) : "<<particule->getPosition()<<" || "<< particule->d<< CGoGNendl;
}
CGoGNout << "etat segments : "<< CGoGNendl;
for(auto s : Segments_)
{
CGoGNout << "segment (p1,p2,part1,part2, index) : "<<s->p1<<" || "<<s->p2<<" || "<<s->indexPart1<<" || "<<s->indexPart2<<" || "<<s->index << CGoGNendl;
}
#endif
}
nbEdges++;
nbVertices++;
#ifdef DEBUG_affichage
CGoGNout << "Nouvel edge (p1,p2,part1,part2) : "<<o->p1<<" || "<<o->p2<<" || "<<o->indexPart1<<" || "<<o->indexPart2 << CGoGNendl;
#endif
}
......@@ -181,17 +161,6 @@ void Needle::move(VEC3 diff)
{
createEdge(nbEdges);
#ifdef DEBUG_affichage
CGoGNout<<" init Segment :"<< nbEdges ;
CGoGNout<<" || nb_segments :"<< Segments_.size() <<CGoGNendl;
CGoGNout<<CGoGNendl;
CGoGNout<<CGoGNendl;
for(unsigned int i =0;i<nbEdges;i++)
{
CGoGNout<<" Segment n° "<< i <<" enregistré dans "<< belonging_cells[i].size()<< " volumes." <<CGoGNendl;
}
#endif
}
}
......@@ -208,12 +177,6 @@ void Needle::updateRegistration()
(sim_->envMap_.map.sameVolume(d1,d2))
&& (getParticule(o->indexPart1)->crossCell==CGoGN::Algo::Volume::MovingObjects::NO_CROSS && getParticule(o->indexPart2)->crossCell==CGoGN::Algo::Volume::MovingObjects::NO_CROSS)))
{
#ifdef DEBUG_affichage
CGoGNout<<"update registration "<<CGoGNendl<<CGoGNendl;
CGoGNout << "p1 : "<<o->p1<<" || "<<d1 << CGoGNendl;
CGoGNout << "p2 : "<<o->p2<<" || "<<d2 << CGoGNendl;
CGoGNout<<CGoGNendl<<" fin update registration "<<CGoGNendl<<CGoGNendl;
#endif
sim_->envMap_.popAndPushSegment(o);
}
......
......@@ -42,7 +42,7 @@ void Simulator::doStep()
void Simulator::initSurfaces()
{
Surface * obj = new Surface(this,VEC3(-1.0f,-1.5f,0.69f));
Surface * obj = new Surface(this,VEC3(-1.0f,-1.5f,0.0f));
CGoGNout<<"surface initialisée : "<<obj->index_surface<<CGoGNendl;
}
......
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