Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkProgressBar.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkProgressBar_h
14 #define mitkProgressBar_h
15 #include <MitkCoreExports.h>
16 #include <itkObject.h>
17 
18 namespace mitk
19 {
20  class ProgressBarImplementation;
21 
22  //##Documentation
23  //## @brief Sending a message to the applications ProgressBar
24  //##
25  //## Holds a GUI dependent ProgressBarImplementation and sends the progress further.
26  //## All mitk-classes use this class to display progress on GUI-ProgressBar.
27  //## The mainapplication has to set the internal held ProgressBarImplementation with SetImplementationInstance(..).
28  //## @ingroup Interaction
29  class MITKCORE_EXPORT ProgressBar : public itk::Object
30  {
31  public:
32  itkTypeMacro(ProgressBar, itk::Object);
33 
34  //##Documentation
35  //## @brief static method to get the GUI dependent ProgressBar-instance
36  //## so the methods for steps to do and progress can be called
37  //## No reference counting, cause of decentral static use!
38  static ProgressBar *GetInstance();
39 
40  //##Documentation
41  //## @brief Supply a GUI- dependent ProgressBar. Has to be set by the application
42  //## to connect the application dependent subclass of mitkProgressBar
43  void RegisterImplementationInstance(ProgressBarImplementation *implementation);
44 
45  void UnregisterImplementationInstance(ProgressBarImplementation *implementation);
46 
47  //##Documentation
48  //## @brief Adds steps to totalSteps.
49  void AddStepsToDo(unsigned int steps);
50 
51  //##Documentation
52  //## @brief Explicitly reset progress bar.
53  void Reset();
54 
55  //##Documentation
56  //## @brief Sets the current amount of progress to current progress + steps.
57  //## @param steps the number of steps done since last Progress(int steps) call.
58  void Progress(unsigned int steps = 1);
59 
60  //##Documentation
61  //## @brief Sets whether the current progress value is displayed.
62  void SetPercentageVisible(bool visible);
63 
64  protected:
65  typedef std::vector<ProgressBarImplementation *> ProgressBarImplementationsList;
66  typedef ProgressBarImplementationsList::iterator ProgressBarImplementationsListIterator;
67 
68  ProgressBar();
69 
70  ~ProgressBar() override;
71 
73 
75  };
76 
77 } // end namespace mitk
78 
79 #endif
mitk::ProgressBar::ProgressBarImplementationsList
std::vector< ProgressBarImplementation * > ProgressBarImplementationsList
Definition: mitkProgressBar.h:65
mitk::ProgressBar::m_Instance
static ProgressBar * m_Instance
Definition: mitkProgressBar.h:74
mitk::ProgressBar
Sending a message to the applications ProgressBar.
Definition: mitkProgressBar.h:29
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
MitkCoreExports.h
mitk::ProgressBar::ProgressBarImplementationsListIterator
ProgressBarImplementationsList::iterator ProgressBarImplementationsListIterator
Definition: mitkProgressBar.h:66
mitk::ProgressBarImplementation
GUI independent Interface for all Gui depentent implementations of a ProgressBar.
Definition: mitkProgressBarImplementation.h:21
mitk::ProgressBar::m_Implementations
ProgressBarImplementationsList m_Implementations
Definition: mitkProgressBar.h:72
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15