42 #include "itkConfigure.h"
43 #include "ITKCommonExport.h"
72 #define ITK_PRAGMA(x) _Pragma (#x)
78 #if defined(__clang__) && defined(__has_warning)
79 #define CLANG_PRAGMA_PUSH ITK_PRAGMA(clang diagnostic push)
80 #define CLANG_PRAGMA_POP ITK_PRAGMA(clang diagnostic pop)
81 # if __has_warning("-Wfloat-equal")
82 #define CLANG_SUPPRESS_Wfloat_equal ITK_PRAGMA( clang diagnostic ignored "-Wfloat-equal" )
85 #define CLANG_PRAGMA_PUSH
86 #define CLANG_PRAGMA_POP
87 #define CLANG_SUPPRESS_Wfloat_equal
96 #if defined( __GNUC__ ) && !defined( __INTEL_COMPILER )
97 # if ( __GNUC__ > 4 ) || (( __GNUC__ >= 4 ) && ( __GNUC_MINOR__ >= 2 ))
98 # define ITK_GCC_PRAGMA_DIAG(x) ITK_PRAGMA(GCC diagnostic x)
100 # define ITK_GCC_PRAGMA_DIAG(x)
103 # define ITK_GCC_PRAGMA_DIAG(x)
115 #if defined( __GNUC__ ) && !defined( __INTEL_COMPILER )
116 # if ( __GNUC__ > 4 ) || (( __GNUC__ >= 4 ) && ( __GNUC_MINOR__ >= 6 ))
117 # define ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(push)
118 # define ITK_GCC_PRAGMA_DIAG_POP() ITK_GCC_PRAGMA_DIAG(pop)
119 # define ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP
121 # define ITK_GCC_PRAGMA_DIAG_PUSH()
122 # define ITK_GCC_PRAGMA_DIAG_POP()
125 # define ITK_GCC_PRAGMA_DIAG_PUSH()
126 # define ITK_GCC_PRAGMA_DIAG_POP()
140 #if defined( _MSC_VER ) && ( _MSC_VER < 1310 )
143 #if defined( __SUNPRO_CC ) && ( __SUNPRO_CC < 0x590 )
144 #error "__SUNPRO_CC < 0x590 not supported under ITKv4"
146 #if defined( __CYGWIN__ )
147 #error "The Cygwin compiler is not supported in ITKv4 and above"
149 #if defined( __BORLANDC__ )
150 #error "The Borland C compiler is not supported in ITKv4 and above"
152 #if defined( __MWERKS__ )
153 #error "The MetroWerks compiler is not supported in ITKv4 and above"
155 #if defined( __GNUC__ ) && ( __GNUC__ < 3 )
156 #error "The __GNUC__ version 2.95 compiler is not supprted under ITKv4 and above"
161 #error "The __sgi compiler is not supprted under ITKv4 and above"
166 #if defined( _WIN32 ) || defined ( WIN32 )
167 #define ITK_ABI_IMPORT __declspec(dllimport)
168 #define ITK_ABI_EXPORT __declspec(dllexport)
169 #define ITK_ABI_HIDDEN
172 #define ITK_ABI_IMPORT __attribute__ ((visibility ("default")))
173 #define ITK_ABI_EXPORT __attribute__ ((visibility ("default")))
174 #define ITK_ABI_HIDDEN __attribute__ ((visibility ("hidden")))
176 #define ITK_ABI_IMPORT
177 #define ITK_ABI_EXPORT
178 #define ITK_ABI_HIDDEN
183 #ifndef ITK_TEMPLATE_EXPORT
184 #ifdef ITK_TEMPLATE_VISIBILITY_DEFAULT
185 #define ITK_TEMPLATE_EXPORT __attribute__ ((visibility ("default")))
187 #define ITK_TEMPLATE_EXPORT
191 #if ITK_COMPILED_CXX_STANDARD_VERSION >= 201103L
192 #define ITK_HAS_CXX11_RVREF
195 #if ! defined( ITK_FUTURE_LEGACY_REMOVE )
196 #if ITK_COMPILER_CXX_STATIC_ASSERT
197 #define ITK_HAS_CXX11_STATIC_ASSERT //NOTE DEPRECATED! should be ITK_COMPILER_CXX_STATIC_ASSERT
200 #if ITK_COMPILER_CXX_DELETED_FUNCTIONS
201 #define ITK_DELETE_FUNCTION =delete //NOTE DEPRECATED! should be ITK_DELETED_FUNCTION
203 #define ITK_DELETE_FUNCTION
205 #if ITK_COMPILER_CXX_ALIGNAS //NOTE DEPRECATED! should use ITK_COMPILER_CXX_ALIGNAS
207 #define ITK_HAS_CPP11_ALIGNAS
209 #ifdef ITK_HAS_CPP11_ALIGNAS
210 #undef ITK_HAS_CPP11_ALIGNAS
215 #if ITK_COMPILER_CXX_NOEXCEPT
216 #define ITK_NOEXCEPT_OR_THROW noexcept
218 #define ITK_NOEXCEPT_OR_THROW throw()
221 #if ITK_COMPILER_CXX_CONSTEXPR
222 #define ITK_CONSTEXPR_FUNC constexpr
223 #define ITK_CONSTEXPR_VAR constexpr
225 #define ITK_CONSTEXPR_FUNC inline
226 #define ITK_CONSTEXPR_VAR const
231 #if ITK_COMPILED_CXX_STANDARD_VERSION >= 201103L && defined(__has_warning)
232 # if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
233 # define ITK_FALLTHROUGH [[clang::fallthrough]]
237 #ifndef ITK_FALLTHROUGH
238 # define ITK_FALLTHROUGH ((void)0)
261 #define itkNewMacro(x) \
262 itkSimpleNewMacro(x) \
263 itkCreateAnotherMacro(x) \
266 #define itkSimpleNewMacro(x) \
267 static Pointer New(void) \
269 Pointer smartPtr = ::itk::ObjectFactory< x >::Create(); \
270 if ( smartPtr.GetPointer() == ITK_NULLPTR ) \
274 smartPtr->UnRegister(); \
278 #define itkCreateAnotherMacro(x) \
279 virtual ::itk::LightObject::Pointer CreateAnother(void) const ITK_OVERRIDE \
281 ::itk::LightObject::Pointer smartPtr; \
282 smartPtr = x::New().GetPointer(); \
286 #define itkCloneMacro(x) \
287 Pointer Clone() const \
290 dynamic_cast<x *>(this->InternalClone().GetPointer()); \
306 #define itkFactorylessNewMacro(x) \
307 static Pointer New(void) \
310 x * rawPtr = new x; \
312 rawPtr->UnRegister(); \
315 virtual ::itk::LightObject::Pointer CreateAnother(void) const ITK_OVERRIDE \
317 ::itk::LightObject::Pointer smartPtr; \
318 smartPtr = x::New().GetPointer(); \
330 #define ITK_DISALLOW_COPY_AND_ASSIGN(TypeName) \
331 TypeName(const TypeName&) ITK_DELETED_FUNCTION; \
332 void operator=(const TypeName&) ITK_DELETED_FUNCTION
336 #define itkTypeMacro(thisClass, superclass) \
337 virtual const char *GetNameOfClass() const ITK_OVERRIDE \
342 #define itkTypeMacroNoParent(thisClass) \
343 virtual const char *GetNameOfClass() const \
356 extern ITKCommon_EXPORT
void OutputWindowDisplayText(
const char *);
359 extern ITKCommon_EXPORT
void OutputWindowDisplayErrorText(
const char *);
361 extern ITKCommon_EXPORT
void OutputWindowDisplayWarningText(
const char *);
363 extern ITKCommon_EXPORT
void OutputWindowDisplayGenericOutputText(
const char *);
365 extern ITKCommon_EXPORT
void OutputWindowDisplayDebugText(
const char *);
371 #if defined( NDEBUG )
372 #define itkDebugMacro(x)
373 #define itkDebugStatement(x)
375 #define itkDebugMacro(x) \
377 if ( this->GetDebug() && ::itk::Object::GetGlobalWarningDisplay() ) \
379 std::ostringstream itkmsg; \
380 itkmsg << "Debug: In " __FILE__ ", line " << __LINE__ << "\n" \
381 << this->GetNameOfClass() << " (" << this << "): " x \
383 ::itk::OutputWindowDisplayDebugText( itkmsg.str().c_str() ); \
390 #define itkDebugStatement(x) x
396 #define itkWarningMacro(x) \
398 if ( ::itk::Object::GetGlobalWarningDisplay() ) \
400 std::ostringstream itkmsg; \
401 itkmsg << "WARNING: In " __FILE__ ", line " << __LINE__ << "\n" \
402 << this->GetNameOfClass() << " (" << this << "): " x \
404 ::itk::OutputWindowDisplayWarningText( itkmsg.str().c_str() ); \
411 #define itkWarningStatement(x) x
413 #if defined( ITK_CPP_FUNCTION )
414 #if defined( _WIN32 ) && !defined( __MINGW32__ ) && !defined( ITK_WRAPPING_PARSER )
415 #define ITK_LOCATION __FUNCSIG__
416 #elif defined( __GNUC__ )
417 #define ITK_LOCATION __PRETTY_FUNCTION__
419 #define ITK_LOCATION __FUNCTION__
422 #define ITK_LOCATION "unknown"
430 #define itkExceptionMacro(x) \
432 std::ostringstream message; \
433 message << "itk::ERROR: " << this->GetNameOfClass() \
434 << "(" << this << "): " x; \
435 ::itk::ExceptionObject e_(__FILE__, __LINE__, message.str().c_str(), ITK_LOCATION); \
440 #define itkGenericExceptionMacro(x) \
442 std::ostringstream message; \
443 message << "itk::ERROR: " x; \
444 ::itk::ExceptionObject e_(__FILE__, __LINE__, message.str().c_str(), ITK_LOCATION); \
448 #define itkDeclareExceptionMacro(newexcp,parentexcp,whatmessage) \
450 class newexcp : public parentexcp \
453 newexcp( const char *file, unsigned int lineNumber ) : \
454 parentexcp( file, lineNumber ) \
456 this->SetDescription( whatmessage ); \
458 newexcp( const std::string & file, unsigned int lineNumber ) : \
459 parentexcp( file, lineNumber ) \
461 this->SetDescription( whatmessage ); \
463 itkTypeMacro(newexcp, parentexcp); \
467 #define itkSpecializedExceptionMacro(exceptiontype) \
469 ::itk::exceptiontype e_(__FILE__, __LINE__); \
470 e_.SetLocation(ITK_LOCATION); \
474 #define itkSpecializedMessageExceptionMacro(exceptiontype,x) \
476 ::itk::exceptiontype e_(__FILE__, __LINE__); \
477 std::ostringstream message; \
478 message << "itk::ERROR: " x; \
479 e_.SetDescription(message.str().c_str()); \
480 e_.SetLocation(ITK_LOCATION); \
485 #define itkGenericOutputMacro(x) \
487 if ( ::itk::Object::GetGlobalWarningDisplay() ) \
489 std::ostringstream itkmsg; \
490 itkmsg << "WARNING: In " __FILE__ ", line " << __LINE__ << "\n" \
492 ::itk::OutputWindowDisplayGenericOutputText( itkmsg.str().c_str() ); \
499 #define itkLogMacro(x, y) \
501 if ( this->GetLogger() ) \
503 this->GetLogger()->Write(::itk::LoggerBase::x, y); \
507 #define itkLogMacroStatic(obj, x, y) \
509 if ( obj->GetLogger() ) \
511 obj->GetLogger()->Write(::itk::LoggerBase::x, y); \
539 #if defined( ITK_LEGACY_REMOVE )
540 #define itkLegacyMacro(method)
541 #elif defined( ITK_LEGACY_SILENT ) || defined( ITK_LEGACY_TEST ) || defined( ITK_WRAPPING_PARSER )
543 #define itkLegacyMacro(method) method
547 #if defined( __GNUC__ ) && !defined( __INTEL_COMPILER ) && ( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1 ) )
548 #define itkLegacyMacro(method) method __attribute__( ( deprecated ) )
549 #elif defined( _MSC_VER )
550 #define itkLegacyMacro(method) __declspec(deprecated) method
552 #define itkLegacyMacro(method) method
571 #if defined( ITK_LEGACY_REMOVE ) || defined( ITK_LEGACY_SILENT )
572 #define itkLegacyBodyMacro(method, version)
573 #define itkLegacyReplaceBodyMacro(method, version, replace)
574 #define itkGenericLegacyBodyMacro(method, version)
575 #define itkGenericLegacyReplaceBodyMacro(method, version, replace)
577 #define itkLegacyBodyMacro(method, version) \
578 itkWarningMacro(#method " was deprecated for ITK " #version " and will be removed in a future version.")
579 #define itkLegacyReplaceBodyMacro(method, version, replace) \
581 #method " was deprecated for ITK " #version " and will be removed in a future version. Use " #replace \
583 #define itkGenericLegacyBodyMacro(method, version) \
584 itkGenericOutputMacro(#method " was deprecated for ITK " #version " and will be removed in a future version.")
585 #define itkGenericLegacyReplaceBodyMacro(method, version, replace) \
586 itkGenericOutputMacro( \
587 #method " was deprecated for ITK " #version " and will be removed in a future version. Use " #replace \
591 #if defined ( ITK_LEGACY_REMOVE )
592 #define ITK_TEMPLATE_TXX "error ITK_TEMPLATE_TXX is no longer a supported identifier, you should replace with ITK_MANUAL_INSTANTIATION as a replacement"
594 #define ITK_TEMPLATE_TXX 1
602 #define ITK_CACHE_LINE_ALIGNMENT 64
610 #define itkPadStruct( mincachesize, oldtype, newtype ) \
611 struct newtype: public oldtype \
613 char _StructPadding[mincachesize - (sizeof(oldtype)%mincachesize) ]; \
620 #if defined( ITK_HAS_GNU_ATTRIBUTE_ALIGNED )
621 # define itkAlignedTypedef( alignment, oldtype, newtype ) \
622 typedef oldtype newtype __attribute__((aligned(alignment)))
623 #elif defined ( _MSC_VER )
624 # define itkAlignedTypedef( alignment, oldtype, newtype ) \
625 typedef __declspec(align( alignment )) oldtype newtype
627 # define itkAlignedTypedef( alignment, oldtype, newtype ) \
628 typedef oldtype newtype
660 #if defined( ITK_SUPPORTS_TEMPLATED_FRIEND_FUNCTION_WITH_NULL_STRING )
661 #define ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT(T)
663 #if defined( ITK_SUPPORTS_TEMPLATED_FRIEND_FUNCTION_WITH_EMPTY_BRACKETS )
664 #define ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT(T) < >
666 #if defined( ITK_SUPPORTS_TEMPLATED_FRIEND_FUNCTION_WITH_TEMPLATE_ARGUMENTS )
667 #define ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT(T) < T >
673 #if ( defined ( _MSC_VER ) && ( _MSC_VER >= 1600 ) )
674 #ifdef ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT
675 #undef ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT
677 #define ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT(T)
693 #define itkForLoopAssignmentMacro(DestinationType, \
695 DestinationElementType, \
698 NumberOfIterations) \
699 for ( unsigned int i = 0; i < NumberOfIterations; ++i ) \
701 DestinationArray[i] = static_cast< DestinationElementType >( SourceArray[i] ); \
713 #define itkForLoopRoundingAndAssignmentMacro(DestinationType, \
714 Sourcrnd_halfintup, \
715 DestinationElementType, \
718 NumberOfIterations) \
719 for ( unsigned int i = 0; i < NumberOfIterations; ++i ) \
721 DestinationArray[i] = itk::Math::Round< DestinationElementType >(SourceArray[i]); \
729 #define itkAssertInDebugOrThrowInReleaseMacro(msg) __assert_fail (msg, __FILE__, __LINE__, __ASSERT_FUNCTION);
731 #define itkAssertInDebugOrThrowInReleaseMacro(msg) itkGenericExceptionMacro(<< msg);
735 #define itkAssertInDebugOrThrowInReleaseMacro(msg) itkGenericExceptionMacro(<< msg);
738 #define itkAssertOrThrowMacro(test, message) \
741 std::ostringstream msgstr; \
743 itkAssertInDebugOrThrowInReleaseMacro( msgstr.str().c_str() ); \
747 #define itkAssertInDebugAndIgnoreInReleaseMacro(X) assert(X)
749 #define itkAssertInDebugAndIgnoreInReleaseMacro(X)
752 #ifdef ITKV3_COMPATIBILITY
756 #define ITK_TYPENAME typename
762 template <
typename TTarget,
typename TSource>
763 TTarget itkDynamicCastInDebugMode(TSource x)
770 TTarget rval =
dynamic_cast<TTarget
>(x);
773 itkGenericExceptionMacro(<<
"Failed dynamic cast to "
774 <<
typeid(TTarget).name()
776 << x->GetNameOfClass());
780 return static_cast<TTarget
>(x);
804 #if defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__ ) < 405 && !defined( __clang__ ) && !defined( __INTEL_COMPILER )
805 # define itkStaticConstMacro(name,type,value) enum { name = value }
807 # define itkStaticConstMacro(name,type,value) static ITK_CONSTEXPR_VAR type name = value
810 #define itkGetStaticConstMacro(name) (Self::name)
813 #define itkSetInputMacro(name, type) \
814 virtual void Set##name(const type *_arg) \
816 itkDebugMacro("setting input " #name " to " << _arg); \
817 if ( _arg != itkDynamicCastInDebugMode< type * >( this->ProcessObject::GetInput(#name) ) ) \
819 this->ProcessObject::SetInput( #name, const_cast< type * >( _arg ) ); \
826 #define itkGetInputMacro(name, type) \
827 virtual const type * Get##name() const \
829 itkDebugMacro( "returning input " << #name " of " << this->ProcessObject::GetInput(#name) ); \
830 return itkDynamicCastInDebugMode< const type * >( this->ProcessObject::GetInput(#name) ); \
835 #define itkSetDecoratedInputMacro(name, type) \
836 virtual void Set##name##Input(const SimpleDataObjectDecorator< type > *_arg) \
838 itkDebugMacro("setting input " #name " to " << _arg); \
839 if ( _arg != itkDynamicCastInDebugMode< SimpleDataObjectDecorator< type > * >( this->ProcessObject::GetInput(#name) ) ) \
841 this->ProcessObject::SetInput( #name, const_cast< SimpleDataObjectDecorator< type > * >( _arg ) ); \
845 virtual void Set##name(const SimpleDataObjectDecorator< type > *_arg) \
847 this->Set##name##Input(_arg); \
849 virtual void Set##name(const type &_arg) \
851 typedef SimpleDataObjectDecorator< type > DecoratorType; \
852 itkDebugMacro("setting input " #name " to " << _arg); \
853 const DecoratorType *oldInput = \
854 itkDynamicCastInDebugMode< const DecoratorType * >( \
855 this->ProcessObject::GetInput(#name) ); \
857 CLANG_SUPPRESS_Wfloat_equal \
858 if ( oldInput && oldInput->Get() == _arg ) \
863 typename DecoratorType::Pointer newInput = DecoratorType::New(); \
864 newInput->Set(_arg); \
865 this->Set##name##Input(newInput); \
870 #define itkGetDecoratedInputMacro(name, type) \
871 virtual const SimpleDataObjectDecorator< type > * Get##name##Input() const \
873 itkDebugMacro( "returning input " << #name " of " << this->ProcessObject::GetInput(#name) ); \
874 return itkDynamicCastInDebugMode< const SimpleDataObjectDecorator< type > * >( this->ProcessObject::GetInput(#name) ); \
876 virtual const type & Get##name() const \
878 itkDebugMacro("Getting input " #name); \
879 typedef SimpleDataObjectDecorator< type > DecoratorType; \
880 const DecoratorType *input = \
881 itkDynamicCastInDebugMode< const DecoratorType * >( \
882 this->ProcessObject::GetInput(#name) ); \
883 if( input == ITK_NULLPTR ) \
885 itkExceptionMacro(<<"input" #name " is not set"); \
887 return input->Get(); \
893 #define itkSetGetDecoratedInputMacro(name, type) \
894 itkSetDecoratedInputMacro(name, type) \
895 itkGetDecoratedInputMacro(name, type)
901 #define itkSetDecoratedObjectInputMacro(name, type) \
902 virtual void Set##name##Input(const DataObjectDecorator< type > *_arg) \
904 itkDebugMacro("setting input " #name " to " << _arg); \
905 if ( _arg != itkDynamicCastInDebugMode< DataObjectDecorator< type > * >( this->ProcessObject::GetInput(#name) ) ) \
907 this->ProcessObject::SetInput( #name, const_cast< DataObjectDecorator< type > * >( _arg ) ); \
911 virtual void Set##name(const type * _arg) \
913 typedef DataObjectDecorator< type > DecoratorType; \
914 itkDebugMacro("setting input " #name " to " << _arg); \
915 const DecoratorType *oldInput = \
916 itkDynamicCastInDebugMode< const DecoratorType * >( \
917 this->ProcessObject::GetInput(#name) ); \
918 if ( oldInput && oldInput->Get() == _arg ) \
922 typename DecoratorType::Pointer newInput = DecoratorType::New(); \
923 newInput->Set(_arg); \
924 this->Set##name##Input(newInput); \
932 #define itkGetDecoratedObjectInputMacro(name, type) \
933 virtual const DataObjectDecorator< type > * Get##name##Input() const \
935 itkDebugMacro( "returning input " << #name " of "<< this->ProcessObject::GetInput(#name) ); \
936 return itkDynamicCastInDebugMode< const DataObjectDecorator< type > * >( this->ProcessObject::GetInput(#name) ); \
938 virtual const type * Get##name() const \
940 itkDebugMacro("Getting input " #name); \
941 typedef DataObjectDecorator< type > DecoratorType; \
942 const DecoratorType *input = \
943 itkDynamicCastInDebugMode< const DecoratorType * >( \
944 this->ProcessObject::GetInput(#name) ); \
945 if( input == ITK_NULLPTR ) \
947 return ITK_NULLPTR; \
949 return input->Get(); \
955 #define itkSetGetDecoratedObjectInputMacro(name, type) \
956 itkSetDecoratedObjectInputMacro(name, type) \
957 itkGetDecoratedObjectInputMacro(name, type)
960 #define itkSetMacro(name, type) \
961 virtual void Set##name (const type _arg) \
963 itkDebugMacro("setting " #name " to " << _arg); \
965 CLANG_SUPPRESS_Wfloat_equal \
966 if ( this->m_##name != _arg ) \
968 this->m_##name = _arg; \
976 #define itkGetMacro(name, type) \
977 virtual type Get##name () \
979 return this->m_##name; \
986 #define itkGetConstMacro(name, type) \
987 virtual type Get##name () const \
989 return this->m_##name; \
997 #define itkGetConstReferenceMacro(name, type) \
998 virtual const type &Get##name () const \
1000 return this->m_##name; \
1008 #define itkSetEnumMacro(name, type) \
1009 virtual void Set##name (const type _arg) \
1011 itkDebugMacro( "setting " #name " to " << static_cast< long >( _arg ) ); \
1012 if ( this->m_##name != _arg ) \
1014 this->m_##name = _arg; \
1024 #define itkGetEnumMacro(name, type) \
1025 virtual type Get##name () const \
1027 return this->m_##name; \
1034 #define itkSetStringMacro(name) \
1035 virtual void Set##name (const char *_arg) \
1037 if ( _arg && ( _arg == this->m_##name ) ) { return; } \
1040 this->m_##name = _arg; \
1044 this->m_##name = ""; \
1048 virtual void Set##name (const std::string & _arg) \
1050 this->Set##name( _arg.c_str() ); \
1058 #define itkGetStringMacro(name) \
1059 virtual const char *Get##name () const \
1061 return this->m_##name.c_str(); \
1067 #define itkSetClampMacro(name, type, min, max) \
1068 virtual void Set##name (type _arg) \
1070 const type temp_extrema=( _arg < min ? min : ( _arg > max ? max : _arg ) );\
1071 itkDebugMacro("setting " << #name " to " << _arg); \
1073 CLANG_SUPPRESS_Wfloat_equal \
1074 if ( this->m_##name != temp_extrema ) \
1076 this->m_##name = temp_extrema; \
1088 #define itkSetObjectMacro(name, type) \
1089 virtual void Set##name (type * _arg) \
1091 itkDebugMacro("setting " << #name " to " << _arg); \
1093 CLANG_SUPPRESS_Wfloat_equal \
1094 if ( this->m_##name != _arg ) \
1096 this->m_##name = _arg; \
1128 #define itkGetConstObjectMacro(name, type) \
1129 virtual const type * Get##name () const \
1131 return this->m_##name.GetPointer(); \
1135 #if defined ( ITK_FUTURE_LEGACY_REMOVE )
1141 # define itkGetObjectMacro(name, type) \
1142 virtual type * Get##name () \
1144 purposeful_error("itkGetObjectMacro should be replaced with itkGetModifiableObjectMacro."); \
1147 # define itkGetModifiableObjectMacro(name, type) \
1148 virtual type * GetModifiable##name () \
1150 return this->m_##name.GetPointer(); \
1152 itkGetConstObjectMacro(name, type)
1154 #else // defined ( ITK_FUTURE_LEGACY_REMOVE )
1157 # define itkGetObjectMacro(name, type) \
1158 virtual type * Get##name () \
1160 return this->m_##name.GetPointer(); \
1162 # define itkGetModifiableObjectMacro(name, type) \
1163 virtual type * GetModifiable##name () \
1165 return this->m_##name.GetPointer(); \
1167 itkGetConstObjectMacro(name, type) \
1168 itkGetObjectMacro(name, type)
1169 #endif // defined ( ITK_FUTURE_LEGACY_REMOVE )
1178 #define itkGetConstReferenceObjectMacro(name, type) \
1179 virtual const typename type::Pointer & Get##name () const \
1181 return this->m_##name; \
1188 #define itkSetConstObjectMacro(name, type) \
1189 virtual void Set##name (const type * _arg) \
1191 itkDebugMacro("setting " << #name " to " << _arg); \
1192 if ( this->m_##name != _arg ) \
1194 this->m_##name = _arg; \
1202 #define itkBooleanMacro(name) \
1203 virtual void name##On () \
1205 this->Set##name(true); \
1207 virtual void name##Off () \
1209 this->Set##name(false); \
1216 #define itkSetVectorMacro(name, type, count) \
1217 virtual void Set##name(type data[]) \
1220 for ( i = 0; i < count; i++ ) \
1223 CLANG_SUPPRESS_Wfloat_equal \
1224 if ( data[i] != this->m_##name[i] ) \
1233 for ( i = 0; i < count; i++ ) \
1235 this->m_##name[i] = data[i]; \
1243 #define itkGetVectorMacro(name, type, count) \
1244 virtual type * Get##name () const \
1246 return this->m_##name; \
1253 #define itkGPUKernelClassMacro(kernel) \