1 | #ifndef VOXEL_H |
---|
2 | #define VOXEL_H |
---|
3 | |
---|
4 | #include <iostream> |
---|
5 | |
---|
6 | namespace PixelInfo |
---|
7 | { |
---|
8 | //========================================================================== |
---|
9 | |
---|
10 | /** |
---|
11 | * Voxel class. |
---|
12 | * A 3-dimensional pixel, with x,y,z position + flux |
---|
13 | */ |
---|
14 | |
---|
15 | class Voxel |
---|
16 | { |
---|
17 | public: |
---|
18 | /** Default constructor. */ |
---|
19 | Voxel(){}; |
---|
20 | /** Specific constructor, defining an (x,y,z) location and flux f. */ |
---|
21 | Voxel(long x, long y, long z, float f); |
---|
22 | /** Copy constructor. */ |
---|
23 | Voxel(const Voxel& v); |
---|
24 | /** Assignment operator. */ |
---|
25 | Voxel& operator= (const Voxel& v); |
---|
26 | virtual ~Voxel(){}; |
---|
27 | |
---|
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); |
---|
48 | |
---|
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 | }; |
---|
55 | |
---|
56 | //========================================================================== |
---|
57 | |
---|
58 | /** |
---|
59 | * Pixel class. |
---|
60 | * A 2-dimensional type of voxel, with just x & y position + flux |
---|
61 | */ |
---|
62 | |
---|
63 | |
---|
64 | class Pixel : public Voxel |
---|
65 | { |
---|
66 | public: |
---|
67 | Pixel(){itsZ=0;}; |
---|
68 | Pixel(long x, long y, float f); |
---|
69 | Pixel(const Pixel& p); |
---|
70 | Pixel& operator= (const Pixel& p); |
---|
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;}; |
---|
75 | |
---|
76 | }; |
---|
77 | |
---|
78 | |
---|
79 | } |
---|
80 | |
---|
81 | #endif // VOXEL_H |
---|