Commit 58858e5a authored by Pierre Kraemer's avatar Pierre Kraemer

correctif traversorCell

parent 109bf033
......@@ -187,7 +187,7 @@ void Viewer::importMesh(std::string& filename)
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::POINTS) ;
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::LINES) ;
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES) ;
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES, false) ;
bb = Algo::Geometry::computeBoundingBox<PFP>(myMap, position) ;
normalBaseSize = bb.diagSize() / 100.0f ;
......
......@@ -123,8 +123,8 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
if (nbnm > 0)
{
map.closeMap();
CGoGNout << "Map closed (" << nbnm << " boundary edges)" << CGoGNendl;
}
CGoGNout << "Warning " << nbnm << " darts with phi2 fix points" << CGoGNendl;
return true ;
}
......
......@@ -297,6 +297,7 @@ inline void MapRender::addTri(typename PFP::MAP& map, Dart d, std::vector<GLuint
if (map.phi1(c) != a)
{
std::cout << "non triangle face" << std::endl ;
addEarTri<PFP>(map, d, tableIndices);
return;
}
......@@ -321,29 +322,27 @@ inline void MapRender::addTri(typename PFP::MAP& map, Dart d, std::vector<GLuint
template<typename PFP>
void MapRender::initTriangles(typename PFP::MAP& map, const FunctorSelect& good, std::vector<GLuint>& tableIndices, unsigned int thread)
{
DartMarker m(map, thread);
tableIndices.reserve(4 * map.getNbDarts() / 3);
for(Dart dd = map.begin(); dd != map.end(); map.next(dd))
{
if(!m.isMarked(dd) && good(dd))
{
addTri<PFP>(map, dd, tableIndices);
m.markOrbit(FACE, dd);
}
}
// DartMarker m(map, thread);
// tableIndices.reserve(4 * map.getNbDarts() / 3);
//
//// TraversorF<typename PFP::MAP> trav(map);
// TraversorCell<typename PFP::MAP,FACE> trav(map);
//
// for (Dart d = trav.begin(); d!= trav.end(); d = trav.next())
// for(Dart dd = map.begin(); dd != map.end(); map.next(dd))
// {
// if (good(d))
// addTri<PFP>(map, d, tableIndices);
// if(!m.isMarked(dd) && good(dd))
// {
// addTri<PFP>(map, dd, tableIndices);
// m.markOrbit(FACE, dd);
// }
// }
DartMarker m(map, thread);
tableIndices.reserve(4 * map.getNbDarts() / 3);
TraversorF<typename PFP::MAP> trav(map);
for (Dart d = trav.begin(); d!= trav.end(); d = trav.next())
{
if (good(d))
addTri<PFP>(map, d, tableIndices);
}
}
template<typename PFP>
......
......@@ -75,10 +75,8 @@ class AttributeHandlerGen ;
class GenericMap : public MapBrowser
{
template<typename T> friend class AttributeHandler ;
template<typename T> friend class AutoAttributeHandler ;
template <typename T> friend class SelectorNoBoundary ;
protected:
/**
......@@ -419,11 +417,13 @@ protected:
*/
void boundaryUnmark(Dart d);
public:
/**
* test if a dart belong to the boundary
*/
bool isBoundaryMarked(Dart d);
protected:
/**
* mark an orbit of dart as belonging to boundary
*/
......
......@@ -47,6 +47,8 @@ public:
{
mark.unmarkAll() ;
current = m.begin() ;
while(m.isBoundaryMarked(current))
m.next(current) ;
if(current == m.end())
current = NIL ;
else
......@@ -58,7 +60,7 @@ public:
{
if(current != NIL)
{
while(current != NIL && mark.isMarked(current))
while(current != NIL && (mark.isMarked(current) || m.isBoundaryMarked(current)))
{
m.next(current) ;
if(current == m.end())
......@@ -73,19 +75,31 @@ public:
template <typename MAP>
class TraversorV : public TraversorCell<MAP, VERTEX>
{};
{
public:
TraversorV(MAP& m) : TraversorCell<MAP, VERTEX>(m) {}
};
template <typename MAP>
class TraversorE : public TraversorCell<MAP, EDGE>
{};
{
public:
TraversorE(MAP& m) : TraversorCell<MAP, EDGE>(m) {}
};
template <typename MAP>
class TraversorF : public TraversorCell<MAP, FACE>
{};
{
public:
TraversorF(MAP& m) : TraversorCell<MAP, FACE>(m) {}
};
template <typename MAP>
class TraversorW : public TraversorCell<MAP, VOLUME>
{};
{
public:
TraversorW(MAP& m) : TraversorCell<MAP, VOLUME>(m) {}
};
} // namespace CGoGN
......
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