//--------------------------------------------------------------------
clitk::FilterBase::FilterBase()
{
+ SetMustStop(false);
SetVerboseOption(false);
SetCurrentStepNumber(0);
SetCurrentStepBaseId("");
StopOnErrorOn();
ResetLastError();
- VerboseWarningOffOn(); // OffOn, it's cool not ?
+ VerboseWarningOffOn(); // OffOn, it's cool no ?
SetWarning("");
}
//--------------------------------------------------------------------
//--------------------------------------------------------------------
void clitk::FilterBase::StartNewStep(std::string s)
{
+ //m_CurrentStepTimer.Reset();
+ // m_CurrentStepTimer.Start();
m_CurrentStepNumber++;
if (GetCurrentStepBaseId() != "") {
std::ostringstream oss;
SetCurrentStepId(oss.str());
}
+ m_CurrentStepName = "Step "+GetCurrentStepId()+" -- "+s;
if (m_VerboseStep) {
- std::cout << "Step " << GetCurrentStepId() << " -- " << s << std::endl;
+ std::cout << m_CurrentStepName << std::endl;
+ //"Step " << GetCurrentStepId() << " -- " << s << std::endl;
}
}
//--------------------------------------------------------------------
//--------------------------------------------------------------------
void clitk::FilterBase::StopCurrentStep()
{
-
+ // m_CurrentStepTimer.Stop();
+ // m_CurrentStepTimer.Print(std::cout);
+ // std::ostringstream oss;
+ //oss << " (" <<
+ // m_CurrentStepName = m_CurrentStepName +"
}
//--------------------------------------------------------------------
+
+//--------------------------------------------------------------------
+void clitk::FilterBase::SetMustStop(bool b)
+{
+ m_MustStop = b;
+ if (GetMustStop()) {
+ SetLastError("Filter is interrupted.");
+ }
+}
+//--------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------
+bool clitk::FilterBase::GetMustStop()
+{
+ if (m_MustStop) return true;
+ if (HasError()) return true;
+ return false;
+}
+//--------------------------------------------------------------------
+
+