35 #include "itkProcessObject.h"
44 m_RedrawCommand = RedrawCommandType::New();
49 this->setMaximum(100);
54 const QString & cancelButtonText,
59 QProgressDialog( labelText, cancelButtonText, minimum, maximum, iParent, f )
61 m_RedrawCommand = RedrawCommandType::New();
76 const itk::EventObject & iEvent )
78 if (
typeid( itk::ProgressEvent ) ==
typeid( iEvent ) )
80 itk::ProcessObject::Pointer process =
dynamic_cast< itk::ProcessObject *
>( caller );
82 const int tempvalue =
static_cast< int >(
83 process->GetProgress() *
static_cast< float >( this->
maximum() ) );
91 const itk::EventObject & iEvent)
93 if (
typeid( itk::ProgressEvent ) ==
typeid( iEvent ) )
95 itk::ProcessObject::ConstPointer process =
96 dynamic_cast< const itk::ProcessObject *
>( caller );
98 const int temp_value =
static_cast< int >(
99 process->GetProgress() *
static_cast< float >( this->
maximum() ) );
108 caller->AddObserver( itk::ProgressEvent(),
m_RedrawCommand.GetPointer() );
void ConstProcessEvent(const itk::Object *caller, const itk::EventObject &event)
void setValue(int progress)
itk::MemberCommand< QtProgressDialog > RedrawCommandType
void Observe(itk::Object *caller)
void ProcessEvent(itk::Object *caller, const itk::EventObject &event)
RedrawCommandType::Pointer m_RedrawCommand
RedrawCommandType * GetRedrawCommand(void) const
QtProgressDialog(QWidget *parent=0, Qt::WindowFlags f=0)