mirror of https://github.com/CGAL/cgal
fix property_map() calls that should be add_property_map()
This commit is contained in:
parent
7befb9c86d
commit
17840c623b
|
|
@ -929,8 +929,7 @@ private:
|
|||
|
||||
SMesh& smesh = *item->face_graph();
|
||||
|
||||
const auto vnm = smesh.property_map<vertex_descriptor, EPICK::Vector_3>("v:normal_before_perturbation").value();
|
||||
const bool vnm_exists = smesh.property_map<vertex_descriptor, EPICK::Vector_3>("v:normal_before_perturbation").has_value();
|
||||
auto vnm = smesh.property_map<vertex_descriptor, EPICK::Vector_3>("v:normal_before_perturbation");
|
||||
|
||||
// compute once and store the value per vertex
|
||||
bool non_init;
|
||||
|
|
@ -938,21 +937,21 @@ private:
|
|||
std::tie(mu_i_map, non_init) = smesh.add_property_map<vertex_descriptor, double>(tied_string, 0);
|
||||
if(non_init || expand_radius_updated)
|
||||
{
|
||||
if(vnm_exists)
|
||||
if(vnm.has_value())
|
||||
{
|
||||
if(mu_index == MEAN_CURVATURE)
|
||||
{
|
||||
PMP::interpolated_corrected_curvatures(smesh,
|
||||
CGAL::parameters::vertex_mean_curvature_map(mu_i_map)
|
||||
.ball_radius(expand_radius)
|
||||
.vertex_normal_map(vnm));
|
||||
.vertex_normal_map(vnm.value()));
|
||||
}
|
||||
else
|
||||
{
|
||||
PMP::interpolated_corrected_curvatures(smesh,
|
||||
CGAL::parameters::vertex_Gaussian_curvature_map(mu_i_map)
|
||||
.ball_radius(expand_radius)
|
||||
.vertex_normal_map(vnm));
|
||||
.vertex_normal_map(vnm.value()));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -436,11 +436,12 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper:
|
|||
SMesh::Property_map<vertex_descriptor, SMesh::Point> positions =
|
||||
smesh_->points();
|
||||
|
||||
SMesh::Property_map<vertex_descriptor, CGAL::IO::Color> vcolors =
|
||||
smesh_->property_map<vertex_descriptor, CGAL::IO::Color >("v:color").value();
|
||||
auto vcolors = smesh_->property_map<vertex_descriptor, CGAL::IO::Color >("v:color");
|
||||
|
||||
SMesh::Property_map<face_descriptor, CGAL::IO::Color> fcolors =
|
||||
smesh_->property_map<face_descriptor, CGAL::IO::Color >("f:color").value();
|
||||
auto fcolors = smesh_->property_map<face_descriptor, CGAL::IO::Color >("f:color");
|
||||
|
||||
has_fcolors = fcolors.has_value();
|
||||
has_vcolors = vcolors.has_value();
|
||||
|
||||
boost::property_map< SMesh, boost::vertex_index_t >::type
|
||||
im = get(boost::vertex_index, *smesh_);
|
||||
|
|
@ -499,10 +500,7 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper:
|
|||
|
||||
if(name.testFlag(Scene_item_rendering_helper::COLORS))
|
||||
{
|
||||
|
||||
has_fpatch_id = smesh_->property_map<face_descriptor, int >("f:patch_id").has_value();
|
||||
has_fcolors = smesh_->property_map<face_descriptor, CGAL::IO::Color >("f:color").has_value();
|
||||
has_vcolors = smesh_->property_map<vertex_descriptor, CGAL::IO::Color >("v:color").has_value();
|
||||
}
|
||||
if(name.testFlag(Scene_item_rendering_helper::GEOMETRY))
|
||||
{
|
||||
|
|
@ -562,7 +560,7 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper:
|
|||
}
|
||||
else if(has_fcolors)
|
||||
{
|
||||
CGAL::IO::Color c = fcolors[fd];
|
||||
CGAL::IO::Color c = fcolors.value()[fd];
|
||||
CPF::add_color_in_buffer(c, f_colors);
|
||||
}
|
||||
}
|
||||
|
|
@ -589,7 +587,7 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper:
|
|||
c = new CGAL::IO::Color(color.red(),color.green(),color.blue());
|
||||
}
|
||||
else if(has_fcolors)
|
||||
c= &fcolors[fd];
|
||||
c= &(fcolors.value()[fd]);
|
||||
else
|
||||
c = nullptr;
|
||||
addFlatData(p,n,c, name);
|
||||
|
|
@ -628,11 +626,11 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper:
|
|||
}
|
||||
else if(is_convex)
|
||||
{
|
||||
triangulate_convex_facet(fd, &fnormals, &fcolors, nullptr, name, false);
|
||||
triangulate_convex_facet(fd, &fnormals, &fcolors.value(), nullptr, name, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
triangulate_facet(fd, &fnormals, &fcolors, nullptr, name, false);
|
||||
triangulate_facet(fd, &fnormals, &fcolors.value(), nullptr, name, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -641,7 +639,7 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper:
|
|||
{
|
||||
for(vertex_descriptor vd : vertices(*smesh_))
|
||||
{
|
||||
CGAL::IO::Color c = vcolors[vd];
|
||||
CGAL::IO::Color c = vcolors.value()[vd];
|
||||
v_colors.push_back(static_cast<float>(c.red())/255);
|
||||
v_colors.push_back(static_cast<float>(c.green())/255);
|
||||
v_colors.push_back(static_cast<float>(c.blue())/255);
|
||||
|
|
@ -2530,7 +2528,7 @@ void Scene_surface_mesh_item::fill_flat_vertex_map()
|
|||
return;
|
||||
|
||||
SMesh::Property_map<face_descriptor, EPICK::Vector_3 > fnormals =
|
||||
face_graph()->property_map<face_descriptor, EPICK::Vector_3 >("f:normal").value();
|
||||
face_graph()->add_property_map<face_descriptor, EPICK::Vector_3 >("f:normal").first;
|
||||
|
||||
d->flat_vertices_map.clear();
|
||||
d->flat_vertices_map.resize(face_graph()->number_of_vertices());
|
||||
|
|
|
|||
Loading…
Reference in New Issue