Commit 21772991 authored by Thomas Pitiot 's avatar Thomas Pitiot

merged

parents b81d34da 20b6c79e
...@@ -58,7 +58,7 @@ public: ...@@ -58,7 +58,7 @@ public:
float mapMinZ; float mapMinZ;
float mapMaxZ; float mapMaxZ;
float maxCellRay; float maxCellRay;
bool subdivideVolume(Dart d ); bool subdivideVolume(Dart d , bool OneLevelDifference=true);
Dart getBelongingCell(const PFP::VEC3& pos); Dart getBelongingCell(const PFP::VEC3& pos);
......
...@@ -541,7 +541,7 @@ void EnvMap::popTriangle(Triangle* o) ...@@ -541,7 +541,7 @@ void EnvMap::popTriangle(Triangle* o)
} }
} }
bool EnvMap::subdivideVolume(Dart dglobal) bool EnvMap::subdivideVolume(Dart dglobal, bool OneLevelDifference)
{ {
bool res =false; bool res =false;
#ifdef IHMap #ifdef IHMap
...@@ -558,18 +558,36 @@ bool EnvMap::subdivideVolume(Dart dglobal) ...@@ -558,18 +558,36 @@ bool EnvMap::subdivideVolume(Dart dglobal)
// Traversor3WF<typename PFP::MAP> traF(map, old, true); // Traversor3WF<typename PFP::MAP> traF(map, old, true);
// for(Dart dit = traF.begin(); dit != traF.end(); dit = traF.next()) // for(Dart dit = traF.begin(); dit != traF.end(); dit = traF.next())
// { // {
for ( Face dit : facesIncidentToVolume3(map,old)) if(OneLevelDifference)
{ {
Dart nv = map.phi3(dit); for ( Face dit : facesIncidentToVolume3(map,old))
if(!map.isBoundaryMarked(3, nv))
{ {
if(map.volumeLevel(nv) == vLevel - 1) #ifdef DEBUG_affichage
count++;
#endif
Dart nv = map.phi3(dit);
if(!map.isBoundaryMarked(3, nv))
{ {
int currentLevel = map.getCurrentLevel(); if(map.volumeLevel(nv) == vLevel - 1)
subdivideVolume(nv); {
map.setCurrentLevel(currentLevel); #ifdef DEBUG_affichage
std::cout << "OK pour cascade en : "<<nv<< std::endl;
#endif
int currentLevel = map.getCurrentLevel();
subdivideVolume(nv);
map.setCurrentLevel(currentLevel);
}
else if(!map.volumeIsSubdivided(nv)) //check if neighboring volumes have to be subdivided first to avoid one cell surrounded by subdivided ones
{
if(map.checkForSurrounded(nv))
{
subdivideVolume(nv,false);
}
}
} }
else if()
} }
} }
......
...@@ -236,7 +236,7 @@ void Needle::refine() ...@@ -236,7 +236,7 @@ void Needle::refine()
{ {
if(sim_->envMap_.subdivideVolume(volume)) if(sim_->envMap_.subdivideVolume(volume))
{ {
refine(); // refine();
} }
} }
......
...@@ -231,6 +231,7 @@ void Volusion::cb_initGL() ...@@ -231,6 +231,7 @@ void Volusion::cb_initGL()
m_explode_render->setBackColor(Geom::Vec4f(0.9f,0.9f,0.9f,1.0f)); m_explode_render->setBackColor(Geom::Vec4f(0.9f,0.9f,0.9f,1.0f));
m_explode_render->setColorLine(Geom::Vec4f(0.8f,0.2f,0.2f,1.0f)); m_explode_render->setColorLine(Geom::Vec4f(0.8f,0.2f,0.2f,1.0f));
m_explode_render->setNoClippingPlane(); m_explode_render->setNoClippingPlane();
// m_sh1 = static_cast<Utils::ClippingShader*>(m_topo_render->shader1()); // m_sh1 = static_cast<Utils::ClippingShader*>(m_topo_render->shader1());
// m_sh2 = static_cast<Utils::ClippingShader*>(m_topo_render->shader2()); // m_sh2 = static_cast<Utils::ClippingShader*>(m_topo_render->shader2());
...@@ -688,6 +689,7 @@ void Volusion::cb_redraw() ...@@ -688,6 +689,7 @@ void Volusion::cb_redraw()
if (render_edges) if (render_edges)
{ {
glLineWidth(2.0f); glLineWidth(2.0f);
// simul.envMap_.map.setCurrentLevel(simul.envMap_.map.getMaxLevel()) ;
m_explode_render->updateData<PFP>(simul.envMap_.map, simul.envMap_.position, simul.envMap_.color); m_explode_render->updateData<PFP>(simul.envMap_.map, simul.envMap_.position, simul.envMap_.color);
m_explode_render->drawEdges(); m_explode_render->drawEdges();
......
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