TEveGridStepper.h

Go to the documentation of this file.
00001 // @(#)root/eve:$Id: TEveGridStepper.h 21434 2007-12-17 21:09:43Z matevz $
00002 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TEveGridStepper
00013 #define ROOT_TEveGridStepper
00014 
00015 #include "TEveUtil.h"
00016 
00017 #include "TObject.h"
00018 
00019 class TEveTrans;
00020 
00021 class TEveGridStepper : public TObject
00022 {
00023    friend class TEveGridStepperSubEditor;
00024 
00025 private:
00026    Int_t *fLimitArr[3], *fValueArr[3]; //! Internal traversal variables.
00027 
00028    TEveGridStepper(const TEveGridStepper&);            // Not implemented
00029    TEveGridStepper& operator=(const TEveGridStepper&); // Not implemented
00030 
00031 public:
00032    enum EStepMode_e { kSM_XYZ, kSM_YXZ, kSM_XZY };
00033 
00034 protected:
00035    EStepMode_e fMode;       // Stepping mode, order of filling.
00036 
00037    Int_t   fCx, fCy, fCz;   // Current positions during filling / traversal.
00038    Int_t   fNx, fNy, fNz;   // Number of slots in each direction.
00039    Float_t fDx, fDy, fDz;   // Step size in each direction.
00040    Float_t fOx, fOy, fOz;   // Initial offset for each direction.
00041 
00042 public:
00043    TEveGridStepper(Int_t sm=kSM_XYZ);
00044    virtual ~TEveGridStepper() {}
00045 
00046    void Reset();
00047    void Subtract(TEveGridStepper& s);
00048    void SetNs(Int_t nx, Int_t ny, Int_t nz=1)
00049    { fNx = nx; fNy = ny; fNz = nz; }
00050    void SetDs(Float_t dx, Float_t dy, Float_t dz=0)
00051    { fDx = dx; fDy = dy; fDz = dz; }
00052    void SetOs(Float_t ox, Float_t oy, Float_t oz=0)
00053    { fOx = ox; fOy = oy; fOz = oz; }
00054 
00055    Bool_t Step();
00056 
00057    void GetPosition(Float_t* p);
00058 
00059    void SetTrans(TEveTrans* mx);
00060    void SetTransAdvance(TEveTrans* mx);
00061 
00062    Int_t   GetCx() const { return fCx; }
00063    Int_t   GetCy() const { return fCy; }
00064    Int_t   GetCz() const { return fCz; }
00065    Int_t   GetNx() const { return fNx; }
00066    Int_t   GetNy() const { return fNy; }
00067    Int_t   GetNz() const { return fNz; }
00068    Float_t GetDx() const { return fDx; }
00069    Float_t GetDy() const { return fDy; }
00070    Float_t GetDz() const { return fDz; }
00071    Float_t GetOx() const { return fOx; }
00072    Float_t GetOy() const { return fOy; }
00073    Float_t GetOz() const { return fOz; }
00074 
00075    ClassDef(TEveGridStepper, 1); // Provide discrete position coordinates for placement of objects on regular grids.
00076 }; // end class TEveGridStepper
00077 
00078 #endif

Generated on Tue Jul 5 14:14:56 2011 for ROOT_528-00b_version by  doxygen 1.5.1