mirror of https://github.com/CGAL/cgal
Updated the examples of the SMP to work with the new Seam mesh
Also a small change in the Polyhedron demo
This commit is contained in:
parent
b00c5f9a56
commit
c71d8285d0
|
|
@ -0,0 +1,24 @@
|
||||||
|
OFF
|
||||||
|
11 7 0
|
||||||
|
# vertices
|
||||||
|
-1 -1 1
|
||||||
|
-1 1 1
|
||||||
|
1 1 1
|
||||||
|
1 -1 1
|
||||||
|
-1 -1 -1
|
||||||
|
-1 1 -1
|
||||||
|
1 1 -1
|
||||||
|
1 -1 -1
|
||||||
|
2 2 2
|
||||||
|
3 2 2
|
||||||
|
3 3 3
|
||||||
|
|
||||||
|
# facets
|
||||||
|
3 3 2 1
|
||||||
|
3 3 1 0
|
||||||
|
4 0 1 5 4
|
||||||
|
4 6 5 1 2
|
||||||
|
4 3 7 6 2
|
||||||
|
4 4 7 3 0
|
||||||
|
4 4 5 6 7
|
||||||
|
3 8 9 10
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
|
||||||
|
|
||||||
|
1 5 1 0 1 3 2 1
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
|
||||||
|
|
||||||
|
2 1 1 0
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
|
||||||
|
|
||||||
|
1 5 5 4 4 7 3 7 1 3
|
||||||
|
|
@ -12,121 +12,138 @@
|
||||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
typedef CGAL::Simple_cartesian<double> Kernel;
|
||||||
typedef Kernel::Point_3 Point;
|
typedef Kernel::Point_3 Point;
|
||||||
typedef CGAL::Surface_mesh<Point> Mesh;
|
typedef CGAL::Surface_mesh<Point> Mesh;
|
||||||
typedef CGAL::Seam_mesh<Mesh> Seam_mesh;
|
|
||||||
|
|
||||||
typedef boost::graph_traits<Mesh>::vertex_descriptor vertex_descriptor;
|
typedef boost::graph_traits<Mesh>::vertex_descriptor SM_vertex_descriptor;
|
||||||
typedef boost::graph_traits<Mesh>::halfedge_descriptor halfedge_descriptor;
|
typedef boost::graph_traits<Mesh>::halfedge_descriptor SM_halfedge_descriptor;
|
||||||
typedef boost::graph_traits<Mesh>::edge_descriptor edge_descriptor;
|
typedef boost::graph_traits<Mesh>::edge_descriptor SM_edge_descriptor;
|
||||||
typedef boost::graph_traits<Mesh>::face_descriptor face_descriptor;
|
typedef boost::graph_traits<Mesh>::face_descriptor SM_face_descriptor;
|
||||||
|
|
||||||
|
typedef Mesh::Property_map<SM_edge_descriptor, bool> Seam_edge_pmap;
|
||||||
|
typedef Mesh::Property_map<SM_vertex_descriptor, bool> Seam_vertex_pmap;
|
||||||
|
typedef CGAL::Seam_mesh<Mesh, Seam_edge_pmap, Seam_vertex_pmap> Seam_mesh;
|
||||||
|
|
||||||
|
typedef boost::graph_traits<Seam_mesh>::vertex_descriptor vertex_descriptor;
|
||||||
|
typedef boost::graph_traits<Seam_mesh>::halfedge_descriptor halfedge_descriptor;
|
||||||
|
typedef boost::graph_traits<Seam_mesh>::edge_descriptor edge_descriptor;
|
||||||
|
typedef boost::graph_traits<Seam_mesh>::face_descriptor face_descriptor;
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
Mesh sm;
|
Mesh sm;
|
||||||
std::ifstream in((argc>1)?argv[1]:"data/cube.off");
|
std::ifstream in((argc>1) ? argv[1] : "data/cube.off");
|
||||||
in >> sm;
|
in >> sm;
|
||||||
|
|
||||||
std::vector<edge_descriptor> seam;
|
Seam_edge_pmap seam_edge_pm =
|
||||||
|
sm.add_property_map<SM_edge_descriptor, bool>("e:on_seam", false).first;
|
||||||
|
Seam_vertex_pmap seam_vertex_pm =
|
||||||
|
sm.add_property_map<SM_vertex_descriptor, bool>("v:on_seam",false).first;
|
||||||
|
|
||||||
// split cube in two connected components
|
Seam_mesh mesh(sm, seam_edge_pm, seam_vertex_pm);
|
||||||
BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_face(*halfedges(sm).first,sm)){
|
|
||||||
seam.push_back(edge(hd,sm));
|
// Add the seams
|
||||||
|
#if 1
|
||||||
|
// Split the cube in two connected components
|
||||||
|
SM_halfedge_descriptor smhd = mesh.add_seams("data/two_connected_components.selection.txt");
|
||||||
|
#else
|
||||||
|
// Seams are all edges incident to a vertex
|
||||||
|
SM_halfedge_descriptor smhd = mesh.add_seams("data/flatten.selection.txt");
|
||||||
|
#endif
|
||||||
|
assert(smhd != SM_halfedge_descriptor());
|
||||||
|
|
||||||
|
std::cout << "Added: " << mesh.number_of_seam_edges() << " seam edges" << std::endl;
|
||||||
|
|
||||||
|
halfedge_descriptor bhd(smhd);
|
||||||
|
std::cout << "First seam halfedge: " << smhd << std::endl;
|
||||||
|
std::cout << "source = " << source(smhd, mesh)
|
||||||
|
<< " (pointing to vertex: " << source(smhd, sm) << ")" << std::endl;
|
||||||
|
std::cout << "target = " << target(smhd, mesh)
|
||||||
|
<< " (pointing to vertex: " << target(smhd, sm) << ")" << std::endl;
|
||||||
|
|
||||||
|
std::cout << "prev of seam halfedge in (base) mesh: " << prev(smhd, sm) << std::endl;
|
||||||
|
std::cout << "prev of seam halfedge in seam mesh: " << prev(bhd, mesh) << std::endl;
|
||||||
|
|
||||||
|
std::cout << "next of seam halfedge in (base) mesh: " << next(smhd, sm) << std::endl;
|
||||||
|
std::cout << "next of seam halfedge in seam mesh: " << next(bhd, mesh) << std::endl;
|
||||||
|
|
||||||
|
std::cout << "opposite of seam halfedge in (base) mesh: " << opposite(smhd, sm) << std::endl;
|
||||||
|
std::cout << "opposite of seam halfedge in seam mesh: " << opposite(bhd, mesh) << std::endl;
|
||||||
|
|
||||||
|
std::cout << "vertices on one of the seams" << std::endl;
|
||||||
|
BOOST_FOREACH(halfedge_descriptor hd,
|
||||||
|
halfedges_around_face(opposite(bhd, mesh), mesh)){
|
||||||
|
std::cout << target(hd.tmhd, sm) << " ";
|
||||||
}
|
}
|
||||||
|
std::cout << std::endl;
|
||||||
|
|
||||||
#if 0
|
std::cout << "vertices around " << target(smhd , sm) << " in (base) mesh" << std::endl;
|
||||||
//cube
|
BOOST_FOREACH(SM_halfedge_descriptor hd, halfedges_around_target(smhd, sm)){
|
||||||
halfedge_descriptor hd = * halfedges(sm).first;
|
std::cout << source(hd, sm) << " ";
|
||||||
std::cout << "center = " << target(hd,sm) << std::endl;
|
}
|
||||||
int count=0;
|
std::cout << std::endl;
|
||||||
BOOST_FOREACH(hd, halfedges_around_target(hd,sm)){
|
|
||||||
std::cout << "v = " << source(hd,sm) << std::endl;
|
std::cout << "vertices around " << target(bhd , mesh) << " in seam mesh" << std::endl;
|
||||||
if(count==0 || count==2){
|
BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_target(bhd, mesh)){
|
||||||
seam.push_back(edge(hd,sm));
|
std::cout << source(hd.tmhd, sm) << " ";
|
||||||
|
}
|
||||||
|
std::cout << std::endl;
|
||||||
|
|
||||||
|
std::cout << "vertices around " << source(smhd , sm) << " in (base) mesh" << std::endl;
|
||||||
|
BOOST_FOREACH(SM_halfedge_descriptor hd,
|
||||||
|
halfedges_around_source(source(smhd, sm), sm)){
|
||||||
|
std::cout << target(hd, sm) << " ";
|
||||||
|
}
|
||||||
|
std::cout << std::endl;
|
||||||
|
|
||||||
|
std::cout << "vertices around " << source(bhd , mesh) << " in seam mesh" << std::endl;
|
||||||
|
BOOST_FOREACH(halfedge_descriptor hd,
|
||||||
|
halfedges_around_source(source(bhd, mesh), mesh)){
|
||||||
|
std::cout << target(hd.tmhd, sm) << " ";
|
||||||
|
}
|
||||||
|
std::cout << std::endl;
|
||||||
|
|
||||||
|
std::cout << "vertices around vertices in seam mesh" << std::endl;
|
||||||
|
BOOST_FOREACH(vertex_descriptor vd, vertices(mesh)){
|
||||||
|
halfedge_descriptor hd = halfedge(vd, mesh);
|
||||||
|
std::cout << " " << vd << " has incident vertices:" << std::endl;
|
||||||
|
BOOST_FOREACH(halfedge_descriptor hd2, halfedges_around_target(hd, mesh)){
|
||||||
|
std::cout << " " << hd2;
|
||||||
}
|
}
|
||||||
if(seam.size() == 2)
|
std::cout << std::endl;
|
||||||
break;
|
|
||||||
count++;
|
|
||||||
}
|
}
|
||||||
#endif
|
std::cout << "done" << std::endl;
|
||||||
|
|
||||||
#if 0
|
std::cout << "the (base) mesh has: " << num_halfedges(sm) << " halfedges" << std::endl;
|
||||||
//cube-ouvert
|
std::cout << "the seam mesh has: " << num_halfedges(mesh) << " halfedges" << std::endl;
|
||||||
BOOST_FOREACH(halfedge_descriptor hd, halfedges(sm)){
|
std::cout << "halfedges in (base) mesh" << std::endl;
|
||||||
if(is_border(hd,sm)){
|
BOOST_FOREACH(SM_halfedge_descriptor hd, halfedges(sm)){
|
||||||
seam.push_back(edge(next(opposite(hd,sm),sm),sm));
|
std::cout << hd << " ";
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
std::cout << std::endl;
|
||||||
|
|
||||||
typedef std::map<Seam_mesh::halfedge_descriptor,int> H_vertex_index_map;
|
std::cout << "halfedges in seam mesh" << std::endl;
|
||||||
typedef boost::associative_property_map<H_vertex_index_map> H_vertex_index_pmap;
|
BOOST_FOREACH(halfedge_descriptor hd, halfedges(mesh)){
|
||||||
H_vertex_index_map hvim; H_vertex_index_pmap hvipm(hvim);
|
std::cout << hd << " ";
|
||||||
|
}
|
||||||
|
std::cout << std::endl;
|
||||||
|
|
||||||
halfedge_descriptor mhd = halfedge(seam.front(),sm);
|
std::cout << "faces of the base and seam meshes" << std::endl;
|
||||||
Seam_mesh ssm(sm, seam);
|
BOOST_FOREACH(face_descriptor fd, faces(mesh)){
|
||||||
|
std::cout << fd << " ";
|
||||||
|
}
|
||||||
|
std::cout << std::endl;
|
||||||
|
|
||||||
std::vector<face_descriptor> faces;
|
std::vector<face_descriptor> faces;
|
||||||
boost::graph_traits<Seam_mesh>::halfedge_descriptor shd(halfedge(seam.front(),sm));
|
CGAL::Polygon_mesh_processing::connected_component(face(bhd, mesh),
|
||||||
CGAL::Polygon_mesh_processing::connected_component(face(shd,ssm),
|
mesh,
|
||||||
ssm,
|
|
||||||
std::back_inserter(faces));
|
std::back_inserter(faces));
|
||||||
std::cerr << faces.size() << std::endl;
|
std::cout << "the connected component (in the seam mesh) given by halfedge: " << smhd;
|
||||||
faces.clear();
|
std::cout << " has " << faces.size() << " faces." << std::endl;
|
||||||
shd = opposite(halfedge(seam.front(),sm),sm);
|
|
||||||
CGAL::Polygon_mesh_processing::connected_component(face(shd,ssm),
|
|
||||||
ssm,
|
|
||||||
std::back_inserter(faces));
|
|
||||||
std::cerr << faces.size() << std::endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
BOOST_FOREACH(Seam_mesh::vertex_descriptor vd, vertices(ssm)){
|
|
||||||
halfedge_descriptor hd = vd;
|
|
||||||
std::cerr << vd << " has incident halfedges:" << std::endl;
|
|
||||||
BOOST_FOREACH(Seam_mesh::halfedge_descriptor hd2, halfedges_around_target(vd,ssm)){
|
|
||||||
std::cerr << hd2 << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
std::cerr << "done"<< std::endl;
|
|
||||||
|
|
||||||
|
|
||||||
Seam_mesh::halfedge_descriptor smhd(mhd), smhd2(opposite(mhd,sm));
|
|
||||||
std::cout << "target = " << target(smhd,ssm) << std::endl;
|
|
||||||
|
|
||||||
std::cout << "vertices on seam" << std::endl;
|
|
||||||
BOOST_FOREACH(Seam_mesh::halfedge_descriptor hd, halfedges_around_face(opposite(smhd,ssm),ssm)){
|
|
||||||
std::cout << target(hd.tmhd,sm) << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::cout << "vertices around target in mesh" << std::endl;
|
|
||||||
BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_target(mhd,sm)){
|
|
||||||
std::cout << source(hd,sm) << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::cout << "vertices around target in seam mesh" << std::endl;
|
|
||||||
BOOST_FOREACH(Seam_mesh::halfedge_descriptor hd, halfedges_around_target(smhd,ssm)){
|
|
||||||
std::cout << source(hd.tmhd,sm) << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::cout << "vertices around source in seam mesh" << std::endl;
|
|
||||||
BOOST_FOREACH(Seam_mesh::halfedge_descriptor hd, halfedges_around_source(opposite(smhd,ssm),ssm)){
|
|
||||||
std::cout << target(hd.tmhd,sm) << std::endl;
|
|
||||||
}
|
|
||||||
std::cout << "vertices around source in seam mesh" << std::endl;
|
|
||||||
BOOST_FOREACH(Seam_mesh::halfedge_descriptor hd, halfedges_around_source(smhd2,ssm)){
|
|
||||||
std::cout << target(hd.tmhd,sm) << std::endl;
|
|
||||||
}
|
|
||||||
std::cout << "vertices around target in seam mesh" << std::endl;
|
|
||||||
BOOST_FOREACH(Seam_mesh::halfedge_descriptor hd, halfedges_around_target(opposite(smhd2,ssm),ssm)){
|
|
||||||
std::cout << source(hd.tmhd,sm) << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
boost::property_map<Seam_mesh, CGAL::vertex_point_t>::type vpm = get(CGAL::vertex_point,ssm);
|
|
||||||
//std::cout << get(vpm, source(hd,ssm)) << std::endl;
|
|
||||||
|
|
||||||
|
|
||||||
|
std::cout << "accessing coordinates of the source of halfedge " << smhd << ": ";
|
||||||
|
boost::property_map<Seam_mesh, CGAL::vertex_point_t>::type vpm =
|
||||||
|
get(CGAL::vertex_point, mesh);
|
||||||
|
std::cout << get(vpm, source(smhd, mesh)) << std::endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -827,6 +827,11 @@ public:
|
||||||
return tmhd;
|
return tmhd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_seam_number(const edges_size_type sn) const
|
||||||
|
{
|
||||||
|
number_of_seams = sn;
|
||||||
|
}
|
||||||
|
|
||||||
/// Constructs a seam mesh for a triangle mesh and an edge and vertex property map
|
/// Constructs a seam mesh for a triangle mesh and an edge and vertex property map
|
||||||
/// \param tm the adapted mesh
|
/// \param tm the adapted mesh
|
||||||
/// \param sem the edge property map with value `true` for seam edges
|
/// \param sem the edge property map with value `true` for seam edges
|
||||||
|
|
|
||||||
|
|
@ -499,11 +499,13 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Seam_mesh *sMesh = new Seam_mesh(tMesh, seam_edge_pm, seam_vertex_pm);
|
Seam_mesh *sMesh = new Seam_mesh(tMesh, seam_edge_pm, seam_vertex_pm);
|
||||||
|
sMesh->set_seam_number(seam_edges.size());
|
||||||
|
|
||||||
UV_uhm uv_uhm;
|
UV_uhm uv_uhm;
|
||||||
UV_pmap uv_pm(uv_uhm);
|
UV_pmap uv_pm(uv_uhm);
|
||||||
|
|
||||||
|
|
||||||
QString new_item_name;
|
QString new_item_name;
|
||||||
//determine the different connected_components
|
//determine the different connected_components
|
||||||
boost::property_map<Textured_polyhedron::Base, boost::face_external_index_t>::type fim
|
boost::property_map<Textured_polyhedron::Base, boost::face_external_index_t>::type fim
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,6 @@ struct Face2Polyline
|
||||||
int main(int argc, char * argv[])
|
int main(int argc, char * argv[])
|
||||||
{
|
{
|
||||||
SurfaceMesh sm;
|
SurfaceMesh sm;
|
||||||
std::vector<SM_edge_descriptor> seam;
|
|
||||||
|
|
||||||
std::ifstream in_mesh((argc>1)?argv[1]:"data/lion.off");
|
std::ifstream in_mesh((argc>1)?argv[1]:"data/lion.off");
|
||||||
in_mesh >> sm;
|
in_mesh >> sm;
|
||||||
|
|
@ -67,7 +66,9 @@ int main(int argc, char * argv[])
|
||||||
Seam_edge_pmap seam_edge_pm = sm.add_property_map<SM_edge_descriptor,bool>("e:on_seam", false).first;
|
Seam_edge_pmap seam_edge_pm = sm.add_property_map<SM_edge_descriptor,bool>("e:on_seam", false).first;
|
||||||
Seam_vertex_pmap seam_vertex_pm = sm.add_property_map<SM_vertex_descriptor,bool>("v:on_seam",false).first;
|
Seam_vertex_pmap seam_vertex_pm = sm.add_property_map<SM_vertex_descriptor,bool>("v:on_seam",false).first;
|
||||||
|
|
||||||
std::ifstream in((argc>2)?argv[2]:"data/lion.selection.txt");
|
const char* filename = (argc>2) ? argv[2] : "data/lion.selection.txt";
|
||||||
|
|
||||||
|
std::ifstream in(filename);
|
||||||
std::string vertices;
|
std::string vertices;
|
||||||
std::getline(in,vertices);
|
std::getline(in,vertices);
|
||||||
std::istringstream iss(vertices);
|
std::istringstream iss(vertices);
|
||||||
|
|
@ -77,22 +78,9 @@ int main(int argc, char * argv[])
|
||||||
two_vertices_given = true;
|
two_vertices_given = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int s,t;
|
|
||||||
SM_halfedge_descriptor smhd;
|
|
||||||
while(in >> s >> t){
|
|
||||||
SM_vertex_descriptor svd(s), tvd(t);
|
|
||||||
SM_edge_descriptor ed = edge(svd, tvd, sm).first;
|
|
||||||
if(! is_border(ed, sm)){
|
|
||||||
put(seam_edge_pm, ed, true);
|
|
||||||
put(seam_vertex_pm, svd, true);
|
|
||||||
put(seam_vertex_pm, tvd, true);
|
|
||||||
if(smhd == boost::graph_traits<SurfaceMesh>::null_halfedge()){
|
|
||||||
smhd = halfedge(edge(svd, tvd, sm).first, sm);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Mesh mesh(sm, seam_edge_pm, seam_vertex_pm);
|
Mesh mesh(sm, seam_edge_pm, seam_vertex_pm);
|
||||||
|
SM_halfedge_descriptor smhd = mesh.add_seams(filename);
|
||||||
|
assert(smhd != SM_halfedge_descriptor());
|
||||||
|
|
||||||
// The 2D points of the uv parametrisation will be written into this map
|
// The 2D points of the uv parametrisation will be written into this map
|
||||||
// Note that this is a halfedge property map, and that the uv
|
// Note that this is a halfedge property map, and that the uv
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,13 @@
|
||||||
#include <CGAL/Surface_mesh.h>
|
#include <CGAL/Surface_mesh.h>
|
||||||
#include <CGAL/boost/graph/graph_traits_Surface_mesh.h>
|
#include <CGAL/boost/graph/graph_traits_Surface_mesh.h>
|
||||||
|
|
||||||
|
#include <CGAL/boost/graph/Seam_mesh.h>
|
||||||
|
#include <CGAL/boost/graph/graph_traits_Seam_mesh.h>
|
||||||
|
|
||||||
#include <CGAL/Polyhedron_3.h>
|
#include <CGAL/Polyhedron_3.h>
|
||||||
#include <CGAL/Polygon_mesh_processing/measure.h>
|
#include <CGAL/Polygon_mesh_processing/measure.h>
|
||||||
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
|
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
|
||||||
|
|
||||||
#include <CGAL/boost/graph/Seam_mesh.h>
|
|
||||||
#include <CGAL/boost/graph/graph_traits_Seam_mesh.h>
|
|
||||||
|
|
||||||
#include <CGAL/ARAP_parameterizer_3.h>
|
#include <CGAL/ARAP_parameterizer_3.h>
|
||||||
#include <CGAL/Barycentric_mapping_parameterizer_3.h>
|
#include <CGAL/Barycentric_mapping_parameterizer_3.h>
|
||||||
#include <CGAL/Discrete_authalic_parameterizer_3.h>
|
#include <CGAL/Discrete_authalic_parameterizer_3.h>
|
||||||
|
|
@ -30,56 +30,79 @@ typedef CGAL::Simple_cartesian<double> Kernel;
|
||||||
typedef Kernel::Point_2 Point_2;
|
typedef Kernel::Point_2 Point_2;
|
||||||
typedef Kernel::Point_3 Point_3;
|
typedef Kernel::Point_3 Point_3;
|
||||||
|
|
||||||
#define POLY_MESH
|
#define POLY_MESH // Polyhedron mesh
|
||||||
#ifdef POLY_MESH
|
#ifdef POLY_MESH
|
||||||
#define MVC_POLY_MESH
|
#define MVC_POLY_MESH
|
||||||
#define BARY_POLY_MESH
|
#define BARY_POLY_MESH
|
||||||
#define ARAP_POLY_MESH
|
#define ARAP_POLY_MESH
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SURF_MESH
|
#define SURF_MESH // Surface_mesh
|
||||||
#ifdef SURF_MESH
|
#ifdef SURF_MESH
|
||||||
#define ARAP_SURF_MESH
|
#define ARAP_SURF_MESH
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#define SEAM_MESH
|
#define PM_SEAM_MESH // Polyhedron-based seam mesh
|
||||||
#ifdef SEAM_MESH
|
#ifdef PM_SEAM_MESH
|
||||||
|
#define POLY_MESH
|
||||||
|
#define ARAP_PM_SEAM_MESH
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define SM_SEAM_MESH // Surface_mesh-based seam mesh
|
||||||
|
#ifdef SM_SEAM_MESH
|
||||||
#define SURF_MESH
|
#define SURF_MESH
|
||||||
#define ARAP_SEMESH
|
#define ARAP_SM_SEAM_MESH
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// #define REDIRECT_OUTPUT
|
// #define REDIRECT_OUTPUT
|
||||||
|
|
||||||
#ifdef POLY_MESH
|
#ifdef POLY_MESH
|
||||||
typedef CGAL::Polyhedron_3<Kernel> PMesh;
|
typedef CGAL::Polyhedron_3<Kernel> PMesh;
|
||||||
|
|
||||||
typedef boost::graph_traits<PMesh>::vertex_descriptor vertex_descriptor;
|
typedef boost::graph_traits<PMesh>::vertex_descriptor PM_vertex_descriptor;
|
||||||
typedef boost::graph_traits<PMesh>::halfedge_descriptor halfedge_descriptor;
|
typedef boost::graph_traits<PMesh>::halfedge_descriptor PM_halfedge_descriptor;
|
||||||
typedef boost::graph_traits<PMesh>::face_descriptor face_descriptor;
|
|
||||||
|
|
||||||
typedef CGAL::Parameterizer_traits_3<PMesh>::Error_code Error_code;
|
typedef CGAL::Unique_hash_map<PM_halfedge_descriptor, Point_2> PM_UV_hmap;
|
||||||
|
typedef boost::associative_property_map<PM_UV_hmap> PM_UV_pmap;
|
||||||
|
|
||||||
|
typedef CGAL::Parameterizer_traits_3<PMesh>::Error_code Error_code;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SURF_MESH
|
#ifdef SURF_MESH
|
||||||
typedef CGAL::Surface_mesh<Point_3> SMesh;
|
typedef CGAL::Surface_mesh<Point_3> SMesh;
|
||||||
|
|
||||||
typedef boost::graph_traits<SMesh>::vertex_descriptor SM_vertex_descriptor;
|
typedef boost::graph_traits<SMesh>::vertex_descriptor SM_vertex_descriptor;
|
||||||
typedef boost::graph_traits<SMesh>::halfedge_descriptor SM_halfedge_descriptor;
|
typedef boost::graph_traits<SMesh>::halfedge_descriptor SM_halfedge_descriptor;
|
||||||
typedef boost::graph_traits<SMesh>::face_descriptor SM_face_descriptor;
|
|
||||||
|
typedef SMesh::Property_map<SM_halfedge_descriptor, Point_2> SM_UV_pmap;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SEAM_MESH
|
#ifdef SM_SEAM_MESH
|
||||||
typedef boost::graph_traits<SMesh>::edge_descriptor SM_edge_descriptor;
|
typedef boost::graph_traits<SMesh>::edge_descriptor SM_edge_descriptor;
|
||||||
|
|
||||||
typedef SMesh::Property_map<SM_halfedge_descriptor, Point_2> UV_pmap;
|
typedef SMesh::Property_map<SM_edge_descriptor, bool> SM_seam_edge_pmap;
|
||||||
typedef SMesh::Property_map<SM_edge_descriptor, bool> Seam_edge_pmap;
|
typedef SMesh::Property_map<SM_vertex_descriptor, bool> SM_seam_vertex_pmap;
|
||||||
typedef SMesh::Property_map<SM_vertex_descriptor, bool> Seam_vertex_pmap;
|
|
||||||
|
|
||||||
typedef CGAL::Seam_mesh<SMesh, Seam_edge_pmap, Seam_vertex_pmap> TMesh;
|
typedef CGAL::Seam_mesh<SMesh, SM_seam_edge_pmap, SM_seam_vertex_pmap>
|
||||||
|
SM_Seam_mesh;
|
||||||
|
|
||||||
typedef boost::graph_traits<TMesh>::vertex_descriptor TM_vertex_descriptor;
|
typedef boost::graph_traits<SM_Seam_mesh>::vertex_descriptor SM_SE_vertex_descriptor;
|
||||||
typedef boost::graph_traits<TMesh>::halfedge_descriptor TM_halfedge_descriptor;
|
typedef boost::graph_traits<SM_Seam_mesh>::halfedge_descriptor SM_SE_halfedge_descriptor;
|
||||||
typedef boost::graph_traits<TMesh>::face_descriptor TM_face_descriptor;
|
#endif
|
||||||
|
|
||||||
|
#ifdef PM_SEAM_MESH
|
||||||
|
typedef boost::graph_traits<PMesh>::edge_descriptor PM_edge_descriptor;
|
||||||
|
|
||||||
|
typedef CGAL::Unique_hash_map<PM_edge_descriptor, bool> PM_seam_edge_hmap;
|
||||||
|
typedef boost::associative_property_map<PM_seam_edge_hmap> PM_seam_edge_pmap;
|
||||||
|
typedef CGAL::Unique_hash_map<PM_vertex_descriptor, bool> PM_seam_vertex_hmap;
|
||||||
|
typedef boost::associative_property_map<PM_seam_vertex_hmap> PM_seam_vertex_pmap;
|
||||||
|
|
||||||
|
typedef CGAL::Seam_mesh<PMesh, PM_seam_edge_pmap, PM_seam_vertex_pmap>
|
||||||
|
PM_Seam_mesh;
|
||||||
|
|
||||||
|
typedef boost::graph_traits<PM_Seam_mesh>::vertex_descriptor PM_SE_vertex_descriptor;
|
||||||
|
typedef boost::graph_traits<PM_Seam_mesh>::halfedge_descriptor PM_SE_halfedge_descriptor;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int main(int argc, char * argv[])
|
int main(int argc, char * argv[])
|
||||||
|
|
@ -91,18 +114,19 @@ int main(int argc, char * argv[])
|
||||||
std::freopen("/home/mrouxell/POLY_MESH.txt", "w", stdout);
|
std::freopen("/home/mrouxell/POLY_MESH.txt", "w", stdout);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// std::ifstream in((argc>1)?argv[1]:"../data/tiny_nef.off");
|
std::ifstream in((argc>1)?argv[1]:"../data/tiny_nef.off");
|
||||||
// std::ifstream in((argc>1)?argv[1]:"../data/nefertiti.off");
|
// std::ifstream in((argc>1)?argv[1]:"../data/nefertiti.off");
|
||||||
// std::ifstream in((argc>1)?argv[1]:"../data/lion.off");
|
// std::ifstream in((argc>1)?argv[1]:"../data/lion.off");
|
||||||
// std::ifstream in((argc>1)?argv[1]:"../data/blob.off");
|
// std::ifstream in((argc>1)?argv[1]:"../data/blob.off");
|
||||||
std::ifstream in((argc>1)?argv[1]:"/home/mrouxell/Data/OFF/mushroom.off");
|
// std::ifstream in((argc>1)?argv[1]:"/home/mrouxell/Data/OFF/mushroom.off");
|
||||||
// std::ifstream in((argc>1)?argv[1]:"/home/mrouxell/Data/OFF/lion-head.off");
|
// std::ifstream in((argc>1)?argv[1]:"/home/mrouxell/Data/OFF/lion-head.off");
|
||||||
// std::ifstream in((argc>1)?argv[1]:"../data/three_peaks.off");
|
// std::ifstream in((argc>1)?argv[1]:"../data/three_peaks.off");
|
||||||
// std::ifstream in((argc>1)?argv[1]:"/home/mrouxell/Data/OFF/three_peaks_dense.off");
|
// std::ifstream in((argc>1)?argv[1]:"/home/mrouxell/Data/OFF/three_peaks_dense.off");
|
||||||
// std::ifstream in((argc>1)?argv[1]:"../data/cow_with_hole.off");
|
// std::ifstream in((argc>1)?argv[1]:"../data/cow_with_hole.off");
|
||||||
// std::ifstream in((argc>1)?argv[1]:"../data/cow_dense.off");
|
// std::ifstream in((argc>1)?argv[1]:"../data/cow_dense.off");
|
||||||
// std::ifstream in((argc>1)?argv[1]:"../data/cow_densified.off");
|
// std::ifstream in((argc>1)?argv[1]:"../data/cow_densified.off");
|
||||||
// std::ifstream in((argc>1)?argv[1]:"../data/mushroom_hole_2.off");
|
// std::ifstream in((argc>1)?argv[1]:"../data/mushroom_big_hole.off");
|
||||||
|
// std::ifstream in((argc>1)?argv[1]:"../data/mushroom_hole_1.off");
|
||||||
|
|
||||||
if(!in){
|
if(!in){
|
||||||
std::cerr << "Problem loading the input data" << std::endl;
|
std::cerr << "Problem loading the input data" << std::endl;
|
||||||
|
|
@ -118,13 +142,13 @@ int main(int argc, char * argv[])
|
||||||
PMesh pm;
|
PMesh pm;
|
||||||
in >> pm;
|
in >> pm;
|
||||||
|
|
||||||
halfedge_descriptor hd = CGAL::Polygon_mesh_processing::longest_border(pm).first;
|
PM_halfedge_descriptor hd = CGAL::Polygon_mesh_processing::longest_border(pm).first;
|
||||||
|
|
||||||
CGAL::Unique_hash_map<vertex_descriptor, Point_2,
|
CGAL::Unique_hash_map<PM_vertex_descriptor, Point_2,
|
||||||
boost::hash<vertex_descriptor> > uvhm;
|
boost::hash<PM_vertex_descriptor> > uvhm;
|
||||||
boost::associative_property_map<
|
boost::associative_property_map<
|
||||||
CGAL::Unique_hash_map<vertex_descriptor, Point_2,
|
CGAL::Unique_hash_map<PM_vertex_descriptor, Point_2,
|
||||||
boost::hash<vertex_descriptor> > > uvpm(uvhm);
|
boost::hash<PM_vertex_descriptor> > > uvpm(uvhm);
|
||||||
// Go to default (aka Mean values)
|
// Go to default (aka Mean values)
|
||||||
CGAL::parameterize(pm, hd, uvpm);
|
CGAL::parameterize(pm, hd, uvpm);
|
||||||
|
|
||||||
|
|
@ -141,16 +165,16 @@ int main(int argc, char * argv[])
|
||||||
PMesh pm;
|
PMesh pm;
|
||||||
in >> pm;
|
in >> pm;
|
||||||
|
|
||||||
halfedge_descriptor hd = CGAL::Polygon_mesh_processing::longest_border(pm).first;
|
PM_halfedge_descriptor hd = CGAL::Polygon_mesh_processing::longest_border(pm).first;
|
||||||
|
|
||||||
// UV map
|
// UV map
|
||||||
CGAL::Unique_hash_map<vertex_descriptor, Point_2,
|
CGAL::Unique_hash_map<PM_vertex_descriptor, Point_2,
|
||||||
boost::hash<vertex_descriptor> > uvhm;
|
boost::hash<PM_vertex_descriptor> > uvhm;
|
||||||
boost::associative_property_map<
|
boost::associative_property_map<
|
||||||
CGAL::Unique_hash_map<vertex_descriptor, Point_2,
|
CGAL::Unique_hash_map<PM_vertex_descriptor, Point_2,
|
||||||
boost::hash<vertex_descriptor> > > uvpm(uvhm);
|
boost::hash<PM_vertex_descriptor> > > uvpm(uvhm);
|
||||||
// Indices map
|
// Indices map
|
||||||
typedef boost::unordered_map<vertex_descriptor,int> Indices;
|
typedef boost::unordered_map<PM_vertex_descriptor, int> Indices;
|
||||||
Indices indices;
|
Indices indices;
|
||||||
CGAL::Polygon_mesh_processing::connected_component(face(opposite(hd, pm), pm),
|
CGAL::Polygon_mesh_processing::connected_component(face(opposite(hd, pm), pm),
|
||||||
pm,
|
pm,
|
||||||
|
|
@ -158,8 +182,8 @@ int main(int argc, char * argv[])
|
||||||
CGAL::Parameterization::Vertices<PMesh, Indices>(pm, indices)));
|
CGAL::Parameterization::Vertices<PMesh, Indices>(pm, indices)));
|
||||||
|
|
||||||
// Vertex parameterized map
|
// Vertex parameterized map
|
||||||
boost::unordered_set<vertex_descriptor> vs;
|
boost::unordered_set<PM_vertex_descriptor> vs;
|
||||||
CGAL::internal::Bool_property_map<boost::unordered_set<vertex_descriptor> > vpm(vs);
|
CGAL::internal::Bool_property_map<boost::unordered_set<PM_vertex_descriptor> > vpm(vs);
|
||||||
typename CGAL::Barycentric_mapping_parameterizer_3<PMesh> parameterizer;
|
typename CGAL::Barycentric_mapping_parameterizer_3<PMesh> parameterizer;
|
||||||
|
|
||||||
parameterizer.parameterize(pm, hd, uvpm, boost::make_assoc_property_map(indices), vpm);
|
parameterizer.parameterize(pm, hd, uvpm, boost::make_assoc_property_map(indices), vpm);
|
||||||
|
|
@ -177,17 +201,17 @@ int main(int argc, char * argv[])
|
||||||
PMesh pm;
|
PMesh pm;
|
||||||
in >> pm;
|
in >> pm;
|
||||||
|
|
||||||
halfedge_descriptor hd = CGAL::Polygon_mesh_processing::longest_border(pm).first;
|
PM_halfedge_descriptor hd = CGAL::Polygon_mesh_processing::longest_border(pm).first;
|
||||||
|
|
||||||
// UV map
|
// UV map
|
||||||
CGAL::Unique_hash_map<vertex_descriptor, Point_2,
|
CGAL::Unique_hash_map<PM_vertex_descriptor, Point_2,
|
||||||
boost::hash<vertex_descriptor> > uvhm;
|
boost::hash<PM_vertex_descriptor> > uvhm;
|
||||||
boost::associative_property_map<
|
boost::associative_property_map<
|
||||||
CGAL::Unique_hash_map<vertex_descriptor, Point_2,
|
CGAL::Unique_hash_map<PM_vertex_descriptor, Point_2,
|
||||||
boost::hash<vertex_descriptor> > > uvpm(uvhm);
|
boost::hash<PM_vertex_descriptor> > > uvpm(uvhm);
|
||||||
|
|
||||||
// Indices map
|
// Indices map
|
||||||
typedef boost::unordered_map<vertex_descriptor, int> Indices;
|
typedef boost::unordered_map<PM_vertex_descriptor, int> Indices;
|
||||||
Indices indices;
|
Indices indices;
|
||||||
CGAL::Polygon_mesh_processing::connected_component(
|
CGAL::Polygon_mesh_processing::connected_component(
|
||||||
face(opposite(hd, pm), pm),
|
face(opposite(hd, pm), pm),
|
||||||
|
|
@ -198,8 +222,8 @@ int main(int argc, char * argv[])
|
||||||
boost::associative_property_map<Indices> vipm(indices);
|
boost::associative_property_map<Indices> vipm(indices);
|
||||||
|
|
||||||
// Vertex parameterized map
|
// Vertex parameterized map
|
||||||
boost::unordered_set<vertex_descriptor> vs;
|
boost::unordered_set<PM_vertex_descriptor> vs;
|
||||||
CGAL::internal::Bool_property_map<boost::unordered_set<vertex_descriptor> > vpm(vs);
|
CGAL::internal::Bool_property_map<boost::unordered_set<PM_vertex_descriptor> > vpm(vs);
|
||||||
|
|
||||||
// Parameterizer
|
// Parameterizer
|
||||||
typename CGAL::ARAP_parameterizer_3<PMesh> parameterizer;
|
typename CGAL::ARAP_parameterizer_3<PMesh> parameterizer;
|
||||||
|
|
@ -257,68 +281,96 @@ int main(int argc, char * argv[])
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
// ARAP WITH SEAM_MESH
|
// ARAP WITH SEAM_MESH (SM)
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
|
|
||||||
#ifdef ARAP_SEMESH
|
#ifdef ARAP_SM_SEAM_MESH
|
||||||
{
|
{
|
||||||
SMesh sm;
|
SMesh sm;
|
||||||
in.clear();
|
in.clear();
|
||||||
in.seekg(0, std::ios::beg);
|
in.seekg(0, std::ios::beg);
|
||||||
in >> sm;
|
in >> sm;
|
||||||
|
|
||||||
Seam_edge_pmap seam_edge_pm =
|
SM_seam_edge_pmap seam_edge_pm =
|
||||||
sm.add_property_map<SM_edge_descriptor,bool>("e:on_seam", false).first;
|
sm.add_property_map<SM_edge_descriptor,bool>("e:on_seam", false).first;
|
||||||
Seam_vertex_pmap seam_vertex_pm =
|
SM_seam_vertex_pmap seam_vertex_pm =
|
||||||
sm.add_property_map<SM_vertex_descriptor,bool>("v:on_seam",false).first;
|
sm.add_property_map<SM_vertex_descriptor,bool>("v:on_seam",false).first;
|
||||||
|
|
||||||
std::ifstream in((argc>2) ? argv[2] : "../data/lion.selection.txt");
|
SM_Seam_mesh mesh(sm, seam_edge_pm, seam_vertex_pm);
|
||||||
std::string vertices;
|
SM_halfedge_descriptor smhd = mesh.add_seams("../data/lion.selection.txt");
|
||||||
std::getline(in,vertices);
|
|
||||||
std::istringstream iss(vertices);
|
|
||||||
int p1, p2;
|
|
||||||
bool two_vertices_given = false;
|
|
||||||
if(iss >> p1 >> p2){
|
|
||||||
two_vertices_given = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
int s, t;
|
|
||||||
SM_halfedge_descriptor smhd;
|
|
||||||
while(in >> s >> t){
|
|
||||||
SM_vertex_descriptor svd(s), tvd(t);
|
|
||||||
SM_edge_descriptor ed = edge(svd, tvd, sm).first;
|
|
||||||
if(! is_border(ed, sm)){
|
|
||||||
put(seam_edge_pm, ed, true);
|
|
||||||
put(seam_vertex_pm, svd, true);
|
|
||||||
put(seam_vertex_pm, tvd, true);
|
|
||||||
if(smhd == boost::graph_traits<SMesh>::null_halfedge()){
|
|
||||||
smhd = halfedge(edge(svd, tvd, sm).first, sm);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TMesh mesh(sm, seam_edge_pm, seam_vertex_pm);
|
|
||||||
|
|
||||||
// The 2D points of the uv parametrisation will be written into this map
|
// The 2D points of the uv parametrisation will be written into this map
|
||||||
// Note that this is a halfedge property map, and that the uv
|
// Note that this is a halfedge property map, and that the uv
|
||||||
// is only stored for the canonical halfedges representing a vertex
|
// is only stored for the canonical halfedges representing a vertex
|
||||||
UV_pmap uv_pm = sm.add_property_map<SM_halfedge_descriptor,
|
SM_UV_pmap uv_pm = sm.add_property_map<SM_halfedge_descriptor,
|
||||||
Point_2>("h:uv").first;
|
Point_2>("h:uv").first;
|
||||||
|
|
||||||
TM_halfedge_descriptor bhd(smhd);
|
SM_SE_halfedge_descriptor bhd(smhd);
|
||||||
bhd = opposite(bhd, mesh); // a halfedge on the virtual border
|
bhd = opposite(bhd, mesh); // a halfedge on the virtual border
|
||||||
|
|
||||||
// Indices
|
// Indices
|
||||||
typedef boost::unordered_map<TM_vertex_descriptor, int> Vertex_index_map;
|
typedef boost::unordered_map<SM_SE_vertex_descriptor, int> Indices;
|
||||||
Vertex_index_map vim;
|
Indices indices;
|
||||||
boost::associative_property_map<Vertex_index_map> vipm(vim);
|
CGAL::Polygon_mesh_processing::connected_component(
|
||||||
mesh.initialize_vertex_index_map(bhd, vipm);
|
face(opposite(bhd, mesh), mesh),
|
||||||
|
mesh,
|
||||||
|
boost::make_function_output_iterator(
|
||||||
|
CGAL::Parameterization::Vertices<SM_Seam_mesh, Indices>(mesh, indices)));
|
||||||
|
boost::associative_property_map<Indices> vipm(indices);
|
||||||
|
|
||||||
// Parameterized
|
// Parameterized
|
||||||
boost::unordered_set<TM_vertex_descriptor> vs;
|
boost::unordered_set<SM_SE_vertex_descriptor> vs;
|
||||||
CGAL::internal::Bool_property_map<boost::unordered_set<TM_vertex_descriptor> > vpm(vs);
|
CGAL::internal::Bool_property_map<boost::unordered_set<SM_SE_vertex_descriptor> > vpm(vs);
|
||||||
|
|
||||||
typename CGAL::ARAP_parameterizer_3<TMesh> parameterizer;
|
typename CGAL::ARAP_parameterizer_3<SM_Seam_mesh> parameterizer;
|
||||||
|
parameterizer.parameterize(mesh, bhd, uv_pm, vipm, vpm);
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ***************************************************************************
|
||||||
|
// ARAP WITH SEAM_MESH (POLY)
|
||||||
|
// ***************************************************************************
|
||||||
|
|
||||||
|
#ifdef ARAP_PM_SEAM_MESH
|
||||||
|
{
|
||||||
|
PMesh pm;
|
||||||
|
in.clear();
|
||||||
|
in.seekg(0, std::ios::beg);
|
||||||
|
in >> pm;
|
||||||
|
|
||||||
|
PM_seam_edge_hmap seam_edge_hm(false);
|
||||||
|
PM_seam_edge_pmap seam_edge_pm(seam_edge_hm);
|
||||||
|
PM_seam_vertex_hmap seam_vertex_hm(false);
|
||||||
|
PM_seam_vertex_pmap seam_vertex_pm(seam_vertex_hm);
|
||||||
|
|
||||||
|
PM_Seam_mesh mesh(pm, seam_edge_pm, seam_vertex_pm);
|
||||||
|
PM_halfedge_descriptor pmhd = mesh.add_seams("../data/lion.selection.txt");
|
||||||
|
|
||||||
|
// The 2D points of the uv parametrisation will be written into this map
|
||||||
|
// Note that this is a halfedge property map, and that the uv
|
||||||
|
// is only stored for the canonical halfedges representing a vertex
|
||||||
|
PM_UV_hmap uv_hm;
|
||||||
|
PM_UV_pmap uv_pm(uv_hm);
|
||||||
|
|
||||||
|
PM_SE_halfedge_descriptor bhd(pmhd);
|
||||||
|
bhd = opposite(bhd, mesh); // a halfedge on the virtual border
|
||||||
|
|
||||||
|
// Indices
|
||||||
|
typedef boost::unordered_map<PM_SE_vertex_descriptor, int> Indices;
|
||||||
|
Indices indices;
|
||||||
|
CGAL::Polygon_mesh_processing::connected_component(
|
||||||
|
face(opposite(bhd, mesh), mesh),
|
||||||
|
mesh,
|
||||||
|
boost::make_function_output_iterator(
|
||||||
|
CGAL::Parameterization::Vertices<PM_Seam_mesh, Indices>(mesh, indices)));
|
||||||
|
boost::associative_property_map<Indices> vipm(indices);
|
||||||
|
|
||||||
|
// Parameterized
|
||||||
|
boost::unordered_set<PM_SE_vertex_descriptor> vs;
|
||||||
|
CGAL::internal::Bool_property_map<boost::unordered_set<PM_SE_vertex_descriptor> > vpm(vs);
|
||||||
|
|
||||||
|
typename CGAL::ARAP_parameterizer_3<PM_Seam_mesh> parameterizer;
|
||||||
parameterizer.parameterize(mesh, bhd, uv_pm, vipm, vpm);
|
parameterizer.parameterize(mesh, bhd, uv_pm, vipm, vpm);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -207,10 +207,14 @@ parameterize(Seam_mesh<TM,SEM,SVM>& mesh,
|
||||||
boost::unordered_set<vertex_descriptor> vs;
|
boost::unordered_set<vertex_descriptor> vs;
|
||||||
internal::Bool_property_map< boost::unordered_set<vertex_descriptor> > vpm(vs);
|
internal::Bool_property_map< boost::unordered_set<vertex_descriptor> > vpm(vs);
|
||||||
|
|
||||||
typedef boost::unordered_map<vertex_descriptor,int> Vertex_index_map;
|
typedef boost::unordered_map<vertex_descriptor, int> Indices;
|
||||||
Vertex_index_map vim;
|
Indices indices;
|
||||||
boost::associative_property_map<Vertex_index_map> vipm(vim);
|
CGAL::Polygon_mesh_processing::connected_component(
|
||||||
mesh.initialize_vertex_index_map(bhd,vipm);
|
face(opposite(bhd, mesh), mesh),
|
||||||
|
mesh,
|
||||||
|
boost::make_function_output_iterator(
|
||||||
|
Parameterization::Vertices<Seam_mesh<TM,SEM,SVM>, Indices>(mesh, indices)));
|
||||||
|
boost::associative_property_map<Indices> vipm(indices);
|
||||||
|
|
||||||
Mean_value_coordinates_parameterizer_3<Seam_mesh<TM,SEM,SVM> > parameterizer;
|
Mean_value_coordinates_parameterizer_3<Seam_mesh<TM,SEM,SVM> > parameterizer;
|
||||||
return parameterizer.parameterize(mesh, bhd, uvm, vipm, vpm);
|
return parameterizer.parameterize(mesh, bhd, uvm, vipm, vpm);
|
||||||
|
|
@ -229,10 +233,14 @@ parameterize(Seam_mesh<TM,SEM,SVM>& mesh,
|
||||||
boost::unordered_set<vertex_descriptor> vs;
|
boost::unordered_set<vertex_descriptor> vs;
|
||||||
internal::Bool_property_map< boost::unordered_set<vertex_descriptor> > vpm(vs);
|
internal::Bool_property_map< boost::unordered_set<vertex_descriptor> > vpm(vs);
|
||||||
|
|
||||||
typedef boost::unordered_map<vertex_descriptor,int> Vertex_index_map;
|
typedef boost::unordered_map<vertex_descriptor, int> Indices;
|
||||||
Vertex_index_map vim;
|
Indices indices;
|
||||||
boost::associative_property_map<Vertex_index_map> vipm(vim);
|
CGAL::Polygon_mesh_processing::connected_component(
|
||||||
mesh.initialize_vertex_index_map(bhd,vipm);
|
face(opposite(bhd, mesh), mesh),
|
||||||
|
mesh,
|
||||||
|
boost::make_function_output_iterator(
|
||||||
|
Parameterization::Vertices<Seam_mesh<TM,SEM,SVM>, Indices>(mesh, indices)));
|
||||||
|
boost::associative_property_map<Indices> vipm(indices);
|
||||||
|
|
||||||
return parameterizer.parameterize(mesh, bhd, uvm, vipm, vpm);
|
return parameterizer.parameterize(mesh, bhd, uvm, vipm, vpm);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue