// @(#)root/eve:$Id$
// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007

/*************************************************************************
 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TEveGridStepper
#define ROOT_TEveGridStepper

#include "TEveUtil.h"

#include "TObject.h"

class TEveTrans;

class TEveGridStepper : public TObject
{
   friend class TEveGridStepperSubEditor;

private:
   Int_t *fLimitArr[3], *fValueArr[3]; //! Internal traversal variables.

   TEveGridStepper(const TEveGridStepper&);            // Not implemented
   TEveGridStepper& operator=(const TEveGridStepper&); // Not implemented

public:
   enum EStepMode_e { kSM_XYZ, kSM_YXZ, kSM_XZY };

protected:
   EStepMode_e fMode;       // Stepping mode, order of filling.

   Int_t   fCx, fCy, fCz;   // Current positions during filling / traversal.
   Int_t   fNx, fNy, fNz;   // Number of slots in each direction.
   Float_t fDx, fDy, fDz;   // Step size in each direction.
   Float_t fOx, fOy, fOz;   // Initial offset for each direction.

public:
   TEveGridStepper(Int_t sm=kSM_XYZ);
   virtual ~TEveGridStepper() {}

   void Reset();
   void Subtract(TEveGridStepper& s);
   void SetNs(Int_t nx, Int_t ny, Int_t nz=1)
   { fNx = nx; fNy = ny; fNz = nz; }
   void SetDs(Float_t dx, Float_t dy, Float_t dz=0)
   { fDx = dx; fDy = dy; fDz = dz; }
   void SetOs(Float_t ox, Float_t oy, Float_t oz=0)
   { fOx = ox; fOy = oy; fOz = oz; }

   Bool_t Step();

   void GetPosition(Float_t* p);

   void SetTrans(TEveTrans* mx);
   void SetTransAdvance(TEveTrans* mx);

   Int_t   GetCx() const { return fCx; }
   Int_t   GetCy() const { return fCy; }
   Int_t   GetCz() const { return fCz; }
   Int_t   GetNx() const { return fNx; }
   Int_t   GetNy() const { return fNy; }
   Int_t   GetNz() const { return fNz; }
   Float_t GetDx() const { return fDx; }
   Float_t GetDy() const { return fDy; }
   Float_t GetDz() const { return fDz; }
   Float_t GetOx() const { return fOx; }
   Float_t GetOy() const { return fOy; }
   Float_t GetOz() const { return fOz; }

   ClassDef(TEveGridStepper, 1); // Provide discrete position coordinates for placement of objects on regular grids.
}; // end class TEveGridStepper

#endif
 TEveGridStepper.h:1
 TEveGridStepper.h:2
 TEveGridStepper.h:3
 TEveGridStepper.h:4
 TEveGridStepper.h:5
 TEveGridStepper.h:6
 TEveGridStepper.h:7
 TEveGridStepper.h:8
 TEveGridStepper.h:9
 TEveGridStepper.h:10
 TEveGridStepper.h:11
 TEveGridStepper.h:12
 TEveGridStepper.h:13
 TEveGridStepper.h:14
 TEveGridStepper.h:15
 TEveGridStepper.h:16
 TEveGridStepper.h:17
 TEveGridStepper.h:18
 TEveGridStepper.h:19
 TEveGridStepper.h:20
 TEveGridStepper.h:21
 TEveGridStepper.h:22
 TEveGridStepper.h:23
 TEveGridStepper.h:24
 TEveGridStepper.h:25
 TEveGridStepper.h:26
 TEveGridStepper.h:27
 TEveGridStepper.h:28
 TEveGridStepper.h:29
 TEveGridStepper.h:30
 TEveGridStepper.h:31
 TEveGridStepper.h:32
 TEveGridStepper.h:33
 TEveGridStepper.h:34
 TEveGridStepper.h:35
 TEveGridStepper.h:36
 TEveGridStepper.h:37
 TEveGridStepper.h:38
 TEveGridStepper.h:39
 TEveGridStepper.h:40
 TEveGridStepper.h:41
 TEveGridStepper.h:42
 TEveGridStepper.h:43
 TEveGridStepper.h:44
 TEveGridStepper.h:45
 TEveGridStepper.h:46
 TEveGridStepper.h:47
 TEveGridStepper.h:48
 TEveGridStepper.h:49
 TEveGridStepper.h:50
 TEveGridStepper.h:51
 TEveGridStepper.h:52
 TEveGridStepper.h:53
 TEveGridStepper.h:54
 TEveGridStepper.h:55
 TEveGridStepper.h:56
 TEveGridStepper.h:57
 TEveGridStepper.h:58
 TEveGridStepper.h:59
 TEveGridStepper.h:60
 TEveGridStepper.h:61
 TEveGridStepper.h:62
 TEveGridStepper.h:63
 TEveGridStepper.h:64
 TEveGridStepper.h:65
 TEveGridStepper.h:66
 TEveGridStepper.h:67
 TEveGridStepper.h:68
 TEveGridStepper.h:69
 TEveGridStepper.h:70
 TEveGridStepper.h:71
 TEveGridStepper.h:72
 TEveGridStepper.h:73
 TEveGridStepper.h:74
 TEveGridStepper.h:75
 TEveGridStepper.h:76
 TEveGridStepper.h:77
 TEveGridStepper.h:78