#include "TEveArrowGL.h"
#include "TEveArrow.h"
#include "TGLRnrCtx.h"
#include "TGLIncludes.h"
#include "TGLUtil.h"
#include "TGLQuadric.h"
ClassImp(TEveArrowGL);
TEveArrowGL::TEveArrowGL() :
TGLObject(), fM(0)
{
}
Bool_t TEveArrowGL::SetModel(TObject* obj, const Option_t* )
{
if (SetModelCheckClass(obj, TEveArrow::Class())) {
fM = dynamic_cast<TEveArrow*>(obj);
return kTRUE;
}
return kFALSE;
}
void TEveArrowGL::SetBBox()
{
SetAxisAlignedBBox(((TEveArrow*)fExternalObj)->AssertBBox());
}
void TEveArrowGL::DirectDraw(TGLRnrCtx& ) const
{
static TGLQuadric quad;
UInt_t drawQuality = 10;
glPushMatrix();
TGLVertex3 uo(fM->fOrigin.fX, fM->fOrigin.fY, fM->fOrigin.fZ);
TGLVector3 uv(fM->fVector.fX, fM->fVector.fY, fM->fVector.fZ);
TGLMatrix local(uo, uv);
glMultMatrixd(local.CArr());
Float_t size = fM->fVector.Mag();
Float_t r = size*fM->fTubeR;
Float_t h = size*fM->fConeL;
gluCylinder(quad.Get(), r, r, size - h, drawQuality, 1);
gluQuadricOrientation(quad.Get(), (GLenum)GLU_INSIDE);
gluDisk(quad.Get(), 0.0, r, drawQuality, 1);
r = size*fM->fConeR;
glTranslated(0.0, 0.0, size -h );
gluDisk(quad.Get(), 0.0, r, drawQuality, 1);
gluQuadricOrientation(quad.Get(), (GLenum)GLU_OUTSIDE);
gluCylinder(quad.Get(), r, 0., h , drawQuality, 1);
glPopMatrix();
}
Last change: Fri Oct 24 16:54:01 2008
Last generated: 2008-10-24 16:54
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.