42 #include "itkConfigure.h"
43 #include "ITKCommonExport.h"
73 #define ITK_PRAGMA(x) _Pragma (#x)
79 #if defined(__clang__) && defined(__has_warning)
80 #define CLANG_PRAGMA_PUSH ITK_PRAGMA(clang diagnostic push)
81 #define CLANG_PRAGMA_POP ITK_PRAGMA(clang diagnostic pop)
82 #if __has_warning("-Wfloat-equal")
83 #define CLANG_SUPPRESS_Wfloat_equal ITK_PRAGMA( clang diagnostic ignored "-Wfloat-equal" )
85 #define CLANG_SUPPRESS_Wfloat_equal
87 #if __has_warning( "-Wc++14-extensions" )
88 #define CLANG_SUPPRESS_Wc__14_extensions ITK_PRAGMA( clang diagnostic ignored "-Wc++14-extensions" )
90 #define CLANG_SUPPRESS_Wc__14_extensions
93 #define CLANG_PRAGMA_PUSH
94 #define CLANG_PRAGMA_POP
95 #define CLANG_SUPPRESS_Wfloat_equal
96 #define CLANG_SUPPRESS_Wc__14_extensions
100 #if defined(__INTEL_COMPILER)
101 #define INTEL_PRAGMA_WARN_PUSH ITK_PRAGMA(warning push)
102 #define INTEL_PRAGMA_WARN_POP ITK_PRAGMA(warning pop)
103 #define INTEL_SUPPRESS_warning_1292 ITK_PRAGMA(warning disable 1292)
105 #define INTEL_PRAGMA_WARN_PUSH
106 #define INTEL_PRAGMA_WARN_POP
107 #define INTEL_SUPPRESS_warning_1292
116 #if defined( __GNUC__ ) && !defined( __INTEL_COMPILER )
117 # if ( __GNUC__ > 4 ) || (( __GNUC__ >= 4 ) && ( __GNUC_MINOR__ >= 2 ))
118 # define ITK_GCC_PRAGMA_DIAG(x) ITK_PRAGMA(GCC diagnostic x)
120 # define ITK_GCC_PRAGMA_DIAG(x)
123 # define ITK_GCC_PRAGMA_DIAG(x)
135 #if defined( __GNUC__ ) && !defined( __INTEL_COMPILER )
136 # if ( __GNUC__ > 4 ) || (( __GNUC__ >= 4 ) && ( __GNUC_MINOR__ >= 6 ))
137 # define ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(push)
138 # define ITK_GCC_PRAGMA_DIAG_POP() ITK_GCC_PRAGMA_DIAG(pop)
139 # define ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP
141 # define ITK_GCC_PRAGMA_DIAG_PUSH()
142 # define ITK_GCC_PRAGMA_DIAG_POP()
145 # define ITK_GCC_PRAGMA_DIAG_PUSH()
146 # define ITK_GCC_PRAGMA_DIAG_POP()
160 #if defined( _MSC_VER ) && ( _MSC_VER < 1310 )
163 #if defined( __SUNPRO_CC ) && ( __SUNPRO_CC < 0x590 )
164 #error "__SUNPRO_CC < 0x590 not supported under ITKv4"
166 #if defined( __CYGWIN__ )
167 #error "The Cygwin compiler is not supported in ITKv4 and above"
169 #if defined( __BORLANDC__ )
170 #error "The Borland C compiler is not supported in ITKv4 and above"
172 #if defined( __MWERKS__ )
173 #error "The MetroWerks compiler is not supported in ITKv4 and above"
175 #if defined( __GNUC__ ) && ( __GNUC__ < 3 )
176 #error "The __GNUC__ version 2.95 compiler is not supprted under ITKv4 and above"
181 #error "The __sgi compiler is not supprted under ITKv4 and above"
186 #if defined( _WIN32 ) || defined ( WIN32 )
187 #define ITK_ABI_IMPORT __declspec(dllimport)
188 #define ITK_ABI_EXPORT __declspec(dllexport)
189 #define ITK_ABI_HIDDEN
192 #define ITK_ABI_IMPORT __attribute__ ((visibility ("default")))
193 #define ITK_ABI_EXPORT __attribute__ ((visibility ("default")))
194 #define ITK_ABI_HIDDEN __attribute__ ((visibility ("hidden")))
196 #define ITK_ABI_IMPORT
197 #define ITK_ABI_EXPORT
198 #define ITK_ABI_HIDDEN
203 #ifndef ITK_TEMPLATE_EXPORT
204 #ifdef ITK_TEMPLATE_VISIBILITY_DEFAULT
205 #define ITK_TEMPLATE_EXPORT __attribute__ ((visibility ("default")))
207 #define ITK_TEMPLATE_EXPORT
212 #ifdef ITK_TEMPLATE_VISIBILITY_DEFAULT
213 #define ITK_FORCE_EXPORT_MACRO(moduleName) __attribute__ ((visibility ("default")))
215 #define ITK_FORCE_EXPORT_MACRO(moduleName) moduleName ## _EXPORT
218 #ifndef ITK_FORWARD_EXPORT
220 #if defined(__APPLE__)\
221 && defined(ITK_TEMPLATE_VISIBILITY_DEFAULT)\
222 && defined(ITK_BUILD_SHARED_LIBS)\
223 && defined(USE_COMPILER_HIDDEN_VISIBILITY)
224 #define ITK_FORWARD_EXPORT __attribute__ ((visibility ("default")))
226 #define ITK_FORWARD_EXPORT
234 #define ITK_NOEXCEPT_OR_THROW error "Replace ITK_NOEXCEPT_OR_THROW with ITK_NOEXCEPT"
236 #if !defined( ITK_LEGACY_REMOVE )
237 #define ITK_DELETE_FUNCTION = delete
239 #define ITK_DELETE_FUNCTION error "Replace ITK_DELETE_FUNCTION with = delete"
246 #if defined ( ITK_FUTURE_LEGACY_REMOVE )
247 #define ITK_CONSTEXPR_FUNC "Replace ITK_CONSTEXPR_FUNC with constexpr"
248 #define ITK_CONSTEXPR_VAR "Replace ITK_CONSTEXPR_VAR with constexpr"
250 #define ITK_CONSTEXPR_FUNC constexpr
251 #define ITK_CONSTEXPR_VAR constexpr
256 #if defined( __GNUC__ ) && !defined( __INTEL_COMPILER )
257 # if ( __GNUC__ >= 7 )
258 # define ITK_FALLTHROUGH __attribute__((fallthrough))
260 #elif defined(__has_warning)
261 # if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
262 # define ITK_FALLTHROUGH [[clang::fallthrough]]
266 #ifndef ITK_FALLTHROUGH
267 # define ITK_FALLTHROUGH ((void)0)
290 #define itkNewMacro(x) \
291 itkSimpleNewMacro(x) \
292 itkCreateAnotherMacro(x) \
295 #define itkSimpleNewMacro(x) \
296 static Pointer New() \
298 Pointer smartPtr = ::itk::ObjectFactory< x >::Create(); \
299 if ( smartPtr == nullptr ) \
303 smartPtr->UnRegister(); \
307 #define itkCreateAnotherMacro(x) \
308 ::itk::LightObject::Pointer CreateAnother() const override \
310 ::itk::LightObject::Pointer smartPtr; \
311 smartPtr = x::New().GetPointer(); \
315 #define itkCloneMacro(x) \
316 Pointer Clone() const \
319 dynamic_cast<x *>(this->InternalClone().GetPointer()); \
335 #define itkFactorylessNewMacro(x) \
336 static Pointer New() \
339 x * rawPtr = new x; \
341 rawPtr->UnRegister(); \
344 ::itk::LightObject::Pointer CreateAnother() const override \
346 ::itk::LightObject::Pointer smartPtr; \
347 smartPtr = x::New().GetPointer(); \
361 #define ITK_DISALLOW_COPY_AND_ASSIGN(TypeName) \
362 TypeName(const TypeName&) = delete; \
363 TypeName& operator=(const TypeName&) = delete; \
364 TypeName(TypeName&&) = delete; \
365 TypeName& operator=(TypeName&&) = delete
369 #define itkTypeMacro(thisClass, superclass) \
370 const char *GetNameOfClass() const override \
375 #define itkTypeMacroNoParent(thisClass) \
376 virtual const char *GetNameOfClass() const \
389 extern ITKCommon_EXPORT
void OutputWindowDisplayText(
const char *);
392 extern ITKCommon_EXPORT
void OutputWindowDisplayErrorText(
const char *);
394 extern ITKCommon_EXPORT
void OutputWindowDisplayWarningText(
const char *);
396 extern ITKCommon_EXPORT
void OutputWindowDisplayGenericOutputText(
const char *);
398 extern ITKCommon_EXPORT
void OutputWindowDisplayDebugText(
const char *);
404 #if defined( NDEBUG )
405 #define itkDebugMacro(x)
406 #define itkDebugStatement(x)
408 #define itkDebugMacro(x) \
410 if ( this->GetDebug() && ::itk::Object::GetGlobalWarningDisplay() ) \
412 std::ostringstream itkmsg; \
413 itkmsg << "Debug: In " __FILE__ ", line " << __LINE__ << "\n" \
414 << this->GetNameOfClass() << " (" << this << "): " x \
416 ::itk::OutputWindowDisplayDebugText( itkmsg.str().c_str() ); \
423 #define itkDebugStatement(x) x
429 #define itkWarningMacro(x) \
431 if ( ::itk::Object::GetGlobalWarningDisplay() ) \
433 std::ostringstream itkmsg; \
434 itkmsg << "WARNING: In " __FILE__ ", line " << __LINE__ << "\n" \
435 << this->GetNameOfClass() << " (" << this << "): " x \
437 ::itk::OutputWindowDisplayWarningText( itkmsg.str().c_str() ); \
444 #define itkWarningStatement(x) x
446 #if defined( ITK_CPP_FUNCTION )
447 #if defined( _WIN32 ) && !defined( __MINGW32__ ) && !defined( ITK_WRAPPING_PARSER )
448 #define ITK_LOCATION __FUNCSIG__
449 #elif defined( __GNUC__ )
450 #define ITK_LOCATION __PRETTY_FUNCTION__
452 #define ITK_LOCATION __FUNCTION__
455 #define ITK_LOCATION "unknown"
461 #define itkExceptionMacro(x) \
463 std::ostringstream message; \
464 message << "itk::ERROR: " << this->GetNameOfClass() \
465 << "(" << this << "): " x; \
466 ::itk::ExceptionObject e_(__FILE__, __LINE__, message.str().c_str(), ITK_LOCATION); \
471 #define itkGenericExceptionMacro(x) \
473 std::ostringstream message; \
474 message << "itk::ERROR: " x; \
475 ::itk::ExceptionObject e_(__FILE__, __LINE__, message.str().c_str(), ITK_LOCATION); \
479 #define itkDeclareExceptionMacro(newexcp,parentexcp,whatmessage) \
481 class newexcp : public parentexcp \
484 newexcp( const char *file, unsigned int lineNumber ) : \
485 parentexcp( file, lineNumber ) \
487 this->SetDescription( whatmessage ); \
489 newexcp( const std::string & file, unsigned int lineNumber ) : \
490 parentexcp( file, lineNumber ) \
492 this->SetDescription( whatmessage ); \
494 itkTypeMacro(newexcp, parentexcp); \
498 #define itkSpecializedExceptionMacro(exceptiontype) \
500 ::itk::exceptiontype e_(__FILE__, __LINE__); \
501 e_.SetLocation(ITK_LOCATION); \
505 #define itkSpecializedMessageExceptionMacro(exceptiontype,x) \
507 ::itk::exceptiontype e_(__FILE__, __LINE__); \
508 std::ostringstream message; \
509 message << "itk::ERROR: " x; \
510 e_.SetDescription(message.str().c_str()); \
511 e_.SetLocation(ITK_LOCATION); \
516 #define itkGenericOutputMacro(x) \
518 if ( ::itk::Object::GetGlobalWarningDisplay() ) \
520 std::ostringstream itkmsg; \
521 itkmsg << "WARNING: In " __FILE__ ", line " << __LINE__ << "\n" \
523 ::itk::OutputWindowDisplayGenericOutputText( itkmsg.str().c_str() ); \
530 #define itkLogMacro(x, y) \
532 if ( this->GetLogger() ) \
534 this->GetLogger()->Write(::itk::LoggerBase::x, y); \
538 #define itkLogMacroStatic(obj, x, y) \
540 if ( obj->GetLogger() ) \
542 obj->GetLogger()->Write(::itk::LoggerBase::x, y); \
570 #if defined( ITK_LEGACY_REMOVE )
571 #define itkLegacyMacro(method)
572 #elif defined( ITK_LEGACY_SILENT ) || defined( ITK_LEGACY_TEST ) || defined( ITK_WRAPPING_PARSER )
574 #define itkLegacyMacro(method) method
578 #if defined( __GNUC__ ) && !defined( __INTEL_COMPILER ) && ( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1 ) )
579 #define itkLegacyMacro(method) method __attribute__( ( deprecated ) )
580 #elif defined( _MSC_VER )
581 #define itkLegacyMacro(method) __declspec(deprecated) method
583 #define itkLegacyMacro(method) method
602 #if defined( ITK_LEGACY_REMOVE ) || defined( ITK_LEGACY_SILENT )
603 #define itkLegacyBodyMacro(method, version)
604 #define itkLegacyReplaceBodyMacro(method, version, replace)
605 #define itkGenericLegacyBodyMacro(method, version)
606 #define itkGenericLegacyReplaceBodyMacro(method, version, replace)
608 #define itkLegacyBodyMacro(method, version) \
609 itkWarningMacro(#method " was deprecated for ITK " #version \
610 " and will be removed in a future version.")
611 #define itkLegacyReplaceBodyMacro(method, version, replace) \
612 itkWarningMacro( #method " was deprecated for ITK " #version \
613 " and will be removed in a future version. Use " #replace " instead.")
614 #define itkGenericLegacyBodyMacro(method, version) \
615 itkGenericOutputMacro(#method " was deprecated for ITK " #version \
616 " and will be removed in a future version.")
617 #define itkGenericLegacyReplaceBodyMacro(method, version, replace) \
618 itkGenericOutputMacro( #method " was deprecated for ITK " #version \
619 " and will be removed in a future version. Use " #replace " instead.")
626 #define ITK_CACHE_LINE_ALIGNMENT 64
634 #define itkPadStruct( mincachesize, oldtype, newtype ) \
635 struct newtype: public oldtype \
637 char _StructPadding[mincachesize - (sizeof(oldtype)%mincachesize) ]; \
644 #if defined( ITK_HAS_GNU_ATTRIBUTE_ALIGNED )
645 # define itkAlignedTypedef( alignment, oldtype, newtype ) \
646 typedef oldtype newtype __attribute__((aligned(alignment)))
647 #elif defined ( _MSC_VER )
648 # define itkAlignedTypedef( alignment, oldtype, newtype ) \
649 typedef __declspec(align( alignment )) oldtype newtype
651 # define itkAlignedTypedef( alignment, oldtype, newtype ) \
652 typedef oldtype newtype
655 #if defined ( ITK_FUTURE_LEGACY_REMOVE )
678 #define ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT(T) < >
679 #else // LEGACY_REMOVE
680 #define ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT(T) "Macro remove use C++11 compliant declaration of "
696 #define itkForLoopAssignmentMacro(DestinationType, \
698 DestinationElementType, \
701 NumberOfIterations) \
702 for ( unsigned int i = 0; i < NumberOfIterations; ++i ) \
704 DestinationArray[i] = \
705 static_cast< DestinationElementType >( SourceArray[i] ); \
717 #define itkForLoopRoundingAndAssignmentMacro(DestinationType, \
718 Sourcrnd_halfintup, \
719 DestinationElementType, \
722 NumberOfIterations) \
723 for ( unsigned int i = 0; i < NumberOfIterations; ++i ) \
725 DestinationArray[i] = \
726 itk::Math::Round< DestinationElementType >(SourceArray[i]); \
734 #define itkAssertInDebugOrThrowInReleaseMacro(msg) __assert_fail (msg, __FILE__, __LINE__, __ASSERT_FUNCTION);
736 #define itkAssertInDebugOrThrowInReleaseMacro(msg) itkGenericExceptionMacro(<< msg);
740 #define itkAssertInDebugOrThrowInReleaseMacro(msg) itkGenericExceptionMacro(<< msg);
743 #define itkAssertOrThrowMacro(test, message) \
746 std::ostringstream msgstr; \
748 itkAssertInDebugOrThrowInReleaseMacro( msgstr.str().c_str() ); \
752 #define itkAssertInDebugAndIgnoreInReleaseMacro(X) assert(X)
754 #define itkAssertInDebugAndIgnoreInReleaseMacro(X)
777 #if defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__ ) < 405 && !defined( __clang__ ) && !defined( __INTEL_COMPILER )
778 # define itkStaticConstMacro(name,type,value) enum { name = value }
780 # define itkStaticConstMacro(name,type,value) static constexpr type name = value
783 #define itkGetStaticConstMacro(name) (Self::name)
786 #define itkSetInputMacro(name, type) \
787 virtual void Set##name(const type *_arg) \
789 itkDebugMacro("setting input " #name " to " << _arg); \
790 if ( _arg != itkDynamicCastInDebugMode< type * >( \
791 this->ProcessObject::GetInput(#name) ) ) \
793 this->ProcessObject::SetInput( #name, const_cast< type * >( _arg ) ); \
800 #define itkGetInputMacro(name, type) \
801 virtual const type * Get##name() const \
803 itkDebugMacro( "returning input " << #name " of " \
804 << this->ProcessObject::GetInput(#name) ); \
805 return itkDynamicCastInDebugMode< const type * >( \
806 this->ProcessObject::GetInput(#name) ); \
811 #define itkSetDecoratedInputMacro(name, type) \
812 virtual void Set##name##Input(const SimpleDataObjectDecorator< type > *_arg) \
814 itkDebugMacro("setting input " #name " to " << _arg); \
815 if ( _arg != itkDynamicCastInDebugMode< SimpleDataObjectDecorator< type > * >( \
816 this->ProcessObject::GetInput(#name) ) ) \
818 this->ProcessObject::SetInput( \
819 #name, const_cast< SimpleDataObjectDecorator< type > * >( _arg ) ); \
823 virtual void Set##name(const SimpleDataObjectDecorator< type > *_arg) \
825 this->Set##name##Input(_arg); \
827 virtual void Set##name(const type &_arg) \
829 using DecoratorType = SimpleDataObjectDecorator< type >; \
830 itkDebugMacro("setting input " #name " to " << _arg); \
831 const DecoratorType *oldInput = \
832 itkDynamicCastInDebugMode< const DecoratorType * >( \
833 this->ProcessObject::GetInput(#name) ); \
835 CLANG_SUPPRESS_Wfloat_equal \
836 if ( oldInput && oldInput->Get() == _arg ) \
841 typename DecoratorType::Pointer newInput = DecoratorType::New(); \
842 newInput->Set(_arg); \
843 this->Set##name##Input(newInput); \
848 #define itkGetDecoratedInputMacro(name, type) \
849 virtual const SimpleDataObjectDecorator< type > * Get##name##Input() const \
851 itkDebugMacro( "returning input " << #name " of " \
852 << this->ProcessObject::GetInput(#name) ); \
853 return itkDynamicCastInDebugMode< const SimpleDataObjectDecorator< type > * >( \
854 this->ProcessObject::GetInput(#name) ); \
856 virtual const type & Get##name() const \
858 itkDebugMacro("Getting input " #name); \
859 using DecoratorType = SimpleDataObjectDecorator< type >; \
860 const DecoratorType *input = \
861 itkDynamicCastInDebugMode< const DecoratorType * >( \
862 this->ProcessObject::GetInput(#name) ); \
863 if( input == nullptr ) \
865 itkExceptionMacro(<<"input" #name " is not set"); \
867 return input->Get(); \
873 #define itkSetGetDecoratedInputMacro(name, type) \
874 itkSetDecoratedInputMacro(name, type) \
875 itkGetDecoratedInputMacro(name, type)
881 #define itkSetDecoratedObjectInputMacro(name, type) \
882 virtual void Set##name##Input(const DataObjectDecorator< type > *_arg) \
884 itkDebugMacro("setting input " #name " to " << _arg); \
885 if ( _arg != itkDynamicCastInDebugMode< DataObjectDecorator< type > * >( \
886 this->ProcessObject::GetInput(#name) ) ) \
888 this->ProcessObject::SetInput( #name, \
889 const_cast< DataObjectDecorator< type > * >( _arg ) ); \
893 virtual void Set##name(const type * _arg) \
895 using DecoratorType = DataObjectDecorator< type >; \
896 itkDebugMacro("setting input " #name " to " << _arg); \
897 const DecoratorType *oldInput = \
898 itkDynamicCastInDebugMode< const DecoratorType * >( \
899 this->ProcessObject::GetInput(#name) ); \
900 if ( oldInput && oldInput->Get() == _arg ) \
904 typename DecoratorType::Pointer newInput = DecoratorType::New(); \
905 newInput->Set(_arg); \
906 this->Set##name##Input(newInput); \
914 #define itkGetDecoratedObjectInputMacro(name, type) \
915 virtual const DataObjectDecorator< type > * Get##name##Input() const \
917 itkDebugMacro( "returning input " << #name " of " \
918 << this->ProcessObject::GetInput(#name) ); \
919 return itkDynamicCastInDebugMode< \
920 const DataObjectDecorator< type > * >( \
921 this->ProcessObject::GetInput(#name) ); \
923 virtual const type * Get##name() const \
925 itkDebugMacro("Getting input " #name); \
926 using DecoratorType = DataObjectDecorator< type >; \
927 const DecoratorType *input = \
928 itkDynamicCastInDebugMode< const DecoratorType * >( \
929 this->ProcessObject::GetInput(#name) ); \
930 if( input == nullptr ) \
934 return input->Get(); \
940 #define itkSetGetDecoratedObjectInputMacro(name, type) \
941 itkSetDecoratedObjectInputMacro(name, type) \
942 itkGetDecoratedObjectInputMacro(name, type)
945 #define itkSetMacro(name, type) \
946 virtual void Set##name (const type _arg) \
948 itkDebugMacro("setting " #name " to " << _arg); \
950 CLANG_SUPPRESS_Wfloat_equal \
951 if ( this->m_##name != _arg ) \
953 this->m_##name = _arg; \
961 #define itkGetMacro(name, type) \
962 virtual type Get##name () \
964 return this->m_##name; \
971 #define itkGetConstMacro(name, type) \
972 virtual type Get##name () const \
974 return this->m_##name; \
982 #define itkGetConstReferenceMacro(name, type) \
983 virtual const type &Get##name () const \
985 return this->m_##name; \
993 #define itkSetEnumMacro(name, type) \
994 virtual void Set##name (const type _arg) \
996 itkDebugMacro( "setting " #name " to " \
997 << static_cast< long >( _arg ) ); \
998 if ( this->m_##name != _arg ) \
1000 this->m_##name = _arg; \
1010 #define itkGetEnumMacro(name, type) \
1011 virtual type Get##name () const \
1013 return this->m_##name; \
1020 #define itkSetStringMacro(name) \
1021 virtual void Set##name (const char *_arg) \
1023 if ( _arg && ( _arg == this->m_##name ) ) { return; } \
1026 this->m_##name = _arg; \
1030 this->m_##name = ""; \
1034 virtual void Set##name (const std::string & _arg) \
1036 this->Set##name( _arg.c_str() ); \
1044 #define itkGetStringMacro(name) \
1045 virtual const char *Get##name () const \
1047 return this->m_##name.c_str(); \
1053 #define itkSetClampMacro(name, type, min, max) \
1054 virtual void Set##name (type _arg) \
1056 const type temp_extrema=( _arg < min ? min \
1057 : ( _arg > max ? max : _arg ) ); \
1058 itkDebugMacro("setting " << #name " to " << _arg); \
1060 CLANG_SUPPRESS_Wfloat_equal \
1061 if ( this->m_##name != temp_extrema ) \
1063 this->m_##name = temp_extrema; \
1075 #define itkSetObjectMacro(name, type) \
1076 virtual void Set##name (type * _arg) \
1078 itkDebugMacro("setting " << #name " to " << _arg); \
1080 CLANG_SUPPRESS_Wfloat_equal \
1081 if ( this->m_##name != _arg ) \
1083 this->m_##name = _arg; \
1115 #define itkGetConstObjectMacro(name, type) \
1116 virtual const type * Get##name () const \
1118 return this->m_##name.GetPointer(); \
1122 #if defined ( ITK_FUTURE_LEGACY_REMOVE )
1128 # define itkGetObjectMacro(name, type) \
1129 virtual type * Get##name () \
1131 purposeful_error("itkGetObjectMacro should be replaced with itkGetModifiableObjectMacro."); \
1134 # define itkGetModifiableObjectMacro(name, type) \
1135 virtual type * GetModifiable##name () \
1137 return this->m_##name.GetPointer(); \
1139 itkGetConstObjectMacro(name, type)
1141 #else // defined ( ITK_FUTURE_LEGACY_REMOVE )
1144 # define itkGetObjectMacro(name, type) \
1145 virtual type * Get##name () \
1147 return this->m_##name.GetPointer(); \
1149 # define itkGetModifiableObjectMacro(name, type) \
1150 virtual type * GetModifiable##name () \
1152 return this->m_##name.GetPointer(); \
1154 itkGetConstObjectMacro(name, type) \
1155 itkGetObjectMacro(name, type)
1156 #endif // defined ( ITK_FUTURE_LEGACY_REMOVE )
1165 #define itkGetConstReferenceObjectMacro(name, type) \
1166 virtual const typename type::Pointer & Get##name () const \
1168 return this->m_##name; \
1175 #define itkSetConstObjectMacro(name, type) \
1176 virtual void Set##name (const type * _arg) \
1178 itkDebugMacro("setting " << #name " to " << _arg); \
1179 if ( this->m_##name != _arg ) \
1181 this->m_##name = _arg; \
1189 #define itkBooleanMacro(name) \
1190 virtual void name##On () \
1192 this->Set##name(true); \
1194 virtual void name##Off () \
1196 this->Set##name(false); \
1203 #define itkSetVectorMacro(name, type, count) \
1204 virtual void Set##name(type data[]) \
1207 for ( i = 0; i < count; i++ ) \
1210 CLANG_SUPPRESS_Wfloat_equal \
1211 if ( data[i] != this->m_##name[i] ) \
1220 for ( i = 0; i < count; i++ ) \
1222 this->m_##name[i] = data[i]; \
1230 #define itkGetVectorMacro(name, type, count) \
1231 virtual type * Get##name () const \
1233 return this->m_##name; \
1240 #define itkGPUKernelClassMacro(kernel) \