ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkSpatialObjectDuplicator.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkSpatialObjectDuplicator_h
00019 #define __itkSpatialObjectDuplicator_h
00020 
00021 #include "itkObject.h"
00022 #include "itkSpatialObject.h"
00023 
00024 namespace itk
00025 {
00031 template< class TInputSpatialObject >
00032 class ITK_EXPORT SpatialObjectDuplicator:public Object
00033 {
00034 public:
00036   typedef SpatialObjectDuplicator    Self;
00037   typedef Object                     Superclass;
00038   typedef SmartPointer< Self >       Pointer;
00039   typedef SmartPointer< const Self > ConstPointer;
00040 
00042   itkNewMacro(Self);
00043 
00045   itkTypeMacro(SpatialObjectDuplicator, Object);
00046 
00048   typedef TInputSpatialObject                        SpatialObjectType;
00049   typedef typename TInputSpatialObject::Pointer      SpatialObjectPointer;
00050   typedef typename TInputSpatialObject::ConstPointer SpatialObjectConstPointer;
00051 
00052   itkStaticConstMacro(ObjectDimension, unsigned int,
00053                       SpatialObjectType::ObjectDimension);
00054 
00055   typedef SpatialObject< itkGetStaticConstMacro(ObjectDimension) >
00056   InternalSpatialObjectType;
00057 
00059   itkSetConstObjectMacro(Input, SpatialObjectType);
00060 
00062   itkGetObjectMacro(Output, SpatialObjectType);
00063 
00065   void Update(void);
00066 
00067 protected:
00068   SpatialObjectDuplicator();
00069   virtual ~SpatialObjectDuplicator() {}
00070   void PrintSelf(std::ostream & os, Indent indent) const;
00071 
00072   void CopyObject(const InternalSpatialObjectType *source,
00073                   InternalSpatialObjectType *destination);
00074 
00075 private:
00076   SpatialObjectDuplicator(const Self &); //purposely not implemented
00077   void operator=(const Self &);          //purposely not implemented
00078 
00079   SpatialObjectConstPointer m_Input;
00080   SpatialObjectPointer      m_Output;
00081   unsigned long             m_InternalSpatialObjectTime;
00082 };
00083 } // end namespace itk
00084 
00085 #ifndef ITK_MANUAL_INSTANTIATION
00086 #include "itkSpatialObjectDuplicator.hxx"
00087 #endif
00088 
00089 #endif /* __itkSpatialObjectDuplicator_h */
00090