Commit 60d13b2e authored by Thomas Pitiot 's avatar Thomas Pitiot

ok

parent 56266509
......@@ -364,7 +364,10 @@ public:
/*!
*/
bool volumeIsSubdividedOnce(Dart d);
/**
* checkForSurrounded check if the cell wont be surrounded by subdivided cells (before subdividing phi2(d)) to avoid the case of a non subdivided cell surrounded by subdivided ones.
*/
bool checkForSurrounded (Dart d);
/*! @name
*************************************************************************/
......
......@@ -705,6 +705,7 @@ inline bool ImplicitHierarchicalMap3::isWellEmbedded()
//void ImplicitHierarchicalMap3::analysis()
//{
// assert(getCurrentLevel() > 0 || !"analysis : called on level 0") ;
......
......@@ -55,6 +55,7 @@ void newLevelHexa(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3, ty
* Subdivision *
***********************************************************************************/
template <typename PFP>
void subdivideEdge(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position) ;
......
......@@ -219,9 +219,22 @@ Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, VertexAttribute<type
{
Dart nv = map.phi3(dit);
if(!map.isBoundaryMarked(3, nv))
{
if(map.volumeLevel(nv) == vLevel - 1)
{
subdivideVolumeClassic<PFP>(map,nv,position,OneLevelDifference);
}
else if(!map.volumeIsSubdivided(nv)) //check if neighboring faces have to be subdivided first to avoid one cell surrounded by subdivided ones
{
if(map.checkForSurrounded(nv))
{
subdivideVolumeClassic<PFP>(map,nv,position,false);
}
}
}
}
}
......
......@@ -387,19 +387,22 @@ unsigned int IHM2<PFP>::subdivideFace(Dart d, bool triQuad, bool OneLevelDiffere
if(OneLevelDifference)
{
Dart nf = m_map.phi2(it) ;
int levelneighbor=faceLevel(nf);
if(levelneighbor== fLevel - 1) // check if neighboring faces have to be subdivided first to avoid 2 level differencies
if(!m_map.isBoundaryMarked(2, nf))
{
subdivideFace(nf,triQuad) ;
}
else if(!faceIsSubdivided(nf)) //check if neighboring faces have to be subdivided first to avoid one cell surrounded by subdivided ones
{
if(checkForSurrounded(nf))
int levelneighbor=faceLevel(nf);
if(levelneighbor== fLevel - 1) // check if neighboring faces have to be subdivided first to avoid 2 level differencies
{
subdivideFace(nf,triQuad) ;
}
else if(!faceIsSubdivided(nf)) //check if neighboring faces have to be subdivided first to avoid one cell surrounded by subdivided ones
{
if(checkForSurrounded(nf))
{
subdivideFace(nf,triQuad,false);
subdivideFace(nf,triQuad,false);
}
}
}
}
......
......@@ -444,7 +444,7 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, const V_ATT& positi
bufferColors.reserve(16384);
// TraversorCell<MAP, MAP::FACE_OF_PARENT> traFace(map);
foreach_cell<MAP::FACE_OF_PARENT>(map, [&] (Cell<MAP::FACE_OF_PARENT> d)
foreach_cell<MAP::FACE_OF_PARENT>(map, [&] (Cell<MAP::FACE_OF_PARENT> d)
{
VEC3F centerFace = PFP::toVec3f(Algo::Surface::Geometry::faceCentroidELW<PFP>(map, d.dart, positions));
VEC3F volColor = PFP::toVec3f(colorPerXXX[d.dart]);
......@@ -486,7 +486,7 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, const V_ATT& positi
c = map.phi1(b);
} while (b != d);
}
});
});
m_nbTris = GLuint(buffer.size()/4);
......@@ -506,11 +506,11 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, const V_ATT& positi
// TraversorCell<typename PFP::MAP, PFP::MAP::EDGE_OF_PARENT> traEdge(map);
// for (Dart d = traEdge.begin(); d != traEdge.end(); d = traEdge.next())
foreach_cell<MAP::EDGE_OF_PARENT>(map, [&] (Cell<MAP::EDGE_OF_PARENT> c)
foreach_cell<MAP::EDGE_OF_PARENT>(map, [&] (Cell<MAP::EDGE_OF_PARENT> c)
{ buffer.push_back(PFP::toVec3f(centerVolumes[c.dart]));
buffer.push_back(PFP::toVec3f(positions[c.dart]));
buffer.push_back(PFP::toVec3f(positions[map.phi1(c)]));
}); // false ???
}); // false ???
m_nbLines = GLuint(buffer.size()/3);
......
......@@ -772,6 +772,20 @@ bool ImplicitHierarchicalMap3::volumeIsSubdividedOnce(Dart d)
}
bool ImplicitHierarchicalMap3::checkForSurrounded (Dart d)
{
for(Vol dd : volumesAdjacentByFace3<ImplicitHierarchicalMap3>(*this,d))
{
if(!sameVolume(phi3(d),dd))
{
if(!volumeIsSubdivided(dd))
{
return false;
}
}
}
return true;
}
bool ImplicitHierarchicalMap3::neighborhoodLevelDiffersMoreThanOne(Dart d)
{
......
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