source: trunk/src/PixelMap/Voxel.hh @ 258

Last change on this file since 258 was 252, checked in by Matthew Whiting, 17 years ago
  • Have put all classes in the files in src/PixelMap/ into a PixelInfo? namespace.
  • Added "using namespace PixelInfo?" to all necessary files.
  • Removed "friend class Detection" from Voxel and Object3D classes -- not necessary and complicated now by them being in the namespace
  • Various minor changes, including fixing up commentary.
File size: 2.3 KB
Line 
1#ifndef VOXEL_H
2#define VOXEL_H
3
4#include <iostream>
5
6namespace 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){ itsX=x; itsY=y; itsZ=z; itsF=f;};
22    /** Copy constructor. */
23    Voxel(const Voxel& v){itsX=v.itsX; itsY=v.itsY; itsZ=v.itsZ; itsF=v.itsF;};
24    /** Copy constructor. */
25    Voxel& operator= (const Voxel& v){
26      itsX=v.itsX; itsY=v.itsY; itsZ=v.itsZ; itsF=v.itsF;};
27    virtual ~Voxel(){};
28
29    // accessor functions
30    void   setX(long x){itsX = x;};
31    void   setY(long y){itsY = y;};
32    void   setZ(long z){itsZ = z;};
33    void   setF(float f){itsF = f;};
34    /* Define an (x,y) coordinate */
35    void   setXY(long x, long y){itsX = x; itsY = y;};
36    /* Define an (x,y,z) coordinate */
37    void   setXYZ(long x, long y, long z){itsX = x; itsY = y; itsZ = z;};
38    /* Define an (x,y) coordinate with a flux f */
39    void   setXYF(long x, long y, float f){itsX = x; itsY = y; itsF = f;};
40    /* Define an (x,y,z) coordinate with a flux f */
41    void   setXYZF(long x, long y, long z, float f){itsX = x; itsY = y; itsZ = z; itsF = f;};
42    long   getX(){return itsX;};
43    long   getY(){return itsY;};
44    long   getZ(){return itsZ;};
45    float  getF(){return itsF;};
46    //
47    /** Operator to print information of voxel. */
48    friend std::ostream& operator<< ( std::ostream& theStream, Voxel& vox);
49
50  protected:
51    long  itsX;         ///< x-position of pixel
52    long  itsY;         ///< y-position of pixel
53    long  itsZ;         ///< z-position of pixel
54    float itsF;         ///< flux of pixel
55  };
56
57  //==========================================================================
58
59  /**
60   * Pixel class.
61   *  A 2-dimensional type of voxel, with just x & y position + flux
62   */
63
64
65  class Pixel : public Voxel
66  {
67  public:
68    Pixel(){itsZ=0;};
69    Pixel(long x, long y, float f){ itsX=x; itsY=y; itsF=f; itsZ=0;};
70    virtual ~Pixel(){};
71    // accessor functions
72    void  setXY(long x, long y){itsX = x; itsY = y;};
73    void  setXYF(long x, long y, float f){itsX = x; itsY = y; itsF = f;};
74
75  };
76
77
78}
79
80#endif // VOXEL_H
Note: See TracBrowser for help on using the repository browser.