ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
SamplePoints.cpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #include <benchmark/benchmark.h>
9 #include <ecvMesh.h>
10 
13 
14 namespace cloudViewer {
15 namespace benchmarks {
16 
17 class SamplePointsFixture : public benchmark::Fixture {
18 public:
19  void SetUp(const benchmark::State& state) {
22  }
23 
24  void TearDown(const benchmark::State& state) {
25  // empty
26  }
27  std::shared_ptr<ccMesh> trimesh;
28 };
29 
30 BENCHMARK_DEFINE_F(SamplePointsFixture, Poisson)(benchmark::State& state) {
31  for (auto _ : state) {
32  trimesh->SamplePointsPoissonDisk(state.range(0));
33  }
34 }
35 
36 BENCHMARK_REGISTER_F(SamplePointsFixture, Poisson)->Args({123})->Args({1000});
37 
38 BENCHMARK_DEFINE_F(SamplePointsFixture, Uniform)(benchmark::State& state) {
39  for (auto _ : state) {
40  trimesh->SamplePointsUniformly(state.range(0));
41  }
42 }
43 
44 BENCHMARK_REGISTER_F(SamplePointsFixture, Uniform)->Args({123})->Args({1000});
45 
46 } // namespace benchmarks
47 } // namespace cloudViewer
void TearDown(const benchmark::State &state)
void SetUp(const benchmark::State &state)
Data class for KnotMesh contains the KnotMesh.ply file.
Definition: Dataset.h:542
std::string GetPath() const
Path to the KnotMesh.ply file.
Definition: Dataset.h:547
BENCHMARK_REGISTER_F(SamplePointsFixture, Poisson) -> Args({123}) ->Args({1000})
BENCHMARK_DEFINE_F(SamplePointsFixture, Poisson)(benchmark
std::shared_ptr< ccMesh > CreateMeshFromFile(const std::string &filename, bool print_progress)
Generic file read and write utility for python interface.