SourceMaskCombineSelect.h

Go to the documentation of this file.
00001 // $Id$
00002 
00003 #ifndef __SOURCEMASKCOMBINESELECT_H__
00004 #define __SOURCEMASKCOMBINESELECT_H__
00005 
00006 #include "SourceGenerics.h"
00007 #include "SourceMaskCombine.h"
00008 #include "Promotion.h"
00009 #include "libUtility.h"
00010 template<class DATA, int DIMENSIONALITY, class PRECISION, class SOURCEMASK, class SOURCECOMBINE>
00011 class SourceMaskCombineSelectOf: public SourceMaskCombineOf<DATA,
00012     DIMENSIONALITY, PRECISION, SOURCEMASK, SOURCECOMBINE>
00013 {
00014 }
00015 
00016 //============================================================================
00017 // 2D
00018 //============================================================================
00019 template<class DATA, class PRECISION, class SOURCEMASK, class SOURCECOMBINE>
00020 class SourceMaskCombineSelectOf<DATA, 2, PRECISION, SOURCEMASK, SOURCECOMBINE> : public SourceMaskCombineOf<
00021     DATA, 2, PRECISION, SOURCEMASK, SOURCECOMBINE>
00022 {
00023 public:
00024   virtual String Describe() const
00025   {
00026     return (_LINE + "SourceMaskCombineSelectOf(" + DIMENSIONALITY + "D)"
00027         + LINE_ + this->DescribeCommon());
00028   }
00029 
00030   SOURCEMASK,SOURCECOMBINE_ACTUALS_2D;
00031 
00032   void Get(DATA& dataOut, const PRECISION &rX, const PRECISION &rY) const
00033   {
00034     TypeOfData(SOURCEMASK) dataMask;
00035     ::Get(*this->psourceMask, dataMask, rX, rY);
00036 
00037     ::Get(*this->PSourceCombine(dataMask), dataOut, rX, rY);
00038   }
00039 
00040   void Set(const PRECISION &rX, const PRECISION &rY, const DATA& data)
00041   {
00042     TypeOfData(SOURCEMASK) dataMask;
00043     ::Get(*this->psourceMask, dataMask, rX, rY);
00044 
00045     ::Set(*this->PSourceCombine(dataMask), rX, rY, data);
00046   }
00047 };
00048 
00049 //============================================================================
00050 // 3d
00051 //============================================================================
00052 template<class DATA, class PRECISION, class SOURCEMASK, class SOURCECOMBINE>
00053 class SourceMaskCombineSelectOf<DATA, 3, PRECISION, SOURCEMASK, SOURCECOMBINE> : public SourceMaskCombineOf<
00054     TypeOfData(DATA), 3, PRECISION, SOURCEMASK, SOURCECOMBINE>
00055 {
00056 typedef TypeOfData(DATA) DATA;
00057 public:
00058   SOURCEMASK,SOURCECOMBINE_ACTUALS_3D;
00059 
00060   void Get(DATA& dataOut, const PRECISION &rX, const PRECISION &rY, const PRECISION &rZ) const
00061   {
00062     TypeOfData(SOURCEMASK) dataMask;
00063     ::Get(*this->psourceMask, dataMask, rX, rY, rZ);
00064 
00065     ::Get(*this->PSourceCombine(dataMask), dataOut, rX, rY, rZ);
00066   }
00067 
00068   void Set(const PRECISION &rX, const PRECISION &rY, const PRECISION &rZ, const DATA& data)
00069   {
00070     TypeOfData(SOURCEMASK) dataMask;
00071     ::Get(*this->psourceMask, dataMask, rX, rY, rZ);
00072 
00073     ::Set(*this->PSourceCombine(dataMask), rX, rY, rZ, data);
00074   }
00075 
00076 };
00077 
00078 #endif
00079 

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1