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

HxCnum.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  *  Marc Navarro            (mnavarro@wins.uva.nl)
00008  */
00009 
00010 #ifndef HxCnum_h
00011 #define HxCnum_h
00012 
00013 
00016 struct HxCoord
00017 {
00018     int x, y, z;
00019 };
00020 
00021 
00024 class HxCnum
00025 {
00026 public:
00028                         HxCnum();
00029 
00031                         HxCnum(HxCoord* coords);
00032 
00034                         HxCnum(const HxCnum& rhs);
00035 
00037     HxCnum&             operator=(const HxCnum& rhs);
00038 
00040     HxCnum&             operator=(HxCoord* coords);
00041 
00043     int                 x();
00044 
00046     int                 y();
00047 
00049     int                 z();
00050 
00052     void                inc();
00053 
00055     bool                operator!=(const HxCnum& rhs);
00056 
00057 private:
00058     HxCoord*            _coords;
00059 };
00060 
00061 inline
00062 HxCnum::HxCnum()
00063     : _coords(0)
00064 {
00065 }
00066 
00067 inline
00068 HxCnum::HxCnum(HxCoord* coords) 
00069     : _coords(coords)
00070 {
00071 }
00072 
00073 inline
00074 HxCnum::HxCnum(const HxCnum& rhs)
00075     : _coords(rhs._coords)
00076 {
00077 }
00078 
00079 inline HxCnum&
00080 HxCnum::operator=(const HxCnum& rhs)
00081 {
00082     _coords = rhs._coords;
00083     return *this;
00084 }
00085 
00086 inline HxCnum&
00087 HxCnum::operator=(HxCoord* coords)
00088 {
00089     _coords = coords;
00090     return *this;
00091 }
00092 
00093 inline int
00094 HxCnum::x()
00095 {
00096     return _coords->x;
00097 }
00098 
00099 inline int
00100 HxCnum::y()
00101 {
00102     return _coords->y;
00103 }
00104 
00105 inline int
00106 HxCnum::z()
00107 {
00108     return _coords->y;
00109 }
00110 
00111 inline void
00112 HxCnum::inc()
00113 {
00114     _coords++;
00115 }
00116 
00117 inline bool
00118 HxCnum::operator!=(const HxCnum& rhs)
00119 {
00120     return _coords != rhs._coords;
00121 }
00122 
00123 #endif

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