From afad58ac4254c3d1b863d796d48e846d972b97fd Mon Sep 17 00:00:00 2001 From: Sylvain Thery Date: Mon, 14 Jan 2013 10:39:20 +0100 Subject: [PATCH] add Surface/Volume namespace in Multiresolution Algos --- .../Map2MR/Filters/Dual/catmullClark.h | 5 ++ .../Multiresolution/Map2MR/Filters/bertram.h | 6 +- .../Map2MR/Filters/catmullClark.h | 5 ++ .../Multiresolution/Map2MR/Filters/lerp.h | 7 +- .../Multiresolution/Map2MR/Filters/loop.h | 5 ++ .../Multiresolution/Map2MR/Filters/sqrt2.h | 7 +- .../Multiresolution/Map2MR/Filters/sqrt3.h | 5 ++ .../Multiresolution/Map2MR/lerpAttributes.h | 5 ++ .../Map2MR/map2MR_DualRegular.h | 5 ++ .../Map2MR/map2MR_DualRegular.hpp | 5 ++ .../Algo/Multiresolution/Map2MR/map2MR_PM.h | 5 ++ .../Algo/Multiresolution/Map2MR/map2MR_PM.hpp | 73 ++++++++++--------- .../Map2MR/map2MR_PrimalAdapt.h | 5 ++ .../Map2MR/map2MR_PrimalAdapt.hpp | 5 ++ .../Map2MR/map2MR_PrimalRegular.h | 5 ++ .../Map2MR/map2MR_PrimalRegular.hpp | 5 ++ .../Multiresolution/Map3MR/Filters/bertram.h | 9 ++- .../Multiresolution/Map3MR/Filters/lerp.h | 13 +++- .../Map3MR/Filters/mcCrackenJoy.h | 23 +++--- .../Multiresolution/Map3MR/Filters/schaefer.h | 11 ++- .../Algo/Multiresolution/Map3MR/Masks/lerp.h | 9 ++- .../Map3MR/Masks/mcCrackenJoy.h | 21 ++++-- .../Multiresolution/Map3MR/Masks/schaefer.h | 5 ++ .../Map3MR/map3MR_PrimalAdapt.h | 5 ++ .../Map3MR/map3MR_PrimalAdapt.hpp | 5 ++ .../Map3MR/map3MR_PrimalRegular.h | 5 ++ .../Map3MR/map3MR_PrimalRegular.hpp | 15 ++-- 27 files changed, 204 insertions(+), 70 deletions(-) diff --git a/include/Algo/Multiresolution/Map2MR/Filters/Dual/catmullClark.h b/include/Algo/Multiresolution/Map2MR/Filters/Dual/catmullClark.h index 6e7cb937..4e442ef2 100644 --- a/include/Algo/Multiresolution/Map2MR/Filters/Dual/catmullClark.h +++ b/include/Algo/Multiresolution/Map2MR/Filters/Dual/catmullClark.h @@ -33,6 +33,9 @@ namespace CGoGN namespace Algo { +namespace Surface +{ + namespace MR { @@ -129,6 +132,8 @@ public: } // namespace MR +} // namespace Surface + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map2MR/Filters/bertram.h b/include/Algo/Multiresolution/Map2MR/Filters/bertram.h index 56920885..43db00ca 100644 --- a/include/Algo/Multiresolution/Map2MR/Filters/bertram.h +++ b/include/Algo/Multiresolution/Map2MR/Filters/bertram.h @@ -36,6 +36,9 @@ namespace CGoGN namespace Algo { +namespace Surface +{ + namespace MR { @@ -644,13 +647,14 @@ public: {} } ; - } // namespace Filters } // namespace Primal } // namespace MR +} // namespace Surface + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map2MR/Filters/catmullClark.h b/include/Algo/Multiresolution/Map2MR/Filters/catmullClark.h index 9f9a813b..b3494c69 100644 --- a/include/Algo/Multiresolution/Map2MR/Filters/catmullClark.h +++ b/include/Algo/Multiresolution/Map2MR/Filters/catmullClark.h @@ -34,6 +34,9 @@ namespace CGoGN namespace Algo { +namespace Surface +{ + namespace MR { @@ -447,6 +450,8 @@ public: } // namespace MR +} // namespace Surface + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map2MR/Filters/lerp.h b/include/Algo/Multiresolution/Map2MR/Filters/lerp.h index 08e78a8a..96f3b129 100644 --- a/include/Algo/Multiresolution/Map2MR/Filters/lerp.h +++ b/include/Algo/Multiresolution/Map2MR/Filters/lerp.h @@ -34,6 +34,9 @@ namespace CGoGN namespace Algo { +namespace Surface +{ + namespace MR { @@ -90,7 +93,7 @@ public: TraversorF trav(m_map) ; for (Dart d = trav.begin(); d != trav.end(); d = trav.next()) { - typename PFP::VEC3 p = Algo::Geometry::faceCentroid(m_map, d, m_position); + typename PFP::VEC3 p = Geometry::faceCentroid(m_map, d, m_position); m_map.incCurrentLevel() ; if(m_map.faceDegree(d) != 3) @@ -111,6 +114,8 @@ public: } // namespace MR +} // namespace Surface + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map2MR/Filters/loop.h b/include/Algo/Multiresolution/Map2MR/Filters/loop.h index 97762996..8a3d7fc4 100644 --- a/include/Algo/Multiresolution/Map2MR/Filters/loop.h +++ b/include/Algo/Multiresolution/Map2MR/Filters/loop.h @@ -34,6 +34,9 @@ namespace CGoGN namespace Algo { +namespace Surface +{ + namespace MR { @@ -255,6 +258,8 @@ public: } // namespace MR +} // namespace Surface + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map2MR/Filters/sqrt2.h b/include/Algo/Multiresolution/Map2MR/Filters/sqrt2.h index 1690213a..c478a5e2 100644 --- a/include/Algo/Multiresolution/Map2MR/Filters/sqrt2.h +++ b/include/Algo/Multiresolution/Map2MR/Filters/sqrt2.h @@ -34,6 +34,9 @@ namespace CGoGN namespace Algo { +namespace Surface +{ + namespace MR { @@ -64,7 +67,7 @@ public: TraversorF trav(m_map) ; for (Dart d = trav.begin(); d != trav.end(); d = trav.next()) { - typename PFP::VEC3 p = Algo::Geometry::faceCentroid(m_map, d, m_position); + typename PFP::VEC3 p = Geometry::faceCentroid(m_map, d, m_position); m_map.incCurrentLevel() ; @@ -89,6 +92,8 @@ public: } // namespace MR +} // namespace Surface + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map2MR/Filters/sqrt3.h b/include/Algo/Multiresolution/Map2MR/Filters/sqrt3.h index f2a3f54b..67215e47 100644 --- a/include/Algo/Multiresolution/Map2MR/Filters/sqrt3.h +++ b/include/Algo/Multiresolution/Map2MR/Filters/sqrt3.h @@ -34,6 +34,9 @@ namespace CGoGN namespace Algo { +namespace Surface +{ + namespace MR { @@ -329,6 +332,8 @@ public: } // namespace MR +} // namespace Surface + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map2MR/lerpAttributes.h b/include/Algo/Multiresolution/Map2MR/lerpAttributes.h index 1878de9f..b53fbdfb 100644 --- a/include/Algo/Multiresolution/Map2MR/lerpAttributes.h +++ b/include/Algo/Multiresolution/Map2MR/lerpAttributes.h @@ -35,6 +35,9 @@ namespace CGoGN namespace Algo { +namespace Surface +{ + namespace MR { @@ -193,6 +196,8 @@ public: } // namespace MR +} // namespace Surface + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map2MR/map2MR_DualRegular.h b/include/Algo/Multiresolution/Map2MR/map2MR_DualRegular.h index 19f941d1..5335d969 100644 --- a/include/Algo/Multiresolution/Map2MR/map2MR_DualRegular.h +++ b/include/Algo/Multiresolution/Map2MR/map2MR_DualRegular.h @@ -37,6 +37,9 @@ namespace CGoGN namespace Algo { +namespace Surface +{ + namespace MR { @@ -83,6 +86,8 @@ public: } // namespace MR +} // namespace Surface + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map2MR/map2MR_DualRegular.hpp b/include/Algo/Multiresolution/Map2MR/map2MR_DualRegular.hpp index 23d115ae..a122169c 100644 --- a/include/Algo/Multiresolution/Map2MR/map2MR_DualRegular.hpp +++ b/include/Algo/Multiresolution/Map2MR/map2MR_DualRegular.hpp @@ -28,6 +28,9 @@ namespace CGoGN namespace Algo { +namespace Surface +{ + namespace MR { @@ -149,6 +152,8 @@ void Map2MR::synthesis() } // namespace MR +} // namespace Surface + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map2MR/map2MR_PM.h b/include/Algo/Multiresolution/Map2MR/map2MR_PM.h index 36b204b0..f59eb044 100644 --- a/include/Algo/Multiresolution/Map2MR/map2MR_PM.h +++ b/include/Algo/Multiresolution/Map2MR/map2MR_PM.h @@ -45,6 +45,9 @@ namespace CGoGN namespace Algo { +namespace Surface +{ + namespace MR { @@ -111,6 +114,8 @@ public: } // namespace Multiresolution +} // namespace Surface + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map2MR/map2MR_PM.hpp b/include/Algo/Multiresolution/Map2MR/map2MR_PM.hpp index 4bd5edef..dc94ade4 100644 --- a/include/Algo/Multiresolution/Map2MR/map2MR_PM.hpp +++ b/include/Algo/Multiresolution/Map2MR/map2MR_PM.hpp @@ -30,6 +30,9 @@ namespace CGoGN namespace Algo { +namespace Surface +{ + namespace MR { @@ -44,14 +47,14 @@ Map2MR_PM::~Map2MR_PM() { if(m_selector) delete m_selector ; - for(typename std::vector*>::iterator it = m_approximators.begin(); it != m_approximators.end(); ++it) + for(typename std::vector*>::iterator it = m_approximators.begin(); it != m_approximators.end(); ++it) delete (*it) ; - for(typename std::vector*>::iterator it = m_predictors.begin(); it != m_predictors.end(); ++it) + for(typename std::vector*>::iterator it = m_predictors.begin(); it != m_predictors.end(); ++it) delete (*it) ; } template -void Map2MR_PM::createPM(Algo::Decimation::SelectorType s, Algo::Decimation::ApproximatorType a, const FunctorSelect& select) +void Map2MR_PM::createPM(Algo::Surface::Decimation::SelectorType s, Algo::Surface::Decimation::ApproximatorType a, const FunctorSelect& select) { CGoGNout << " creating approximator and predictor.." << CGoGNflush ; @@ -59,31 +62,31 @@ void Map2MR_PM::createPM(Algo::Decimation::SelectorType s, Algo::Decimation pos_v.push_back(&m_position) ; switch(a) { - case Algo::Decimation::A_QEM : { - m_approximators.push_back(new Algo::Decimation::Approximator_QEM(m_map, pos_v)) ; + case Algo::Surface::Decimation::A_QEM : { + m_approximators.push_back(new Algo::Surface::Decimation::Approximator_QEM(m_map, pos_v)) ; break ; } - case Algo::Decimation::A_MidEdge : { - m_approximators.push_back(new Algo::Decimation::Approximator_MidEdge(m_map, pos_v)) ; + case Algo::Surface::Decimation::A_MidEdge : { + m_approximators.push_back(new Algo::Surface::Decimation::Approximator_MidEdge(m_map, pos_v)) ; break ; } - case Algo::Decimation::A_hHalfCollapse : { - Algo::Decimation::Predictor_HalfCollapse* pred = new Algo::Decimation::Predictor_HalfCollapse(m_map, m_position) ; + case Algo::Surface::Decimation::A_hHalfCollapse : { + Algo::Surface::Decimation::Predictor_HalfCollapse* pred = new Algo::Surface::Decimation::Predictor_HalfCollapse(m_map, m_position) ; m_predictors.push_back(pred) ; - m_approximators.push_back(new Algo::Decimation::Approximator_HalfCollapse(m_map, pos_v, pred)) ; + m_approximators.push_back(new Algo::Surface::Decimation::Approximator_HalfCollapse(m_map, pos_v, pred)) ; break ; } - case Algo::Decimation::A_CornerCutting : { - Algo::Decimation::Predictor_CornerCutting* pred = new Algo::Decimation::Predictor_CornerCutting(m_map, m_position) ; + case Algo::Surface::Decimation::A_CornerCutting : { + Algo::Surface::Decimation::Predictor_CornerCutting* pred = new Algo::Surface::Decimation::Predictor_CornerCutting(m_map, m_position) ; m_predictors.push_back(pred) ; - m_approximators.push_back(new Algo::Decimation::Approximator_CornerCutting(m_map, pos_v, pred)) ; + m_approximators.push_back(new Algo::Surface::Decimation::Approximator_CornerCutting(m_map, pos_v, pred)) ; break ; } - case Algo::Decimation::A_TangentPredict1 : { - Algo::Decimation::Predictor_TangentPredict1* pred = new Algo::Decimation::Predictor_TangentPredict1(m_map, m_position) ; + case Algo::Surface::Decimation::A_TangentPredict1 : { + Algo::Surface::Decimation::Predictor_TangentPredict1* pred = new Algo::Surface::Decimation::Predictor_TangentPredict1(m_map, m_position) ; m_predictors.push_back(pred) ; - m_approximators.push_back(new Algo::Decimation::Approximator_MidEdge(m_map, pos_v, pred)) ; + m_approximators.push_back(new Algo::Surface::Decimation::Approximator_MidEdge(m_map, pos_v, pred)) ; break ; } - case Algo::Decimation::A_TangentPredict2 : { - Algo::Decimation::Predictor_TangentPredict2* pred = new Algo::Decimation::Predictor_TangentPredict2(m_map, m_position) ; + case Algo::Surface::Decimation::A_TangentPredict2 : { + Algo::Surface::Decimation::Predictor_TangentPredict2* pred = new Algo::Surface::Decimation::Predictor_TangentPredict2(m_map, m_position) ; m_predictors.push_back(pred) ; - m_approximators.push_back(new Algo::Decimation::Approximator_MidEdge(m_map, pos_v, pred)) ; + m_approximators.push_back(new Algo::Surface::Decimation::Approximator_MidEdge(m_map, pos_v, pred)) ; break ; } } CGoGNout << "..done" << CGoGNendl ; @@ -91,23 +94,23 @@ void Map2MR_PM::createPM(Algo::Decimation::SelectorType s, Algo::Decimation CGoGNout << " creating selector.." << CGoGNflush ; switch(s) { - case Algo::Decimation::S_MapOrder : { - m_selector = new Algo::Decimation::EdgeSelector_MapOrder(m_map, m_position, m_approximators, select) ; + case Algo::Surface::Decimation::S_MapOrder : { + m_selector = new Algo::Surface::Decimation::EdgeSelector_MapOrder(m_map, m_position, m_approximators, select) ; break ; } - case Algo::Decimation::S_Random : { - m_selector = new Algo::Decimation::EdgeSelector_Random(m_map, m_position, m_approximators, select) ; + case Algo::Surface::Decimation::S_Random : { + m_selector = new Algo::Surface::Decimation::EdgeSelector_Random(m_map, m_position, m_approximators, select) ; break ; } - case Algo::Decimation::S_EdgeLength : { - m_selector = new Algo::Decimation::EdgeSelector_Length(m_map, m_position, m_approximators, select) ; + case Algo::Surface::Decimation::S_EdgeLength : { + m_selector = new Algo::Surface::Decimation::EdgeSelector_Length(m_map, m_position, m_approximators, select) ; break ; } - case Algo::Decimation::S_QEM : { - m_selector = new Algo::Decimation::EdgeSelector_QEM(m_map, m_position, m_approximators, select) ; + case Algo::Surface::Decimation::S_QEM : { + m_selector = new Algo::Surface::Decimation::EdgeSelector_QEM(m_map, m_position, m_approximators, select) ; break ; } - case Algo::Decimation::S_MinDetail : { - m_selector = new Algo::Decimation::EdgeSelector_MinDetail(m_map, m_position, m_approximators, select) ; + case Algo::Surface::Decimation::S_MinDetail : { + m_selector = new Algo::Surface::Decimation::EdgeSelector_MinDetail(m_map, m_position, m_approximators, select) ; break ; } - case Algo::Decimation::S_Curvature : { - m_selector = new Algo::Decimation::EdgeSelector_Curvature(m_map, m_position, m_approximators, select) ; + case Algo::Surface::Decimation::S_Curvature : { + m_selector = new Algo::Surface::Decimation::EdgeSelector_Curvature(m_map, m_position, m_approximators, select) ; break ; } } CGoGNout << "..done" << CGoGNendl ; @@ -115,17 +118,17 @@ void Map2MR_PM::createPM(Algo::Decimation::SelectorType s, Algo::Decimation m_initOk = true ; CGoGNout << " initializing approximators.." << CGoGNflush ; - for(typename std::vector*>::iterator it = m_approximators.begin(); it != m_approximators.end(); ++it) + for(typename std::vector*>::iterator it = m_approximators.begin(); it != m_approximators.end(); ++it) { if(! (*it)->init()) m_initOk = false ; if((*it)->getApproximatedAttributeName() == "position") - m_positionApproximator = reinterpret_cast*>(*it) ; + m_positionApproximator = reinterpret_cast*>(*it) ; } CGoGNout << "..done" << CGoGNendl ; CGoGNout << " initializing predictors.." << CGoGNflush ; - for(typename std::vector*>::iterator it = m_predictors.begin(); it != m_predictors.end(); ++it) + for(typename std::vector*>::iterator it = m_predictors.begin(); it != m_predictors.end(); ++it) if(! (*it)->init()) m_initOk = false ; CGoGNout << "..done" << CGoGNendl ; @@ -312,6 +315,8 @@ Dart Map2MR_PM::vertexOrigin(Dart d) } // namespace Multiresolution +} // namespace Surface + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map2MR/map2MR_PrimalAdapt.h b/include/Algo/Multiresolution/Map2MR/map2MR_PrimalAdapt.h index 61c0a03a..219781e3 100644 --- a/include/Algo/Multiresolution/Map2MR/map2MR_PrimalAdapt.h +++ b/include/Algo/Multiresolution/Map2MR/map2MR_PrimalAdapt.h @@ -37,6 +37,9 @@ namespace CGoGN namespace Algo { +namespace Surface +{ + namespace MR { @@ -180,6 +183,8 @@ public: } // namespace MR +} // namespace Surface + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map2MR/map2MR_PrimalAdapt.hpp b/include/Algo/Multiresolution/Map2MR/map2MR_PrimalAdapt.hpp index a2b45370..404fbd35 100644 --- a/include/Algo/Multiresolution/Map2MR/map2MR_PrimalAdapt.hpp +++ b/include/Algo/Multiresolution/Map2MR/map2MR_PrimalAdapt.hpp @@ -30,6 +30,9 @@ namespace CGoGN namespace Algo { +namespace Surface +{ + namespace MR { @@ -565,6 +568,8 @@ unsigned int Map2MR::subdivideFaceSqrt3(Dart d) } // namespace MR +} // namespace Surface + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.h b/include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.h index 3c1b215e..f2f0a141 100644 --- a/include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.h +++ b/include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.h @@ -37,6 +37,9 @@ namespace CGoGN namespace Algo { +namespace Surface +{ + namespace MR { @@ -91,6 +94,8 @@ public: } // namespace MR +} // namespace Surface + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.hpp b/include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.hpp index 88f9f27e..c7e5adb0 100644 --- a/include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.hpp +++ b/include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.hpp @@ -28,6 +28,9 @@ namespace CGoGN namespace Algo { +namespace Surface +{ + namespace MR { @@ -281,6 +284,8 @@ void Map2MR::synthesis() } // namespace MR +} // namespace Surface + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map3MR/Filters/bertram.h b/include/Algo/Multiresolution/Map3MR/Filters/bertram.h index a297d877..8505d72b 100644 --- a/include/Algo/Multiresolution/Map3MR/Filters/bertram.h +++ b/include/Algo/Multiresolution/Map3MR/Filters/bertram.h @@ -36,6 +36,9 @@ namespace CGoGN namespace Algo { +namespace Volume +{ + namespace MR { @@ -71,7 +74,7 @@ public: TraversorW travW(m_map) ; for (Dart d = travW.begin(); d != travW.end(); d = travW.next()) { - typename PFP::VEC3 vc = Algo::Geometry::volumeCentroid(m_map, d, m_position); + typename PFP::VEC3 vc = Algo::Surface::Geometry::volumeCentroid(m_map, d, m_position); vc *= 8 * m_a * m_a * m_a; unsigned int count = 0; @@ -483,7 +486,7 @@ public: TraversorW travW(m_map) ; for (Dart d = travW.begin(); d != travW.end(); d = travW.next()) { - typename PFP::VEC3 vc = Algo::Geometry::volumeCentroid(m_map, d, m_position); + typename PFP::VEC3 vc = Algo::Surface::Geometry::volumeCentroid(m_map, d, m_position); vc *= 8 * m_a * m_a * m_a; unsigned int count = 0; @@ -799,6 +802,8 @@ public: } // namespace MR +} // namespace Volume + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map3MR/Filters/lerp.h b/include/Algo/Multiresolution/Map3MR/Filters/lerp.h index 447dcdac..cbbc5dd1 100644 --- a/include/Algo/Multiresolution/Map3MR/Filters/lerp.h +++ b/include/Algo/Multiresolution/Map3MR/Filters/lerp.h @@ -36,6 +36,9 @@ namespace CGoGN namespace Algo { +namespace Volume +{ + namespace MR { @@ -95,7 +98,7 @@ public: TraversorF trav(m_map) ; for (Dart d = trav.begin(); d != trav.end(); d = trav.next()) { - typename PFP::VEC3 p = Algo::Geometry::faceCentroid(m_map, d, m_position); + typename PFP::VEC3 p = Algo::Surface::Geometry::faceCentroid(m_map, d, m_position); m_map.incCurrentLevel() ; @@ -124,11 +127,11 @@ public: TraversorW trav(m_map) ; for (Dart d = trav.begin(); d != trav.end(); d = trav.next()) { - typename PFP::VEC3 p = Algo::Geometry::volumeCentroid(m_map, d, m_position); + typename PFP::VEC3 p = Algo::Surface::Geometry::volumeCentroid(m_map, d, m_position); m_map.incCurrentLevel() ; - if(!Algo::Modelisation::Tetrahedralization::isTetrahedron(m_map,d)) + if(!Algo::Volume::Modelisation::Tetrahedralization::isTetrahedron(m_map,d)) { Dart midV = m_map.phi_1(m_map.phi2(m_map.phi1(d))); @@ -157,7 +160,7 @@ public: TraversorW trav(m_map) ; for (Dart d = trav.begin(); d != trav.end(); d = trav.next()) { - typename PFP::VEC3 p = Algo::Geometry::volumeCentroid(m_map, d, m_position); + typename PFP::VEC3 p = Algo::Surface::Geometry::volumeCentroid(m_map, d, m_position); m_map.incCurrentLevel() ; @@ -176,6 +179,8 @@ public: } // namespace MR +} // namespace Volume + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map3MR/Filters/mcCrackenJoy.h b/include/Algo/Multiresolution/Map3MR/Filters/mcCrackenJoy.h index f8938dc1..85710596 100644 --- a/include/Algo/Multiresolution/Map3MR/Filters/mcCrackenJoy.h +++ b/include/Algo/Multiresolution/Map3MR/Filters/mcCrackenJoy.h @@ -35,6 +35,9 @@ namespace CGoGN namespace Algo { +namespace Volume +{ + namespace MR { @@ -112,7 +115,7 @@ public: Traversor3VW travVW(m_map, d); for(Dart dit = travVW.begin() ; dit != travVW.end() ; dit = travVW.next()) { - Cavg += Algo::Geometry::volumeCentroid(m_map, dit, m_position); + Cavg += Algo::Surface::Geometry::volumeCentroid(m_map, dit, m_position); ++degree; } Cavg /= degree; @@ -122,7 +125,7 @@ public: Traversor3VF travVF(m_map, d); for(Dart dit = travVF.begin() ; dit != travVF.end() ; dit = travVF.next()) { - Aavg += Algo::Geometry::faceCentroid(m_map, dit, m_position); + Aavg += Algo::Surface::Geometry::faceCentroid(m_map, dit, m_position); ++degree; } Aavg /= degree; @@ -208,7 +211,7 @@ public: Traversor3EW travEW(m_map, d); for(Dart dit = travEW.begin() ; dit != travEW.end() ; dit = travEW.next()) { - Cavg += Algo::Geometry::volumeCentroid(m_map, dit, m_position); + Cavg += Algo::Surface::Geometry::volumeCentroid(m_map, dit, m_position); ++degree; } Cavg /= degree; @@ -218,7 +221,7 @@ public: Traversor3EF travEF(m_map, d); for(Dart dit = travEF.begin() ; dit != travEF.end() ; dit = travEF.next()) { - Aavg += Algo::Geometry::faceCentroid(m_map, dit, m_position); + Aavg += Algo::Surface::Geometry::faceCentroid(m_map, dit, m_position); ++degree; } Aavg /= degree; @@ -282,10 +285,10 @@ public: else { //face points - typename PFP::VEC3 C0 = Algo::Geometry::volumeCentroid(m_map, d, m_position); - typename PFP::VEC3 C1 = Algo::Geometry::volumeCentroid(m_map, m_map.phi3(d), m_position); + typename PFP::VEC3 C0 = Algo::Surface::Geometry::volumeCentroid(m_map, d, m_position); + typename PFP::VEC3 C1 = Algo::Surface::Geometry::volumeCentroid(m_map, m_map.phi3(d), m_position); - typename PFP::VEC3 A = Algo::Geometry::faceCentroid(m_map, m_map.phi3(d), m_position); + typename PFP::VEC3 A = Algo::Surface::Geometry::faceCentroid(m_map, m_map.phi3(d), m_position); typename PFP::VEC3 fp = C0 + A * 2 + C1; fp /= 4; @@ -319,11 +322,11 @@ public: { //cell points : these points are the average of the //vertices of the lattice that bound the cell - typename PFP::VEC3 p = Algo::Geometry::volumeCentroid(m_map, d, m_position); + typename PFP::VEC3 p = Algo::Surface::Geometry::volumeCentroid(m_map, d, m_position); m_map.incCurrentLevel() ; - if(!Algo::Modelisation::Tetrahedralization::isTetrahedron(m_map,d)) + if(!Algo::Volume::Modelisation::Tetrahedralization::isTetrahedron(m_map,d)) { Dart midV = m_map.phi_1(m_map.phi2(m_map.phi1(d))); m_position[midV] = p ; @@ -341,6 +344,8 @@ public: } // namespace MR +} // namespace Volume + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map3MR/Filters/schaefer.h b/include/Algo/Multiresolution/Map3MR/Filters/schaefer.h index cf9b8093..5aac0bac 100644 --- a/include/Algo/Multiresolution/Map3MR/Filters/schaefer.h +++ b/include/Algo/Multiresolution/Map3MR/Filters/schaefer.h @@ -36,6 +36,9 @@ namespace CGoGN namespace Algo { +namespace Volume +{ + namespace MR { @@ -99,7 +102,7 @@ typename PFP::VEC3 SHW04Vertex(typename PFP::MAP& map, const VertexAttribute(map, d)) + if(Algo::Volume::Modelisation::Tetrahedralization::isTetrahedron(map, d)) { Dart d1 = map.phi1(d) ; Dart d2 = map.phi_1(d); @@ -374,9 +377,9 @@ public: TraversorW trav(m_map) ; for (Dart d = trav.begin(); d != trav.end(); d = trav.next()) { - if(!Algo::Modelisation::Tetrahedralization::isTetrahedron(m_map,d)) + if(!Algo::Volume::Modelisation::Tetrahedralization::isTetrahedron(m_map,d)) { - typename PFP::VEC3 p = Algo::Geometry::volumeCentroid(m_map, d, m_position); + typename PFP::VEC3 p = Algo::Surface::Geometry::volumeCentroid(m_map, d, m_position); m_map.incCurrentLevel() ; @@ -433,6 +436,8 @@ public: } // namespace MR +} // namespace Volume + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map3MR/Masks/lerp.h b/include/Algo/Multiresolution/Map3MR/Masks/lerp.h index c7348be3..9f7f6d01 100644 --- a/include/Algo/Multiresolution/Map3MR/Masks/lerp.h +++ b/include/Algo/Multiresolution/Map3MR/Masks/lerp.h @@ -34,6 +34,9 @@ namespace CGoGN namespace Algo { +namespace Volume +{ + namespace MR { @@ -110,7 +113,7 @@ public: Dart df = m_map.phi1(m_map.phi1(d)) ; m_map.decCurrentLevel() ; - typename PFP::VEC3 p = Algo::Geometry::faceCentroid(m_map, df, m_position); + typename PFP::VEC3 p = Algo::Surface::Geometry::faceCentroid(m_map, df, m_position); m_map.incCurrentLevel() ; m_position[d] = p ; @@ -135,7 +138,7 @@ public: Dart df = m_map.phi_1(m_map.phi2(m_map.phi1(d))) ; m_map.decCurrentLevel() ; - typename PFP::VEC3 p = Algo::Geometry::volumeCentroid(m_map, df, m_position); + typename PFP::VEC3 p = Algo::Surface::Geometry::volumeCentroid(m_map, df, m_position); m_map.incCurrentLevel() ; m_position[d] = p ; @@ -151,6 +154,8 @@ public: } // namespace MR +} // namespace Volume + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map3MR/Masks/mcCrackenJoy.h b/include/Algo/Multiresolution/Map3MR/Masks/mcCrackenJoy.h index a37c8da8..a21f3e74 100644 --- a/include/Algo/Multiresolution/Map3MR/Masks/mcCrackenJoy.h +++ b/include/Algo/Multiresolution/Map3MR/Masks/mcCrackenJoy.h @@ -34,6 +34,9 @@ namespace CGoGN namespace Algo { +namespace Volume +{ + namespace MR { @@ -109,7 +112,7 @@ public: Traversor3VW travVW(m_map, d); for(Dart dit = travVW.begin() ; dit != travVW.end() ; dit = travVW.next()) { - Cavg += Algo::Geometry::volumeCentroid(m_map, dit, m_position); + Cavg += Algo::Surface::Geometry::volumeCentroid(m_map, dit, m_position); ++degree; } Cavg /= degree; @@ -119,7 +122,7 @@ public: Traversor3VF travVF(m_map, d); for(Dart dit = travVF.begin() ; dit != travVF.end() ; dit = travVF.next()) { - Aavg += Algo::Geometry::faceCentroid(m_map, dit, m_position); + Aavg += Algo::Surface::Geometry::faceCentroid(m_map, dit, m_position); ++degree; } Aavg /= degree; @@ -203,7 +206,7 @@ public: Traversor3EW travEW(m_map, d2); for(Dart dit = travEW.begin() ; dit != travEW.end() ; dit = travEW.next()) { - Cavg += Algo::Geometry::volumeCentroid(m_map, dit, m_position); + Cavg += Algo::Surface::Geometry::volumeCentroid(m_map, dit, m_position); ++degree; } Cavg /= degree; @@ -213,7 +216,7 @@ public: Traversor3EF travEF(m_map, d2); for(Dart dit = travEF.begin() ; dit != travEF.end() ; dit = travEF.next()) { - Aavg += Algo::Geometry::faceCentroid(m_map, dit, m_position); + Aavg += Algo::Surface::Geometry::faceCentroid(m_map, dit, m_position); ++degree; } Aavg /= degree; @@ -273,10 +276,10 @@ public: Dart df = m_map.phi1(m_map.phi1(d)) ; //m_map.decCurrentLevel() ; //face points - typename PFP::VEC3 C0 = Algo::Geometry::volumeCentroid(m_map, df, m_position); - typename PFP::VEC3 C1 = Algo::Geometry::volumeCentroid(m_map, m_map.phi3(df), m_position); + typename PFP::VEC3 C0 = Algo::Surface::Geometry::volumeCentroid(m_map, df, m_position); + typename PFP::VEC3 C1 = Algo::Surface::Geometry::volumeCentroid(m_map, m_map.phi3(df), m_position); - typename PFP::VEC3 A = Algo::Geometry::volumeCentroid(m_map, m_map.phi3(df), m_position); + typename PFP::VEC3 A = Algo::Surface::Geometry::volumeCentroid(m_map, m_map.phi3(df), m_position); typename PFP::VEC3 fp = C0 + A * 2 + C1; fp /= 4; @@ -309,7 +312,7 @@ public: m_map.decCurrentLevel() ; //cell points : these points are the average of the //vertices of the lattice that bound the cell - typename PFP::VEC3 p = Algo::Geometry::volumeCentroid(m_map,df,m_position); + typename PFP::VEC3 p = Algo::Surface::Geometry::volumeCentroid(m_map,df,m_position); m_map.incCurrentLevel() ; m_position[d] = p; @@ -324,6 +327,8 @@ public: } // namespace MR +} // namespace Volume + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map3MR/Masks/schaefer.h b/include/Algo/Multiresolution/Map3MR/Masks/schaefer.h index 7fa458d5..7bd77230 100644 --- a/include/Algo/Multiresolution/Map3MR/Masks/schaefer.h +++ b/include/Algo/Multiresolution/Map3MR/Masks/schaefer.h @@ -34,6 +34,9 @@ namespace CGoGN namespace Algo { +namespace Volume +{ + namespace MR { @@ -311,6 +314,8 @@ public: } // namespace MR +} // namespace Volume + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.h b/include/Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.h index 0aa6ba81..09389827 100644 --- a/include/Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.h +++ b/include/Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.h @@ -36,6 +36,9 @@ namespace CGoGN namespace Algo { +namespace Volume +{ + namespace MR { @@ -189,6 +192,8 @@ public: } // namespace MR +} // namespace Volume + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.hpp b/include/Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.hpp index 05b9d628..023c8e41 100644 --- a/include/Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.hpp +++ b/include/Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.hpp @@ -30,6 +30,9 @@ namespace CGoGN namespace Algo { +namespace Volume +{ + namespace MR { @@ -1073,6 +1076,8 @@ void Map3MR::subdivideVolumeTetOcta(Dart d) } // namespace MR +} // namespace Volume + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.h b/include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.h index f721c02e..44f6f363 100644 --- a/include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.h +++ b/include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.h @@ -38,6 +38,9 @@ namespace CGoGN namespace Algo { +namespace Volume +{ + namespace MR { @@ -133,6 +136,8 @@ public: } // namespace MR +} // namespace Volume + } // namespace Algo } // namespace CGoGN diff --git a/include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.hpp b/include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.hpp index 36286874..a48845a4 100644 --- a/include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.hpp +++ b/include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.hpp @@ -28,6 +28,9 @@ namespace CGoGN namespace Algo { +namespace Volume +{ + namespace MR { @@ -148,7 +151,7 @@ void Map3MR::addNewLevelSqrt3(bool embedNewVertices) m.markOrbit(ditWF); } - Algo::Modelisation::Tetrahedralization::flip1To4(m_map, dit); + Algo::Volume::Modelisation::Tetrahedralization::flip1To4(m_map, dit); } /* @@ -161,7 +164,7 @@ void Map3MR::addNewLevelSqrt3(bool embedNewVertices) if(m.isMarked(dit)) { m.unmarkOrbit(dit); - Algo::Modelisation::Tetrahedralization::swap2To3(m_map, dit); + Algo::Volume::Modelisation::Tetrahedralization::swap2To3(m_map, dit); } } @@ -180,7 +183,7 @@ void Map3MR::addNewLevelSqrt3(bool embedNewVertices) m.markOrbit(ditWE); } - Algo::Modelisation::Tetrahedralization::flip1To3(m_map, dit); + Algo::Volume::Modelisation::Tetrahedralization::flip1To3(m_map, dit); } } @@ -194,7 +197,7 @@ void Map3MR::addNewLevelSqrt3(bool embedNewVertices) { m.unmarkOrbit(dit); Dart d = m_map.phi2(m_map.phi3(m_map.findBoundaryFaceOfEdge(dit))); - Algo::Modelisation::Tetrahedralization::swapGen3To2(m_map, d); + Algo::Volume::Modelisation::Tetrahedralization::swapGen3To2(m_map, d); } } @@ -334,7 +337,7 @@ void Map3MR::addNewLevelTetraOcta(bool embedNewVertices) m_map.setCurrentLevel(m_map.getMaxLevel()) ; Dart x = m_map.phi_1(m_map.phi2(m_map.phi1(ditWV))); - if(!Algo::Modelisation::Tetrahedralization::isTetrahedron(m_map,x)) + if(!Algo::Volume::Modelisation::Tetrahedralization::isTetrahedron(m_map,x)) { DartMarkerStore me(m_map); @@ -762,6 +765,8 @@ void Map3MR::synthesis() } // namespace MR +} // namespace Volume + } // namespace Algo } // namespace CGoGN -- GitLab