Fix warnings

This commit is contained in:
Mael Rouxel-Labbé 2022-03-22 14:35:42 +01:00
parent 9e8940adcd
commit e2aa7d2718
2 changed files with 4 additions and 10 deletions

View File

@ -130,7 +130,6 @@ construct_edge_normal(typename boost::graph_traits<TriangleMesh>::halfedge_descr
const VertexPointMap vpm, const VertexPointMap vpm,
const GeomTraits& gt) const GeomTraits& gt)
{ {
typedef typename boost::graph_traits<TriangleMesh>::vertex_descriptor vertex_descriptor;
typedef typename boost::property_traits<VertexPointMap>::reference Point_ref; typedef typename boost::property_traits<VertexPointMap>::reference Point_ref;
typedef typename GeomTraits::FT FT; typedef typename GeomTraits::FT FT;
@ -313,7 +312,6 @@ construct_classic_plane_quadric_from_edge(typename boost::graph_traits<TriangleM
const GeomTraits& gt) const GeomTraits& gt)
{ {
typedef typename GeomTraits::Vector_3 Vector_3; typedef typename GeomTraits::Vector_3 Vector_3;
typedef typename boost::graph_traits<TriangleMesh>::vertex_descriptor vertex_descriptor;
const Vector_3 normal = construct_edge_normal(he, mesh, vpm, gt); const Vector_3 normal = construct_edge_normal(he, mesh, vpm, gt);

View File

@ -121,28 +121,24 @@ Surface_mesh edge_collapse(Surface_mesh& mesh,
// ================================================================================================= // =================================================================================================
// ================================================================================================= // =================================================================================================
// always decimate meshes in this vector to avoid timing the copying of the meshes
template <typename Policy, typename TriangleMesh> template <typename Policy, typename TriangleMesh>
void time_mesh(const TriangleMesh mesh, void time_mesh(const TriangleMesh mesh,
std::ostream& out) std::ostream& out)
{ {
// always decimate meshes in this vector to avoid timing the copying of the meshes
std::vector<TriangleMesh> meshes (n_burns + n_samples, mesh); std::vector<TriangleMesh> meshes (n_burns + n_samples, mesh);
for(int i=0; i<n_burns; ++i) for(int i=0; i<n_burns; ++i)
edge_collapse<Policy>(meshes[i]); edge_collapse<Policy>(meshes[i]);
unsigned long elapsed_ns = 0; std::chrono::time_point<std::chrono::steady_clock> start_time = std::chrono::steady_clock::now();
for(int i=0; i<n_samples; ++i) for(int i=0; i<n_samples; ++i)
{ {
// measure time taken by the edge_collapse function over each mesh individually // measure time taken by the edge_collapse function over each mesh individually
std::chrono::time_point<std::chrono::steady_clock> start_time = std::chrono::steady_clock::now();
edge_collapse<Policy>(meshes[n_burns + i]); edge_collapse<Policy>(meshes[n_burns + i]);
std::chrono::time_point<std::chrono::steady_clock> end_time = std::chrono::steady_clock::now();
// get elapsed time in milliseconds
elapsed_ns += std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time).count();
} }
std::chrono::time_point<std::chrono::steady_clock> end_time = std::chrono::steady_clock::now();
auto elapsed_ns = std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time).count();
out << "Policy: " << typeid(Policy).name() << "\n" out << "Policy: " << typeid(Policy).name() << "\n"
<< "Elapsed: " << elapsed_ns << " (ms)\n" << "Elapsed: " << elapsed_ns << " (ms)\n"