X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=common%2FclitkFilterBase.h;h=089fa52a60097dd7ee447fa8a6caea4dfc635fa7;hb=7e0af5456045a0fd19a3eeb473f9b434f8f11939;hp=ef0a0d9ac45cb24d4f3f1e262127d51ba2114088;hpb=38786c4da19b87319bbe3cecc145e3d1771d10da;p=clitk.git diff --git a/common/clitkFilterBase.h b/common/clitkFilterBase.h index ef0a0d9..089fa52 100644 --- a/common/clitkFilterBase.h +++ b/common/clitkFilterBase.h @@ -20,7 +20,7 @@ #define CLITKFILTERBASE_H // clitk -#include "clitkCommon.h" +#include "clitkTimer.h" #include "clitkFilterMacros.txx" #include "clitkLabelizeParameters.h" @@ -31,10 +31,11 @@ namespace clitk { //-------------------------------------------------------------------- /* - Convenient class to manage options from GGO gengetopt) to filter + Convenient class to manage options from GGO (gengetopt) to filter */ //-------------------------------------------------------------------- - class FilterBase { + class FilterBase + { public: // Standard class typedefs @@ -89,15 +90,6 @@ namespace clitk { template void VerboseOptionV(std::string name, int nb, OptionType * value); - // Error - void SetLastError(std::string e); - void ResetLastError(); - itkGetConstMacro(LastError, std::string); - bool HasError() { return (GetLastError() != ""); } - itkSetMacro(StopOnError, bool); - itkGetConstMacro(StopOnError, bool); - itkBooleanMacro(StopOnError); - void SetWarning(std::string e); itkGetConstMacro(Warning, std::string); itkSetMacro(VerboseWarningOff, bool); @@ -105,9 +97,10 @@ namespace clitk { itkBooleanMacro(VerboseWarningOff); GGO_DefineOption_Flag(verboseWarningOff, SetVerboseWarningOff); - // Use this function to stop (when threaded) - void MustStop(); - + // Use this function to cancel the filter between step + void Cancel(); + bool Cancelled(); + protected: FilterBase(); virtual ~FilterBase() {} @@ -123,12 +116,12 @@ namespace clitk { int m_NumberOfSteps; std::string m_CurrentStepId; std::string m_CurrentStepBaseId; - std::string m_LastError; std::string m_CurrentStepName; - bool m_StopOnError; std::string m_Warning; bool m_VerboseWarningOff; - bool m_MustStop; + bool m_IsCancelled; + Timer m_CurrentStepTimer; + private: FilterBase(const Self&); //purposely not implemented