diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Engrave_text_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Engrave_text_plugin.cpp index 1817cdd120f..fbd416ee949 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Engrave_text_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Engrave_text_plugin.cpp @@ -150,9 +150,14 @@ public : pen.setWidth(0); painter->setPen(pen); painter->setBrush(brush); - SMesh::Property_map > uv; - uv = graph->add_property_map > - ("h:uv",std::make_pair(0.0f,0.0f)).first; + SMesh::Property_map u; + SMesh::Property_map v; + + u = graph->add_property_map + ("h:u", 0.0f).first; + v = graph->add_property_map + ("h:v", 0.0f).first; + for( Component::iterator fi = component->begin(); fi != component->end(); @@ -161,11 +166,11 @@ public : boost::graph_traits::face_descriptor f(*fi); QPointF points[3]; boost::graph_traits::halfedge_descriptor h = halfedge(f, *graph);; - points[0] = QPointF(get(uv, h).first, -get(uv, h).second); + points[0] = QPointF(get(u, h), -get(v, h)); h = next(halfedge(f, *graph), *graph); - points[1] = QPointF(get(uv, h).first, -get(uv, h).second); + points[1] = QPointF(get(u, h), -get(v, h)); h = next(next(halfedge(f, *graph), *graph), *graph); - points[2] = QPointF(get(uv, h).first, -get(uv, h).second); + points[2] = QPointF(get(u, h), -get(v, h)); painter->drawPolygon(points,3); } @@ -605,9 +610,12 @@ public Q_SLOTS: { component->insert(*bfit); } - SMesh::Property_map > uv; - uv = sm->add_property_map >( - "h:uv",std::make_pair(0.0f,0.0f)).first; + SMesh::Property_map umap; + SMesh::Property_map vmap; + umap = sm->add_property_map + ("h:u", 0.0f).first; + vmap = sm->add_property_map + ("h:v", 0.0f).first; SMesh::Halfedge_iterator it; SMesh::Property_map uv_map = sm->property_map("v:uv").first; @@ -618,7 +626,8 @@ public Q_SLOTS: halfedge_descriptor hd(*it); EPICK::FT u = uv_map[target(hd, *sm)].x(); EPICK::FT v = uv_map[target(hd, *sm)].y(); - put(uv, *it, std::make_pair(static_cast(u),static_cast(v))); + put(umap, *it, static_cast(u)); + put(vmap, *it, static_cast(v)); } //ParamItem does not take ownership of text_mesh_bottom diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp index 72f29cdf983..7ef01c4e953 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp @@ -265,8 +265,11 @@ public : pen.setWidth(0); painter->setPen(pen); painter->setBrush(brush); -SMesh::Property_map > uv; -uv = graph->add_property_map >("h:uv",std::make_pair(0.0f,0.0f)).first; + SMesh::Property_map u,v; + + u = graph->add_property_map("h:u", 0.0f).first; + v = graph->add_property_map("h:v", 0.0f).first; + for( Component::iterator fi = components->at(m_current_component).begin(); fi != components->at(m_current_component).end(); @@ -276,11 +279,11 @@ uv = graph->add_property_map >("h:uv QPointF points[3]; boost::graph_traits::halfedge_descriptor h = halfedge(f, *graph);; - points[0] = QPointF(get(uv, h).first, get(uv, h).second); + points[0] = QPointF(get(u, h), get(v, h)); h = next(halfedge(f, *graph), *graph); - points[1] = QPointF(get(uv, h).first, get(uv, h).second); + points[1] = QPointF(get(u, h), get(v, h)); h = next(next(halfedge(f, *graph), *graph), *graph); - points[2] = QPointF(get(uv, h).first, get(uv, h).second); + points[2] = QPointF(get(u, h), get(v, h)); painter->drawPolygon(points,3); } } @@ -906,8 +909,13 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio QApplication::restoreOverrideCursor(); QPointF min(FLT_MAX, FLT_MAX), max(-FLT_MAX, -FLT_MAX); - SMesh::Property_map > uv; - uv = tMesh.add_property_map >("h:uv",std::make_pair(0.0f,0.0f)).first; + SMesh::Property_map umap; + SMesh::Property_map vmap; + + umap = tMesh.add_property_map("h:u", 0.0f).first; + vmap = tMesh.add_property_map("h:v", 0.0f).first; + + tMesh.property_stats(std::cerr); Base_face_graph::Halfedge_iterator it; for(it = tMesh.halfedges_begin(); it != tMesh.halfedges_end(); @@ -916,7 +924,8 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio Seam_mesh::halfedge_descriptor hd(*it); FT u = uv_pm[target(hd, sMesh)].x(); FT v = uv_pm[target(hd, sMesh)].y(); - put(uv, *it, std::make_pair(static_cast(u),static_cast(v))); + put(umap, *it, static_cast(u)); + put(vmap, *it, static_cast(v)); if(umax.x()) diff --git a/Polyhedron/demo/Polyhedron/Scene_textured_surface_mesh_item.cpp b/Polyhedron/demo/Polyhedron/Scene_textured_surface_mesh_item.cpp index b0a2a2019d8..816d37d3e60 100644 --- a/Polyhedron/demo/Polyhedron/Scene_textured_surface_mesh_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_textured_surface_mesh_item.cpp @@ -21,8 +21,8 @@ struct Scene_textured_surface_mesh_item_priv { item = parent; texture.GenerateCheckerBoard(2048,2048,128,0,0,0,250,250,255); - uv = sm->add_property_map >("h:uv",std::make_pair(0.0f,0.0f)).first; - + umap = sm->add_property_map("h:u", 0.0f).first; + vmap = sm->add_property_map("h:v", 0.0f).first; } Scene_textured_surface_mesh_item_priv(const SMesh& p, Scene_textured_surface_mesh_item* parent) : sm(new SMesh(p)) @@ -30,14 +30,16 @@ struct Scene_textured_surface_mesh_item_priv { item = parent; texture.GenerateCheckerBoard(2048,2048,128,0,0,0,250,250,255); - uv = sm->add_property_map >("h:uv",std::make_pair(0.0f,0.0f)).first; + umap = sm->add_property_map("h:u", 0.0f).first; + vmap = sm->add_property_map("h:v", 0.0f).first; } Scene_textured_surface_mesh_item_priv(SMesh* const p,Scene_textured_surface_mesh_item* parent) :sm(p) { item = parent; texture.GenerateCheckerBoard(2048,2048,128,0,0,0,250,250,255); - uv = sm->add_property_map >("h:uv",std::make_pair(0.0f,0.0f)).first; + umap = sm->add_property_map("h:u", 0.0f).first; + vmap = sm->add_property_map("h:v", 0.0f).first; } ~Scene_textured_surface_mesh_item_priv() @@ -49,7 +51,8 @@ struct Scene_textured_surface_mesh_item_priv SMesh* sm; ::Texture texture; - SMesh::Property_map > uv; + SMesh::Property_map umap; + SMesh::Property_map vmap; //[Px][Py][Pz][Nx][Ny][Nz][u][v] mutable std::vector faces_buffer; @@ -102,8 +105,8 @@ Scene_textured_surface_mesh_item_priv::compute_normals_and_vertices(void) const faces_buffer.push_back(n[1]); faces_buffer.push_back(n[2]); //uvs [2] - const float u = get(uv, *he).first; - const float v = get(uv, *he).second; + const float u = get(umap, *he); + const float v = get(vmap, *he); faces_buffer.push_back(u); faces_buffer.push_back(v); } @@ -127,8 +130,8 @@ Scene_textured_surface_mesh_item_priv::compute_normals_and_vertices(void) const edges_buffer.push_back(a.y() + offset.y); edges_buffer.push_back(a.z() + offset.z); //uvs [2] - float u = get(uv, halfedge(*he, *sm)).first; - float v = get(uv, halfedge(*he, *sm)).second; + float u = get(umap, halfedge(*he, *sm)); + float v = get(vmap, halfedge(*he, *sm)); edges_buffer.push_back(u); edges_buffer.push_back(v); @@ -138,8 +141,8 @@ Scene_textured_surface_mesh_item_priv::compute_normals_and_vertices(void) const edges_buffer.push_back(b.z() + offset.z); //uvs [2] - u = get(uv, opposite(halfedge(*he, *sm), *sm)).first; - v = get(uv, opposite(halfedge(*he, *sm), *sm)).second; + u = get(umap, opposite(halfedge(*he, *sm), *sm)); + v = get(vmap, opposite(halfedge(*he, *sm), *sm)); edges_buffer.push_back(u); edges_buffer.push_back(v);