Open3D (C++ API)  0.18.0
ProgressBar.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <string>
11 
12 namespace open3d {
13 namespace utility {
14 
15 class ProgressBar {
16 public:
17  ProgressBar(size_t expected_count,
18  const std::string &progress_info,
19  bool active = false);
20  void Reset(size_t expected_count,
21  const std::string &progress_info,
22  bool active);
23  virtual ProgressBar &operator++();
24  void SetCurrentCount(size_t n);
25  size_t GetCurrentCount() const;
26 
27 protected:
28  const size_t resolution_ = 40;
31  std::string progress_info_;
33  bool active_;
34 };
35 
36 class OMPProgressBar : public ProgressBar {
37 public:
38  OMPProgressBar(size_t expected_count,
39  const std::string &progress_info,
40  bool active = false);
41  ProgressBar &operator++() override;
42 };
43 
44 } // namespace utility
45 } // namespace open3d
Definition: ProgressBar.h:36
ProgressBar & operator++() override
Definition: ProgressBar.cpp:71
OMPProgressBar(size_t expected_count, const std::string &progress_info, bool active=false)
Definition: ProgressBar.cpp:66
Definition: ProgressBar.h:15
virtual ProgressBar & operator++()
Definition: ProgressBar.cpp:36
bool active_
Definition: ProgressBar.h:33
ProgressBar(size_t expected_count, const std::string &progress_info, bool active=false)
Definition: ProgressBar.cpp:19
size_t progress_pixel_
Definition: ProgressBar.h:32
size_t current_count_
Definition: ProgressBar.h:30
void SetCurrentCount(size_t n)
Definition: ProgressBar.cpp:41
size_t GetCurrentCount() const
Definition: ProgressBar.cpp:64
std::string progress_info_
Definition: ProgressBar.h:31
const size_t resolution_
Definition: ProgressBar.h:28
size_t expected_count_
Definition: ProgressBar.h:29
void Reset(size_t expected_count, const std::string &progress_info, bool active)
Definition: ProgressBar.cpp:25
Definition: PinholeCameraIntrinsic.cpp:16