Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkPath.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkPath.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007-02-10 14:31:15 $
00007   Version:   $Revision: 1.11 $
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 __itkPath_h
00018 #define __itkPath_h
00019 
00020 #include "itkDataObject.h"
00021 #include "itkIndex.h"
00022 #include "itkOffset.h"
00023 #include "itkNumericTraits.h"
00024 
00025 namespace itk
00026 {
00027 
00028 
00048 template <class TInput, class TOutput, unsigned int VDimension>
00049 class ITK_EXPORT Path : public DataObject
00050 {
00051 public:
00053   typedef Path                      Self;
00054   typedef DataObject                Superclass;
00055   typedef SmartPointer<Self>        Pointer;
00056   typedef SmartPointer<const Self>  ConstPointer;
00057 
00059   itkStaticConstMacro(PathDimension, unsigned int, VDimension);
00060 
00062   itkTypeMacro(Path, FunctionBase);
00063 
00065   typedef TInput  InputType;
00066 
00068   typedef TOutput OutputType;
00069 
00070   
00072   typedef Index<  VDimension >  IndexType;
00073   typedef Offset< VDimension >  OffsetType;
00074 
00075 
00079   virtual inline InputType StartOfInput() const
00080     {
00081     return NumericTraits<InputType>::Zero;
00082     }
00083 
00086   virtual inline InputType EndOfInput() const
00087     {
00088     return NumericTraits<InputType>::One;
00089     }
00090 
00093   virtual OutputType Evaluate( const InputType & input ) const = 0;
00094 
00096   virtual IndexType EvaluateToIndex( const InputType & input ) const = 0;
00097 
00106   virtual OffsetType IncrementInput(InputType & input) const = 0;
00107 
00108   
00109 protected:
00110   Path();
00111   ~Path(){}
00112 
00113   void PrintSelf(std::ostream& os, Indent indent) const;
00114 
00115   itkGetConstMacro(ZeroOffset,OffsetType);
00116   itkGetConstMacro(ZeroIndex,IndexType);
00117 
00118 private:
00119   Path(const Self&); //purposely not implemented
00120   void operator=(const Self&); //purposely not implemented
00121   
00122   // These "constants" are initialized in the constructor
00123   OffsetType  m_ZeroOffset; // = 0 for all dimensions
00124   IndexType   m_ZeroIndex;  // = 0 for all dimensions
00125   
00126 };
00127 
00128 } // namespace itk
00129 
00130 // Define instantiation macro for this template.
00131 #define ITK_TEMPLATE_Path(_, EXPORT, x, y) namespace itk { \
00132   _(3(class EXPORT Path< ITK_TEMPLATE_3 x >)) \
00133   namespace Templates { typedef Path< ITK_TEMPLATE_3 x > Path##y; } \
00134   }
00135 
00136 #if ITK_TEMPLATE_EXPLICIT
00137 # include "Templates/itkPath+-.h"
00138 #endif
00139 
00140 #if ITK_TEMPLATE_TXX
00141 # include "itkPath.txx"
00142 #endif
00143   
00144 #endif
00145 

Generated at Thu May 28 11:06:12 2009 for ITK by doxygen 1.5.5 written by Dimitri van Heesch, © 1997-2000