Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TEveLine.h
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 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_TEveLine
13 #define ROOT_TEveLine
14 
15 #include "TEvePointSet.h"
16 #include "TEveVector.h"
17 
18 #include "TAttLine.h"
19 
20 //------------------------------------------------------------------------------
21 // TEveLine
22 //------------------------------------------------------------------------------
23 
24 class TEveLine : public TEvePointSet,
25  public TAttLine
26 {
27  friend class TEveLineEditor;
28  friend class TEveLineGL;
29 
30 private:
31  TEveLine(const TEveLine&); // Not implemented
32  TEveLine& operator=(const TEveLine&); // Not implemented
33 
34 protected:
35  Bool_t fRnrLine;
36  Bool_t fRnrPoints;
37  Bool_t fSmooth;
38 
39  static Bool_t fgDefaultSmooth;
40 
41 public:
42  TEveLine(Int_t n_points=0, ETreeVarType_e tv_type=kTVT_XYZ);
43  TEveLine(const char* name, Int_t n_points=0, ETreeVarType_e tv_type=kTVT_XYZ);
44  virtual ~TEveLine() {}
45 
46  virtual void SetMarkerColor(Color_t col);
47 
48  virtual void SetLineColor(Color_t col) { SetMainColor(col); }
49  virtual void SetLineStyle(Style_t lstyle);
50  virtual void SetLineWidth(Width_t lwidth);
51 
52  Bool_t GetRnrLine() const { return fRnrLine; }
53  Bool_t GetRnrPoints() const { return fRnrPoints; }
54  Bool_t GetSmooth() const { return fSmooth; }
55  void SetRnrLine(Bool_t r);
56  void SetRnrPoints(Bool_t r);
57  void SetSmooth(Bool_t r);
58 
59  void ReduceSegmentLengths(Float_t max);
60  Float_t CalculateLineLength() const;
61 
62  TEveVector GetLineStart() const;
63  TEveVector GetLineEnd() const;
64 
65  virtual const TGPicture* GetListTreeIcon(Bool_t open=kFALSE);
66 
67  virtual void CopyVizParams(const TEveElement* el);
68  virtual void WriteVizParams(std::ostream& out, const TString& var);
69 
70  virtual TClass* ProjectedClass(const TEveProjection* p) const;
71 
72  static Bool_t GetDefaultSmooth();
73  static void SetDefaultSmooth(Bool_t r);
74 
75  ClassDef(TEveLine, 0); // An arbitrary polyline with fixed line and marker attributes.
76 };
77 
78 
79 //------------------------------------------------------------------------------
80 // TEveLineProjected
81 //------------------------------------------------------------------------------
82 
83 class TEveLineProjected : public TEveLine,
84  public TEveProjected
85 {
86 private:
87  TEveLineProjected(const TEveLineProjected&); // Not implemented
88  TEveLineProjected& operator=(const TEveLineProjected&); // Not implemented
89 
90 protected:
91  virtual void SetDepthLocal(Float_t d);
92 
93 public:
94  TEveLineProjected();
95  virtual ~TEveLineProjected() {}
96 
97  virtual void SetProjection(TEveProjectionManager* mng, TEveProjectable* model);
98  virtual void UpdateProjection();
99  virtual TEveElement* GetProjectedAsElement() { return this; }
100 
101  ClassDef(TEveLineProjected, 0); // Projected replica of a TEveLine.
102 };
103 
104 #endif