#include "TEveTrackGL.h"
#include "TEveTrack.h"
#include "TEveTrackPropagator.h"
#include "TGLIncludes.h"
#include "TGLRnrCtx.h"
#include "TGLSelectRecord.h"
ClassImp(TEveTrackGL);
TEveTrackGL::TEveTrackGL() : TEveLineGL()
{
}
Bool_t TEveTrackGL::SetModel(TObject* obj, const Option_t* )
{
if (TEveLineGL::SetModel(obj) == kFALSE) return kFALSE;
if (SetModelCheckClass(obj, TEveTrack::Class())) {
fTrack = dynamic_cast<TEveTrack*>(obj);
return kTRUE;
}
return kFALSE;
}
void TEveTrackGL::ProcessSelection(TGLRnrCtx & , TGLSelectRecord & rec)
{
printf("TEveTrackGL::ProcessSelection %d names on the stack (z1=%g, z2=%g).\n",
rec.GetN(), rec.GetMinZ(), rec.GetMaxZ());
printf(" Names: ");
for (Int_t j=0; j<rec.GetN(); ++j) printf ("%d ", rec.GetItem(j));
printf("\n");
((TEveTrack*)fM)->SecSelected((TEveTrack*)fM);
}
void TEveTrackGL::DirectDraw(TGLRnrCtx & rnrCtx) const
{
TEveLineGL::DirectDraw(rnrCtx);
const TEveTrack::vPathMark_t& pms = fTrack->RefPathMarks();
TEveTrackPropagator& rTP = *fTrack->GetPropagator();
if (pms.size())
{
Float_t* pnts = new Float_t[3*pms.size()];
Int_t n = 0;
Bool_t accept;
for (TEveTrack::vPathMark_ci pm = pms.begin(); pm != pms.end(); ++pm)
{
accept = kFALSE;
switch (pm->fType)
{
case TEvePathMark::kDaughter:
if (rTP.GetRnrDaughters()) accept = kTRUE;
break;
case TEvePathMark::kReference:
if (rTP.GetRnrReferences()) accept = kTRUE;
break;
case TEvePathMark::kDecay:
if (rTP.GetRnrDecay()) accept = kTRUE;
break;
case TEvePathMark::kCluster2D:
if (rTP.GetRnrCluster2Ds()) accept = kTRUE;
break;
}
if (accept)
{
if ((TMath::Abs(pm->fV.fZ) < rTP.GetMaxZ()) && (pm->fV.Perp() < rTP.GetMaxR()))
{
pnts[3*n ] = pm->fV.fX;
pnts[3*n+1] = pm->fV.fY;
pnts[3*n+2] = pm->fV.fZ;
++n;
}
}
}
TGLUtil::RenderPolyMarkers(rTP.RefPMAtt(), pnts, n,
rnrCtx.GetPickRadius(),
rnrCtx.Selection());
delete [] pnts;
}
if (rTP.GetRnrFV() && fTrack->GetLastPoint())
TGLUtil::RenderPolyMarkers(rTP.RefFVAtt(), fTrack->GetP(), 1,
rnrCtx.GetPickRadius(),
rnrCtx.Selection());
}
Last change: Wed Jun 25 08:38:20 2008
Last generated: 2008-06-25 08:38
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.