Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxInOutGetPoints.h

00001 /*
00002  *  Copyright (c) 2000, University of Amsterdam, The Netherlands.
00003  *  All rights reserved.
00004  *
00005  *  Author(s):
00006  *  Edo Poll (poll@wins.uva.nl)
00007  */
00008 
00009 #ifndef HxInOutGetPoints_h
00010 #define HxInOutGetPoints_h
00011 
00012 #include "HxCategories.h"
00013 #include "HxTagList.h"
00014 #include "HxPointList.h"
00015 
00016 
00017 template<class ArithT>
00018 class HxInOutGetPoints
00019 {
00020 public:
00021     typedef HxTagPixOpOut       DirectionCategory;
00022     typedef HxTagTransVar       TransVarianceCategory;
00023     typedef HxTag1Phase         PhaseCategory;
00024 
00025                                     HxInOutGetPoints(HxTagList&, int, int, int);
00026 
00027     void                            doIt(const ArithT& v, int x, int y, int z);
00028 
00029     static HxString                 className();
00030 private:
00031     HxPointListBackInserter         _ptIns;
00032     HxPointList&                    dummyList();
00033     HxPointListBackInserter&        dummyInserter();
00034 };
00035 
00036 template<class ArithT>
00037 inline
00038 HxInOutGetPoints<ArithT>::HxInOutGetPoints(HxTagList& tags, int, int, int)
00039     : _ptIns(*HxGetTag(tags, "pointInserter", &dummyInserter()))
00040 {
00041 }
00042 
00043 template<class ArithT>
00044 inline HxString
00045 HxInOutGetPoints<ArithT>::className()
00046 {
00047     static HxString theName("getPoints");
00048     return theName;
00049 }
00050 
00051 template<class ArithT>
00052 inline void
00053 HxInOutGetPoints<ArithT>::doIt(const ArithT& v, int x, int y, int z)
00054 {
00055     if (HxScalarInt(v).x())
00056         *_ptIns++ = HxPoint(x, y, z);
00057 }
00058 
00059 template<class ArithT>
00060 inline HxPointList&
00061 HxInOutGetPoints<ArithT>::dummyList()
00062 {
00063     static HxPointList theList;
00064     return theList;
00065 }
00066 
00067 template<class ArithT>
00068 inline HxPointListBackInserter&
00069 HxInOutGetPoints<ArithT>::dummyInserter()
00070 {
00071     static HxPointListBackInserter theInserter(std::back_inserter(dummyList()));
00072     return theInserter;
00073 }
00074 
00075 #endif

Generated on Tue Feb 3 14:18:38 2004 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001