Commit 26ed1ddb authored by Thomas Pitiot 's avatar Thomas Pitiot

réparé détection de sortie du maillage

parent 2a8274e6
......@@ -5,15 +5,15 @@
<backgroundColor red="51" blue="51" green="51"/>
</State>
<Display axisIsDrawn="false" gridIsDrawn="false" FPSIsDisplayed="false" cameraIsEdited="false"/>
<Geometry fullScreen="false" width="1200" posX="0" height="701" posY="0"/>
<Geometry fullScreen="false" width="1200" posX="-83" height="701" posY="533"/>
<Camera>
<Parameters fieldOfView="0.785398" sceneRadius="8.66025" Type="PERSPECTIVE" zNearCoefficient="0.005" orthoCoef="0.414214" zClippingCoefficient="1.73205">
<SceneCenter x="0" y="0" z="0"/>
</Parameters>
<Stereo focusDistance="20.9077" physScreenWidth="0.5" IODist="0.062"/>
<ManipulatedCameraFrame>
<position x="0" y="0" z="22.6303"/>
<orientation q0="0" q1="0" q2="0" q3="1"/>
<position x="4.74424" y="-4.86234" z="1.60241"/>
<orientation q0="0.118155" q1="0.590838" q2="0.182477" q3="0.77695"/>
<ManipulatedParameters transSens="1" zoomSens="1" rotSens="1" wheelSens="1" spinSens="0.3"/>
<ManipulatedCameraParameters zoomsOnPivotPoint="false" flySpeed="0.0866025" rotatesAroundUpVector="false">
<sceneUpVector x="0" y="1" z="0"/>
......
......@@ -36,7 +36,18 @@ public :
{
return parts_[index];
}
inline const int& getNeedForSubd(int index) const
{
return partNeedReset[index];
}
inline const int& getNeedForSubd(int index)
{
return partNeedReset[index];
}
inline void setNeedForSubd(int index, int b)
{
partNeedReset[index]=b;
}
const Segment* getSegment(int index) const
{
return Segments_[index];
......@@ -53,13 +64,14 @@ public :
bool removeGeneralCell (Dart d);
void addGeneralNeighbor ( Dart d);
bool removeGeneralNeighbor (Dart d);
void needResetSegment(Segment * o);
unsigned int nbVertices;
unsigned int nbEdges;
std::vector<Particule*> parts_ ;
std::vector<int>partNeedReset;
std::vector<Segment *> Segments_;
std::vector< std::vector<Dart> > belonging_cells;
......@@ -78,7 +90,7 @@ public :
float distanceColorationMaxi;
};
//void resetPart(Segment * o, Dart d1);
......
......@@ -49,6 +49,7 @@ public:
EnvMap() ;
void init(int argc, char **argv) ;
bool checkPointInMap(VEC3 pos,Dart neighborhood);
bool checkPointInCube(VEC3 pos);
bool insideVolume(VEC3 pos, Dart d);
REAL volumeMaxdistance(Vol volume);
VEC3 normaleFromVolume(Dart volume,Dart face);
......@@ -64,10 +65,6 @@ public:
Dart getBelongingCell(const PFP::VEC3& pos);
//
// void resetAgentInFace(Agent* agent) ;
PFP::MAP map ;
VertexAttribute<VEC3, MAP> position ;
......@@ -95,7 +92,7 @@ public:
void pushSegmentInCellAsNeighbor(Segment* o, Dart d);
void popSegmentInCellAsNeighbor(Segment* o, Dart d);
void resetPartSubdiv(Segment* o, int vLevelOld);
void resetPartSubdiv(Segment* o);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Enregistrement Surfaces
......@@ -108,19 +105,11 @@ public:
void popTriangleInCell(Triangle* o, Dart d);
void pushTriangleInCellAsNeighbor(Triangle* cell, Dart d);
void popTriangleInCellAsNeighbor(Triangle* cell, Dart d);
void resetPartSubdiv(Triangle* cell, int vLevelOld);
void resetPartSubdiv(Triangle* cell);
} ;
//void update_registration(Segment * o);
//void register_pop(Segment* o, int n);
//void resetPartSubdiv(Segment* o);
//void resetObstPartInFace(Segment* o, Dart d, unsigned int fLevel);// empeche de viser une dart ayant disparu
//void resetObstPartInFace(Segment* o, Dart d);// empeche de viser une dart ayant disparu
//void resetPart(Segment * mo, Dart d); // empeche de viser une dart ayant disparu pour les voisins
/**************************************
* INLINE FUNCTIONS *
**************************************/
......
......@@ -120,100 +120,14 @@ bool ArticulatedObject::removeGeneralNeighbor (Dart d)
return false;
}
void ArticulatedObject::needResetSegment(Segment * o)
{
partNeedReset[o->indexPart1]=1;
partNeedReset[o->indexPart2]=1;
//-------------------------------------------------------------------------
//////// a implémenter
//void resetPartSubdiv(Segment* o)
//{
// ArticulatedObject * mo = o->mo;
//
// if (mo != NULL)
// {
// unsigned int n =o->index;
// /// ajout Segments lointains
// unsigned int n2;
// switch (n-(mo->nbVertices))
// {
// case 0 : n2=n+1; break;
// case 1 : n2=n-1;break;
// default : n2 =(n+1)%(mo->nbVertices); break;
// }
// ////////
// VEC3 pos = mo->getParticule(n)->getPosition();
// VEC3 pos2 = mo->getParticule(n2)->getPosition();
// mo->getParticule(n]->CGoGN::Algo::MovingObjects::ParticleBase<PFP>::move(Algo::Volume::Geometry::faceCentroid<PFP>(mo->sim_->envMap_.map, mo->parts_[n)->getCell(), mo->sim_->envMap_.position)) ;
//
// mo->getParticule(n)->setState(VOLUME) ;
// mo->getParticule(n)->move(pos) ;
//
// mo->getParticule(n2]->CGoGN::Algo::MovingObjects::ParticleBase<PFP>::move(Algo::Volume::Geometry::faceCentroid<PFP>(mo->sim_->envMap_.map, mo->parts_[n2)->getCell(), mo->sim_->envMap_.position)) ;
//
// mo->getParticule(n2)->setState(VOLUME) ;
// mo->getParticule(n2)->move(pos2) ;
//
// mo->dDir = mo->getParticule(0)->getCell();
// }
//}
//
//void resetObstPartInFace(Segment* o, Dart d1)
//{
// ArticulatedObject * mo = o->mo;
//
// if (mo != NULL)
// {
// unsigned int n =o->index;
// /// ajout Segments lointains
// unsigned int n2;
// switch (n-(mo->nbVertices))
// {
// case 0 : n2=n+1; break;
// case 1 : n2=n-1;break;
// default : n2 =(n+1)%(mo->nbVertices); break;
// }
// ////////
// VEC3 pos1 = mo->getParticule(n)->getPosition();
// VEC3 pos2 = mo->getParticule(n2)->getPosition();
//// if (Algo::Volume::Geometry::isPointInConvexFace2D <PFP> (mo->sim_->envMap_.map, d1, mo->sim_->envMap_.position, pos1, true))
// if ( mo->sim_->envMap_.is_insideConvexCell2D(pos1, d1))
// mo->getParticule(n)->getCell() = d1;
//// if (Algo::Volume::Geometry::isPointInConvexFace2D <PFP> (mo->sim_->envMap_.map, d1, mo->sim_->envMap_.position, pos2, true))
// if ( mo->sim_->envMap_.is_insideConvexCell2D(pos2, d1))
// mo->getParticule(n2)->getCell() = d1;
// if(n==0)
// mo->dDir = mo->getParticule(0)->getCell();
// }
//}
///// a implementer 4 cas
//void resetPart(Segment * o, Dart d1)
//{
// ArticulatedObject * nid = o->nid;
// if(nid!=NULL)
// {
// int n1 = o->indexPart1;
// int n2 = o->indexPart2;
// if (nid->getParticule(n1)->getCell() == nid->sim_->envMap_.map.phi1(d1))
// nid->getParticule(n1)->getCell() = d1;
// if (nid->getParticule(n2)->getCell() == nid->sim_->envMap_.map.phi1(d1))
// nid->getParticule(n2)->getCell() = d1;
// }
//}
}
......
......@@ -23,7 +23,7 @@ EnvMap::EnvMap()
void EnvMap::init(int argc, char **argv)
{
maxCellRay = 2.0f;
maxCellRay = 1.0f;
mapMinX=0;
mapMaxX=0;
mapMinY=0;
......@@ -98,12 +98,12 @@ REAL EnvMap::volumeMaxdistance(Vol volume)
{
Dart d = volume;
VEC3 center = Algo::Surface::Geometry::volumeCentroid<PFP,VertexAttribute<VEC3,MAP>>(map,volume,position);
VEC3 center = volumecenter[d];
REAL res = (position[d]-center).norm2();
REAL res = (position[d]-center).norm();
for ( Vertex vert : verticesIncidentToVolume3(map,volume))
{
REAL size=(position[vert]-center).norm2();
REAL size=(position[vert]-center).norm();
if(size>res)
{
res=size;
......@@ -114,7 +114,7 @@ REAL EnvMap::volumeMaxdistance(Vol volume)
VEC3 EnvMap::normaleFromVolume(Dart volume,Dart face) // renvoie la normale a la face pointant vers l'extérieur du volume
{
VEC3 center = Algo::Surface::Geometry::volumeCentroid<PFP,VertexAttribute<VEC3,MAP>>(map,volume,position);
VEC3 center = volumecenter[volume];
VEC3 norm = Algo::Surface::Geometry::faceNormal<PFP, VertexAttribute<VEC3, MAP>>(map,face,position);
VEC3 temp =center-facecenter[face];
if(norm*temp>0) norm*=-1;
......@@ -124,14 +124,21 @@ VEC3 EnvMap::normaleFromVolume(Dart volume,Dart face) // renvoie la normale a la
bool EnvMap::checkPointInMap(VEC3 pos,Dart neighborhood) // definit si le point pos est dans le voisinage interne a la carte du volume "neighborhood"
{
if(insideVolume(pos, neighborhood))
{
// CGoGNout<<"checkPos : inside the original volume"<<CGoGNendl;
return true;
}
for (Vol d : volumesAdjacentByVertex3(map,neighborhood))
{
if (!map.isBoundaryMarked<3>(d) )
{
// CGoGNout<<"checkPos : test volume d :"<<d<<CGoGNendl;
if(insideVolume(pos, d))
{
// CGoGNout<<" TRUE !"<<CGoGNendl;
return true;
}
}
}
......@@ -139,6 +146,13 @@ bool EnvMap::checkPointInMap(VEC3 pos,Dart neighborhood) // definit si le point
return false;
}
bool EnvMap::checkPointInCube(VEC3 pos) // definit si le point pos est dans le voisinage interne a la carte du volume "neighborhood"
{
return (pos[0]<=mapMaxX && pos[0]>=mapMinX&& pos[1]<=mapMaxY && pos[1]>=mapMinY && pos[2]<=mapMaxZ && pos[2]>=mapMinZ);
}
bool EnvMap::insideVolume(VEC3 pos, Dart volume) // définit si le point pos est dans le volume convexe
{
......@@ -337,14 +351,6 @@ void EnvMap::pushAOneCellSegment(Segment * o, Dart d)
#ifdef DEBUG_affichage
CGoGNout<<"fin du push , etat du belong/neighbor : "<<mo->belonging_cells[n].size()<<"/"<<mo->neighbor_cells[n].size()<<CGoGNendl;
// if(mo->neighbor_cells[n].size()>26)
// {
// for(auto d : mo->neighbor_cells[n])
// {
// CGoGNout<<" || "<<d<<" || "<<CGoGNendl;
// }
// }
#endif
}
......@@ -379,14 +385,6 @@ void EnvMap::pushSegmentInSetOfCells(Segment* o, const std::vector<Dart>& memo_c
}
#ifdef DEBUG_affichage
CGoGNout<<"fin du push , etat du belong/neighbor : "<<mo->belonging_cells[n].size()<<"/"<<mo->neighbor_cells[n].size()<<CGoGNendl;
// if(mo->neighbor_cells[n].size()>26)
// {
// for(auto d : mo->neighbor_cells[n])
// {
// CGoGNout<<" || "<<d<<" || "<<CGoGNendl;
// }
// }
#endif
}
......@@ -560,9 +558,6 @@ bool EnvMap::subdivideVolume(Dart dglobal, bool OneLevelDifference)
#endif
// la subdivision ne doit pas mettre plus d'un level de différence entre des cellules adjacentes
// on commence donc par subdiviser les voisins qui ont trop de différence
// Traversor3WF<typename PFP::MAP> traF(map, old, true);
// for(Dart dit = traF.begin(); dit != traF.end(); dit = traF.next())
// {
if(OneLevelDifference)
{
......@@ -586,23 +581,23 @@ bool EnvMap::subdivideVolume(Dart dglobal, bool OneLevelDifference)
}
else if(!map.volumeIsSubdivided(nv)) //check if neighboring volumes have to be subdivided first to avoid one cell surrounded by subdivided ones
{
// CGoGNout<<"neighbor not subdivided :"<<nv<<CGoGNendl;
if(map.checkForSurrounded(nv))
{
// CGoGNout<<"subdiv to avoid"<<CGoGNendl;
subdivideVolume(nv,false);
}
}
}
}
// CGoGNout<<"\n";
}
const std::chrono::time_point<std::chrono::system_clock> startPop = std::chrono::system_clock::now();
// on commence ensuite a subdiviser
// map.check();
map.setCurrentLevel(map.getMaxLevel()) ;
const ARETES oldobst(RegisteredEdges[dglobal]) ;
......@@ -610,15 +605,13 @@ bool EnvMap::subdivideVolume(Dart dglobal, bool OneLevelDifference)
for (Segment * o : oldobst)
{
this->popSegment(o) ;
o->nid->needResetSegment(o);
}
ARETES oldNeighborObst(RegisteredNeighborEdges[old]) ;
for (Segment * o : oldNeighborObst)
{
// this->popSegment(o) ; // old version
// removeElementFromVector(RegisteredNeighborEdges[old], o) ;
// CGoGNout<<"tentative de pop voisin "<<o->index<<" : ";
if(removeElementFromVector(o->nid->neighbor_cells[o->index],old))
{
o->nid->removeGeneralNeighbor (old);
......@@ -645,29 +638,34 @@ bool EnvMap::subdivideVolume(Dart dglobal, bool OneLevelDifference)
for (Triangle * o : oldTrianNeighbor)
{
// this->popTriangle(o) ; // old version
// removeElementFromVector(RegisteredNeighborTriangles[old], o) ;
removeElementFromVector(o->surf->neighbor_cells[o->indexTri],old);
o->surf->removeGeneralNeighbor (old);
if(removeElementFromVector(o->surf->neighbor_cells[o->indexTri],old))
{
o->surf->removeGeneralNeighbor (old);
}
else
{
CGoGNout<<"failed to remove... ";
afficheVector(o->surf->neighbor_cells[o->indexTri]);
CGoGNout<<" et old :"<<old<<CGoGNendl;
}
}
RegisteredNeighborTriangles[old].clear();
const std::chrono::time_point<std::chrono::system_clock> endPop = std::chrono::system_clock::now();
duration_pop = endPop - startPop;
if(duration_pop.count()>0.035)std::cout << "pop duration : " << duration_pop.count() << "s\n";
if(duration_pop.count()>0.01)CGoGNout << "pop duration : " << duration_pop.count() << "s\n";
const std::chrono::time_point<std::chrono::system_clock> startSubdiv = std::chrono::system_clock::now();
if(!map.isBoundaryMarked(3,dglobal) && map.getDartLevel(dglobal) <= map.getMaxLevel() && !map.volumeIsSubdivided(dglobal) )
{
centerDart =Algo::Volume::IHM::subdivideVolumeClassic<PFP>(map, dglobal, position,false);
res=true;
}
const std::chrono::time_point<std::chrono::system_clock> endSubdiv = std::chrono::system_clock::now();
duration_subdiv = endSubdiv - startSubdiv;
if(duration_subdiv.count()>0.035)std::cout << "subdiv duration : " << duration_subdiv.count() << "s\n";
if(duration_subdiv.count()>0.01)CGoGNout << "subdiv duration : " << duration_subdiv.count() << "s\n";
map.setCurrentLevel(map.getMaxLevel()) ;
CellMarkerMemo<MAP,VOLUME> newVolumes(map);
......@@ -683,24 +681,10 @@ bool EnvMap::subdivideVolume(Dart dglobal, bool OneLevelDifference)
newVolumes.mark(old);
}
// Dart start = old;
// do // on marque les nouvelles cellules ! attention TODO cas des volumes qui n'ont aucune arete en commun avec le volume d'origine
// {
// map.setCurrentLevel(vLevel+1);
// newVolumes.mark(map.volumeOldestDart(start));
// map.setCurrentLevel(vLevel);
// start=map.phi1(start);
// }while(start !=old);
// map.check();
//////push neighbors et maj des attributs couleur, facecenter et volumecenter
// CGoGNout<<"nombre de sous cellules markées :"<<newVolumes.get_markedCells().size()<<CGoGNendl;
const std::chrono::time_point<std::chrono::system_clock> startPush = std::chrono::system_clock::now();
for (Dart d : newVolumes.get_markedCells())
{
// CGoGNout<<"markée :"<<d<<CGoGNendl;
......@@ -740,8 +724,8 @@ bool EnvMap::subdivideVolume(Dart dglobal, bool OneLevelDifference)
}
}
}
const std::chrono::time_point<std::chrono::system_clock> endPushNeighbors = std::chrono::system_clock::now();
const std::chrono::time_point<std::chrono::system_clock> startPush = std::chrono::system_clock::now();
......@@ -749,7 +733,7 @@ bool EnvMap::subdivideVolume(Dart dglobal, bool OneLevelDifference)
//same for triangles //
for (Triangle * o : oldTrian)
{
resetPartSubdiv(o,vLevel);
resetPartSubdiv(o);
this->FirstRegistrationTriangle(o) ;
}
......@@ -757,22 +741,21 @@ bool EnvMap::subdivideVolume(Dart dglobal, bool OneLevelDifference)
const std::chrono::time_point<std::chrono::system_clock> endPushSegmentNeighbors = std::chrono::system_clock::now();
//same for obstacles contained
for (Segment * o : oldobst)
{
resetPartSubdiv(o,vLevel);
resetPartSubdiv(o);
FirstRegistrationSegment(o);
}
const std::chrono::time_point<std::chrono::system_clock> endPush = std::chrono::system_clock::now();
duration_push = endPush - startPush;
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_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";
std::chrono::duration<double> duration_triangle= (endPushTriangle -endPushNeighbors );
std::chrono::duration<double> duration_segment= (endPush - endPushTriangle);
std::chrono::duration<double> duration_neighbors= (endPushNeighbors - startPush );
if(duration_triangle.count()>0.01)CGoGNout << "push triangle duration : " << duration_triangle.count() << "s\n";
if(duration_push.count()>0.01)CGoGNout << "push duration : " << duration_push.count() << "\n dont pour les segments présents : "<<duration_segment.count() <<"s\n et pour les voisins :"<<duration_neighbors.count() <<"s\n";
#endif
......@@ -780,138 +763,97 @@ bool EnvMap::subdivideVolume(Dart dglobal, bool OneLevelDifference)
}
void EnvMap::resetPartSubdiv(Segment* o, int vLevelOld)
void EnvMap::resetPartSubdiv(Segment* o)
{
ArticulatedObject * mo = o->nid;
if (mo != NULL)
{
VEC3 pos = mo->getParticule(o->indexPart1)->getPosition();
VEC3 pos2 = mo->getParticule(o->indexPart2)->getPosition();
Dart d1 =mo->getParticule(o->indexPart1)->getCell();
Dart d2 =mo->getParticule(o->indexPart2)->getCell();
int indPart=o->indexPart1;
int indPart2=o->indexPart2;
#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<<"Faces centroids : "<<volumecenter[d]<<" || "<<Algo::Surface::Geometry::volumeCentroid<PFP,VertexAttribute<VEC3,MAP>>(map,d2,position)<<CGoGNendl;
#endif
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();
mo->getParticule(o->indexPart1)->reset_positionVolume();
#ifdef DEBUG_affichage
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) ;
if(mo->getNeedForSubd(indPart))
{
mo->getParticule(indPart)->resetParticule();
mo->setNeedForSubd(indPart,0);
#ifdef DEBUG_affichage
CGoGNout<<"part1 moved in the end (destination, arrivée,d,state) : "<<pos<<" || "<< mo->getParticule(o->indexPart1)->getPosition()<<" || "<<mo->parts_[o->indexPart1]->getCell()<<" || "<<mo->parts_[o->indexPart1]->getState()<<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();
mo->getParticule(o->indexPart2)->reset_positionVolume();
#ifdef DEBUG_affichage
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) ;
}
if(mo->getNeedForSubd(indPart2))
{
mo->getParticule(indPart2)->resetParticule();
mo->setNeedForSubd(indPart2,0);
#ifdef DEBUG_affichage
CGoGNout<<"part2 moved in the end (destination, arrivée,d,state) : "<<pos2<<" || "<< mo->getParticule(o->indexPart2)->getPosition()<<" || "<<mo->parts_[o->indexPart2]->getCell()<<" || "<<mo->parts_[o->indexPart2]->getState()<<CGoGNendl;
#endif
}
}
}
void EnvMap::resetPartSubdiv(Triangle * o, int vLevelOld)
void EnvMap::resetPartSubdiv(Triangle * o)
{
Surface * mo = o->surf;
Dart cell =o->cell;
Dart cell2 = mo->getSurfaceMap().phi1(cell);
Dart cell3 = mo->getSurfaceMap().phi1(cell2);
int indPart=mo->getIndexOfParticuleAtVertex(cell);
int indPart2=mo->getIndexOfParticuleAtVertex(cell2);
int indPart3=mo->getIndexOfParticuleAtVertex(cell3);
Particule * p = mo->getParticule(indPart);
Particule * p2 = mo->getParticule(indPart2);
Particule * p3 = mo->getParticule(indPart3);
if (mo != NULL)
{
Dart cell =o->cell;
Dart cell2 = mo->getSurfaceMap().phi1(cell);
Dart cell3 = mo->getSurfaceMap().phi1(cell2);
int indPart=mo->getIndexOfParticuleAtVertex(cell);
int indPart2=mo->getIndexOfParticuleAtVertex(cell2);
int indPart3=mo->getIndexOfParticuleAtVertex(cell3);
Particule * p = mo->getParticule(indPart);
Particule * p2 = mo->getParticule(indPart2);
Particule * p3 = mo->getParticule(indPart3);
VEC3 pos = p->getPosition();
VEC3 pos2 = p2->getPosition();
VEC3 pos3 = p3->getPosition();
Dart d1 =p->getCell();
Dart d2 =p2->getCell();
Dart d3 = p3->getCell();
#ifdef DEBUG_affichage
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
if(mo->getNeedForSubd(indPart))
{
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 !!!
p->reset_positionVolume();
#ifdef DEBUG_affichage
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,state) : "<<pos<<" || "<< p->getPosition()<<" || "<<p->getCell()<<" || "<<p->getState()<<CGoGNendl;
#ifdef DEBUG_affichage
CGoGNout<<"Reset part subdiv (index triangle, pos1, d1, pos2, d2, pos3, d3) : "<<o->indexTri<<" || "<<pos<<" || "<<d1<<" || "<<pos2<<" || "<<d2<<" || "<<pos3<<" || "<<d3<<CGoGNendl;
CGoGNout<<"Faces centroids : "<<volumecenter[d1]<<" || "<<volumecenter[d2]<<" || "<<volumecenter[d3]<<CGoGNendl;
#endif