#include "TEveArrow.h"
#include "TEveTrans.h"
#include "TBuffer3D.h"
#include "TBuffer3DTypes.h"
#include "TVirtualPad.h"
#include "TVirtualViewer3D.h"
ClassImp(TEveArrow);
TEveArrow::TEveArrow(Float_t xVec, Float_t yVec, Float_t zVec,
Float_t xOrg, Float_t yOrg, Float_t zOrg):
TEveElement(fColor),
TNamed("TEveArrow", ""),
TAtt3D(), TAttBBox(),
fTubeR(0.02), fConeR(0.04), fConeL(0.08),
fOrigin(xOrg, yOrg, zOrg), fVector(xVec, yVec, zVec)
{
}
void TEveArrow::ComputeBBox()
{
TEveVector a, b;
fVector.OrthoNormBase(a, b);
Float_t r = TMath::Max(fTubeR, fConeR);
a *= r; b *= r;
TEveVector end(fOrigin + fVector);
BBoxZero();
BBoxCheckPoint(fOrigin + a + b);
BBoxCheckPoint(fOrigin + a - b);
BBoxCheckPoint(fOrigin - a - b);
BBoxCheckPoint(fOrigin - a + b);
BBoxCheckPoint(end + a + b);
BBoxCheckPoint(end + a - b);
BBoxCheckPoint(end - a - b);
BBoxCheckPoint(end - a + b);
}
void TEveArrow::Paint(Option_t* )
{
static const TEveException eh("TEveArrow::Paint ");
if (fRnrSelf == kFALSE) return;
TBuffer3D buff(TBuffer3DTypes::kGeneric);
buff.fID = this;
buff.fColor = GetMainColor();
buff.fTransparency = GetMainTransparency();
if (HasMainTrans())
RefMainTrans().SetBuffer3D(buff);
buff.SetSectionsValid(TBuffer3D::kCore);
Int_t reqSections = gPad->GetViewer3D()->AddObject(buff);
if (reqSections != TBuffer3D::kNone)
Error(eh, "only direct GL rendering supported.");
}
Last change: Mon Oct 20 13:14:41 2008
Last generated: 2008-10-20 13:14
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.