Commit b75bfd43 authored by Thery Sylvain's avatar Thery Sylvain

boundary2/boundary3

parent 3a8ecd23
......@@ -110,7 +110,7 @@ void MyQT::createMap()
for (Dart d = myMap.begin(); d != myMap.end(); myMap.next(d))
{
CGoGNout << "Dart "<< d;
if (myMap.isBoundaryMarked(d))
if (myMap.isBoundaryMarkedCurrent(d))
CGoGNout << " is a boundary dart (implicitly added)"<< CGoGNendl;
else
{
......
......@@ -197,7 +197,7 @@ void MyQT::createMap(int n)
for (Dart d=myMap.begin(); d!=myMap.end(); myMap.next(d))
{
if (dm.isMarked(d) && (!myMap.isBoundaryMarked(d)))
if (dm.isMarked(d) && (!myMap.isBoundaryMarked2(d)))
{
int n = rand();
float r = float(n&0x7f)/255.0f + 0.25f;
......@@ -214,7 +214,7 @@ void MyQT::updateMap()
m_render_topo->updateData<PFP>(myMap, position, 0.9f, 0.9f,nb);
for (Dart d=myMap.begin(); d!=myMap.end(); myMap.next(d))
{
if (dm.isMarked(d) && (!myMap.isBoundaryMarked(d)))
if (dm.isMarked(d) && (!myMap.isBoundaryMarked2(d)))
{
const Geom::Vec3f& C = colorDarts[d];
if (C*C != 0.0f)
......@@ -273,7 +273,7 @@ void MyQT::cb_keyPress(int keycode)
case 'c':
for (Dart d = myMap.begin(); d != myMap.end(); myMap.next(d))
{
if (!myMap.isBoundaryMarked(d))
if (!myMap.isBoundaryMarked2(d))
{
int n = rand();
float r = float(n&0x7f)/255.0f + 0.25f;
......@@ -287,7 +287,7 @@ void MyQT::cb_keyPress(int keycode)
case 'g':
for (Dart d = myMap.begin(); d != myMap.end(); myMap.next(d))
{
if (!myMap.isBoundaryMarked(d))
if (!myMap.isBoundaryMarked2(d))
{
colorDarts[d] = Geom::Vec3f(0.5f,0.5f,0.5f);
m_render_topo->setDartColor(d,0.5f,0.5f,0.5f);
......@@ -298,7 +298,7 @@ void MyQT::cb_keyPress(int keycode)
case 'b':
for (Dart d = myMap.begin(); d != myMap.end(); myMap.next(d))
{
if (!myMap.isBoundaryMarked(d))
if (!myMap.isBoundaryMarked2(d))
{
colorDarts[d] = Geom::Vec3f(0.0f,0.0f,0.0f);
m_render_topo->setDartColor(d,0.0f,0.0f,0.0f);
......@@ -388,7 +388,7 @@ void MyQT::importMesh(std::string& filename)
colorDarts = myMap.addAttribute<VEC3, DART>("color");
for (Dart d=myMap.begin(); d!=myMap.end(); myMap.next(d))
{
if (dm.isMarked(d) && (!myMap.isBoundaryMarked(d)))
if (dm.isMarked(d) && (!myMap.isBoundaryMarked2(d)))
{
int n = rand();
float r = float(n&0x7f)/255.0f + 0.25f;
......
......@@ -520,7 +520,7 @@ void MyQT::cb_keyPress(int keycode)
// case 'c':
// for (Dart d=myMap.begin(); d!=myMap.end(); myMap.next(d))
// {
// if (!myMap.isBoundaryMarked(d))
// if (!myMap.isBoundaryMarked3(d))
// {
// int n = random();
// float r = float(n&0x7f)/255.0f + 0.25f;
......@@ -534,7 +534,7 @@ void MyQT::cb_keyPress(int keycode)
// case 'g':
// for (Dart d=myMap.begin(); d!=myMap.end(); myMap.next(d))
// {
// if (!myMap.isBoundaryMarked(d))
// if (!myMap.isBoundaryMarked3(d))
// {
// colorDarts[d] = Geom::Vec3f(0.5f,0.5f,0.5f);
// m_render_topo->setDartColor(d,0.5f,0.5f,0.5f);
......@@ -545,7 +545,7 @@ void MyQT::cb_keyPress(int keycode)
// case 'b':
// for (Dart d=myMap.begin(); d!=myMap.end(); myMap.next(d))
// {
// if (!myMap.isBoundaryMarked(d))
// if (!myMap.isBoundaryMarked3(d))
// {
// colorDarts[d] = Geom::Vec3f(0.0f,0.0f,0.0f);
// m_render_topo->setDartColor(d,0.0f,0.0f,0.0f);
......
......@@ -41,7 +41,7 @@ void subdivideEdge(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP
{
assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ;
assert(!map.edgeIsSubdivided(d) || !"Trying to subdivide an already subdivided edge") ;
assert(!map.isBoundaryMarked(d) || !"Trying to subdivide a dart marked boundary");
assert(!map.isBoundaryMarked3(d) || !"Trying to subdivide a dart marked boundary");
unsigned int eLevel = map.edgeLevel(d) ;
......@@ -73,7 +73,7 @@ void subdivideFace(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP
{
assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ;
assert(!map.faceIsSubdivided(d) || !"Trying to subdivide an already subdivided face") ;
assert(!map.isBoundaryMarked(d) || !"Trying to subdivide a dart marked boundary");
assert(!map.isBoundaryMarked3(d) || !"Trying to subdivide a dart marked boundary");
unsigned int fLevel = map.faceLevel(d) ;
Dart old = map.faceOldestDart(d) ;
......@@ -192,7 +192,7 @@ Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, AttributeHandler<typ
{
assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ;
assert(!map.volumeIsSubdivided(d) || !"Trying to subdivide an already subdivided volume") ;
assert(!map.isBoundaryMarked(d) || !"Trying to subdivide a dart marked boundary");
assert(!map.isBoundaryMarked3(d) || !"Trying to subdivide a dart marked boundary");
unsigned int vLevel = map.volumeLevel(d);
Dart old = map.volumeOldestDart(d);
......@@ -524,7 +524,7 @@ Dart subdivideVolumeClassic2(typename PFP::MAP& map, Dart d, AttributeHandler<ty
{
assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ;
assert(!map.volumeIsSubdivided(d) || !"Trying to subdivide an already subdivided volume") ;
assert(!map.isBoundaryMarked(d) || !"Trying to subdivide a dart marked boundary");
assert(!map.isBoundaryMarked3(d) || !"Trying to subdivide a dart marked boundary");
unsigned int vLevel = map.volumeLevel(d);
Dart old = map.volumeOldestDart(d);
......@@ -658,7 +658,7 @@ void subdivideLoop(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP
{
assert(map.getDartLevel(d) <= map.getCurrentLevel() || !"Access to a dart introduced after current level") ;
assert(!map.volumeIsSubdivided(d) || !"Trying to subdivide an already subdivided volume") ;
assert(!map.isBoundaryMarked(d) || !"Trying to subdivide a dart marked boundary");
assert(!map.isBoundaryMarked3(d) || !"Trying to subdivide a dart marked boundary");
unsigned int vLevel = map.volumeLevel(d);
Dart old = map.volumeOldestDart(d);
......
......@@ -532,7 +532,7 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib
// //close the intersections
// for(Dart d = map.begin();d != map.end(); map.next(d))
// {
// if(map.isBoundaryMarked(map.phi2(d)))
// if(map.isBoundaryMarked2(map.phi2(d)))
// map.closeHole(d);
// }
......
......@@ -1183,7 +1183,7 @@ void MarchingCube<DataType, Windowing, PFP>::removeFacesOfBoundary(VertexAttribu
DartMarker mf(*m_map);
for (Dart d = m_map->begin(); d != m_map->end();) // next done inside loop because of deleteFace
{
if (!mf.isMarked(d) && !m_map->isBoundaryMarked(d))
if (!mf.isMarked(d) && !m_map->isBoundaryMarked2(d))
{
Dart dd = d;
Dart e = m_map->phi1(d);
......@@ -1208,7 +1208,7 @@ void MarchingCube<DataType, Windowing, PFP>::removeFacesOfBoundary(VertexAttribu
// vecF.reserve(8192);
// for (Dart d = m_map->begin(); d != m_map->end();m_map->next(d)) // next done inside loop because of deleteFace
// {
// if ((!mf.isMarked(d)) && (!m_map->isBoundaryMarked(d)) )
// if ((!mf.isMarked(d)) && (!m_map->isBoundaryMarked2(d)) )
// {
// Dart dd = d;
// Dart e = m_map->phi1(d);
......
......@@ -134,7 +134,7 @@ void quadranguleFaces(typename PFP::MAP& map, EMBV& attributs, const FunctorSele
// first pass: cut the edges
for (Dart d = map.begin(); d != map.end(); map.next(d))
{
if (selected(d) && !map.isBoundaryMarked(d) && !me.isMarked(d))
if (selected(d) && !map.isBoundaryMarked2(d) && !me.isMarked(d))
{
Dart f = map.phi1(d);
Dart e = map.cutEdge(d);
......@@ -154,7 +154,7 @@ void quadranguleFaces(typename PFP::MAP& map, EMBV& attributs, const FunctorSele
// second pass: quandrangule faces
for (Dart d = map.begin(); d != map.end(); map.next(d))
{
if (selected(d) && !map.isBoundaryMarked(d) && !mf.isMarked(d))
if (selected(d) && !map.isBoundaryMarked2(d) && !mf.isMarked(d))
{
EMB center = Geometry::faceCentroidGen<PFP,EMBV,EMB>(map, d, attributs); // compute center
Dart cf = quadranguleFace<PFP>(map, d); // quadrangule the face
......@@ -188,7 +188,7 @@ void CatmullClarkSubdivision(typename PFP::MAP& map, EMBV& attributs, const Func
// first pass: cut edges
for (Dart d = map.begin(); d != map.end(); map.next(d))
{
if (selected(d) && !map.isBoundaryMarked(d) && !me.isMarked(d))
if (selected(d) && !map.isBoundaryMarked2(d) && !me.isMarked(d))
{
if (!m0.isMarked(d))
{
......@@ -222,7 +222,7 @@ void CatmullClarkSubdivision(typename PFP::MAP& map, EMBV& attributs, const Func
// second pass: quandrangule faces
for (Dart d = map.begin(); d != map.end(); map.next(d))
{
if (selected(d) && !map.isBoundaryMarked(d) && mf.isMarked(d)) // for each face not subdivided
if (selected(d) && !map.isBoundaryMarked2(d) && mf.isMarked(d)) // for each face not subdivided
{
// compute center skip darts of new vertices non embedded
EMB center = AttribOps::zero<EMB,PFP>();
......@@ -340,7 +340,7 @@ void LoopSubdivision(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec
// first pass cut edges
for (Dart d = map.begin(); d != map.end(); map.next(d))
{
if (selected(d) && !map.isBoundaryMarked(d) && !me.isMarked(d))
if (selected(d) && !map.isBoundaryMarked2(d) && !me.isMarked(d))
{
if (!m0.isMarked(d))
{
......
......@@ -73,7 +73,7 @@ namespace Tetrahedralization
// //check if all vertices degree is equal to 3 (= no direct adjacent vertex has been split)
// for(std::vector<Dart>::iterator it=dov.begin();vertToTet && it!=dov.end();++it)
// {
// if(!cmv.isMarked(*it) && !map.isBoundaryMarked(*it))
// if(!cmv.isMarked(*it) && !map.isBoundaryMarked3(*it))
// {
// cmv.mark(*it);
// vertToTet = (map.phi1(map.phi2(map.phi1(map.phi2(map.phi1(map.phi2(*it))))))==*it); //degree = 3
......@@ -85,7 +85,7 @@ namespace Tetrahedralization
// {
// for(std::vector<Dart>::iterator it=dov.begin();it!=dov.end();++it)
// {
// if(cmv.isMarked(*it) && !map.isBoundaryMarked(*it))
// if(cmv.isMarked(*it) && !map.isBoundaryMarked3(*it))
// {
// cmv.unmark(*it);
// cut3Ear<PFP>(map,*it);
......@@ -569,7 +569,7 @@ Dart edgeBisection(typename PFP::MAP& map, Dart d)
std::vector<Dart> edges;
do
{
if(!map.isBoundaryMarked(dit))
if(!map.isBoundaryMarked3(dit))
{
edges.push_back(map.phi_1(dit));
edges.push_back(map.phi_1(map.phi2(map.phi_1(edges[0]))));
......
......@@ -204,7 +204,7 @@ void foreach_cell(MAP& map, std::vector<FunctorMapThreaded<MAP>*>& funcs, bool n
unsigned int nb = 0;
while ((d != map.end()) && (nb < nbth*SIZE_BUFFER_THREAD) )
{
if (good(d) && (!map.isBoundaryMarked(d)) && (!cmark->isMarked(d)))
if (good(d) && (!map.isBoundaryMarkedCurrent(d)) && (!cmark->isMarked(d)))
{
cmark->mark(d);
vd[nb%nbth].push_back(d);
......@@ -220,7 +220,7 @@ void foreach_cell(MAP& map, std::vector<FunctorMapThreaded<MAP>*>& funcs, bool n
unsigned int nb = 0;
while ((d != map.end()) && (nb < nbth*SIZE_BUFFER_THREAD) )
{
if (good(d) && (!map.isBoundaryMarked(d)) && (!dmark->isMarked(d)))
if (good(d) && (!map.isBoundaryMarkedCurrent(d)) && (!dmark->isMarked(d)))
{
dmark->markOrbit<ORBIT>(d);
vd[nb%nbth].push_back(d);
......@@ -292,7 +292,7 @@ void foreach_cell(MAP& map, std::vector<FunctorMapThreaded<MAP>*>& funcs, bool n
unsigned int nb = 0;
while ((d != map.end()) && (nb < nbth*SIZE_BUFFER_THREAD) )
{
if (good(d) && (!map.isBoundaryMarked(d)) && (!cmark->isMarked(d)))
if (good(d) && (!map.isBoundaryMarkedCurrent(d)) && (!cmark->isMarked(d)))
{
cmark->mark(d);
tempo[nb%nbth].push_back(d);
......@@ -315,7 +315,7 @@ void foreach_cell(MAP& map, std::vector<FunctorMapThreaded<MAP>*>& funcs, bool n
unsigned int nb = 0;
while ((d != map.end()) && (nb < nbth*SIZE_BUFFER_THREAD) )
{
if (good(d) && (!map.isBoundaryMarked(d)) && (!dmark->isMarked(d)))
if (good(d) && (!map.isBoundaryMarkedCurrent(d)) && (!dmark->isMarked(d)))
{
dmark->markOrbit<ORBIT>(d);
tempo[nb%nbth].push_back(d);
......@@ -704,7 +704,7 @@ void foreach_cell_all_thread(MAP& map, std::vector<FunctorMapThreaded<MAP>*>& fu
unsigned int nb=0;
while ((d != map.end()) && (nb < SIZE_BUFFER_THREAD) )
{
if (good(d) && (!map.isBoundaryMarked(d)) && (!cmark->isMarked(d)))
if (good(d) && (!map.isBoundaryMarkedCurrent(d)) && (!cmark->isMarked(d)))
{
cmark->mark(d);
vd.push_back(d);
......@@ -720,7 +720,7 @@ void foreach_cell_all_thread(MAP& map, std::vector<FunctorMapThreaded<MAP>*>& fu
unsigned int nb=0;
while ((d != map.end()) && (nb < SIZE_BUFFER_THREAD) )
{
if (good(d) && (!map.isBoundaryMarked(d)) && (!dmark->isMarked(d)))
if (good(d) && (!map.isBoundaryMarkedCurrent(d)) && (!dmark->isMarked(d)))
{
dmark->markOrbit<ORBIT>(d);
vd.push_back(d);
......@@ -778,7 +778,7 @@ void foreach_cell_all_thread(MAP& map, std::vector<FunctorMapThreaded<MAP>*>& fu
unsigned int nb=0;
while ((d != map.end()) && (nb < SIZE_BUFFER_THREAD) )
{
if (good(d) && (!map.isBoundaryMarked(d)) && (!cmark->isMarked(d)))
if (good(d) && (!map.isBoundaryMarkedCurrent(d)) && (!cmark->isMarked(d)))
{
cmark->mark(d);
tempo.push_back(d);
......@@ -799,7 +799,7 @@ void foreach_cell_all_thread(MAP& map, std::vector<FunctorMapThreaded<MAP>*>& fu
unsigned int nb=0;
while ((d != map.end()) && (nb < SIZE_BUFFER_THREAD) )
{
if (good(d) && (!map.isBoundaryMarked(d)) && (!dmark->isMarked(d)))
if (good(d) && (!map.isBoundaryMarkedCurrent(d)) && (!dmark->isMarked(d)))
{
dmark->markOrbit<ORBIT>(d);
tempo.push_back(d);
......
......@@ -336,7 +336,7 @@ void MapRender::initTrianglesOptimized(typename PFP::MAP& map, const FunctorSele
{
std::list<Dart> bound;
if (good(dd) && !map.isBoundaryMarked(dd))
if (good(dd) && !map.isBoundaryMarkedCurrent(dd))
{
if(position == NULL)
addTri<PFP>(map, dd, tableIndices);
......@@ -362,7 +362,7 @@ void MapRender::initTrianglesOptimized(typename PFP::MAP& map, const FunctorSele
{
if (!m.isMarked(f))
{
if (good(f) && !map.isBoundaryMarked(f))
if (good(f) && !map.isBoundaryMarkedCurrent(f))
{
if(position == NULL)
addTri<PFP>(map, f, tableIndices);
......
......@@ -208,7 +208,7 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const VertexAttribute<
m_nbRel2++;
}
e = mapx.phi3(d);
if (!mapx.isBoundaryMarked(e) && (d < e) && good(d) && good(e))
if (!mapx.isBoundaryMarked3(e) && (d < e) && good(d) && good(e))
{
*positionF3++ = fv2[d];
*positionF3++ = fv2x[e];
......@@ -485,7 +485,7 @@ void Topo3Render::updateDataGMap3(typename PFP::MAP& mapx, const VertexAttribute
m_nbRel2++;
}
e = map.beta3(d);
if (!map.isBoundaryMarked(e) && (d < e))
if (!map.isBoundaryMarked3(e) && (d < e))
{
*positionF3++ = fv2[d];
*positionF3++ = fv2x[e];
......@@ -504,7 +504,7 @@ void Topo3Render::updateDataGMap3(typename PFP::MAP& mapx, const VertexAttribute
m_nbRel2++;
}
e = map.beta3(d);
if (!map.isBoundaryMarked(e) && (d < e))
if (!map.isBoundaryMarked3(e) && (d < e))
{
*positionF3++ = fv2[d];
*positionF3++ = fv2x[e];
......@@ -745,7 +745,7 @@ void Topo3Render::computeDartMiddlePositions(typename PFP::MAP& map, DartAttribu
// m_nbRel2++;
// }
// e = map.phi3(d);
// if (!map.isBoundaryMarked(e) && (d < e))
// if (!map.isBoundaryMarked3(e) && (d < e))
// {
// *positionF3++ = fv2[d];
// *positionF3++ = fv2x[e];
......
......@@ -146,6 +146,9 @@ public:
FunctorSelect* copy() const { return new SelectorEdgeNoBoundary(m_map);}
};
/**
* Selector for darts of boundary (of current dimension)
*/
template <typename MAP>
class SelectorDartBoundary : public FunctorSelect
{
......@@ -154,10 +157,13 @@ protected:
MAP& m_map;
public:
SelectorDartBoundary(MAP& m): m_map(m) {}
bool operator()(Dart d) const { return m_map.isBoundaryMarked(d); }
bool operator()(Dart d) const { return m_map.isBoundaryMarkedCurrent(d); }
FunctorSelect* copy() const { return new SelectorDartBoundary(m_map);}
};
/**
* Selector for darts not of boundary (of current dimension)
*/
template <typename MAP>
class SelectorDartNoBoundary : public FunctorSelect
......@@ -167,7 +173,7 @@ protected:
MAP& m_map;
public:
SelectorDartNoBoundary(MAP& m): m_map(m) {}
bool operator()(Dart d) const { return !m_map.isBoundaryMarked(d); }
bool operator()(Dart d) const { return !m_map.isBoundaryMarkedCurrent(d); }
FunctorSelect* copy() const { return new SelectorDartNoBoundary(m_map);}
};
......@@ -372,7 +378,7 @@ public:
FunctorStoreNotBoundary(MAP& map, std::vector<Dart>& vec) : FunctorMap<MAP>(map), m_vec(vec) {}
bool operator()(Dart d)
{
if (!this->m_map.isBoundaryMarked(d))
if (!this->m_map.isBoundaryMarkedCurrent(d))
m_vec.push_back(d);
return false;
}
......
......@@ -710,41 +710,55 @@ public:
unsigned int degree(Dart d);
protected:
/// boundary marker
Mark m_boundaryMarker ;
/// boundary markers
// Mark m_boundaryMarker2 ;
// Mark m_boundaryMarker3 ;
Mark m_boundaryMarkers[2] ; // 0 for dim 2 / 1 for dim 3
/**
* mark a dart as belonging to boundary
*/
template <unsigned int D>
void boundaryMark(Dart d) ;
void boundaryMark2(Dart d) ;
void boundaryMark3(Dart d) ;
/**
* unmark a dart from the boundary
*/
template <unsigned int D>
void boundaryUnmark(Dart d) ;
void boundaryUnmark2(Dart d) ;
void boundaryUnmark3(Dart d) ;
public:
/**
* test if a dart belong to the boundary
*/
template <unsigned int D>
bool isBoundaryMarked(Dart d) const ;
bool isBoundaryMarked2(Dart d) const ;
bool isBoundaryMarked3(Dart d) const ;
bool isBoundaryMarkedCurrent(Dart d) const ;
protected:
/**
* mark an orbit of dart as belonging to boundary
*/
template <unsigned int ORBIT>
template <unsigned int ORBIT, unsigned int DIM>
void boundaryMarkOrbit(Dart d) ;
/**
* unmark an orbit of dart from the boundary
*/
template <unsigned int ORBIT>
template <unsigned int ORBIT, unsigned int DIM>
void boundaryUnmarkOrbit(Dart d) ;
/**
* clear all boundary markers
*/
template<unsigned int DIM>
void boundaryUnmarkAll() ;
} ;
......
......@@ -655,19 +655,8 @@ unsigned int GenericMap::degree(Dart d)
return fcount.getNb() ;
}
template <unsigned int ORBIT>
void GenericMap::boundaryMarkOrbit(Dart d)
{
FunctorMark<GenericMap> fm(*this, m_boundaryMarker, m_markTables[DART][0]) ;
foreach_dart_of_orbit<ORBIT>(d, fm, 0) ;
}
template <unsigned int ORBIT>
void GenericMap::boundaryUnmarkOrbit(Dart d)
{
FunctorUnmark<GenericMap> fm(*this, m_boundaryMarker, m_markTables[DART][0]) ;
foreach_dart_of_orbit<ORBIT>(d, fm, 0) ;
}
/****************************************
* TOPOLOGICAL ATTRIBUTES MANAGEMENT *
......@@ -697,19 +686,82 @@ inline AttributeMultiVector<Dart>* GenericMap::getRelation(const std::string& na
* BOUNDARY MANAGEMENT *
**************************/
template <unsigned int D>
inline void GenericMap::boundaryMark(Dart d)
{
m_markTables[DART][0]->operator[](dartIndex(d)).setMark(m_boundaryMarker);
m_markTables[DART][0]->operator[](dartIndex(d)).setMark(m_boundaryMarkers[D-2]);
}
template <unsigned int D>
inline void GenericMap::boundaryUnmark(Dart d)
{
m_markTables[DART][0]->operator[](dartIndex(d)).unsetMark(m_boundaryMarker);
m_markTables[DART][0]->operator[](dartIndex(d)).unsetMark(m_boundaryMarkers[D-2]);
}
template <unsigned int D>
inline bool GenericMap::isBoundaryMarked(Dart d) const
{
return m_markTables[DART][0]->operator[](dartIndex(d)).testMark(m_boundaryMarker);
return m_markTables[DART][0]->operator[](dartIndex(d)).testMark(m_boundaryMarkers[D-2]);
}
inline bool GenericMap::isBoundaryMarkedCurrent(Dart d) const
{
return m_markTables[DART][0]->operator[](dartIndex(d)).testMark(m_boundaryMarkers[this->dimension()-2]);
}
inline void GenericMap::boundaryMark2(Dart d)
{
boundaryMark<2>(d);
}
inline void GenericMap::boundaryUnmark2(Dart d)
{
boundaryUnmark<2>(d);
}
inline bool GenericMap::isBoundaryMarked2(Dart d) const
{
return isBoundaryMarked<2>(d);
}
inline void GenericMap::boundaryMark3(Dart d)
{
boundaryMark<3>(d);
}
inline void GenericMap::boundaryUnmark3(Dart d)
{
boundaryUnmark<3>(d);
}
inline bool GenericMap::isBoundaryMarked3(Dart d) const
{
return isBoundaryMarked<3>(d);
}
template <unsigned int ORBIT, unsigned int DIM>
void GenericMap::boundaryMarkOrbit(Dart d)
{
FunctorMark<GenericMap> fm(*this, m_boundaryMarkers[DIM-2], m_markTables[DART][0]) ;
foreach_dart_of_orbit<ORBIT>(d, fm, 0) ;
}
template <unsigned int ORBIT, unsigned int DIM>
void GenericMap::boundaryUnmarkOrbit(Dart d)
{
FunctorUnmark<GenericMap> fm(*this, m_boundaryMarkers[DIM-2], m_markTables[DART][0]) ;
foreach_dart_of_orbit<ORBIT>(d, fm, 0) ;
}
template <unsigned int DIM>
void GenericMap::boundaryUnmarkAll()
{
AttributeContainer& cont = getAttributeContainer<DART>() ;
for (unsigned int i = cont.begin(); i != cont.end(); cont.next(i))
m_markTables[DART][0]->operator[](i).unsetMark(m_boundaryMarkers[DIM-1]);
}
} //namespace CGoGN
......@@ -66,7 +66,7 @@ Dart Traversor2VE<MAP>::next()
template <typename MAP>
Traversor2VF<MAP>::Traversor2VF(MAP& map, Dart dart) : m(map), start(dart)
{
if(m.isBoundaryMarked(start)) // jump over a boundary face
if(m.isBoundaryMarked2(start)) // jump over a boundary face
start = m.phi2(m.phi_1(start)) ;
}
......@@ -89,7 +89,7 @@ Dart Traversor2VF<MAP>::next()
if(current != NIL)
{
current = m.phi2(m.phi_1(current)) ;
if(m.isBoundaryMarked(current)) // jump over a boundary face
if(m.isBoundaryMarked2(current)) // jump over a boundary face
current = m.phi2(m.phi_1(current)) ;
if(current == start)
current = NIL ;
......@@ -135,7 +135,7 @@ Dart Traversor2VVaE<MAP>::next()
template <typename MAP>
Traversor2VVaF<MAP>::Traversor2VVaF(MAP& map, Dart dart) : m(map)
{
if(m.isBoundaryMarked(dart))
if(m.isBoundaryMarked2(dart))
dart = m.phi2(m.phi_1(dart)) ;
start = m.phi1(m.phi1(dart)) ;
if(start == dart)
......@@ -165,7 +165,7 @@ Dart Traversor2VVaF<MAP>::next()
if(current == stop)
{
Dart d = m.phi2(m.phi_1(current)) ;
if(m.isBoundaryMarked(d)) // jump over a boundary face
if(m.isBoundaryMarked2(d)) // jump over a boundary face
{
d = m.phi2(m.phi_1(d)) ;
current = m.phi1(d);
......@@ -222,7 +222,7 @@ Dart Traversor2EV<MAP>::next()
template <typename MAP>
Traversor2EF<MAP>::Traversor2EF(MAP& map, Dart dart) : m(map), start(dart)
{
if(m.isBoundaryMarked(start))
if(m.isBoundaryMarked2(start))
start = m.phi2(current) ;
}
......@@ -245,7 +245,7 @@ Dart Traversor2EF<MAP>::next()
if(current != NIL)
{
current = m.phi2(current) ;
if(current == start || m.isBoundaryMarked(current)) // do not consider a boundary face
if(current == start || m.isBoundaryMarked2(current)) // do not consider a boundary face
current = NIL ;
}
return current ;
......@@ -373,7 +373,7 @@ Traversor2FFaV<MAP>::Traversor2FFaV(MAP& map, Dart dart) : m(map)
start = next() ;