Fix facet color reading

This commit is contained in:
Maxime Gimeno 2016-04-27 11:13:28 +02:00
parent b923641321
commit b8ecd34eb5
3 changed files with 4 additions and 8 deletions

View File

@ -100,7 +100,7 @@ void set_vcolors(Scene_surface_mesh_item::SMesh* smesh, std::vector<CGAL::Color>
SMesh::Property_map<vertex_descriptor, CGAL::Color> vcolors =
smesh->property_map<vertex_descriptor, CGAL::Color >("v:color").first;
bool created;
boost::tie(vcolors, created) = smesh->template add_property_map<SMesh::Vertex_index,CGAL::Color>("v:color",CGAL::Color(0,0,0));
boost::tie(vcolors, created) = smesh->add_property_map<SMesh::Vertex_index,CGAL::Color>("v:color",CGAL::Color(0,0,0));
assert(colors.size()==smesh->number_of_vertices());
int color_id = 0;
BOOST_FOREACH(vertex_descriptor vd, vertices(*smesh))
@ -114,7 +114,7 @@ void set_fcolors(Scene_surface_mesh_item::SMesh* smesh, std::vector<CGAL::Color>
SMesh::Property_map<face_descriptor, CGAL::Color> fcolors =
smesh->property_map<face_descriptor, CGAL::Color >("f:color").first;
bool created;
boost::tie(fcolors, created) = smesh->template add_property_map<SMesh::Face_index,CGAL::Color>("f:color",CGAL::Color(0,0,0));
boost::tie(fcolors, created) = smesh->add_property_map<SMesh::Face_index,CGAL::Color>("f:color",CGAL::Color(0,0,0));
assert(colors.size()==smesh->number_of_faces());
int color_id = 0;
BOOST_FOREACH(face_descriptor fd, faces(*smesh))

View File

@ -121,7 +121,7 @@ namespace CGAL{
vcolors[i] = Color_rgb(r,g,b);
}
else
scanner.skip_to_next_vertex(i);
scanner.skip_to_next_vertex(i);
}
if(!in)
return false;
@ -154,10 +154,7 @@ namespace CGAL{
has_fcolors = true;
fcolors.resize(scanner.size_of_facets());
std::istringstream iss2(col);
CGAL::File_scanner_OFF scanner2(iss2);
unsigned char r=0, g=0, b=0;
scanner2.scan_color(r,g,b);
fcolors[i] = Color_rgb(r,g,b);
fcolors[i] = scanner.get_color_from_line(iss2);
}
}
else if(has_fcolors)

View File

@ -569,7 +569,6 @@ public:
//else stores the value
else
rgb[index] = static_cast<unsigned char>(atoi(color_info.c_str()));
index++;
}
CGAL::Color color;