TEveArrow.cxx

Go to the documentation of this file.
00001 // @(#)root/eve:$Id: TEveArrow.cxx 33864 2010-06-14 09:47:19Z matevz $
00002 // Author: Matevz Tadel 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 #include "TEveArrow.h"
00013 #include "TEveTrans.h"
00014 
00015 
00016 //______________________________________________________________________________
00017 //
00018 // TEveElement class used for display of a thick arrow.
00019 
00020 ClassImp(TEveArrow);
00021 
00022 //______________________________________________________________________________
00023 TEveArrow::TEveArrow(Float_t xVec, Float_t yVec, Float_t zVec,
00024                      Float_t xOrg, Float_t yOrg, Float_t zOrg):
00025    TEveElement(fColor),
00026    TNamed("TEveArrow", ""),
00027    TAtt3D(), TAttBBox(),
00028 
00029    fTubeR(0.02), fConeR(0.04), fConeL(0.08),
00030    fOrigin(xOrg, yOrg, zOrg), fVector(xVec, yVec, zVec),
00031    fDrawQuality(10)
00032 {
00033    // Constructor.
00034    // Org - starting point.
00035    // Vec - vector from start to end of the arrow.
00036 
00037    fCanEditMainColor        = kTRUE;
00038    fCanEditMainTransparency = kTRUE;
00039 }
00040 
00041 //______________________________________________________________________________
00042 void TEveArrow::ComputeBBox()
00043 {
00044    // Compute bounding-box of the arrow.
00045 
00046    TEveVector a, b;
00047    fVector.OrthoNormBase(a, b);
00048    Float_t r = TMath::Max(fTubeR, fConeR);
00049    a *= r; b *= r;
00050 
00051    TEveVector end(fOrigin + fVector);
00052 
00053    BBoxZero();
00054    BBoxCheckPoint(fOrigin + a + b);
00055    BBoxCheckPoint(fOrigin + a - b);
00056    BBoxCheckPoint(fOrigin - a - b);
00057    BBoxCheckPoint(fOrigin - a + b);
00058    BBoxCheckPoint(end + a + b);
00059    BBoxCheckPoint(end + a - b);
00060    BBoxCheckPoint(end - a - b);
00061    BBoxCheckPoint(end - a + b);
00062 }
00063 
00064 //______________________________________________________________________________
00065 void TEveArrow::Paint(Option_t*)
00066 {
00067    // Paint object.
00068    // This is for direct rendering (using TEveArrowGL class).
00069 
00070    PaintStandard(this);
00071 }

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