#include "TEveGridStepper.h"
#include "TEveTrans.h"
ClassImp(TEveGridStepper)
TEveGridStepper::TEveGridStepper(Int_t sm) :
fMode(EStepMode_e(sm)),
fCx(0), fCy(0), fCz(0), fNx(0), fNy(0), fNz(0),
fDx(0), fDy(0), fDz(0), fOx(0), fOy(0), fOz(0)
{
switch(fMode) {
default:
case kSM_XYZ:
fLimitArr[0] = &fNx; fLimitArr[1] = &fNy; fLimitArr[2] = &fNz;
fValueArr[0] = &fCx; fValueArr[1] = &fCy; fValueArr[2] = &fCz;
break;
case kSM_YXZ:
fLimitArr[0] = &fNy; fLimitArr[1] = &fNx; fLimitArr[2] = &fNz;
fValueArr[0] = &fCy; fValueArr[1] = &fCx; fValueArr[2] = &fCz;
break;
case kSM_XZY:
fLimitArr[0] = &fNx; fLimitArr[1] = &fNz; fLimitArr[2] = &fNy;
fValueArr[0] = &fCx; fValueArr[1] = &fCz; fValueArr[2] = &fCy;
break;
}
fCx = fCy = fCz = 0;
fNx = fNy = fNz = 16;
fDx = fDy = fDz = 1;
fOx = fOy = fOz = 0;
}
void TEveGridStepper::Reset()
{
fCx = fCy = fCz = 0;
}
void TEveGridStepper::Subtract(TEveGridStepper& s)
{
fOx = -(s.fOx + s.fCx*s.fDx);
fOy = -(s.fOy + s.fCy*s.fDy);
fOz = -(s.fOz + s.fCz*s.fDz);
}
Bool_t TEveGridStepper::Step()
{
(*fValueArr[0])++;
if (*fValueArr[0] >= *fLimitArr[0]) {
*fValueArr[0] = 0; (*fValueArr[1])++;
if (*fValueArr[1] >= *fLimitArr[1]) {
*fValueArr[1] = 0; (*fValueArr[2])++;
if (*fValueArr[2] >= *fLimitArr[2]) {
return kFALSE;
}
}
}
return kTRUE;
}
void TEveGridStepper::GetPosition(Float_t* p)
{
p[0] = fOx + fCx*fDx;
p[1] = fOy + fCy*fDy;
p[2] = fOz + fCz*fDz;
}
void TEveGridStepper::SetTrans(TEveTrans* mx)
{
mx->SetPos(fOx + fCx*fDx, fOy + fCy*fDy, fOz + fCz*fDz);
}
void TEveGridStepper::SetTransAdvance(TEveTrans* mx)
{
SetTrans(mx);
Step();
}
Last change: Wed Jun 25 08:37:12 2008
Last generated: 2008-06-25 08:37
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.