]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Reve/GridStepper.h
First big commit of the mchview program and its accompanying library,
[u/mrichter/AliRoot.git] / EVE / Reve / GridStepper.h
1 // $Header$
2
3 #ifndef REVE_GridStepper_H
4 #define REVE_GridStepper_H
5
6 #include <Reve/Reve.h>
7
8 #include <TObject.h>
9
10 namespace Reve {
11
12 class ZTrans;
13
14 class GridStepper : public TObject
15 {
16 private:
17   Int_t *ls[3], *ns[3]; //! Internal traversal variables.
18
19   GridStepper(const GridStepper&);            // Not implemented
20   GridStepper& operator=(const GridStepper&); // Not implemented
21
22 public: 
23   enum StepMode_e { SM_XYZ, SM_YXZ, SM_XZY };
24   StepMode_e Mode;      // Stepping mode, order of filling.
25
26   Int_t   nx, ny, nz;   // Current positions during filling / traversal.
27   Int_t   Nx, Ny, Nz;   // Number of slots in eaxh direction.
28   Float_t Dx, Dy, Dz;   // Step size in each direction.
29   Float_t Ox, Oy, Oz;   // Initial offset for each direction.
30
31   GridStepper(Int_t sm=SM_XYZ);
32   virtual ~GridStepper() {}
33
34   void Reset();
35   void Subtract(GridStepper& s);
36   void SetNs(Int_t nx, Int_t ny, Int_t nz=1)
37   { Nx = nx; Ny = ny; Nz = nz; }
38   void SetDs(Float_t dx, Float_t dy, Float_t dz=0)
39   { Dx = dx; Dy = dy; Dz = dz; }
40   void SetOs(Float_t ox, Float_t oy, Float_t oz=0)
41   { Ox = ox; Oy = oy; Oz = oz; }
42   
43   Bool_t Step();
44
45   void GetPosition(Float_t* p);
46
47   void SetTrans(ZTrans* mx);
48   void SetTransAdvance(ZTrans* mx);
49
50   ClassDef(GridStepper, 1);
51 }; // end class GridStepper
52
53 }  // namespace Reve
54
55 #endif