00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkSpatialObjectDuplicator.h,v $ 00005 Language: C++ 00006 Date: $Date: 2005/08/08 14:16:15 $ 00007 Version: $Revision: 1.1 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 #ifndef __itkSpatialObjectDuplicator_h 00018 #define __itkSpatialObjectDuplicator_h 00019 00020 #include "itkObject.h" 00021 #include "itkSpatialObject.h" 00022 00023 namespace itk 00024 { 00025 00028 template <class TInputSpatialObject> 00029 class ITK_EXPORT SpatialObjectDuplicator : public Object 00030 { 00031 public: 00033 typedef SpatialObjectDuplicator Self; 00034 typedef Object Superclass; 00035 typedef SmartPointer<Self> Pointer; 00036 typedef SmartPointer<const Self> ConstPointer; 00037 00039 itkNewMacro(Self); 00040 00042 itkTypeMacro(SpatialObjectDuplicator, Object); 00043 00045 typedef TInputSpatialObject SpatialObjectType; 00046 typedef typename TInputSpatialObject::Pointer SpatialObjectPointer; 00047 typedef typename TInputSpatialObject::ConstPointer SpatialObjectConstPointer; 00048 00049 itkStaticConstMacro(ObjectDimension, unsigned int, 00050 SpatialObjectType::ObjectDimension); 00051 00052 typedef SpatialObject<itkGetStaticConstMacro(ObjectDimension)> InternalSpatialObjectType; 00053 00055 itkSetConstObjectMacro(Input,SpatialObjectType); 00056 00058 itkGetObjectMacro(Output,SpatialObjectType); 00059 00061 void Update(void); 00062 00063 protected: 00064 SpatialObjectDuplicator(); 00065 virtual ~SpatialObjectDuplicator() {}; 00066 void PrintSelf(std::ostream& os, Indent indent) const; 00067 00068 void CopyObject(const InternalSpatialObjectType* source,InternalSpatialObjectType* destination); 00069 00070 private: 00071 SpatialObjectDuplicator(const Self&); //purposely not implemented 00072 void operator=(const Self&); //purposely not implemented 00073 00074 SpatialObjectConstPointer m_Input; 00075 SpatialObjectPointer m_Output; 00076 unsigned long m_InternalSpatialObjectTime; 00077 00078 }; 00079 00080 } // end namespace itk 00081 00082 00083 #ifndef ITK_MANUAL_INSTANTIATION 00084 #include "itkSpatialObjectDuplicator.txx" 00085 #endif 00086 00087 #endif /* __itkSpatialObjectDuplicator_h */