Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef MITKPROGRESSBAR_H
18 #define MITKPROGRESSBAR_H
19 #include <MitkCoreExports.h>
20 #include <itkObject.h>
21 
22 namespace mitk
23 {
24  class ProgressBarImplementation;
25 
26  //##Documentation
27  //## @brief Sending a message to the applications ProgressBar
28  //##
29  //## Holds a GUI dependent ProgressBarImplementation and sends the progress further.
30  //## All mitk-classes use this class to display progress on GUI-ProgressBar.
31  //## The mainapplication has to set the internal held ProgressBarImplementation with SetImplementationInstance(..).
32  //## @ingroup Interaction
33  class MITKCORE_EXPORT ProgressBar : public itk::Object
34  {
35  public:
36  itkTypeMacro(ProgressBar, itk::Object);
37 
38  //##Documentation
39  //## @brief static method to get the GUI dependent ProgressBar-instance
40  //## so the methods for steps to do and progress can be called
41  //## No reference counting, cause of decentral static use!
42  static ProgressBar *GetInstance();
43 
44  //##Documentation
45  //## @brief Supply a GUI- dependent ProgressBar. Has to be set by the application
46  //## to connect the application dependent subclass of mitkProgressBar
47  void RegisterImplementationInstance(ProgressBarImplementation *implementation);
48 
49  void UnregisterImplementationInstance(ProgressBarImplementation *implementation);
50 
51  //##Documentation
52  //## @brief Adds steps to totalSteps.
53  void AddStepsToDo(unsigned int steps);
54 
55  //##Documentation
56  //## @brief Explicitly reset progress bar.
57  void Reset();
58 
59  //##Documentation
60  //## @brief Sets the current amount of progress to current progress + steps.
61  //## @param: steps the number of steps done since last Progress(int steps) call.
62  void Progress(unsigned int steps = 1);
63 
64  //##Documentation
65  //## @brief Sets whether the current progress value is displayed.
66  void SetPercentageVisible(bool visible);
67 
68  protected:
69  typedef std::vector<ProgressBarImplementation *> ProgressBarImplementationsList;
70  typedef ProgressBarImplementationsList::iterator ProgressBarImplementationsListIterator;
71 
72  ProgressBar();
73 
74  virtual ~ProgressBar();
75 
76  ProgressBarImplementationsList m_Implementations;
77 
79  };
80 
81 } // end namespace mitk
82 
83 #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