Commit 6ea92056 authored by Thomas Pitiot 's avatar Thomas Pitiot

no onelevel diff

parent 8ae449f5
......@@ -56,8 +56,6 @@ public:
bool checkPointInCube(VEC3 pos);
bool checkFaces(); // vérifie que tous les points des faces sont bien coplanaires si ce n'eest pas le cas renvoie true
bool insideVolume(VEC3 pos, Dart d);
void unStuckCell(Dart cell);
void StuckCell(Dart cell);
REAL volumeMaxdistance(Vol volume);
VEC3 normaleFromVolume(Dart volume,Dart face);
void open_file(std::string filename);
......@@ -70,13 +68,13 @@ public:
float maxCellRay;
void resetPartNeighborsFace(Dart neighbor, unsigned int vLevel);
void simplifyNeedle(Dart celltoSimplify, Dart needleCell);
bool simplifyCellAgents(Dart volume);
bool simplifyVolume (Dart d , CellMarkerMemo<MAP,VOLUME>& smallCells );
bool subdivideVolume(Dart d , bool OneLevelDifference=true);
bool subdivideVolume(Dart d );
void subdivideToMaxLevel();
bool subdivideMap();
bool simplifyMap();
Dart getBelongingCell(const PFP::VEC3& pos);
unsigned int nbAgentsToSubdivide;
unsigned int nbAgentsToSimplify;
......@@ -95,8 +93,7 @@ public:
VolumeAttribute<TRIANGLES, MAP> RegisteredTriangles ;
VolumeAttribute<TRIANGLES, MAP> RegisteredNeighborTriangles ;
VolumeAttribute<Dart, MAP> OldestDart;
VolumeAttribute<bool,MAP> CellOnMaxLevel; // remplacer apr marker ?
VolumeAttribute<bool,MAP> CellStuckCauseOneLevel;
VolumeAttribute<bool,MAP> CellOnMaxLevel; // remplacer par marker ?
Geom::BoundingBox<PFP::VEC3> bb;
std::vector<Dart> getMemoCross(const VEC3& pos, const VEC3& dest, Dart& d1, unsigned int state);
......@@ -144,6 +141,7 @@ public:
#ifndef IHMap
Dart volumeLowestIndex(Dart v);
#endif
} ;
/**************************************
......
This diff is collapsed.
......@@ -149,22 +149,22 @@ void Needle::move(VEC3 diff)
diff*=(sim_->envMap_.maxCellRay/4)*0.9;
}
VEC3 pos = getPosition(0)+diff;
if(sim_->envMap_.map.isVolumeIncidentToBoundary(oldDart))
{
if(!sim_->envMap_.checkPointInMap(pos,oldDart))
{
// if(sim_->envMap_.map.isVolumeIncidentToBoundary(oldDart))
// {
// if(!sim_->envMap_.checkPointInMap(pos,oldDart))
// {
pos=pos-diff;
// pos=pos-diff;
}
}
// }
// }
this->getParticule(0)->move(pos);
updateRegistration();
this->unColor_close(oldDart);
#ifdef IHMap
if(getParticule(0)->newVol)
if(getParticule(0)->crossCell!=CGoGN::Algo::Volume::MovingObjects::NO_CROSS)
{
#ifdef DEBUG_affichage
......@@ -198,7 +198,7 @@ void Needle::updateRegistration()
Dart d2 = this->getParticule(o->indexPart2)->getCell();
if(!(
(sim_->envMap_.map.sameVolume(d1,d2))
&& (!(getParticule(o->indexPart1)->newVol) && !(getParticule(o->indexPart2)->newVol))))
&& (!(getParticule(o->indexPart1)->crossCell!=CGoGN::Algo::Volume::MovingObjects::NO_CROSS) && !(getParticule(o->indexPart2)->crossCell!=CGoGN::Algo::Volume::MovingObjects::NO_CROSS))))
{
sim_->envMap_.popAndPushSegment(o);
......@@ -230,7 +230,7 @@ Dart Needle::refine()
{
if(sim_->envMap_.subdivideVolume(volume))
{
newold = volume;
newold = this->getParticule(0)->getCell();;
refine();
}
}
......
......@@ -47,7 +47,7 @@ void Simulator::doStep()
Dart oldCell=ag->part_->getCell();
ag->updatePosition();
if(ag->part_->newVol)
if(ag->part_->crossCell!=CGoGN::Algo::Volume::MovingObjects::NO_CROSS)
{
envMap_.agentChangeFace(ag,oldCell);
}
......
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