Commit 0c3be6e9 authored by Pierre Kraemer's avatar Pierre Kraemer

update MR filters

parent 28b02542
......@@ -44,7 +44,7 @@ inline void nextNonEmptyLine(std::ifstream& fp, std::string& line)
template <typename PFP>
bool importMRDAT(typename PFP::MAP& map, const std::string& filename, std::vector<std::string>& attrNames, QuadTree& qt)
{
VertexAttribute<typename PFP::VEC3> position = map.template getAttribute<typename PFP::VEC3, VERTEX>("position") ;
VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL> position = map.template getAttribute<typename PFP::VEC3, VERTEX>("position") ;
if (!position.isValid())
position = map.template addAttribute<typename PFP::VEC3, VERTEX>("position") ;
......@@ -193,8 +193,8 @@ bool importMRDAT(typename PFP::MAP& map, const std::string& filename, std::vecto
std::cout << " Create base level mesh.." << std::flush ;
VertexAutoAttribute< NoTypeNameAttribute< std::vector<Dart> > > vecDartsPerVertex(map, "incidents") ;
DartMarkerNoUnmark m(map) ;
VertexAutoAttribute<NoTypeNameAttribute<std::vector<Dart> >, typename PFP::MAP::IMPL> vecDartsPerVertex(map, "incidents") ;
DartMarkerNoUnmark<typename PFP::MAP> m(map) ;
unsigned nbf = qt.roots.size() ;
......@@ -237,7 +237,7 @@ bool importMRDAT(typename PFP::MAP& map, const std::string& filename, std::vecto
if (good_dart != NIL)
{
map.sewFaces(d, good_dart, false) ;
m.unmarkOrbit<EDGE>(d) ;
m.template unmarkOrbit<EDGE>(d) ;
}
else
{
......
......@@ -762,7 +762,7 @@ void computeBoundaryConstraintDual(typename PFP::MAP& map, VertexAttribute<typen
DartMarkerStore<MAP> mf(map);
for(Dart dit = map.begin() ; dit != map.end() ; map.next(dit))
{
if(!mf.isMarked(dit) && map.isBoundaryMarked2(dit))
if(!mf.isMarked(dit) && map.template isBoundaryMarked<2>(dit))
{
boundsDart.push_back(dit);
Dart db = dit;
......@@ -772,7 +772,7 @@ void computeBoundaryConstraintDual(typename PFP::MAP& map, VertexAttribute<typen
map.cutEdge(map.phi_1(db)) ;
positionF[dit] = (position[dit] + position[map.phi2(dit)]) * REAL(0.5);
mf.markOrbit<FACE>(dit);
mf.template markOrbit<FACE>(dit);
Dart x = map.phi2(map.phi_1(db)) ;
Dart dd = map.phi1(map.phi1(map.phi1(x)));
......@@ -782,12 +782,12 @@ void computeBoundaryConstraintDual(typename PFP::MAP& map, VertexAttribute<typen
Dart prev = map.phi_1(dd);
map.splitFace(dd, map.phi1(x)) ;
positionF[prev] = (position[prev] + position[map.phi1(prev)]) * REAL(0.5);
mf.markOrbit<FACE>(prev);
mf.template markOrbit<FACE>(prev);
dd = next ;
}
positionF[dprev] = (position[dprev] + position[map.phi1(dprev)]) * REAL(0.5);
mf.markOrbit<FACE>(dprev);
mf.template markOrbit<FACE>(dprev);
}
}
......@@ -797,10 +797,10 @@ void computeBoundaryConstraintDual(typename PFP::MAP& map, VertexAttribute<typen
// Fill the holes
for(Dart dit = map.begin() ; dit != map.end() ; map.next(dit))
{
if(mf.isMarked(dit) && map.isBoundaryMarked2(dit))
if(mf.isMarked(dit) && map.template isBoundaryMarked<2>(dit))
{
map.fillHole(dit);
mf.unmarkOrbit<FACE>(dit);
mf.template unmarkOrbit<FACE>(dit);
}
}
......@@ -833,7 +833,7 @@ void computeBoundaryConstraintKeepingOldVerticesDual(typename PFP::MAP& map, Ver
DartMarkerStore<MAP> mf(map);
for(Dart dit = map.begin() ; dit != map.end() ; map.next(dit))
{
if(!mf.isMarked(dit) && map.isBoundaryMarked2(dit))
if(!mf.isMarked(dit) && map.template isBoundaryMarked<2>(dit))
{
boundsDart.push_back(dit);
Dart db = dit;
......@@ -843,7 +843,7 @@ void computeBoundaryConstraintKeepingOldVerticesDual(typename PFP::MAP& map, Ver
map.cutEdge(map.phi_1(db)) ;
positionF[dit] = (position[dit] + position[map.phi2(dit)]) * REAL(0.5);
mf.markOrbit<FACE>(dit);
mf.template markOrbit<FACE>(dit);
Dart x = map.phi2(map.phi_1(db)) ;
Dart dd = map.phi1(map.phi1(map.phi1(x)));
......@@ -853,12 +853,12 @@ void computeBoundaryConstraintKeepingOldVerticesDual(typename PFP::MAP& map, Ver
Dart prev = map.phi_1(dd);
map.splitFace(dd, map.phi1(x)) ;
positionF[prev] = (position[prev] + position[map.phi1(prev)]) * REAL(0.5);
mf.markOrbit<FACE>(prev);
mf.template markOrbit<FACE>(prev);
dd = next ;
}
positionF[dprev] = (position[dprev] + position[map.phi1(dprev)]) * REAL(0.5);
mf.markOrbit<FACE>(dprev);
mf.template markOrbit<FACE>(dprev);
}
}
......@@ -868,10 +868,10 @@ void computeBoundaryConstraintKeepingOldVerticesDual(typename PFP::MAP& map, Ver
// Fill the holes
for(Dart dit = map.begin() ; dit != map.end() ; map.next(dit))
{
if(mf.isMarked(dit) && map.isBoundaryMarked2(dit))
if(mf.isMarked(dit) && map.template isBoundaryMarked<2>(dit))
{
map.fillHole(dit);
mf.unmarkOrbit<FACE>(dit);
mf.template unmarkOrbit<FACE>(dit);
}
}
......@@ -893,12 +893,12 @@ void computeBoundaryConstraintKeepingOldVerticesDual(typename PFP::MAP& map, Ver
// Manage old vertices with new FaceAttribute
for(Dart dit = map.begin() ; dit != map.end() ; map.next(dit))
{
if(!mf.isMarked(dit) && map.isBoundaryMarked2(dit))
if(!mf.isMarked(dit) && map.template isBoundaryMarked<2>(dit))
{
Dart nd = map.cutEdge(dit);
position[nd] = positionF[map.phi2(dit)];
mf.markOrbit<EDGE>(dit);
mf.markOrbit<EDGE>(nd);
mf.template markOrbit<EDGE>(dit);
mf.template markOrbit<EDGE>(nd);
}
}
}
......
......@@ -48,17 +48,22 @@ namespace Filters
template <typename PFP>
class CCVertexSynthesisFilter : public Algo::MR::Filter
{
typedef typename PFP::MAP MAP;
typedef typename PFP::MAP::IMPL MAP_IMPL;
typedef typename PFP::VEC3 VEC3;
typedef typename PFP::REAL REAL;
protected:
typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ;
MAP& m_map ;
VertexAttribute<VEC3, MAP_IMPL>& m_position ;
public:
CCVertexSynthesisFilter(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3>& p) : m_map(m), m_position(p)
CCVertexSynthesisFilter(MAP& m, VertexAttribute<VEC3, MAP_IMPL>& p) : m_map(m), m_position(p)
{}
void operator() ()
{
TraversorV<typename PFP::MAP> trav(m_map) ;
TraversorV<MAP> trav(m_map) ;
for (Dart dV = trav.begin(); dV != trav.end(); dV = trav.next())
{
m_map.incCurrentLevel() ;
......@@ -69,11 +74,11 @@ public:
{
Dart d = m_map.phi1(m_map.phi2(m_map.phi1(m_map.phi2(dit))));
unsigned int degree = m_map.faceDegree(d);
typename PFP::VEC3 p(0.0);
VEC3 p(0.0);
typename PFP::REAL a0 = 1.0 / 2.0 + 1.0 / (4.0 * typename PFP::REAL(degree));
typename PFP::REAL a1 = 1.0 / 8.0 + 1.0 / (4.0 * typename PFP::REAL(degree));
typename PFP::REAL ak_1 = a1;
REAL a0 = 1.0 / 2.0 + 1.0 / (4.0 * REAL(degree));
REAL a1 = 1.0 / 8.0 + 1.0 / (4.0 * REAL(degree));
REAL ak_1 = a1;
if(degree == 3)
{
......@@ -86,7 +91,7 @@ public:
}
else if(degree == 4)
{
typename PFP::REAL a2 = 1.0 / (4.0 * typename PFP::REAL(degree));
REAL a2 = 1.0 / (4.0 * REAL(degree));
p += a0 * m_position[d] + a1 * m_position[m_map.phi1(d)] + a2 * m_position[m_map.phi1(m_map.phi1(d))] + ak_1 * m_position[m_map.phi_1(d)];
......@@ -102,7 +107,7 @@ public:
Dart dit = m_map.phi1(m_map.phi1(d));
do
{
typename PFP::REAL ai = 1.0 / (4.0 * typename PFP::REAL(degree));
REAL ai = 1.0 / (4.0 * REAL(degree));
p += ai * m_position[dit];
dit = m_map.phi1(dit);
......@@ -125,7 +130,6 @@ public:
}
} ;
} // namespace Masks
} // namespace Primal
......@@ -139,4 +143,3 @@ public:
} // namespace CGoGN
#endif
......@@ -48,28 +48,33 @@ namespace Filters
template <typename PFP>
class DooSabinVertexSynthesisFilter : public Algo::MR::Filter
{
typedef typename PFP::MAP MAP;
typedef typename PFP::MAP::IMPL MAP_IMPL;
typedef typename PFP::VEC3 VEC3;
typedef typename PFP::REAL REAL;
protected:
typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ;
MAP& m_map ;
VertexAttribute<VEC3, MAP_IMPL>& m_position ;
public:
DooSabinVertexSynthesisFilter(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3>& p) : m_map(m), m_position(p)
DooSabinVertexSynthesisFilter(MAP& m, VertexAttribute<VEC3, MAP_IMPL>& p) : m_map(m), m_position(p)
{}
void operator() ()
{
for (Dart dV = m_map.begin(); dV != m_map.end(); m_map.next(dV))
{
typename PFP::VEC3 p(0.0);
VEC3 p(0.0);
unsigned int N = m_map.faceDegree(dV);
typename PFP::REAL K0 = float(N+5)/float(4*N);//(1.0 / 4.0) + (5.0 / 4.0) * double(N);
REAL K0 = float(N+5)/float(4*N);//(1.0 / 4.0) + (5.0 / 4.0) * double(N);
p += K0 * m_position[dV];
unsigned int j = 1;
Dart tmp = m_map.phi1(dV);
do
{
typename PFP::REAL Kj = (3.0 + 2.0 * cos(2.0 * double(j) * M_PI / double(N))) / (4.0 * N);
REAL Kj = (3.0 + 2.0 * cos(2.0 * double(j) * M_PI / double(N))) / (4.0 * N);
p += Kj * m_position[tmp];
tmp = m_map.phi1(tmp);
++j;
......@@ -84,7 +89,6 @@ public:
}
} ;
} // namespace Masks
} // namespace Primal
......@@ -98,4 +102,3 @@ public:
} // namespace CGoGN
#endif
......@@ -56,21 +56,25 @@ namespace Filters
template <typename PFP>
class Ber02OddAnalysisFilter : public Algo::MR::Filter
{
typedef typename PFP::MAP MAP;
typedef typename PFP::MAP::IMPL MAP_IMPL;
typedef typename PFP::VEC3 VEC3;
protected:
typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ;
typename PFP::VEC3::DATA_TYPE m_a;
MAP& m_map ;
VertexAttribute<VEC3, MAP_IMPL>& m_position ;
typename VEC3::DATA_TYPE m_a;
public:
Ber02OddAnalysisFilter(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3>& p, typename PFP::VEC3::DATA_TYPE a) : m_map(m), m_position(p), m_a(a)
Ber02OddAnalysisFilter(MAP& m, VertexAttribute<VEC3, MAP_IMPL>& p, typename VEC3::DATA_TYPE a) : m_map(m), m_position(p), m_a(a)
{}
void operator() ()
{
TraversorE<typename PFP::MAP> travE(m_map) ;
TraversorE<MAP> travE(m_map) ;
for (Dart d = travE.begin(); d != travE.end(); d = travE.next())
{
typename PFP::VEC3 ve = (m_position[d] + m_position[m_map.phi1(d)]) * typename PFP::REAL(0.5);
VEC3 ve = (m_position[d] + m_position[m_map.phi1(d)]) * typename PFP::REAL(0.5);
ve *= 2.0 * m_a;
m_map.incCurrentLevel() ;
......@@ -79,14 +83,14 @@ public:
m_map.decCurrentLevel() ;
}
TraversorF<typename PFP::MAP> travF(m_map) ;
TraversorF<MAP> travF(m_map) ;
for (Dart d = travF.begin(); d != travF.end(); d = travF.next())
{
typename PFP::VEC3 vf(0.0);
typename PFP::VEC3 ef(0.0);
VEC3 vf(0.0);
VEC3 ef(0.0);
unsigned int count = 0;
Traversor2FE<typename PFP::MAP> travFE(m_map, d);
Traversor2FE<MAP> travFE(m_map, d);
for (Dart dit = travFE.begin(); dit != travFE.end(); dit = travFE.next())
{
vf += m_position[dit];
......@@ -113,26 +117,30 @@ public:
template <typename PFP>
class Ber02EvenAnalysisFilter : public Algo::MR::Filter
{
typedef typename PFP::MAP MAP;
typedef typename PFP::MAP::IMPL MAP_IMPL;
typedef typename PFP::VEC3 VEC3;
protected:
typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ;
typename PFP::VEC3::DATA_TYPE m_a;
MAP& m_map ;
VertexAttribute<VEC3, MAP_IMPL>& m_position ;
typename VEC3::DATA_TYPE m_a;
public:
Ber02EvenAnalysisFilter(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3>& p, typename PFP::VEC3::DATA_TYPE a) : m_map(m), m_position(p), m_a(a)
Ber02EvenAnalysisFilter(MAP& m, VertexAttribute<VEC3, MAP_IMPL>& p, typename VEC3::DATA_TYPE a) : m_map(m), m_position(p), m_a(a)
{}
void operator() ()
{
TraversorE<typename PFP::MAP> travE(m_map);
TraversorE<MAP> travE(m_map);
for(Dart d = travE.begin() ; d != travE.end() ; d = travE.next())
{
if(!m_map.isBoundaryEdge(d))
{
unsigned int count = 0;
typename PFP::VEC3 fe(0);
Traversor2EF<typename PFP::MAP> travEF(m_map, d);
VEC3 fe(0);
Traversor2EF<MAP> travEF(m_map, d);
for(Dart dit = travEF.begin() ; dit != travEF.end() ; dit = travEF.next())
{
m_map.incCurrentLevel() ;
......@@ -152,11 +160,11 @@ public:
}
}
TraversorV<typename PFP::MAP> travV(m_map);
TraversorV<MAP> travV(m_map);
for(Dart d = travV.begin() ; d != travV.end() ; d = travV.next())
{
typename PFP::VEC3 ev(0.0);
typename PFP::VEC3 fv(0.0);
VEC3 ev(0.0);
VEC3 fv(0.0);
if(m_map.isBoundaryVertex(d))
{
Dart db = m_map.findBoundaryEdgeOfVertex(d);
......@@ -173,7 +181,7 @@ public:
{
unsigned int count = 0;
Traversor2VF<typename PFP::MAP> travVF(m_map,d);
Traversor2VF<MAP> travVF(m_map,d);
for(Dart dit = travVF.begin(); dit != travVF.end() ; dit = travVF.next())
{
m_map.incCurrentLevel() ;
......@@ -201,18 +209,22 @@ public:
template <typename PFP>
class Ber02ScaleAnalysisFilter : public Algo::MR::Filter
{
typedef typename PFP::MAP MAP;
typedef typename PFP::MAP::IMPL MAP_IMPL;
typedef typename PFP::VEC3 VEC3;
protected:
typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ;
typename PFP::VEC3::DATA_TYPE m_a;
MAP& m_map ;
VertexAttribute<VEC3, MAP_IMPL>& m_position ;
typename VEC3::DATA_TYPE m_a;
public:
Ber02ScaleAnalysisFilter(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3>& p, typename PFP::VEC3::DATA_TYPE a) : m_map(m), m_position(p), m_a(a)
Ber02ScaleAnalysisFilter(MAP& m, VertexAttribute<VEC3, MAP_IMPL>& p, typename VEC3::DATA_TYPE a) : m_map(m), m_position(p), m_a(a)
{}
void operator() ()
{
TraversorE<typename PFP::MAP> travE(m_map) ;
TraversorE<MAP> travE(m_map) ;
for (Dart d = travE.begin(); d != travE.end(); d = travE.next())
{
m_map.incCurrentLevel() ;
......@@ -222,7 +234,7 @@ public:
m_map.decCurrentLevel() ;
}
TraversorV<typename PFP::MAP> travV(m_map) ;
TraversorV<MAP> travV(m_map) ;
for (Dart d = travV.begin(); d != travV.end(); d = travV.next())
{
if(m_map.isBoundaryVertex(d))
......@@ -243,26 +255,30 @@ public:
template <typename PFP>
class Ber02OddSynthesisFilter : public Algo::MR::Filter
{
typedef typename PFP::MAP MAP;
typedef typename PFP::MAP::IMPL MAP_IMPL;
typedef typename PFP::VEC3 VEC3;
protected:
typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ;
typename PFP::VEC3::DATA_TYPE m_a;
MAP& m_map ;
VertexAttribute<VEC3, MAP_IMPL>& m_position ;
typename VEC3::DATA_TYPE m_a;
public:
Ber02OddSynthesisFilter(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3>& p, typename PFP::VEC3::DATA_TYPE a) : m_map(m), m_position(p), m_a(a)
Ber02OddSynthesisFilter(MAP& m, VertexAttribute<VEC3, MAP_IMPL>& p, typename VEC3::DATA_TYPE a) : m_map(m), m_position(p), m_a(a)
{}
void operator() ()
{
TraversorF<typename PFP::MAP> travF(m_map) ;
TraversorF<MAP> travF(m_map) ;
for (Dart d = travF.begin(); d != travF.end(); d = travF.next())
{
typename PFP::VEC3 vf(0.0);
typename PFP::VEC3 ef(0.0);
VEC3 vf(0.0);
VEC3 ef(0.0);
unsigned int count = 0;
Traversor2FE<typename PFP::MAP> travFE(m_map, d);
Traversor2FE<MAP> travFE(m_map, d);
for (Dart dit = travFE.begin(); dit != travFE.end(); dit = travFE.next())
{
vf += m_position[dit];
......@@ -284,10 +300,10 @@ public:
}
TraversorE<typename PFP::MAP> travE(m_map) ;
TraversorE<MAP> travE(m_map) ;
for (Dart d = travE.begin(); d != travE.end(); d = travE.next())
{
typename PFP::VEC3 ve = (m_position[d] + m_position[m_map.phi1(d)]) * typename PFP::REAL(0.5);
VEC3 ve = (m_position[d] + m_position[m_map.phi1(d)]) * typename PFP::REAL(0.5);
ve *= 2.0 * m_a;
m_map.incCurrentLevel() ;
......@@ -302,22 +318,26 @@ public:
template <typename PFP>
class Ber02EvenSynthesisFilter : public Algo::MR::Filter
{
typedef typename PFP::MAP MAP;
typedef typename PFP::MAP::IMPL MAP_IMPL;
typedef typename PFP::VEC3 VEC3;
protected:
typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ;
typename PFP::VEC3::DATA_TYPE m_a;
MAP& m_map ;
VertexAttribute<VEC3, MAP_IMPL>& m_position ;
typename VEC3::DATA_TYPE m_a;
public:
Ber02EvenSynthesisFilter(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3>& p, typename PFP::VEC3::DATA_TYPE a) : m_map(m), m_position(p), m_a(a)
Ber02EvenSynthesisFilter(MAP& m, VertexAttribute<VEC3, MAP_IMPL>& p, typename VEC3::DATA_TYPE a) : m_map(m), m_position(p), m_a(a)
{}
void operator() ()
{
TraversorV<typename PFP::MAP> travV(m_map);
TraversorV<MAP> travV(m_map);
for(Dart d = travV.begin() ; d != travV.end() ; d = travV.next())
{
typename PFP::VEC3 ev(0.0);
typename PFP::VEC3 fv(0.0);
VEC3 ev(0.0);
VEC3 fv(0.0);
if(m_map.isBoundaryVertex(d))
{
Dart db = m_map.findBoundaryEdgeOfVertex(d);
......@@ -331,7 +351,7 @@ public:
else
{
unsigned int count = 0;
Traversor2VF<typename PFP::MAP> travVF(m_map,d);
Traversor2VF<MAP> travVF(m_map,d);
for(Dart dit = travVF.begin(); dit != travVF.end() ; dit = travVF.next())
{
m_map.incCurrentLevel() ;
......@@ -352,15 +372,15 @@ public:
}
}
TraversorE<typename PFP::MAP> travE(m_map);
TraversorE<MAP> travE(m_map);
for(Dart d = travE.begin() ; d != travE.end() ; d = travE.next())
{
if(!m_map.isBoundaryEdge(d))
{
unsigned int count = 0;
typename PFP::VEC3 fe(0.0);
Traversor2EF<typename PFP::MAP> travEF(m_map, d);
VEC3 fe(0.0);
Traversor2EF<MAP> travEF(m_map, d);
for(Dart dit = travEF.begin() ; dit != travEF.end() ; dit = travEF.next())
{
m_map.incCurrentLevel() ;
......@@ -379,7 +399,6 @@ public:
m_map.decCurrentLevel() ;
}
}
}
} ;
......@@ -387,18 +406,22 @@ public:
template <typename PFP>
class Ber02ScaleSynthesisFilter : public Algo::MR::Filter
{
typedef typename PFP::MAP MAP;
typedef typename PFP::MAP::IMPL MAP_IMPL;
typedef typename PFP::VEC3 VEC3;
protected:
typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ;
typename PFP::VEC3::DATA_TYPE m_a;
MAP& m_map ;
VertexAttribute<VEC3, MAP_IMPL>& m_position ;
typename VEC3::DATA_TYPE m_a;
public:
Ber02ScaleSynthesisFilter(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3>& p, typename PFP::VEC3::DATA_TYPE a) : m_map(m), m_position(p), m_a(a)
Ber02ScaleSynthesisFilter(MAP& m, VertexAttribute<VEC3, MAP_IMPL>& p, typename VEC3::DATA_TYPE a) : m_map(m), m_position(p), m_a(a)
{}
void operator() ()
{
TraversorV<typename PFP::MAP> travV(m_map) ;
TraversorV<MAP> travV(m_map) ;
for (Dart d = travV.begin(); d != travV.end(); d = travV.next())
{
if(m_map.isBoundaryVertex(d))
......@@ -407,7 +430,7 @@ public:
m_position[d] *= m_a * m_a;
}
TraversorE<typename PFP::MAP> travE(m_map) ;
TraversorE<MAP> travE(m_map) ;
for (Dart d = travE.begin(); d != travE.end(); d = travE.next())
{
m_map.incCurrentLevel() ;
......@@ -419,8 +442,6 @@ public:
}
} ;
} // namespace Filters
} // namespace Primal
......@@ -433,5 +454,4 @@ public:
} // namespace CGoGN
#endif /* __2MR_FILTERS_PRIMAL__ */
......@@ -54,24 +54,28 @@ namespace Filters
template <typename PFP>
class LerpQuadOddSynthesisFilter : public Algo::MR::Filter
{
typedef typename PFP::MAP MAP;
typedef typename PFP::MAP::IMPL MAP_IMPL;
typedef typename PFP::VEC3 VEC3;
protected:
typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ;
MAP& m_map ;
VertexAttribute<VEC3, MAP_IMPL>& m_position ;
public:
LerpQuadOddSynthesisFilter(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3>& p) : m_map(m), m_position(p)
LerpQuadOddSynthesisFilter(MAP& m, VertexAttribute<VEC3, MAP_IMPL>& p) : m_map(m), m_position(p)
{}
void operator() ()
{
TraversorF<typename PFP::MAP> travF(m_map) ;
TraversorF<MAP> travF(m_map) ;
for (Dart d = travF.begin(); d != travF.end(); d = travF.next())
{
typename PFP::VEC3 vf(0.0);
typename PFP::VEC3 ef(0.0);
VEC3 vf(0.0);
VEC3 ef(0.0);
unsigned int count = 0;
Traversor2FE<typename PFP::MAP> travFE(m_map, d);
Traversor2FE<MAP> travFE(m_map, d);
for (Dart dit = travFE.begin(); dit != travFE.end(); dit = travFE.next())
{
vf += m_position[dit];
......@@ -93,10 +97,10 @@ public:
break;
}
TraversorE<typename PFP::MAP> travE(m_map) ;
TraversorE<MAP> travE(m_map) ;
for (Dart d = travE.begin(); d != travE.end(); d = travE.next())
{
typename PFP::VEC3 ve = (m_position[d] + m_position[m_map.phi1(d)]) * typename PFP::REAL(0.5);
VEC3 ve = (m_position[d] + m_position[m_map.phi1(d)]) * typename PFP::REAL(0.5);
m_map.incCurrentLevel() ;
Dart midV = m_map.phi1(d) ;
......@@ -110,26 +114,30 @@ public:
template <typename PFP>
class LerpTriQuadOddSynthesisFilter : public Algo::MR::Filter
{
typedef typename PFP::MAP MAP;
typedef typename PFP::MAP::IMPL MAP_IMPL;
typedef typename PFP::VEC3 VEC3;
protected:
typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ;
MAP& m_map ;
VertexAttribute<VEC3, MAP_IMPL>& m_position ;
public:
LerpTriQuadOddSynthesisFilter(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3>& p) : m_map(m), m_position(p)
LerpTriQuadOddSynthesisFilter(MAP& m, VertexAttribute<VEC3, MAP_IMPL>& p) : m_map(m), m_position(p)
{}
void operator() ()
{
TraversorF<typename PFP::MAP> travF(m_map) ;
TraversorF<MAP> travF(m_map) ;
for (Dart d = travF.begin(); d != travF.end(); d = travF.next())
{
if(m_map.faceDegree(d) != 3)
{
typename PFP::VEC3 vf(0.0);
typename PFP::VEC3 ef(0.0);