X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FclitkFilterBase.h;h=94736f7329f1f00cd74e5161548bd412f4371c4d;hb=dad240d633996ba10087d96ece317415086f5a59;hp=a53a181490b07ab0180e34b7d2e7c1b2e09ac879;hpb=868922dc773690f1be8f21159f10fc4702e5c09f;p=clitk.git diff --git a/common/clitkFilterBase.h b/common/clitkFilterBase.h index a53a181..94736f7 100644 --- a/common/clitkFilterBase.h +++ b/common/clitkFilterBase.h @@ -20,7 +20,6 @@ #define CLITKFILTERBASE_H // clitk -#include "clitkCommon.h" #include "clitkTimer.h" #include "clitkFilterMacros.txx" #include "clitkLabelizeParameters.h" @@ -32,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 @@ -90,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); @@ -106,10 +97,10 @@ namespace clitk { itkBooleanMacro(VerboseWarningOff); GGO_DefineOption_Flag(verboseWarningOff, SetVerboseWarningOff); - // Use this function to stop (when threaded) - void SetMustStop(bool b); - bool GetMustStop(); - + // Use this function to cancel the filter between step + void Cancel(); + bool Cancelled(); + protected: FilterBase(); virtual ~FilterBase() {} @@ -125,14 +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 void operator=(const Self&); //purposely not implemented @@ -143,8 +132,6 @@ namespace clitk { } // end namespace clitk //-------------------------------------------------------------------- -#define StartNewStepOrStop(s) StartNewStep(s); if (GetMustStop()) return; - #ifndef ITK_MANUAL_INSTANTIATION #include "clitkFilterBase.txx" #endif