ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
GenericProgressCallback.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 <pybind11/pybind11.h>
9 
11 
12 namespace py = pybind11;
13 using namespace pybind11::literals;
14 
15 void define_GenericProgressCallback(py::module &cccorelib)
16 {
17  py::class_<cloudViewer::GenericProgressCallback>(cccorelib, "GenericProgressCallback")
25 
26  py::class_<cloudViewer::NormalizedProgress>(cccorelib, "NormalizedProgress")
27  .def(py::init<cloudViewer::GenericProgressCallback *, unsigned, unsigned>(),
28  "callback"_a,
29  "totalSteps"_a,
30  "totalPercentage"_a = 100)
31  .def("scale",
33  "totalSteps"_a,
34  "totalPercentage"_a = 100,
35  "updateCurrentProgress"_a = false)
39 }
void define_GenericProgressCallback(py::module &cccorelib)
virtual void stop()=0
Notifies the fact that the process has ended.
virtual void setInfo(const char *infoStr)=0
Notifies some information about the ongoing process.
virtual void setMethodTitle(const char *methodTitle)=0
Notifies the algorithm title.
virtual bool textCanBeEdited() const
Returns whether the dialog title and info can be updated or not.
virtual void update(float percent)=0
Notifies the algorithm progress.
virtual bool isCancelRequested()=0
Checks if the process should be canceled.
bool steps(unsigned n)
Increments total progress value of more than a single unit.
void reset()
Resets progress state.
bool oneStep()
Increments total progress value of a single unit.
void scale(unsigned totalSteps, unsigned totalPercentage=100, bool updateCurrentProgress=false)