Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TEveArrow.h
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 #ifndef ROOT_TEveArrow
13 #define ROOT_TEveArrow
14 
15 #include "TEveElement.h"
16 #include "TEveVector.h"
17 #include "TNamed.h"
18 #include "TAtt3D.h"
19 #include "TAttBBox.h"
20 
21 class TEveArrow : public TEveElement,
22  public TNamed,
23  public TAtt3D,
24  public TAttBBox
25 {
26  friend class TEveArrowGL;
27  friend class TEveArrowEditor;
28 
29 private:
30  TEveArrow(const TEveArrow&); // Not implemented
31  TEveArrow& operator=(const TEveArrow&); // Not implemented
32 
33 protected:
34  Color_t fColor;
35 
36  Float_t fTubeR;
37  Float_t fConeR;
38  Float_t fConeL;
39 
40  TEveVector fOrigin;
41  TEveVector fVector;
42 
43  Int_t fDrawQuality; // Number of segments of circles.
44 
45 public:
46  TEveArrow(Float_t xVec=0, Float_t yVec=0, Float_t zVec=1,
47  Float_t xOrg=0, Float_t yOrg=0, Float_t zOrg=0);
48  virtual ~TEveArrow() {}
49 
50  virtual TObject* GetObject(const TEveException& ) const
51  { const TObject* obj = this; return const_cast<TObject*>(obj); }
52 
53  void StampGeom() { ResetBBox(); AddStamp(kCBTransBBox | kCBObjProps); }
54 
55  Float_t GetTubeR() const { return fTubeR; }
56  Float_t GetConeR() const { return fConeR; }
57  Float_t GetConeL() const { return fConeL; }
58 
59  void SetTubeR(Float_t x) { fTubeR = x; StampGeom(); }
60  void SetConeR(Float_t x) { fConeR = x; StampGeom(); }
61  void SetConeL(Float_t x) { fConeL = x; StampGeom(); }
62 
63  TEveVector GetOrigin() { return fOrigin; }
64  TEveVector& RefOrigin() { return fOrigin; }
65  TEveVector GetVector() { return fVector; }
66  TEveVector& RefVector() { return fVector; }
67 
68  void SetOrigin(const TEveVector& o) { fOrigin = o; StampGeom(); }
69  void SetOrigin(Float_t x, Float_t y, Float_t z) { fOrigin.Set(x, y, z); StampGeom(); }
70  void SetVector(const TEveVector& v) { fVector = v; StampGeom(); }
71  void SetVector(Float_t x, Float_t y, Float_t z) { fVector.Set(x, y, z); StampGeom(); }
72 
73  Int_t GetDrawQuality() const { return fDrawQuality; }
74  void SetDrawQuality(Int_t q) { fDrawQuality = q; }
75 
76  virtual void ComputeBBox();
77  virtual void Paint(Option_t* option="");
78 
79  ClassDef(TEveArrow, 0); // Class for gl visualisation of arrow.
80 };
81 
82 #endif