Commit 109bf033 authored by Sylvain Thery's avatar Sylvain Thery
Browse files

bug newFace

bug import (newFace !!)
parent 2850fa49
...@@ -168,8 +168,8 @@ int main(int argc, char **argv) ...@@ -168,8 +168,8 @@ int main(int argc, char **argv)
sqt.m_positionVBO->updateData(position); sqt.m_positionVBO->updateData(position);
// update des primitives du renderer // update des primitives du renderer
// SelectorTrue allDarts; SelectorTrue allDarts;
SelectorNoBoundary<PFP::MAP> allDarts; // SelectorNoBoundary<PFP::MAP> allDarts(myMap);
sqt.m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES); sqt.m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES);
sqt.m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::LINES); sqt.m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::LINES);
......
...@@ -74,7 +74,7 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts) ...@@ -74,7 +74,7 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
nbe = edgesBuffer.size(); nbe = edgesBuffer.size();
if (nbe > 2) if (nbe > 2)
{ {
Dart d = map.newFace(nbe); Dart d = map.newOrientedFace(nbe);
for (unsigned int j = 0; j < nbe; ++j) for (unsigned int j = 0; j < nbe; ++j)
{ {
unsigned int em = edgesBuffer[j]; // get embedding unsigned int em = edgesBuffer[j]; // get embedding
...@@ -121,6 +121,9 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts) ...@@ -121,6 +121,9 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
} }
if (nbnm > 0) if (nbnm > 0)
{
map.closeMap();
}
CGoGNout << "Warning " << nbnm << " darts with phi2 fix points" << CGoGNendl; CGoGNout << "Warning " << nbnm << " darts with phi2 fix points" << CGoGNendl;
return true ; return true ;
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#include "Geometry/intersection.h" #include "Geometry/intersection.h"
#include "Algo/Geometry/normal.h" #include "Algo/Geometry/normal.h"
#include "Topology/generic/traversorCell.h"
namespace CGoGN namespace CGoGN
{ {
...@@ -330,6 +332,18 @@ void MapRender::initTriangles(typename PFP::MAP& map, const FunctorSelect& good, ...@@ -330,6 +332,18 @@ void MapRender::initTriangles(typename PFP::MAP& map, const FunctorSelect& good,
m.markOrbit(FACE, dd); 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())
// {
// if (good(d))
// addTri<PFP>(map, d, tableIndices);
// }
} }
template<typename PFP> template<typename PFP>
...@@ -348,7 +362,7 @@ void MapRender::initTrianglesOptimized(typename PFP::MAP& map, const FunctorSele ...@@ -348,7 +362,7 @@ void MapRender::initTrianglesOptimized(typename PFP::MAP& map, const FunctorSele
{ {
std::list<Dart> bound; std::list<Dart> bound;
if(good(dd)) if (good(dd))
addTri<PFP>(map, dd, tableIndices); addTri<PFP>(map, dd, tableIndices);
m.markOrbit(FACE, dd); m.markOrbit(FACE, dd);
bound.push_back(dd); bound.push_back(dd);
......
...@@ -78,6 +78,7 @@ class GenericMap : public MapBrowser ...@@ -78,6 +78,7 @@ class GenericMap : public MapBrowser
template<typename T> friend class AttributeHandler ; template<typename T> friend class AttributeHandler ;
template<typename T> friend class AutoAttributeHandler ; template<typename T> friend class AutoAttributeHandler ;
template <typename T> friend class SelectorNoBoundary ;
protected: protected:
/** /**
......
...@@ -40,7 +40,7 @@ private: ...@@ -40,7 +40,7 @@ private:
Dart current ; Dart current ;
public: public:
TraversorCell(MAP& map, Dart dart) : m(map), mark(map) TraversorCell(MAP& map) : m(map), mark(map)
{} {}
Dart begin() Dart begin()
......
...@@ -120,6 +120,7 @@ void Map2::deleteOrientedFace(Dart d) ...@@ -120,6 +120,7 @@ void Map2::deleteOrientedFace(Dart d)
Dart Map2::newFace(unsigned int nbEdges) Dart Map2::newFace(unsigned int nbEdges)
{ {
std::cout << "OUCHHH"<< std::endl;
Dart d = Map1::newFace(nbEdges); Dart d = Map1::newFace(nbEdges);
Dart e = Map1::newBoundaryFace(nbEdges); Dart e = Map1::newBoundaryFace(nbEdges);
...@@ -128,7 +129,7 @@ Dart Map2::newFace(unsigned int nbEdges) ...@@ -128,7 +129,7 @@ Dart Map2::newFace(unsigned int nbEdges)
{ {
phi2sew(d,e); phi2sew(d,e);
d = phi1(d); d = phi1(d);
e = phi1(e); e = phi_1(e);
} while (d != x); } while (d != x);
return x; return x;
} }
......
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