00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 #include "mitkProgressBar.h" 00019 #include "mitkCallbackFromGUIThread.h" 00020 #include "mitkProgressBarImplementation.h" 00021 #include <itkObjectFactory.h> 00022 #include <itkOutputWindow.h> 00023 #include <itkCommand.h> 00024 00025 namespace mitk 00026 { 00027 00028 ProgressBarImplementation* ProgressBar::m_Implementation = NULL; 00029 ProgressBar* ProgressBar::m_Instance = NULL; 00030 00035 void ProgressBar::Progress(unsigned int steps) 00036 { 00037 if (m_Implementation != NULL) 00038 { 00039 m_Implementation->Progress(steps); 00040 } 00041 } 00042 00046 void ProgressBar::AddStepsToDo(unsigned int steps) 00047 { 00048 if (m_Implementation) 00049 { 00050 m_Implementation->AddStepsToDo(steps); 00051 } 00052 } 00053 00057 void ProgressBar::SetPercentageVisible(bool visible) 00058 { 00059 if (m_Implementation != NULL) 00060 { 00061 m_Implementation->SetPercentageVisible(visible); 00062 } 00063 } 00064 00068 ProgressBar* ProgressBar::GetInstance() 00069 { 00070 if (m_Instance == NULL) 00071 { 00072 m_Instance = new ProgressBar(); 00073 } 00074 00075 return m_Instance; 00076 } 00077 00081 void ProgressBar::SetImplementationInstance(ProgressBarImplementation* implementation) 00082 { 00083 if ( m_Implementation == implementation ) 00084 { 00085 return; 00086 } 00087 m_Implementation = implementation; 00088 } 00089 00090 ProgressBar::ProgressBar() 00091 { 00092 } 00093 00094 ProgressBar::~ProgressBar() 00095 { 00096 } 00097 00098 }//end namespace mitk 00099