source: branches/pixel-map-branch/src/PixelMap/Voxel.hh @ 237

Last change on this file since 237 was 237, checked in by Matthew Whiting, 17 years ago

Moved voxel.{cc,hh} to a new PixelMap? directory, and capitalised them.
Changed all references to the .hh file accordingly.

File size: 2.2 KB
Line 
1#ifndef VOXEL_H
2#define VOXEL_H
3
4#include <iostream>
5
6//==========================================================================
7
8/**
9 * Voxel class.
10 *  A 3-dimensional pixel, with x,y,z position + flux
11 */
12
13class Voxel
14{
15public:
16  /** Default constructor. */
17  Voxel(){};
18  /** Specific constructor, defining an (x,y,z) location and flux f. */
19  Voxel(long x, long y, long z, float f){ itsX=x; itsY=y; itsZ=z; itsF=f;};
20  /** Copy constructor. */
21  Voxel(const Voxel& v){itsX=v.itsX; itsY=v.itsY; itsZ=v.itsZ; itsF=v.itsF;};
22  /** Copy constructor. */
23  Voxel& operator= (const Voxel& v){
24    itsX=v.itsX; itsY=v.itsY; itsZ=v.itsZ; itsF=v.itsF;};
25  virtual ~Voxel(){};
26
27  // accessor functions
28  void   setX(long x){itsX = x;};
29  void   setY(long y){itsY = y;};
30  void   setZ(long z){itsZ = z;};
31  void   setF(float f){itsF = f;};
32  /* Define an (x,y) coordinate */
33  void   setXY(long x, long y){itsX = x; itsY = y;};
34  /* Define an (x,y,z) coordinate */
35  void   setXYZ(long x, long y, long z){itsX = x; itsY = y; itsZ = z;};
36  /* Define an (x,y) coordinate with a flux f */
37  void   setXYF(long x, long y, float f){itsX = x; itsY = y; itsF = f;};
38  /* Define an (x,y,z) coordinate with a flux f */
39  void   setXYZF(long x, long y, long z, float f){itsX = x; itsY = y; itsZ = z; itsF = f;};
40  long   getX(){return itsX;};
41  long   getY(){return itsY;};
42  long   getZ(){return itsZ;};
43  float  getF(){return itsF;};
44  //
45  /** Operator to print information of voxel. */
46  friend std::ostream& operator<< ( std::ostream& theStream, Voxel& vox);
47
48  friend class Detection;
49  //
50protected:
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
65class Pixel : public Voxel
66{
67public:
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.