ROOT  6.06/09
Reference Guide
TEveArrow.cxx
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Author: Matevz Tadel 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #include "TEveArrow.h"
13 #include "TEveTrans.h"
14 
15 
16 /** \class TEveArrow
17 \ingroup TEve
18 Class used for display of a thick arrow.
19 */
20 
22 
23 ////////////////////////////////////////////////////////////////////////////////
24 
26  Float_t xOrg, Float_t yOrg, Float_t zOrg):
27  TEveElement(fColor),
28  TNamed("TEveArrow", ""),
29  TAtt3D(), TAttBBox(),
30 
31  fTubeR(0.02), fConeR(0.04), fConeL(0.08),
32  fOrigin(xOrg, yOrg, zOrg), fVector(xVec, yVec, zVec),
33  fDrawQuality(10)
34 {
35  // Constructor.
36  // Org - starting point.
37  // Vec - vector from start to end of the arrow.
38 
41 }
42 
43 ////////////////////////////////////////////////////////////////////////////////
44 /// Compute bounding-box of the arrow.
45 
47 {
48  TEveVector a, b;
49  fVector.OrthoNormBase(a, b);
51  a *= r; b *= r;
52 
53  TEveVector end(fOrigin + fVector);
54 
55  BBoxZero();
56  BBoxCheckPoint(fOrigin + a + b);
57  BBoxCheckPoint(fOrigin + a - b);
58  BBoxCheckPoint(fOrigin - a - b);
59  BBoxCheckPoint(fOrigin - a + b);
60  BBoxCheckPoint(end + a + b);
61  BBoxCheckPoint(end + a - b);
62  BBoxCheckPoint(end - a - b);
63  BBoxCheckPoint(end - a + b);
64 }
65 
66 ////////////////////////////////////////////////////////////////////////////////
67 /// Paint object.
68 /// This is for direct rendering (using TEveArrowGL class).
69 
71 {
72  PaintStandard(this);
73 }
TEveArrow(const TEveArrow &)
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
ClassImp(TEveArrow)
Bool_t fCanEditMainColor
Definition: TEveElement.h:92
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:29
Class used for display of a thick arrow.
Definition: TEveArrow.h:21
void OrthoNormBase(TEveVectorT &a, TEveVectorT &b) const
Set vectors a and b to be normal to this and among themselves, both of length 1.
Definition: TEveVector.cxx:86
virtual void PaintStandard(TObject *id)
Paint object – a generic implementation for EVE elements.
TArc * a
Definition: textangle.C:12
virtual void ComputeBBox()
Compute bounding-box of the arrow.
Definition: TEveArrow.cxx:46
void BBoxCheckPoint(Float_t x, Float_t y, Float_t z)
Definition: TAttBBox.h:60
Bool_t fCanEditMainTransparency
Definition: TEveElement.h:93
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
virtual void Paint(Option_t *option="")
Paint object.
Definition: TEveArrow.cxx:70
ROOT::R::TRInterface & r
Definition: Object.C:4
void BBoxZero(Float_t epsilon=0, Float_t x=0, Float_t y=0, Float_t z=0)
Create cube of volume (2*epsilon)^3 at (x,y,z).
Definition: TAttBBox.cxx:39
TEveVector fVector
Definition: TEveArrow.h:41
Float_t fTubeR
Definition: TEveArrow.h:36
TEveVector fOrigin
Definition: TEveArrow.h:40
Float_t fConeR
Definition: TEveArrow.h:37
Helper for management of bounding-box information.
Definition: TAttBBox.h:19
Short_t Max(Short_t a, Short_t b)
Definition: TMathBase.h:202
const Bool_t kTRUE
Definition: Rtypes.h:91
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:33