mirror of https://github.com/CGAL/cgal
Re-ordered functions in Subdivision_methods_3
This commit is contained in:
parent
a50c455806
commit
0ed206a5d0
|
|
@ -42,7 +42,9 @@ namespace CGAL {
|
|||
namespace Subdivision_method_3 {
|
||||
|
||||
namespace parameters = Polygon_mesh_processing::parameters;
|
||||
//
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
template <class PolygonMesh, class Mask>
|
||||
void PQQ(PolygonMesh& pmesh, Mask mask, int step = 1) {
|
||||
// todo: static assert that PolygonMesh == Mask::PolygonMesh
|
||||
|
|
@ -64,70 +66,6 @@ namespace Subdivision_method_3 {
|
|||
Private::PQQ_1step(pmesh, vpm, mask);
|
||||
}
|
||||
|
||||
//
|
||||
template <class PolygonMesh, class Mask>
|
||||
void PTQ(PolygonMesh& pmesh, Mask mask, int step = 1) {
|
||||
for (int i = 0; i < step; i++)
|
||||
Private::PTQ_1step(pmesh, get(vertex_point,pmesh), mask);
|
||||
}
|
||||
|
||||
template <class PolygonMesh, class Mask, class NamedParameters>
|
||||
void PTQ(PolygonMesh& pmesh, Mask mask, const NamedParameters& np) {
|
||||
// todo: static assert that PolygonMesh == Mask::PolygonMesh
|
||||
using boost::choose_param;
|
||||
using boost::get_param;
|
||||
typedef typename GetVertexPointMap<PolygonMesh, NamedParameters>::type Vpm;
|
||||
Vpm vpm = choose_param(get_param(np, vertex_point),
|
||||
get_property_map(CGAL::vertex_point, pmesh));
|
||||
|
||||
unsigned int step = choose_param(get_param(np, number_of_iterations), 1);
|
||||
for (unsigned int i = 0; i < step; i++)
|
||||
Private::PTQ_1step(pmesh, vpm, mask);
|
||||
}
|
||||
|
||||
//
|
||||
template <class PolygonMesh, class Mask>
|
||||
void DQQ(PolygonMesh& pmesh, Mask mask, int step = 1) {
|
||||
for (int i = 0; i < step; ++i)
|
||||
Private::DQQ_1step(pmesh, get(vertex_point, pmesh), mask);
|
||||
}
|
||||
|
||||
template <class PolygonMesh, class Mask, class NamedParameters>
|
||||
void DQQ(PolygonMesh& pmesh, Mask mask, const NamedParameters& np) {
|
||||
// todo: static assert that PolygonMesh == Mask::PolygonMesh
|
||||
using boost::choose_param;
|
||||
using boost::get_param;
|
||||
typedef typename GetVertexPointMap<PolygonMesh, NamedParameters>::type Vpm;
|
||||
Vpm vpm = choose_param(get_param(np, vertex_point),
|
||||
get_property_map(CGAL::vertex_point, pmesh));
|
||||
|
||||
unsigned int step = choose_param(get_param(np, number_of_iterations), 1);
|
||||
for (unsigned int i = 0; i < step; i++)
|
||||
Private::DQQ_1step(pmesh, vpm, mask);
|
||||
}
|
||||
|
||||
//
|
||||
template <class PolygonMesh, class Mask>
|
||||
void Sqrt3(PolygonMesh& pmesh, Mask mask, int step = 1) {
|
||||
for (int i = 0; i < step; i++)
|
||||
Private::Sqrt3_1step(pmesh, get(vertex_point,pmesh), mask);
|
||||
}
|
||||
|
||||
template <class PolygonMesh, class Mask, class NamedParameters>
|
||||
void Sqrt3(PolygonMesh& pmesh, Mask mask, const NamedParameters& np) {
|
||||
// todo: static assert that PolygonMesh == Mask::PolygonMesh
|
||||
using boost::choose_param;
|
||||
using boost::get_param;
|
||||
typedef typename GetVertexPointMap<PolygonMesh, NamedParameters>::type Vpm;
|
||||
Vpm vpm = choose_param(get_param(np, vertex_point),
|
||||
get_property_map(CGAL::vertex_point, pmesh));
|
||||
|
||||
unsigned int step = choose_param(get_param(np, number_of_iterations), 1);
|
||||
for (unsigned int i = 0; i < step; i++)
|
||||
Private::Sqrt3_1step(pmesh, vpm, mask);
|
||||
}
|
||||
|
||||
//
|
||||
template <class PolygonMesh>
|
||||
void CatmullClark_subdivision(PolygonMesh& pmesh, int step = 1) {
|
||||
PQQ(pmesh, CatmullClark_mask_3<PolygonMesh>(pmesh,get(vertex_point,pmesh)), step);
|
||||
|
|
@ -148,7 +86,28 @@ namespace Subdivision_method_3 {
|
|||
Private::PQQ_1step(pmesh, vpm, mask);
|
||||
}
|
||||
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
template <class PolygonMesh, class Mask>
|
||||
void PTQ(PolygonMesh& pmesh, Mask mask, int step = 1) {
|
||||
for (int i = 0; i < step; i++)
|
||||
Private::PTQ_1step(pmesh, get(vertex_point,pmesh), mask);
|
||||
}
|
||||
|
||||
template <class PolygonMesh, class Mask, class NamedParameters>
|
||||
void PTQ(PolygonMesh& pmesh, Mask mask, const NamedParameters& np) {
|
||||
// todo: static assert that PolygonMesh == Mask::PolygonMesh
|
||||
using boost::choose_param;
|
||||
using boost::get_param;
|
||||
typedef typename GetVertexPointMap<PolygonMesh, NamedParameters>::type Vpm;
|
||||
Vpm vpm = choose_param(get_param(np, vertex_point),
|
||||
get_property_map(CGAL::vertex_point, pmesh));
|
||||
|
||||
unsigned int step = choose_param(get_param(np, number_of_iterations), 1);
|
||||
for (unsigned int i = 0; i < step; i++)
|
||||
Private::PTQ_1step(pmesh, vpm, mask);
|
||||
}
|
||||
|
||||
template <class PolygonMesh>
|
||||
void Loop_subdivision(PolygonMesh& pmesh, int step = 1) {
|
||||
PTQ(pmesh, Loop_mask_3<PolygonMesh>(pmesh,get(vertex_point,pmesh)) , step);
|
||||
|
|
@ -169,7 +128,29 @@ namespace Subdivision_method_3 {
|
|||
Private::PTQ_1step(pmesh, vpm, mask);
|
||||
}
|
||||
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
template <class PolygonMesh, class Mask>
|
||||
void DQQ(PolygonMesh& pmesh, Mask mask, int step = 1) {
|
||||
for (int i = 0; i < step; ++i) {
|
||||
Private::DQQ_1step(pmesh, get(vertex_point, pmesh), mask);
|
||||
}
|
||||
}
|
||||
|
||||
template <class PolygonMesh, class Mask, class NamedParameters>
|
||||
void DQQ(PolygonMesh& pmesh, Mask mask, const NamedParameters& np) {
|
||||
// todo: static assert that PolygonMesh == Mask::PolygonMesh
|
||||
using boost::choose_param;
|
||||
using boost::get_param;
|
||||
typedef typename GetVertexPointMap<PolygonMesh, NamedParameters>::type Vpm;
|
||||
Vpm vpm = choose_param(get_param(np, vertex_point),
|
||||
get_property_map(CGAL::vertex_point, pmesh));
|
||||
|
||||
unsigned int step = choose_param(get_param(np, number_of_iterations), 1);
|
||||
for (unsigned int i = 0; i < step; i++)
|
||||
Private::DQQ_1step(pmesh, vpm, mask);
|
||||
}
|
||||
|
||||
template <class PolygonMesh>
|
||||
void DooSabin_subdivision(PolygonMesh& pmesh, int step = 1) {
|
||||
DQQ(pmesh, DooSabin_mask_3<PolygonMesh>(pmesh, get(vertex_point,pmesh)), step);
|
||||
|
|
@ -190,7 +171,28 @@ namespace Subdivision_method_3 {
|
|||
Private::DQQ_1step(pmesh, vpm, mask);
|
||||
}
|
||||
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
template <class PolygonMesh, class Mask>
|
||||
void Sqrt3(PolygonMesh& pmesh, Mask mask, int step = 1) {
|
||||
for (int i = 0; i < step; i++)
|
||||
Private::Sqrt3_1step(pmesh, get(vertex_point,pmesh), mask, (i%2==1));
|
||||
}
|
||||
|
||||
template <class PolygonMesh, class Mask, class NamedParameters>
|
||||
void Sqrt3(PolygonMesh& pmesh, Mask mask, const NamedParameters& np) {
|
||||
// todo: static assert that PolygonMesh == Mask::PolygonMesh
|
||||
using boost::choose_param;
|
||||
using boost::get_param;
|
||||
typedef typename GetVertexPointMap<PolygonMesh, NamedParameters>::type Vpm;
|
||||
Vpm vpm = choose_param(get_param(np, vertex_point),
|
||||
get_property_map(CGAL::vertex_point, pmesh));
|
||||
|
||||
unsigned int step = choose_param(get_param(np, number_of_iterations), 1);
|
||||
for (unsigned int i = 0; i < step; i++)
|
||||
Private::Sqrt3_1step(pmesh, vpm, mask, (i%2==1));
|
||||
}
|
||||
|
||||
template <class PolygonMesh>
|
||||
void Sqrt3_subdivision(PolygonMesh& pmesh, int step = 1) {
|
||||
Sqrt3(pmesh, Sqrt3_mask_3<PolygonMesh>(pmesh,get(vertex_point,pmesh)), step);
|
||||
|
|
@ -208,9 +210,11 @@ namespace Subdivision_method_3 {
|
|||
Sqrt3_mask_3<PolygonMesh,Vpm> mask(pmesh,vpm);
|
||||
|
||||
for(unsigned int i = 0; i < step; i++)
|
||||
Private::Sqrt3_1step(pmesh, vpm, mask);
|
||||
Private::Sqrt3_1step(pmesh, vpm, mask, (i%2==1));
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
}
|
||||
|
||||
} //namespace CGAL
|
||||
|
|
|
|||
Loading…
Reference in New Issue