Commit afad58ac authored by Sylvain Thery's avatar Sylvain Thery

add Surface/Volume namespace in Multiresolution Algos

parent ce89d70a
...@@ -33,6 +33,9 @@ namespace CGoGN ...@@ -33,6 +33,9 @@ namespace CGoGN
namespace Algo namespace Algo
{ {
namespace Surface
{
namespace MR namespace MR
{ {
...@@ -129,6 +132,8 @@ public: ...@@ -129,6 +132,8 @@ public:
} // namespace MR } // namespace MR
} // namespace Surface
} // namespace Algo } // namespace Algo
} // namespace CGoGN } // namespace CGoGN
......
...@@ -36,6 +36,9 @@ namespace CGoGN ...@@ -36,6 +36,9 @@ namespace CGoGN
namespace Algo namespace Algo
{ {
namespace Surface
{
namespace MR namespace MR
{ {
...@@ -644,13 +647,14 @@ public: ...@@ -644,13 +647,14 @@ public:
{} {}
} ; } ;
} // namespace Filters } // namespace Filters
} // namespace Primal } // namespace Primal
} // namespace MR } // namespace MR
} // namespace Surface
} // namespace Algo } // namespace Algo
} // namespace CGoGN } // namespace CGoGN
......
...@@ -34,6 +34,9 @@ namespace CGoGN ...@@ -34,6 +34,9 @@ namespace CGoGN
namespace Algo namespace Algo
{ {
namespace Surface
{
namespace MR namespace MR
{ {
...@@ -447,6 +450,8 @@ public: ...@@ -447,6 +450,8 @@ public:
} // namespace MR } // namespace MR
} // namespace Surface
} // namespace Algo } // namespace Algo
} // namespace CGoGN } // namespace CGoGN
......
...@@ -34,6 +34,9 @@ namespace CGoGN ...@@ -34,6 +34,9 @@ namespace CGoGN
namespace Algo namespace Algo
{ {
namespace Surface
{
namespace MR namespace MR
{ {
...@@ -90,7 +93,7 @@ public: ...@@ -90,7 +93,7 @@ public:
TraversorF<typename PFP::MAP> trav(m_map) ; TraversorF<typename PFP::MAP> trav(m_map) ;
for (Dart d = trav.begin(); d != trav.end(); d = trav.next()) for (Dart d = trav.begin(); d != trav.end(); d = trav.next())
{ {
typename PFP::VEC3 p = Algo::Geometry::faceCentroid<PFP>(m_map, d, m_position); typename PFP::VEC3 p = Geometry::faceCentroid<PFP>(m_map, d, m_position);
m_map.incCurrentLevel() ; m_map.incCurrentLevel() ;
if(m_map.faceDegree(d) != 3) if(m_map.faceDegree(d) != 3)
...@@ -111,6 +114,8 @@ public: ...@@ -111,6 +114,8 @@ public:
} // namespace MR } // namespace MR
} // namespace Surface
} // namespace Algo } // namespace Algo
} // namespace CGoGN } // namespace CGoGN
......
...@@ -34,6 +34,9 @@ namespace CGoGN ...@@ -34,6 +34,9 @@ namespace CGoGN
namespace Algo namespace Algo
{ {
namespace Surface
{
namespace MR namespace MR
{ {
...@@ -255,6 +258,8 @@ public: ...@@ -255,6 +258,8 @@ public:
} // namespace MR } // namespace MR
} // namespace Surface
} // namespace Algo } // namespace Algo
} // namespace CGoGN } // namespace CGoGN
......
...@@ -34,6 +34,9 @@ namespace CGoGN ...@@ -34,6 +34,9 @@ namespace CGoGN
namespace Algo namespace Algo
{ {
namespace Surface
{
namespace MR namespace MR
{ {
...@@ -64,7 +67,7 @@ public: ...@@ -64,7 +67,7 @@ public:
TraversorF<typename PFP::MAP> trav(m_map) ; TraversorF<typename PFP::MAP> trav(m_map) ;
for (Dart d = trav.begin(); d != trav.end(); d = trav.next()) for (Dart d = trav.begin(); d != trav.end(); d = trav.next())
{ {
typename PFP::VEC3 p = Algo::Geometry::faceCentroid<PFP>(m_map, d, m_position); typename PFP::VEC3 p = Geometry::faceCentroid<PFP>(m_map, d, m_position);
m_map.incCurrentLevel() ; m_map.incCurrentLevel() ;
...@@ -89,6 +92,8 @@ public: ...@@ -89,6 +92,8 @@ public:
} // namespace MR } // namespace MR
} // namespace Surface
} // namespace Algo } // namespace Algo
} // namespace CGoGN } // namespace CGoGN
......
...@@ -34,6 +34,9 @@ namespace CGoGN ...@@ -34,6 +34,9 @@ namespace CGoGN
namespace Algo namespace Algo
{ {
namespace Surface
{
namespace MR namespace MR
{ {
...@@ -329,6 +332,8 @@ public: ...@@ -329,6 +332,8 @@ public:
} // namespace MR } // namespace MR
} // namespace Surface
} // namespace Algo } // namespace Algo
} // namespace CGoGN } // namespace CGoGN
......
...@@ -35,6 +35,9 @@ namespace CGoGN ...@@ -35,6 +35,9 @@ namespace CGoGN
namespace Algo namespace Algo
{ {
namespace Surface
{
namespace MR namespace MR
{ {
...@@ -193,6 +196,8 @@ public: ...@@ -193,6 +196,8 @@ public:
} // namespace MR } // namespace MR
} // namespace Surface
} // namespace Algo } // namespace Algo
} // namespace CGoGN } // namespace CGoGN
......
...@@ -37,6 +37,9 @@ namespace CGoGN ...@@ -37,6 +37,9 @@ namespace CGoGN
namespace Algo namespace Algo
{ {
namespace Surface
{
namespace MR namespace MR
{ {
...@@ -83,6 +86,8 @@ public: ...@@ -83,6 +86,8 @@ public:
} // namespace MR } // namespace MR
} // namespace Surface
} // namespace Algo } // namespace Algo
} // namespace CGoGN } // namespace CGoGN
......
...@@ -28,6 +28,9 @@ namespace CGoGN ...@@ -28,6 +28,9 @@ namespace CGoGN
namespace Algo namespace Algo
{ {
namespace Surface
{
namespace MR namespace MR
{ {
...@@ -149,6 +152,8 @@ void Map2MR<PFP>::synthesis() ...@@ -149,6 +152,8 @@ void Map2MR<PFP>::synthesis()
} // namespace MR } // namespace MR
} // namespace Surface
} // namespace Algo } // namespace Algo
} // namespace CGoGN } // namespace CGoGN
...@@ -45,6 +45,9 @@ namespace CGoGN ...@@ -45,6 +45,9 @@ namespace CGoGN
namespace Algo namespace Algo
{ {
namespace Surface
{
namespace MR namespace MR
{ {
...@@ -111,6 +114,8 @@ public: ...@@ -111,6 +114,8 @@ public:
} // namespace Multiresolution } // namespace Multiresolution
} // namespace Surface
} // namespace Algo } // namespace Algo
} // namespace CGoGN } // namespace CGoGN
......
...@@ -30,6 +30,9 @@ namespace CGoGN ...@@ -30,6 +30,9 @@ namespace CGoGN
namespace Algo namespace Algo
{ {
namespace Surface
{
namespace MR namespace MR
{ {
...@@ -44,14 +47,14 @@ Map2MR_PM<PFP>::~Map2MR_PM() ...@@ -44,14 +47,14 @@ Map2MR_PM<PFP>::~Map2MR_PM()
{ {
if(m_selector) if(m_selector)
delete m_selector ; delete m_selector ;
for(typename std::vector<Algo::Decimation::ApproximatorGen<PFP>*>::iterator it = m_approximators.begin(); it != m_approximators.end(); ++it) for(typename std::vector<Algo::Surface::Decimation::ApproximatorGen<PFP>*>::iterator it = m_approximators.begin(); it != m_approximators.end(); ++it)
delete (*it) ; delete (*it) ;
for(typename std::vector<Algo::Decimation::PredictorGen<PFP>*>::iterator it = m_predictors.begin(); it != m_predictors.end(); ++it) for(typename std::vector<Algo::Surface::Decimation::PredictorGen<PFP>*>::iterator it = m_predictors.begin(); it != m_predictors.end(); ++it)
delete (*it) ; delete (*it) ;
} }
template <typename PFP> template <typename PFP>
void Map2MR_PM<PFP>::createPM(Algo::Decimation::SelectorType s, Algo::Decimation::ApproximatorType a, const FunctorSelect& select) void Map2MR_PM<PFP>::createPM(Algo::Surface::Decimation::SelectorType s, Algo::Surface::Decimation::ApproximatorType a, const FunctorSelect& select)
{ {
CGoGNout << " creating approximator and predictor.." << CGoGNflush ; CGoGNout << " creating approximator and predictor.." << CGoGNflush ;
...@@ -59,31 +62,31 @@ void Map2MR_PM<PFP>::createPM(Algo::Decimation::SelectorType s, Algo::Decimation ...@@ -59,31 +62,31 @@ void Map2MR_PM<PFP>::createPM(Algo::Decimation::SelectorType s, Algo::Decimation
pos_v.push_back(&m_position) ; pos_v.push_back(&m_position) ;
switch(a) switch(a)
{ {
case Algo::Decimation::A_QEM : { case Algo::Surface::Decimation::A_QEM : {
m_approximators.push_back(new Algo::Decimation::Approximator_QEM<PFP>(m_map, pos_v)) ; m_approximators.push_back(new Algo::Surface::Decimation::Approximator_QEM<PFP>(m_map, pos_v)) ;
break ; } break ; }
case Algo::Decimation::A_MidEdge : { case Algo::Surface::Decimation::A_MidEdge : {
m_approximators.push_back(new Algo::Decimation::Approximator_MidEdge<PFP>(m_map, pos_v)) ; m_approximators.push_back(new Algo::Surface::Decimation::Approximator_MidEdge<PFP>(m_map, pos_v)) ;
break ; } break ; }
case Algo::Decimation::A_hHalfCollapse : { case Algo::Surface::Decimation::A_hHalfCollapse : {
Algo::Decimation::Predictor_HalfCollapse<PFP>* pred = new Algo::Decimation::Predictor_HalfCollapse<PFP>(m_map, m_position) ; Algo::Surface::Decimation::Predictor_HalfCollapse<PFP>* pred = new Algo::Surface::Decimation::Predictor_HalfCollapse<PFP>(m_map, m_position) ;
m_predictors.push_back(pred) ; m_predictors.push_back(pred) ;
m_approximators.push_back(new Algo::Decimation::Approximator_HalfCollapse<PFP>(m_map, pos_v, pred)) ; m_approximators.push_back(new Algo::Surface::Decimation::Approximator_HalfCollapse<PFP>(m_map, pos_v, pred)) ;
break ; } break ; }
case Algo::Decimation::A_CornerCutting : { case Algo::Surface::Decimation::A_CornerCutting : {
Algo::Decimation::Predictor_CornerCutting<PFP>* pred = new Algo::Decimation::Predictor_CornerCutting<PFP>(m_map, m_position) ; Algo::Surface::Decimation::Predictor_CornerCutting<PFP>* pred = new Algo::Surface::Decimation::Predictor_CornerCutting<PFP>(m_map, m_position) ;
m_predictors.push_back(pred) ; m_predictors.push_back(pred) ;
m_approximators.push_back(new Algo::Decimation::Approximator_CornerCutting<PFP>(m_map, pos_v, pred)) ; m_approximators.push_back(new Algo::Surface::Decimation::Approximator_CornerCutting<PFP>(m_map, pos_v, pred)) ;
break ; } break ; }
case Algo::Decimation::A_TangentPredict1 : { case Algo::Surface::Decimation::A_TangentPredict1 : {
Algo::Decimation::Predictor_TangentPredict1<PFP>* pred = new Algo::Decimation::Predictor_TangentPredict1<PFP>(m_map, m_position) ; Algo::Surface::Decimation::Predictor_TangentPredict1<PFP>* pred = new Algo::Surface::Decimation::Predictor_TangentPredict1<PFP>(m_map, m_position) ;
m_predictors.push_back(pred) ; m_predictors.push_back(pred) ;
m_approximators.push_back(new Algo::Decimation::Approximator_MidEdge<PFP>(m_map, pos_v, pred)) ; m_approximators.push_back(new Algo::Surface::Decimation::Approximator_MidEdge<PFP>(m_map, pos_v, pred)) ;
break ; } break ; }
case Algo::Decimation::A_TangentPredict2 : { case Algo::Surface::Decimation::A_TangentPredict2 : {
Algo::Decimation::Predictor_TangentPredict2<PFP>* pred = new Algo::Decimation::Predictor_TangentPredict2<PFP>(m_map, m_position) ; Algo::Surface::Decimation::Predictor_TangentPredict2<PFP>* pred = new Algo::Surface::Decimation::Predictor_TangentPredict2<PFP>(m_map, m_position) ;
m_predictors.push_back(pred) ; m_predictors.push_back(pred) ;
m_approximators.push_back(new Algo::Decimation::Approximator_MidEdge<PFP>(m_map, pos_v, pred)) ; m_approximators.push_back(new Algo::Surface::Decimation::Approximator_MidEdge<PFP>(m_map, pos_v, pred)) ;
break ; } break ; }
} }
CGoGNout << "..done" << CGoGNendl ; CGoGNout << "..done" << CGoGNendl ;
...@@ -91,23 +94,23 @@ void Map2MR_PM<PFP>::createPM(Algo::Decimation::SelectorType s, Algo::Decimation ...@@ -91,23 +94,23 @@ void Map2MR_PM<PFP>::createPM(Algo::Decimation::SelectorType s, Algo::Decimation
CGoGNout << " creating selector.." << CGoGNflush ; CGoGNout << " creating selector.." << CGoGNflush ;
switch(s) switch(s)
{ {
case Algo::Decimation::S_MapOrder : { case Algo::Surface::Decimation::S_MapOrder : {
m_selector = new Algo::Decimation::EdgeSelector_MapOrder<PFP>(m_map, m_position, m_approximators, select) ; m_selector = new Algo::Surface::Decimation::EdgeSelector_MapOrder<PFP>(m_map, m_position, m_approximators, select) ;
break ; } break ; }
case Algo::Decimation::S_Random : { case Algo::Surface::Decimation::S_Random : {
m_selector = new Algo::Decimation::EdgeSelector_Random<PFP>(m_map, m_position, m_approximators, select) ; m_selector = new Algo::Surface::Decimation::EdgeSelector_Random<PFP>(m_map, m_position, m_approximators, select) ;
break ; } break ; }
case Algo::Decimation::S_EdgeLength : { case Algo::Surface::Decimation::S_EdgeLength : {
m_selector = new Algo::Decimation::EdgeSelector_Length<PFP>(m_map, m_position, m_approximators, select) ; m_selector = new Algo::Surface::Decimation::EdgeSelector_Length<PFP>(m_map, m_position, m_approximators, select) ;
break ; } break ; }
case Algo::Decimation::S_QEM : { case Algo::Surface::Decimation::S_QEM : {
m_selector = new Algo::Decimation::EdgeSelector_QEM<PFP>(m_map, m_position, m_approximators, select) ; m_selector = new Algo::Surface::Decimation::EdgeSelector_QEM<PFP>(m_map, m_position, m_approximators, select) ;
break ; } break ; }
case Algo::Decimation::S_MinDetail : { case Algo::Surface::Decimation::S_MinDetail : {
m_selector = new Algo::Decimation::EdgeSelector_MinDetail<PFP>(m_map, m_position, m_approximators, select) ; m_selector = new Algo::Surface::Decimation::EdgeSelector_MinDetail<PFP>(m_map, m_position, m_approximators, select) ;
break ; } break ; }
case Algo::Decimation::S_Curvature : { case Algo::Surface::Decimation::S_Curvature : {
m_selector = new Algo::Decimation::EdgeSelector_Curvature<PFP>(m_map, m_position, m_approximators, select) ; m_selector = new Algo::Surface::Decimation::EdgeSelector_Curvature<PFP>(m_map, m_position, m_approximators, select) ;
break ; } break ; }
} }
CGoGNout << "..done" << CGoGNendl ; CGoGNout << "..done" << CGoGNendl ;
...@@ -115,17 +118,17 @@ void Map2MR_PM<PFP>::createPM(Algo::Decimation::SelectorType s, Algo::Decimation ...@@ -115,17 +118,17 @@ void Map2MR_PM<PFP>::createPM(Algo::Decimation::SelectorType s, Algo::Decimation
m_initOk = true ; m_initOk = true ;
CGoGNout << " initializing approximators.." << CGoGNflush ; CGoGNout << " initializing approximators.." << CGoGNflush ;
for(typename std::vector<Algo::Decimation::ApproximatorGen<PFP>*>::iterator it = m_approximators.begin(); it != m_approximators.end(); ++it) for(typename std::vector<Algo::Surface::Decimation::ApproximatorGen<PFP>*>::iterator it = m_approximators.begin(); it != m_approximators.end(); ++it)
{ {
if(! (*it)->init()) if(! (*it)->init())
m_initOk = false ; m_initOk = false ;
if((*it)->getApproximatedAttributeName() == "position") if((*it)->getApproximatedAttributeName() == "position")
m_positionApproximator = reinterpret_cast<Algo::Decimation::Approximator<PFP, VEC3>*>(*it) ; m_positionApproximator = reinterpret_cast<Algo::Surface::Decimation::Approximator<PFP, VEC3>*>(*it) ;
} }
CGoGNout << "..done" << CGoGNendl ; CGoGNout << "..done" << CGoGNendl ;
CGoGNout << " initializing predictors.." << CGoGNflush ; CGoGNout << " initializing predictors.." << CGoGNflush ;
for(typename std::vector<Algo::Decimation::PredictorGen<PFP>*>::iterator it = m_predictors.begin(); it != m_predictors.end(); ++it) for(typename std::vector<Algo::Surface::Decimation::PredictorGen<PFP>*>::iterator it = m_predictors.begin(); it != m_predictors.end(); ++it)
if(! (*it)->init()) if(! (*it)->init())
m_initOk = false ; m_initOk = false ;
CGoGNout << "..done" << CGoGNendl ; CGoGNout << "..done" << CGoGNendl ;
...@@ -312,6 +315,8 @@ Dart Map2MR_PM<PFP>::vertexOrigin(Dart d) ...@@ -312,6 +315,8 @@ Dart Map2MR_PM<PFP>::vertexOrigin(Dart d)
} // namespace Multiresolution } // namespace Multiresolution
} // namespace Surface
} // namespace Algo } // namespace Algo
} // namespace CGoGN } // namespace CGoGN
...@@ -37,6 +37,9 @@ namespace CGoGN ...@@ -37,6 +37,9 @@ namespace CGoGN
namespace Algo namespace Algo
{ {
namespace Surface
{
namespace MR namespace MR
{ {
...@@ -180,6 +183,8 @@ public: ...@@ -180,6 +183,8 @@ public:
} // namespace MR } // namespace MR
} // namespace Surface
} // namespace Algo } // namespace Algo
} // namespace CGoGN } // namespace CGoGN
......
...@@ -30,6 +30,9 @@ namespace CGoGN ...@@ -30,6 +30,9 @@ namespace CGoGN
namespace Algo namespace Algo
{ {
namespace Surface
{
namespace MR namespace MR
{ {
...@@ -565,6 +568,8 @@ unsigned int Map2MR<PFP>::subdivideFaceSqrt3(Dart d) ...@@ -565,6 +568,8 @@ unsigned int Map2MR<PFP>::subdivideFaceSqrt3(Dart d)
} // namespace MR } // namespace MR
} // namespace Surface