Medical Imaging Interaction Toolkit  2018.4.99-bd7b41ba
Medical Imaging Interaction Toolkit
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 
72  ProgressBarImplementationsList m_Implementations;
73 
75  };
76 
77 } // end namespace mitk
78 
79 #endif /* define MITKPROGRESSBAR_H */
GUI indepentent Interface for all Gui depentent implementations of a ProgressBar. ...
#define MITKCORE_EXPORT
Sending a message to the applications ProgressBar.
ProgressBarImplementationsList m_Implementations
DataCollection - Class to facilitate loading/accessing structured data.
std::vector< ProgressBarImplementation * > ProgressBarImplementationsList
ProgressBarImplementationsList::iterator ProgressBarImplementationsListIterator
static ProgressBar * m_Instance