00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00030 #ifndef __itkMacro_h
00031 #define __itkMacro_h
00032
00033 #include "itkWin32Header.h"
00034 #include "itkConfigure.h"
00035
00036 #include <string>
00037
00038
00039 #if !defined(CMAKE_NO_ANSI_STRING_STREAM)
00040 # include <sstream>
00041 #elif !defined(CMAKE_NO_ANSI_STREAM_HEADERS)
00042 # include <strstream>
00043 # define ITK_NO_ANSI_STRING_STREAM
00044 #else
00045 # include <strstream.h>
00046 # define ITK_NO_ANSI_STRING_STREAM
00047 #endif
00048
00053 namespace itk
00054 {
00055 }
00056
00059 #define itkNotUsed(x)
00060
00075 #if defined(_MSC_VER) && (_MSC_VER <= 1300)
00076 # define ITK_NO_INCLASS_MEMBER_INITIALIZATION
00077 #endif
00078 #if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x540)
00079 # define ITK_NO_INCLASS_MEMBER_INITIALIZATION
00080 #endif
00081 #if defined(__SVR4) && !defined(__SUNPRO_CC)
00082 # define ITK_NO_INCLASS_MEMBER_INITIALIZATION
00083 #endif
00084
00085
00086
00087
00088
00089
00090
00091
00092 #if defined(__GNUC__)
00093 # define ITK_NO_SIZEOF_CONSTANT_LOOKUP
00094 #endif
00095
00096 #if defined(_MSC_VER) && (_MSC_VER <= 1300)
00097 #define ITK_NO_SELF_AS_TRAIT_IN_TEMPLATE_ARGUMENTS
00098 #endif
00099
00100 #if defined(ITK_NO_INCLASS_MEMBER_INITIALIZATION) || \
00101 defined(ITK_NO_SIZEOF_CONSTANT_LOOKUP)
00102 # define itkStaticConstMacro(name,type,value) enum { name = value }
00103 #else
00104 # define itkStaticConstMacro(name,type,value) static const type name = value
00105 #endif
00106
00107 #ifdef ITK_NO_SELF_AS_TRAIT_IN_TEMPLATE_ARGUMENTS
00108 # define itkGetStaticConstMacro(name) name
00109 #else
00110 # define itkGetStaticConstMacro(name) (Self::name)
00111 #endif
00112
00114 #define itkSetInputMacro(name, type, number) \
00115 virtual void Set##name##Input(const type *_arg) \
00116 { \
00117 itkDebugMacro("setting input " #name " to " << _arg); \
00118 if (_arg != static_cast<type *>(this->ProcessObject::GetInput( number ))) \
00119 { \
00120 this->ProcessObject::SetNthInput( number, const_cast<type *>(_arg) ); \
00121 this->Modified(); \
00122 } \
00123 } \
00124 virtual void SetInput##number(const type *_arg) \
00125 { \
00126 itkDebugMacro("setting input " #number " to " << _arg); \
00127 if (_arg != static_cast<type *>(this->ProcessObject::GetInput( number ))) \
00128 { \
00129 this->ProcessObject::SetNthInput( number, const_cast<type *>(_arg) ); \
00130 this->Modified(); \
00131 } \
00132 }
00133
00134
00136 #define itkSuperclassTraitMacro(traitnameType) \
00137 typedef typename Superclass::traitnameType traitnameType;
00138
00140 #define itkGetInputMacro(name, type, number) \
00141 virtual const type * Get##name##Input() const \
00142 { \
00143 itkDebugMacro("returning input " << #name " of " << static_cast<const type *>(this->ProcessObject::GetInput( number )) ); \
00144 return static_cast<const type *>(this->ProcessObject::GetInput( number )); \
00145 } \
00146 virtual const type * GetInput##number() const \
00147 { \
00148 itkDebugMacro("returning input " << #number " of " << static_cast<const type *>(this->ProcessObject::GetInput( number )) ); \
00149 return static_cast<const type *>(this->ProcessObject::GetInput( number )); \
00150 }
00151
00152
00155 #define itkSetDecoratedInputMacro(name, type, number) \
00156 itkSetInputMacro(name, SimpleDataObjectDecorator<type>, number); \
00157 itkGetInputMacro(name, SimpleDataObjectDecorator<type>, number); \
00158 virtual void Set##name(const type &_arg) \
00159 { \
00160 typedef SimpleDataObjectDecorator< type > DecoratorType; \
00161 itkDebugMacro("setting input " #name " to " << _arg); \
00162 const DecoratorType * oldInput = \
00163 static_cast< const DecoratorType * >( \
00164 this->ProcessObject::GetInput(number) ); \
00165 if( oldInput && oldInput->Get() == _arg ) \
00166 { \
00167 return; \
00168 } \
00169 typename DecoratorType::Pointer newInput = DecoratorType::New(); \
00170 newInput->Set( _arg ); \
00171 this->Set##name##Input( newInput ); \
00172 }
00173
00174
00178 #define itkSetDecoratedObjectInputMacro(name, type, number) \
00179 itkSetInputMacro(name, DataObjectDecorator<type>, number); \
00180 itkGetInputMacro(name, DataObjectDecorator<type>, number); \
00181 virtual void Set##name(const type *_arg) \
00182 { \
00183 typedef DataObjectDecorator< type > DecoratorType; \
00184 itkDebugMacro("setting input " #name " to " << _arg); \
00185 const DecoratorType * oldInput = \
00186 static_cast< const DecoratorType * >( \
00187 this->ProcessObject::GetInput(number) ); \
00188 if( oldInput && oldInput->Get() == _arg ) \
00189 { \
00190 return; \
00191 } \
00192 typename DecoratorType::Pointer newInput = DecoratorType::New(); \
00193 newInput->Set( _arg ); \
00194 this->Set##name##Input( newInput ); \
00195 }
00196
00197
00198
00200 #define itkSetMacro(name,type) \
00201 virtual void Set##name (const type _arg) \
00202 { \
00203 itkDebugMacro("setting " #name " to " << _arg); \
00204 if (this->m_##name != _arg) \
00205 { \
00206 this->m_##name = _arg; \
00207 this->Modified(); \
00208 } \
00209 }
00210
00211
00213 #define itkGetMacro(name,type) \
00214 virtual type Get##name () \
00215 { \
00216 itkDebugMacro("returning " << #name " of " << this->m_##name ); \
00217 return this->m_##name; \
00218 }
00219
00220
00224 #define itkGetConstMacro(name,type) \
00225 virtual type Get##name () const \
00226 { \
00227 itkDebugMacro("returning " << #name " of " << this->m_##name ); \
00228 return this->m_##name; \
00229 }
00230
00231
00236 #define itkGetConstReferenceMacro(name,type) \
00237 virtual const type & Get##name () const \
00238 { \
00239 itkDebugMacro("returning " << #name " of " << this->m_##name ); \
00240 return this->m_##name; \
00241 }
00242
00243
00247 #define itkSetEnumMacro(name,type) \
00248 virtual void Set##name (const type _arg) \
00249 { \
00250 itkDebugMacro("setting " #name " to " << static_cast<long>(_arg)); \
00251 if (this->m_##name != _arg) \
00252 { \
00253 this->m_##name = _arg; \
00254 this->Modified(); \
00255 } \
00256 }
00257
00258
00262 #define itkGetEnumMacro(name,type) \
00263 virtual type Get##name () const \
00264 { \
00265 itkDebugMacro("returning " << #name " of " << static_cast<long>(this->m_##name) ); \
00266 return this->m_##name; \
00267 }
00268
00269
00273 #define itkSetStringMacro(name) \
00274 virtual void Set##name (const char* _arg) \
00275 { \
00276 if ( _arg && (_arg == this->m_##name) ) { return;} \
00277 if (_arg) \
00278 { \
00279 this->m_##name = _arg;\
00280 } \
00281 else \
00282 { \
00283 this->m_##name = ""; \
00284 } \
00285 this->Modified(); \
00286 } \
00287 virtual void Set##name (const std::string & _arg) \
00288 { \
00289 this->Set##name( _arg.c_str() ); \
00290 } \
00291
00292
00293
00297 #define itkGetStringMacro(name) \
00298 virtual const char* Get##name () const \
00299 { \
00300 return this->m_##name.c_str(); \
00301 }
00302
00306 #define itkSetClampMacro(name,type,min,max) \
00307 virtual void Set##name (type _arg) \
00308 { \
00309 itkDebugMacro("setting " << #name " to " << _arg ); \
00310 if (this->m_##name != (_arg<min?min:(_arg>max?max:_arg))) \
00311 { \
00312 this->m_##name = (_arg<min?min:(_arg>max?max:_arg)); \
00313 this->Modified(); \
00314 } \
00315 }
00316
00317
00322 #define itkSetObjectMacro(name,type) \
00323 virtual void Set##name (type* _arg) \
00324 { \
00325 itkDebugMacro("setting " << #name " to " << _arg ); \
00326 if (this->m_##name != _arg) \
00327 { \
00328 this->m_##name = _arg; \
00329 this->Modified(); \
00330 } \
00331 }
00332
00333
00336 #define itkGetObjectMacro(name,type) \
00337 virtual type * Get##name () \
00338 { \
00339 itkDebugMacro("returning " #name " address " << this->m_##name ); \
00340 return this->m_##name.GetPointer(); \
00341 }
00342
00343
00348 #define itkSetConstObjectMacro(name,type) \
00349 virtual void Set##name (const type* _arg) \
00350 { \
00351 itkDebugMacro("setting " << #name " to " << _arg ); \
00352 if (this->m_##name != _arg) \
00353 { \
00354 this->m_##name = _arg; \
00355 this->Modified(); \
00356 } \
00357 }
00358
00359
00360
00363 #define itkGetConstObjectMacro(name,type) \
00364 virtual const type * Get##name () const \
00365 { \
00366 itkDebugMacro("returning " #name " address " << this->m_##name ); \
00367 return this->m_##name.GetPointer(); \
00368 }
00369
00370
00373 #define itkGetConstReferenceObjectMacro(name,type) \
00374 virtual const typename type::Pointer & Get##name () const \
00375 { \
00376 itkDebugMacro("returning " #name " address " << this->m_##name ); \
00377 return this->m_##name; \
00378 }
00379
00380
00383 #define itkBooleanMacro(name) \
00384 virtual void name##On () { this->Set##name(true);} \
00385 virtual void name##Off () { this->Set##name(false);}
00386
00387
00391 #define itkSetVectorMacro(name,type,count) \
00392 virtual void Set##name(type data[]) \
00393 { \
00394 unsigned int i; \
00395 for (i=0; i<count; i++) { if ( data[i] != this->m_##name[i] ) { break; }} \
00396 if ( i < count ) \
00397 { \
00398 this->Modified(); \
00399 for (i=0; i<count; i++) { this->m_##name[i] = data[i]; }\
00400 } \
00401 }
00402
00403
00406 #define itkGetVectorMacro(name,type,count) \
00407 virtual type *Get##name () const \
00408 { \
00409 return this->m_##name; \
00410 }
00411
00428 #define itkNewMacro(x) \
00429 static Pointer New(void) \
00430 { \
00431 Pointer smartPtr = ::itk::ObjectFactory<x>::Create(); \
00432 if(smartPtr.GetPointer() == NULL) \
00433 { \
00434 smartPtr = new x; \
00435 } \
00436 smartPtr->UnRegister(); \
00437 return smartPtr; \
00438 } \
00439 virtual ::itk::LightObject::Pointer CreateAnother(void) const \
00440 { \
00441 ::itk::LightObject::Pointer smartPtr; \
00442 smartPtr = x::New().GetPointer(); \
00443 return smartPtr; \
00444 }
00445
00446
00447
00464 #define itkFactorylessNewMacro(x) \
00465 static Pointer New(void) \
00466 { \
00467 Pointer smartPtr; \
00468 x *rawPtr = new x; \
00469 smartPtr = rawPtr; \
00470 rawPtr->UnRegister(); \
00471 return smartPtr; \
00472 } \
00473 virtual ::itk::LightObject::Pointer CreateAnother(void) const \
00474 { \
00475 ::itk::LightObject::Pointer smartPtr; \
00476 smartPtr = x::New().GetPointer(); \
00477 return smartPtr; \
00478 }
00479
00480
00483 #define itkTypeMacro(thisClass,superclass) \
00484 virtual const char *GetNameOfClass() const \
00485 {return #thisClass;}
00486
00487
00488 namespace itk
00489 {
00496 extern ITKCommon_EXPORT void OutputWindowDisplayText(const char*);
00497 extern ITKCommon_EXPORT void OutputWindowDisplayErrorText(const char*);
00498 extern ITKCommon_EXPORT void OutputWindowDisplayWarningText(const char*);
00499 extern ITKCommon_EXPORT void OutputWindowDisplayGenericOutputText(const char*);
00500 extern ITKCommon_EXPORT void OutputWindowDisplayDebugText(const char*);
00501 }
00503
00507 #if defined(ITK_LEAN_AND_MEAN) || defined(__BORLANDC__)
00508 #define itkDebugMacro(x)
00509 #else
00510 #define itkDebugMacro(x) \
00511 { if (this->GetDebug() && ::itk::Object::GetGlobalWarningDisplay()) \
00512 { ::itk::OStringStream itkmsg; \
00513 itkmsg << "Debug: In " __FILE__ ", line " << __LINE__ << "\n" \
00514 << this->GetNameOfClass() << " (" << this << "): " x \
00515 << "\n\n"; \
00516 ::itk::OutputWindowDisplayDebugText(itkmsg.str().c_str());} \
00517 }
00518 #endif
00519
00520
00521
00525 #ifdef ITK_LEAN_AND_MEAN
00526 #define itkWarningMacro(x)
00527 #else
00528 #define itkWarningMacro(x) \
00529 { if (::itk::Object::GetGlobalWarningDisplay()) \
00530 { ::itk::OStringStream itkmsg; \
00531 itkmsg << "WARNING: In " __FILE__ ", line " << __LINE__ << "\n" \
00532 << this->GetNameOfClass() << " (" << this << "): " x \
00533 << "\n\n"; \
00534 ::itk::OutputWindowDisplayWarningText(itkmsg.str().c_str());} \
00535 }
00536 #endif
00537
00538
00539 namespace itk
00540 {
00541
00547 #if !defined(ITK_NO_ANSI_STRING_STREAM)
00548 class OStringStream: public std::ostringstream
00549 {
00550 public:
00551 OStringStream() {}
00552 private:
00553 OStringStream(const OStringStream&);
00554 void operator=(const OStringStream&);
00555 };
00556 #else
00557 namespace OStringStreamDetail
00558 {
00559 class Cleanup
00560 {
00561 public:
00562 Cleanup(std::ostrstream& ostr): m_OStrStream(ostr) {}
00563 ~Cleanup() { m_OStrStream.rdbuf()->freeze(0); }
00564 static void IgnoreUnusedVariable(const Cleanup&) {}
00565 protected:
00566 std::ostrstream& m_OStrStream;
00567 };
00568 }
00570
00571 class OStringStream: public std::ostrstream
00572 {
00573 public:
00574 typedef std::ostrstream Superclass;
00575 OStringStream() {}
00576 std::string str()
00577 {
00578 OStringStreamDetail::Cleanup cleanup(*this);
00579 OStringStreamDetail::Cleanup::IgnoreUnusedVariable(cleanup);
00580 int pcount = this->pcount();
00581 const char* ptr = this->Superclass::str();
00582 return std::string(ptr?ptr:"", pcount);
00583 }
00584 private:
00585 OStringStream(const OStringStream&);
00586 void operator=(const OStringStream&);
00587 };
00588 #endif
00589
00590 }
00591
00592 #if defined(ITK_CPP_FUNCTION)
00593 #if defined(__BORLANDC__)
00594 #define ITK_LOCATION __FUNC__
00595 #elif defined(_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(CABLE_CONFIGURATION) && !defined(CSWIG)
00596 #define ITK_LOCATION __FUNCSIG__
00597 #elif defined(__GNUC__)
00598 #define ITK_LOCATION __PRETTY_FUNCTION__
00599 #else
00600 #define ITK_LOCATION __FUNCTION__
00601 #endif
00602 #else
00603 #define ITK_LOCATION "unknown"
00604 #endif
00605
00606 #include "itkExceptionObject.h"
00607
00611 #define itkExceptionMacro(x) \
00612 { \
00613 ::itk::OStringStream message; \
00614 message << "itk::ERROR: " << this->GetNameOfClass() \
00615 << "(" << this << "): " x; \
00616 ::itk::ExceptionObject e_(__FILE__, __LINE__, message.str().c_str(),ITK_LOCATION); \
00617 throw e_; \
00618 }
00619
00620
00621 #define itkGenericExceptionMacro(x) \
00622 { \
00623 ::itk::OStringStream message; \
00624 message << "itk::ERROR: " x; \
00625 ::itk::ExceptionObject e_(__FILE__, __LINE__, message.str().c_str(),ITK_LOCATION); \
00626 throw e_; \
00627 }
00628
00629 #ifdef ITK_LEAN_AND_MEAN
00630 #define itkGenericOutputMacro(x)
00631 #else
00632 #define itkGenericOutputMacro(x) \
00633 { if (::itk::Object::GetGlobalWarningDisplay()) \
00634 { ::itk::OStringStream itkmsg; \
00635 itkmsg << "WARNING: In " __FILE__ ", line " << __LINE__ << "\n" \
00636 x << "\n\n"; \
00637 ::itk::OutputWindowDisplayGenericOutputText(itkmsg.str().c_str());} \
00638 }
00639 #endif
00640
00641
00642
00643
00644
00645
00646 #define itkLogMacro( x, y) \
00647 { \
00648 if (this->GetLogger() ) \
00649 { \
00650 this->GetLogger()->Write(::itk::LoggerBase::x, y); \
00651 } \
00652 }
00653
00654
00655 #define itkLogMacroStatic( obj, x, y) \
00656 { \
00657 if (obj->GetLogger() ) \
00658 { \
00659 obj->GetLogger()->Write(::itk::LoggerBase::x, y); \
00660 } \
00661 }
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687 #if defined(ITK_LEGACY_REMOVE)
00688
00689
00690
00691
00692 # define itkLegacyMacro(method) class itkLegacyMethodRemoved
00693 #elif defined(ITK_LEGACY_SILENT) || defined(ITK_LEGACY_TEST) || defined(CSWIG)
00694
00695 # define itkLegacyMacro(method) method
00696 #else
00697
00698
00699 # if defined(__GNUC__) && !defined(__INTEL_COMPILER) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
00700 # define itkLegacyMacro(method) method __attribute__((deprecated))
00701 # elif defined(_MSC_VER) && _MSC_VER >= 1300
00702 # define itkLegacyMacro(method) __declspec(deprecated) method
00703 # else
00704 # define itkLegacyMacro(method) method
00705 # endif
00706 #endif
00707
00708
00709
00710
00711
00712
00713
00714
00715
00716
00717
00718
00719
00720
00721 #if defined(ITK_LEGACY_REMOVE) || defined(ITK_LEGACY_SILENT)
00722 # define itkLegacyBodyMacro(method, version)
00723 # define itkLegacyReplaceBodyMacro(method, version, replace)
00724 #else
00725 # define itkLegacyBodyMacro(method, version) \
00726 itkWarningMacro(#method " was deprecated for ITK " #version " and will be removed in a future version.")
00727 # define itkLegacyReplaceBodyMacro(method, version, replace) \
00728 itkWarningMacro(#method " was deprecated for ITK " #version " and will be removed in a future version. Use " #replace " instead.")
00729 #endif
00730
00731 #if defined(__INTEL_COMPILER)
00732 # pragma warning (disable: 193)
00733 #endif
00734
00735
00736
00737
00738
00739
00740
00741
00742
00743
00744
00745 #if defined(__sgi) && defined(_COMPILER_VERSION)
00746 # define ITK_TEMPLATE_DO_NOT_INSTANTIATE 1
00747 #elif defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 700
00748 # define ITK_TEMPLATE_EXTERN 1
00749 #elif defined(__GNUC__) && __GNUC__ >= 3
00750 # define ITK_TEMPLATE_EXTERN 1
00751 #elif defined(_MSC_VER) && _MSC_VER >= 1300
00752 # define ITK_TEMPLATE_EXTERN 1
00753 #endif
00754 #if !defined(ITK_TEMPLATE_DO_NOT_INSTANTIATE)
00755 # define ITK_TEMPLATE_DO_NOT_INSTANTIATE 0
00756 #endif
00757 #if !defined(ITK_TEMPLATE_EXTERN)
00758 # define ITK_TEMPLATE_EXTERN 0
00759 #endif
00760
00761
00762
00763
00764
00765
00766
00767
00768 #define ITK_TEMPLATE_EXPORT(x) ITK_TEMPLATE_EXPORT_DELAY(x)
00769 #define ITK_TEMPLATE_EXPORT_DELAY(x) template ITK_TEMPLATE_##x;
00770
00771
00772
00773
00774
00775
00776
00777
00778
00779 #if ITK_TEMPLATE_EXTERN
00780 # define ITK_TEMPLATE_IMPORT_DELAY(x) extern template ITK_TEMPLATE_##x;
00781 # if defined(_MSC_VER)
00782 # pragma warning (disable: 4231)
00783 # endif
00784 #elif ITK_TEMPLATE_DO_NOT_INSTANTIATE
00785 # define ITK_TEMPLATE_IMPORT_DELAY(x) \
00786 ITK_TEMPLATE_IMPORT_IMPL(do_not_instantiate ITK_TEMPLATE_##x)
00787 # define ITK_TEMPLATE_IMPORT_IMPL(x) _Pragma(#x)
00788 #endif
00789 #if defined(ITK_TEMPLATE_IMPORT_DELAY)
00790 # define ITK_TEMPLATE_IMPORT(x) ITK_TEMPLATE_IMPORT_DELAY(x)
00791 # define ITK_TEMPLATE_IMPORT_WORKS 1
00792 #else
00793 # define ITK_TEMPLATE_IMPORT(x)
00794 # define ITK_TEMPLATE_IMPORT_WORKS 0
00795 #endif
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807
00808
00809
00810
00811
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822
00823
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853 #define ITK_EXPORT_TEMPLATE(EXPORT, c, x, y) \
00854 ITK_TEMPLATE_##c(ITK_TEMPLATE_EXPORT, EXPORT ITK_EMPTY, x, y)
00855 #define ITK_IMPORT_TEMPLATE(EXPORT, c, x, y) \
00856 ITK_TEMPLATE_##c(ITK_TEMPLATE_IMPORT, EXPORT ITK_EMPTY, x, y)
00857 #define ITK_EMPTY
00858
00859
00860
00861
00862
00863 #define ITK_TEMPLATE_1(x1) x1
00864 #define ITK_TEMPLATE_2(x1,x2) x1,x2
00865 #define ITK_TEMPLATE_3(x1,x2,x3) x1,x2,x3
00866 #define ITK_TEMPLATE_4(x1,x2,x3,x4) x1,x2,x3,x4
00867 #define ITK_TEMPLATE_5(x1,x2,x3,x4,x5) x1,x2,x3,x4,x5
00868 #define ITK_TEMPLATE_6(x1,x2,x3,x4,x5,x6) x1,x2,x3,x4,x5,x6
00869 #define ITK_TEMPLATE_7(x1,x2,x3,x4,x5,x6,x7) x1,x2,x3,x4,x5,x6,x7
00870 #define ITK_TEMPLATE_8(x1,x2,x3,x4,x5,x6,x7,x8) x1,x2,x3,x4,x5,x6,x7,x8
00871 #define ITK_TEMPLATE_9(x1,x2,x3,x4,x5,x6,x7,x8,x9) x1,x2,x3,x4,x5,x6,x7,x8,x9
00872
00873
00874
00875
00876
00877
00878
00879
00880
00881 #if defined(ITK_MANUAL_INSTANTIATION)
00882 # define ITK_TEMPLATE_TXX 0
00883 #else
00884 # define ITK_TEMPLATE_TXX !(ITK_TEMPLATE_CXX || ITK_TEMPLATE_TYPE)
00885 #endif
00886
00887
00888
00889
00890
00891
00892 #if ITK_TEMPLATE_CXX
00893 # undef ITK_MANUAL_INSTANTIATION
00894 # define ITK_MANUAL_INSTANTIATION
00895 # if defined(_MSC_VER)
00896 # pragma warning (disable: 4275)
00897 # pragma warning (disable: 4661)
00898 # endif
00899 #endif
00900
00901
00902
00903
00904 #define ITK_EXPORT_ITKCommon(c, x, n) \
00905 ITK_EXPORT_TEMPLATE(ITKCommon_EXPORT, c, x, n)
00906 #define ITK_IMPORT_ITKCommon(c, x, n) \
00907 ITK_IMPORT_TEMPLATE(ITKCommon_EXPORT, c, x, n)
00908
00909
00910
00911
00912
00913
00914
00915
00916
00917
00918
00919
00920
00921
00922 #if ITK_TEMPLATE_IMPORT_WORKS && defined(ITK_EXPLICIT_INSTANTIATION)
00923 # define ITK_TEMPLATE_EXPLICIT !ITK_TEMPLATE_CXX
00924 #else
00925 # define ITK_TEMPLATE_EXPLICIT 0
00926 #endif
00927
00928
00929
00930
00931
00932
00933
00934
00935 #if defined(__GNUC__)
00936 # if (((__GNUC__ == 2) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ >= 3))
00937 # define ITK_NO_RETURN \
00938 __attribute__ ((noreturn))
00939 # endif
00940 #else
00941 # define ITK_NO_RETURN
00942 #endif
00943
00944
00945 #ifdef ITK_USE_TEMPLATE_META_PROGRAMMING_LOOP_UNROLLING
00946
00947
00948
00949
00950
00951
00952
00953
00954
00955
00956
00957 #define itkFoorLoopAssignmentMacro(DestinationType,SourceType,DestinationElementType,DestinationArray,SourceArray,NumberOfIterations) \
00958 for(unsigned int i=0;i < NumberOfIterations; ++i) \
00959 { \
00960 DestinationArray[i] = static_cast< DestinationElementType >( SourceArray[i] ); \
00961 }
00962
00963
00964
00965
00966
00967
00968
00969
00970
00971 #define itkFoorLoopRoundingAndAssignmentMacro(DestinationType,SourceType,DestinationElementType,DestinationArray,SourceArray,NumberOfIterations) \
00972 for(unsigned int i=0;i < NumberOfIterations; ++i) \
00973 { \
00974 DestinationArray[i] = static_cast< DestinationElementType >( vnl_math_rnd( SourceArray[i] ) ); \
00975 }
00976
00977 #endif
00978
00979
00980
00981 #endif //end of itkMacro.h
00982