Commit a55f60bf authored by untereiner's avatar untereiner

modifying subdivision filters

parent 411513f7
...@@ -156,6 +156,8 @@ public: ...@@ -156,6 +156,8 @@ public:
*/ */
void embedHexaGrid(float x, float y, float z); void embedHexaGrid(float x, float y, float z);
void embedHexaGrid(typename PFP::VEC3 origin, float x, float y, float z);
/** /**
* Create a 3D grid * Create a 3D grid
* @param nx nb of cubes in x * @param nx nb of cubes in x
......
...@@ -37,14 +37,14 @@ template <typename PFP> ...@@ -37,14 +37,14 @@ template <typename PFP>
Dart Primitive3D<PFP>::HexaGrid1Topo(unsigned int nx) Dart Primitive3D<PFP>::HexaGrid1Topo(unsigned int nx)
{ {
// first cube // first cube
Dart d0 = createHexahedron<PFP>(m_map); Dart d0 = createHexahedron<PFP>(m_map,false);
m_tableVertDarts.push_back(d0); m_tableVertDarts.push_back(d0);
Dart d1 = m_map.template phi<2112>(d0); Dart d1 = m_map.template phi<2112>(d0);
for (unsigned int i = 1; i < nx; ++i) for (unsigned int i = 1; i < nx; ++i)
{ {
Dart d2 = createHexahedron<PFP>(m_map); Dart d2 = createHexahedron<PFP>(m_map,false);
m_tableVertDarts.push_back(d2); m_tableVertDarts.push_back(d2);
m_map.sewVolumes(d1, d2, false); m_map.sewVolumes(d1, d2, false);
d1 = m_map.template phi<2112>(d2); d1 = m_map.template phi<2112>(d2);
...@@ -183,6 +183,37 @@ void Primitive3D<PFP>::embedHexaGrid(float x, float y, float z) ...@@ -183,6 +183,37 @@ void Primitive3D<PFP>::embedHexaGrid(float x, float y, float z)
} }
} }
template <typename PFP>
void Primitive3D<PFP>::embedHexaGrid(typename PFP::VEC3 origin, float x, float y, float z)
{
if (m_kind != HEXAGRID)
{
CGoGNerr << "Warning try to embedHexaGrid something that is not a grid of hexahedron"<<CGoGNendl;
return;
}
float dx = x/float(m_nx);
float dy = y/float(m_ny);
float dz = z/float(m_nz);
unsigned int nbs = (m_nx+1)*(m_ny+1);
for(unsigned int i = 0; i <= m_nz; ++i)
{
for(unsigned int j = 0; j <= m_ny; ++j)
{
for(unsigned int k = 0; k <= m_nx; ++k)
{
typename PFP::VEC3 pos(-x/2.0f + dx*float(k), -y/2.0f + dy*float(j), -z/2.0f + dz*float(i));
Dart d = m_tableVertDarts[ i*nbs+j*(m_nx+1)+k ];
m_map.template setOrbitEmbeddingOnNewCell<VERTEX>(d);
m_positions[d] = origin + pos;
}
}
}
}
template <typename PFP> template <typename PFP>
void Primitive3D<PFP>::transform(const Geom::Matrix44f& matrice) void Primitive3D<PFP>::transform(const Geom::Matrix44f& matrice)
{ {
......
...@@ -133,7 +133,16 @@ public: ...@@ -133,7 +133,16 @@ public:
m_map.incCurrentLevel() ; m_map.incCurrentLevel() ;
Dart midF = m_map.phi1(m_map.phi1(d)); Dart midF = m_map.phi1(m_map.phi1(d));
m_position[midF] += vf + ef ; if(filtering)
{
std::cout << "sans +=" << std::endl;
m_position[midF] = vf + ef ;
}
else
{
std::cout << "avec +=" << std::endl;
m_position[midF] += vf + ef ;
}
m_map.decCurrentLevel() ; m_map.decCurrentLevel() ;
} }
...@@ -146,7 +155,16 @@ public: ...@@ -146,7 +155,16 @@ public:
m_map.incCurrentLevel() ; m_map.incCurrentLevel() ;
Dart midV = m_map.phi1(d) ; Dart midV = m_map.phi1(d) ;
m_position[midV] += ve; if(filtering)
{
std::cout << "sans +=" << std::endl;
m_position[midV] = ve;
}
else
{
std::cout << "avec +=" << std::endl;
m_position[midV] += ve;
}
m_map.decCurrentLevel() ; m_map.decCurrentLevel() ;
} }
} }
...@@ -251,9 +269,15 @@ public: ...@@ -251,9 +269,15 @@ public:
ev *= 2 * m_a; ev *= 2 * m_a;
if(filtering) if(filtering)
{
std::cout << "sans +=" << std::endl;
m_position[db] = ev; m_position[db] = ev;
}
else else
{
std::cout << "avec +=" << std::endl;
m_position[db] += ev; m_position[db] += ev;
}
} }
else else
{ {
...@@ -276,9 +300,15 @@ public: ...@@ -276,9 +300,15 @@ public:
ev /= count; ev /= count;
ev *= 4 * m_a; ev *= 4 * m_a;
if(filtering) if(filtering)
m_position[d] = fv;// + ev; {
std::cout << "sans +=" << std::endl;
m_position[d] = fv + ev;
}
else else
{
std::cout << "avec +=" << std::endl;
m_position[d] += fv + ev; m_position[d] += fv + ev;
}
} }
} }
...@@ -306,9 +336,15 @@ public: ...@@ -306,9 +336,15 @@ public:
m_map.incCurrentLevel() ; m_map.incCurrentLevel() ;
Dart midF = m_map.phi1(d); Dart midF = m_map.phi1(d);
if(filtering) if(filtering)
m_position[midF] += fe; {
std::cout << "sans +=" << std::endl;
m_position[midF] = fe;
}
else else
{
std::cout << "avec +=" << std::endl;
m_position[midF] += fe; m_position[midF] += fe;
}
m_map.decCurrentLevel() ; m_map.decCurrentLevel() ;
} }
} }
......
...@@ -90,6 +90,11 @@ public: ...@@ -90,6 +90,11 @@ public:
first = false; first = false;
} }
} }
void operator() (bool filtering)
{
}
} ; } ;
template <typename PFP> template <typename PFP>
...@@ -118,6 +123,11 @@ public: ...@@ -118,6 +123,11 @@ public:
first = false; first = false;
} }
} }
void operator() (bool filtering)
{
}
} ; } ;
template <typename PFP> template <typename PFP>
...@@ -144,6 +154,11 @@ public: ...@@ -144,6 +154,11 @@ public:
m_map.decCurrentLevel() ; m_map.decCurrentLevel() ;
} }
} }
void operator() (bool filtering)
{
}
} ; } ;
template <typename PFP> template <typename PFP>
...@@ -192,6 +207,11 @@ public: ...@@ -192,6 +207,11 @@ public:
} }
} }
void operator() (bool filtering)
{
}
} ; } ;
template <typename PFP> template <typename PFP>
...@@ -244,6 +264,11 @@ public: ...@@ -244,6 +264,11 @@ public:
m_map.decCurrentLevel() ; m_map.decCurrentLevel() ;
} }
} }
void operator() (bool filtering)
{
}
} ; } ;
template <typename PFP> template <typename PFP>
...@@ -277,6 +302,11 @@ public: ...@@ -277,6 +302,11 @@ public:
m_map.decCurrentLevel() ; m_map.decCurrentLevel() ;
} }
} }
void operator() (bool filtering)
{
}
} ; } ;
template <typename PFP> template <typename PFP>
...@@ -310,6 +340,11 @@ public: ...@@ -310,6 +340,11 @@ public:
m_map.decCurrentLevel() ; m_map.decCurrentLevel() ;
} }
} }
void operator() (bool filtering)
{
}
} ; } ;
template <typename PFP> template <typename PFP>
...@@ -364,6 +399,11 @@ public: ...@@ -364,6 +399,11 @@ public:
} }
} }
void operator() (bool filtering)
{
}
} ; } ;
template <typename PFP> template <typename PFP>
...@@ -411,6 +451,10 @@ public: ...@@ -411,6 +451,10 @@ public:
m_position[m_map.phi2(m_map.phi1(d))] = m_position[m_map.phi2(m_map.phi1(d))] - v - e ; m_position[m_map.phi2(m_map.phi1(d))] = m_position[m_map.phi2(m_map.phi1(d))] - v - e ;
m_map.decCurrentLevel() ; m_map.decCurrentLevel() ;
} }
}
void operator() (bool filtering)
{
} }
} ; } ;
...@@ -439,6 +483,11 @@ public: ...@@ -439,6 +483,11 @@ public:
m_map.decCurrentLevel() ; m_map.decCurrentLevel() ;
} }
} }
void operator() (bool filtering)
{
}
} ; } ;
} // namespace Filters } // namespace Filters
......
...@@ -99,6 +99,11 @@ public: ...@@ -99,6 +99,11 @@ public:
m_map.decCurrentLevel() ; m_map.decCurrentLevel() ;
} }
} }
void operator() (bool filtering)
{
}
}; };
// Tri/quad refinement // Tri/quad refinement
...@@ -156,6 +161,11 @@ public: ...@@ -156,6 +161,11 @@ public:
m_map.decCurrentLevel() ; m_map.decCurrentLevel() ;
} }
} }
void operator() (bool filtering)
{
}
}; };
/********************************************************************************* /*********************************************************************************
...@@ -214,6 +224,11 @@ public: ...@@ -214,6 +224,11 @@ public:
m_map.decCurrentLevel() ; m_map.decCurrentLevel() ;
} }
} }
void operator() (bool filtering)
{
}
}; };
// Tri/quad refinement // Tri/quad refinement
...@@ -271,6 +286,11 @@ public: ...@@ -271,6 +286,11 @@ public:
} }
} }
} }
void operator() (bool filtering)
{
}
}; };
} // namespace Filters } // namespace Filters
......
...@@ -121,6 +121,11 @@ public: ...@@ -121,6 +121,11 @@ public:
m_map.decCurrentLevel() ; m_map.decCurrentLevel() ;
} }
} }
void operator() (bool filtering)
{
}
} ; } ;
template <typename PFP> template <typename PFP>
...@@ -143,6 +148,11 @@ public: ...@@ -143,6 +148,11 @@ public:
m_position[d] -= p ; m_position[d] -= p ;
} }
} }
void operator() (bool filtering)
{
}
} ; } ;
template <typename PFP> template <typename PFP>
...@@ -168,6 +178,11 @@ public: ...@@ -168,6 +178,11 @@ public:
m_position[d] /= n ; m_position[d] /= n ;
} }
} }
void operator() (bool filtering)
{
}
} ; } ;
/********************************************************************************* /*********************************************************************************
...@@ -200,6 +215,11 @@ public: ...@@ -200,6 +215,11 @@ public:
m_map.decCurrentLevel() ; m_map.decCurrentLevel() ;
} }
} }
void operator() (bool filtering)
{
}
} ; } ;
template <typename PFP> template <typename PFP>
...@@ -222,6 +242,11 @@ public: ...@@ -222,6 +242,11 @@ public:
m_position[d] += p ; m_position[d] += p ;
} }
} }
void operator() (bool filtering)
{
}
} ; } ;
template <typename PFP> template <typename PFP>
...@@ -247,6 +272,11 @@ public: ...@@ -247,6 +272,11 @@ public:
m_position[d] *= n ; m_position[d] *= n ;
} }
} }
void operator() (bool filtering)
{
}
} ; } ;
} // namespace Filters } // namespace Filters
......
...@@ -80,6 +80,11 @@ public: ...@@ -80,6 +80,11 @@ public:
} }
} }
void operator() (bool filtering)
{
}
} ; } ;
......
...@@ -141,6 +141,11 @@ public: ...@@ -141,6 +141,11 @@ public:
m_map.decCurrentLevel() ; m_map.decCurrentLevel() ;
} }
} }
void operator() (bool filtering)
{
}
} ; } ;
template <typename PFP> template <typename PFP>
...@@ -225,6 +230,11 @@ public: ...@@ -225,6 +230,11 @@ public:
} }
} }
} }
void operator() (bool filtering)
{
}
} ; } ;
template <typename PFP> template <typename PFP>
...@@ -275,6 +285,11 @@ public: ...@@ -275,6 +285,11 @@ public:
} }
} }
void operator() (bool filtering)
{
}
} ; } ;
template <typename PFP> template <typename PFP>
...@@ -312,6 +327,11 @@ public: ...@@ -312,6 +327,11 @@ public:
} }
} }
void operator() (bool filtering)
{
}
} ; } ;
/********************************************************************************* /*********************************************************************************
......
...@@ -258,18 +258,24 @@ void Map2MR<PFP>::synthesis() ...@@ -258,18 +258,24 @@ void Map2MR<PFP>::synthesis()
{ {
assert(m_map.getCurrentLevel() < m_map.getMaxLevel() || !"synthesis : called on max level") ; assert(m_map.getCurrentLevel() < m_map.getMaxLevel() || !"synthesis : called on max level") ;
for(unsigned int i = 0; i < synthesisFilters.size(); ++i)
(*synthesisFilters[i])() ;
// for(unsigned int i = 0; i < synthesisFilters.size(); ++i) // for(unsigned int i = 0; i < synthesisFilters.size(); ++i)
// { // (*synthesisFilters[i])() ;
// if((filter == F_LowPass && m_map.getCurrentLevel() <= thresholdHigh) ||
// (filter == F_HighPass && m_map.getCurrentLevel() >= thresholdLow) || for(unsigned int i = 0; i < synthesisFilters.size(); ++i)
// (filter == F_BandPass && (thresholdLow >= m_map.getCurrentLevel() && m_map.getCurrentLevel() <= thresholdHigh))) {
// (*synthesisFilters[i])(true) ; if((filter == F_LowPass && m_map.getCurrentLevel() <= thresholdHigh) ||
// else (filter == F_HighPass && m_map.getCurrentLevel() >= thresholdLow) ||
// (*synthesisFilters[i])(false) ; (filter == F_BandPass && (thresholdLow >= m_map.getCurrentLevel() && m_map.getCurrentLevel() <= thresholdHigh)))
// } {
std::cout << "without details" << std::endl;