Commit 927fc518 authored by Sylvain Thery's avatar Sylvain Thery

multi-attributes algorithms comeback

parent 5502db65
...@@ -45,7 +45,9 @@ namespace Geometry ...@@ -45,7 +45,9 @@ namespace Geometry
template <typename PFP, typename EMBV, typename EMB> template <typename PFP, typename EMBV, typename EMB>
EMB volumeCentroidGen(typename PFP::MAP& map, Dart d, const EMBV& attributs, unsigned int thread) EMB volumeCentroidGen(typename PFP::MAP& map, Dart d, const EMBV& attributs, unsigned int thread)
{ {
EMB center = AttribOps::zero<EMB,PFP>() ; // EMB center = AttribOps::zero<EMB,PFP>() ;
EMB center(0.0);
unsigned int count = 0 ; unsigned int count = 0 ;
Traversor3WV<typename PFP::MAP> tra(map,d,false,thread); Traversor3WV<typename PFP::MAP> tra(map,d,false,thread);
...@@ -62,7 +64,8 @@ EMB volumeCentroidGen(typename PFP::MAP& map, Dart d, const EMBV& attributs, uns ...@@ -62,7 +64,8 @@ EMB volumeCentroidGen(typename PFP::MAP& map, Dart d, const EMBV& attributs, uns
template <typename PFP, typename EMBV, typename EMB> template <typename PFP, typename EMBV, typename EMB>
EMB volumeCentroidELWGen(typename PFP::MAP& map, Dart d, const EMBV& attributs, unsigned int thread) EMB volumeCentroidELWGen(typename PFP::MAP& map, Dart d, const EMBV& attributs, unsigned int thread)
{ {
EMB center = AttribOps::zero<EMB,PFP>(); // EMB center = AttribOps::zero<EMB,PFP>();
EMB center(0.0);
double count=0.0; double count=0.0;
Traversor3WE<typename PFP::MAP> t(map, d,false,thread) ; Traversor3WE<typename PFP::MAP> t(map, d,false,thread) ;
for(Dart it = t.begin(); it != t.end();it = t.next()) for(Dart it = t.begin(); it != t.end();it = t.next())
...@@ -81,7 +84,8 @@ EMB volumeCentroidELWGen(typename PFP::MAP& map, Dart d, const EMBV& attributs, ...@@ -81,7 +84,8 @@ EMB volumeCentroidELWGen(typename PFP::MAP& map, Dart d, const EMBV& attributs,
template <typename PFP, typename EMBV, typename EMB> template <typename PFP, typename EMBV, typename EMB>
EMB faceCentroidGen(typename PFP::MAP& map, Dart d, const EMBV& attributs) EMB faceCentroidGen(typename PFP::MAP& map, Dart d, const EMBV& attributs)
{ {
EMB center = AttribOps::zero<EMB,PFP>(); // EMB center = AttribOps::zero<EMB,PFP>();
EMB center(0.0);
unsigned int count = 0 ; unsigned int count = 0 ;
Traversor2FV<typename PFP::MAP> t(map, d) ; Traversor2FV<typename PFP::MAP> t(map, d) ;
for(Dart it = t.begin(); it != t.end(); it = t.next()) for(Dart it = t.begin(); it != t.end(); it = t.next())
...@@ -97,7 +101,8 @@ EMB faceCentroidGen(typename PFP::MAP& map, Dart d, const EMBV& attributs) ...@@ -97,7 +101,8 @@ EMB faceCentroidGen(typename PFP::MAP& map, Dart d, const EMBV& attributs)
template <typename PFP, typename EMBV, typename EMB> template <typename PFP, typename EMBV, typename EMB>
EMB faceCentroidELWGen(typename PFP::MAP& map, Dart d, const EMBV& attributs) EMB faceCentroidELWGen(typename PFP::MAP& map, Dart d, const EMBV& attributs)
{ {
EMB center = AttribOps::zero<EMB,PFP>(); // EMB center = AttribOps::zero<EMB,PFP>();
EMB center(0.0);
double count=0.0; double count=0.0;
Traversor2FE<typename PFP::MAP> t(map, d) ; Traversor2FE<typename PFP::MAP> t(map, d) ;
for(Dart it = t.begin(); it != t.end(); it = t.next()) for(Dart it = t.begin(); it != t.end(); it = t.next())
...@@ -116,7 +121,8 @@ EMB faceCentroidELWGen(typename PFP::MAP& map, Dart d, const EMBV& attributs) ...@@ -116,7 +121,8 @@ EMB faceCentroidELWGen(typename PFP::MAP& map, Dart d, const EMBV& attributs)
template <typename PFP, typename EMBV, typename EMB> template <typename PFP, typename EMBV, typename EMB>
EMB vertexNeighborhoodCentroidGen(typename PFP::MAP& map, Dart d, const EMBV& attributs) EMB vertexNeighborhoodCentroidGen(typename PFP::MAP& map, Dart d, const EMBV& attributs)
{ {
EMB center = AttribOps::zero<EMB,PFP>(); // EMB center = AttribOps::zero<EMB,PFP>();
EMB center(0.0);
unsigned int count = 0 ; unsigned int count = 0 ;
Traversor2VVaE<typename PFP::MAP> t(map, d) ; Traversor2VVaE<typename PFP::MAP> t(map, d) ;
for(Dart it = t.begin(); it != t.end(); it = t.next()) for(Dart it = t.begin(); it != t.end(); it = t.next())
...@@ -248,7 +254,8 @@ namespace Geometry ...@@ -248,7 +254,8 @@ namespace Geometry
template <typename PFP, typename EMBV, typename EMB> template <typename PFP, typename EMBV, typename EMB>
EMB vertexNeighborhoodCentroidGen(typename PFP::MAP& map, Dart d, const EMBV& attributs) EMB vertexNeighborhoodCentroidGen(typename PFP::MAP& map, Dart d, const EMBV& attributs)
{ {
EMB center = AttribOps::zero<EMB,PFP>(); // EMB center = AttribOps::zero<EMB,PFP>();
EMB center(0.0);
unsigned int count = 0 ; unsigned int count = 0 ;
Traversor3VVaE<typename PFP::MAP> t(map, d) ; Traversor3VVaE<typename PFP::MAP> t(map, d) ;
for(Dart it = t.begin(); it != t.end(); it = t.next()) for(Dart it = t.begin(); it != t.end(); it = t.next())
......
...@@ -225,7 +225,8 @@ void CatmullClarkSubdivision(typename PFP::MAP& map, EMBV& attributs) ...@@ -225,7 +225,8 @@ void CatmullClarkSubdivision(typename PFP::MAP& map, EMBV& attributs)
if ( !map.isBoundaryMarked2(d) && mf.isMarked(d)) // for each face not subdivided if ( !map.isBoundaryMarked2(d) && mf.isMarked(d)) // for each face not subdivided
{ {
// compute center skip darts of new vertices non embedded // compute center skip darts of new vertices non embedded
EMB center = AttribOps::zero<EMB,PFP>(); // EMB center = AttribOps::zero<EMB,PFP>();
EMB center(0.0);
unsigned int count = 0 ; unsigned int count = 0 ;
mf.unmarkOrbit<FACE>(d) ; mf.unmarkOrbit<FACE>(d) ;
Dart it = d; Dart it = d;
...@@ -254,8 +255,9 @@ void CatmullClarkSubdivision(typename PFP::MAP& map, EMBV& attributs) ...@@ -254,8 +255,9 @@ void CatmullClarkSubdivision(typename PFP::MAP& map, EMBV& attributs)
{ {
Dart f1 = map.phi_1(x); Dart f1 = map.phi_1(x);
Dart f2 = map.phi2(map.phi1(map.phi2(x))); Dart f2 = map.phi2(map.phi1(map.phi2(x)));
EMB temp = AttribOps::zero<EMB,PFP>(); // EMB temp = AttribOps::zero<EMB,PFP>();
temp = attributs[f1]; // temp = attributs[f1];
EMB temp = attributs[f1];
temp += attributs[f2]; // E' = (V0+V1+F1+F2)/4 temp += attributs[f2]; // E' = (V0+V1+F1+F2)/4
temp *= 0.25; temp *= 0.25;
attributs[x] *= 0.5; attributs[x] *= 0.5;
...@@ -269,8 +271,10 @@ void CatmullClarkSubdivision(typename PFP::MAP& map, EMBV& attributs) ...@@ -269,8 +271,10 @@ void CatmullClarkSubdivision(typename PFP::MAP& map, EMBV& attributs)
{ {
m0.unmark(*vert); m0.unmark(*vert);
EMB temp = AttribOps::zero<EMB,PFP>(); // EMB temp = AttribOps::zero<EMB,PFP>();
EMB temp2 = AttribOps::zero<EMB,PFP>(); // EMB temp2 = AttribOps::zero<EMB,PFP>();
EMB temp(0.0);
EMB temp2(0.0);
unsigned int n = 0; unsigned int n = 0;
Dart x = *vert; Dart x = *vert;
...@@ -378,8 +382,11 @@ void LoopSubdivision(typename PFP::MAP& map, EMBV& attributs) ...@@ -378,8 +382,11 @@ void LoopSubdivision(typename PFP::MAP& map, EMBV& attributs)
Dart dd = map.phi2(d); Dart dd = map.phi2(d);
attributs[d] *= 0.75; attributs[d] *= 0.75;
Dart e1 = map.template phi<111>(d); Dart e1 = map.template phi<111>(d);
EMB temp = AttribOps::zero<EMB,PFP>();
temp = attributs[e1]; // EMB temp(0.0);
// temp += attributs[e1];
EMB temp = attributs[e1];
e1 = map.phi_1(map.phi_1(dd)); e1 = map.phi_1(map.phi_1(dd));
temp += attributs[e1]; temp += attributs[e1];
temp *= 1.0 / 8.0; temp *= 1.0 / 8.0;
...@@ -393,7 +400,8 @@ void LoopSubdivision(typename PFP::MAP& map, EMBV& attributs) ...@@ -393,7 +400,8 @@ void LoopSubdivision(typename PFP::MAP& map, EMBV& attributs)
{ {
m0.unmark(*vert); m0.unmark(*vert);
EMB temp = AttribOps::zero<EMB,PFP>(); // EMB temp = AttribOps::zero<EMB,PFP>();
EMB temp(0.0);
int n = 0; int n = 0;
Dart x = *vert; Dart x = *vert;
do do
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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