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: 00032 00034 typedef SpatialObjectDuplicator Self; 00035 typedef Object Superclass; 00036 typedef SmartPointer<Self> Pointer; 00037 typedef SmartPointer<const Self> ConstPointer; 00038 00040 itkNewMacro(Self); 00041 00043 itkTypeMacro(SpatialObjectDuplicator, Object); 00044 00046 typedef TInputSpatialObject SpatialObjectType; 00047 typedef typename TInputSpatialObject::Pointer SpatialObjectPointer; 00048 typedef typename TInputSpatialObject::ConstPointer SpatialObjectConstPointer; 00049 00050 itkStaticConstMacro(ObjectDimension, unsigned int, 00051 SpatialObjectType::ObjectDimension); 00052 00053 typedef SpatialObject<itkGetStaticConstMacro(ObjectDimension)> InternalSpatialObjectType; 00054 00056 itkSetConstObjectMacro(Input,SpatialObjectType); 00057 00059 itkGetObjectMacro(Output,SpatialObjectType); 00060 00062 void Update(void); 00063 00064 protected: 00065 SpatialObjectDuplicator(); 00066 virtual ~SpatialObjectDuplicator() {}; 00067 void PrintSelf(std::ostream& os, Indent indent) const; 00068 00069 void CopyObject(const InternalSpatialObjectType* source,InternalSpatialObjectType* destination); 00070 00071 private: 00072 SpatialObjectDuplicator(const Self&); //purposely not implemented 00073 void operator=(const Self&); //purposely not implemented 00074 00075 SpatialObjectConstPointer m_Input; 00076 SpatialObjectPointer m_Output; 00077 unsigned long m_InternalSpatialObjectTime; 00078 00079 }; 00080 00081 } // end namespace itk 00082 00083 00084 #ifndef ITK_MANUAL_INSTANTIATION 00085 #include "itkSpatialObjectDuplicator.txx" 00086 #endif 00087 00088 #endif /* __itkSpatialObjectDuplicator_h */ 00089