[237] | 1 | #ifndef VOXEL_H |
---|
| 2 | #define VOXEL_H |
---|
| 3 | |
---|
| 4 | #include <iostream> |
---|
| 5 | |
---|
[252] | 6 | namespace PixelInfo |
---|
| 7 | { |
---|
| 8 | //========================================================================== |
---|
[237] | 9 | |
---|
[252] | 10 | /** |
---|
| 11 | * Voxel class. |
---|
| 12 | * A 3-dimensional pixel, with x,y,z position + flux |
---|
| 13 | */ |
---|
[237] | 14 | |
---|
[252] | 15 | class Voxel |
---|
| 16 | { |
---|
| 17 | public: |
---|
| 18 | /** Default constructor. */ |
---|
| 19 | Voxel(){}; |
---|
| 20 | /** Specific constructor, defining an (x,y,z) location and flux f. */ |
---|
[270] | 21 | Voxel(long x, long y, long z, float f); |
---|
[252] | 22 | /** Copy constructor. */ |
---|
[270] | 23 | Voxel(const Voxel& v); |
---|
| 24 | /** Assignment operator. */ |
---|
| 25 | Voxel& operator= (const Voxel& v); |
---|
[252] | 26 | virtual ~Voxel(){}; |
---|
[237] | 27 | |
---|
[252] | 28 | // accessor functions |
---|
| 29 | void setX(long x){itsX = x;}; |
---|
| 30 | void setY(long y){itsY = y;}; |
---|
| 31 | void setZ(long z){itsZ = z;}; |
---|
| 32 | void setF(float f){itsF = f;}; |
---|
| 33 | /* Define an (x,y) coordinate */ |
---|
| 34 | void setXY(long x, long y){itsX = x; itsY = y;}; |
---|
| 35 | /* Define an (x,y,z) coordinate */ |
---|
| 36 | void setXYZ(long x, long y, long z){itsX = x; itsY = y; itsZ = z;}; |
---|
| 37 | /* Define an (x,y) coordinate with a flux f */ |
---|
| 38 | void setXYF(long x, long y, float f){itsX = x; itsY = y; itsF = f;}; |
---|
| 39 | /* Define an (x,y,z) coordinate with a flux f */ |
---|
| 40 | void setXYZF(long x, long y, long z, float f){itsX = x; itsY = y; itsZ = z; itsF = f;}; |
---|
| 41 | long getX(){return itsX;}; |
---|
| 42 | long getY(){return itsY;}; |
---|
| 43 | long getZ(){return itsZ;}; |
---|
| 44 | float getF(){return itsF;}; |
---|
| 45 | // |
---|
| 46 | /** Operator to print information of voxel. */ |
---|
| 47 | friend std::ostream& operator<< ( std::ostream& theStream, Voxel& vox); |
---|
[237] | 48 | |
---|
[252] | 49 | protected: |
---|
| 50 | long itsX; ///< x-position of pixel |
---|
| 51 | long itsY; ///< y-position of pixel |
---|
| 52 | long itsZ; ///< z-position of pixel |
---|
| 53 | float itsF; ///< flux of pixel |
---|
| 54 | }; |
---|
[237] | 55 | |
---|
[252] | 56 | //========================================================================== |
---|
[237] | 57 | |
---|
[252] | 58 | /** |
---|
| 59 | * Pixel class. |
---|
| 60 | * A 2-dimensional type of voxel, with just x & y position + flux |
---|
| 61 | */ |
---|
[237] | 62 | |
---|
| 63 | |
---|
[252] | 64 | class Pixel : public Voxel |
---|
| 65 | { |
---|
| 66 | public: |
---|
| 67 | Pixel(){itsZ=0;}; |
---|
[270] | 68 | Pixel(long x, long y, float f); |
---|
| 69 | Pixel(const Pixel& p); |
---|
| 70 | Pixel& operator= (const Pixel& p); |
---|
[252] | 71 | virtual ~Pixel(){}; |
---|
| 72 | // accessor functions |
---|
| 73 | void setXY(long x, long y){itsX = x; itsY = y;}; |
---|
| 74 | void setXYF(long x, long y, float f){itsX = x; itsY = y; itsF = f;}; |
---|
[237] | 75 | |
---|
[252] | 76 | }; |
---|
[237] | 77 | |
---|
| 78 | |
---|
[252] | 79 | } |
---|
[237] | 80 | |
---|
| 81 | #endif // VOXEL_H |
---|