Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
REveLine.hxx
Go to the documentation of this file.
1 // @(#)root/eve7:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007, 2018
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2019, 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 ROOT7_REveLine
13 #define ROOT7_REveLine
14 
15 #include <ROOT/REvePointSet.hxx>
16 #include <ROOT/REveVector.hxx>
17 
18 #include "TAttLine.h"
19 
20 namespace ROOT {
21 namespace Experimental {
22 
23 ////////////////////////////////////////////////////////////////////////////////
24 /// REveLine
25 /// An arbitrary polyline with fixed line and marker attributes.
26 ////////////////////////////////////////////////////////////////////////////////
27 
28 class REveLine : public REvePointSet,
29  public TAttLine
30 {
31 private:
32  REveLine &operator=(const REveLine &); // 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  REveLine(const std::string &name = "", const std::string &title = "", Int_t n_points = 0);
43  REveLine(const REveLine &l);
44  virtual ~REveLine() {}
45 
46  void SetMarkerColor(Color_t col) override;
47 
48  void SetLineColor(Color_t col) override { SetMainColor(col); }
49  void SetLineStyle(Style_t lstyle) override;
50  void SetLineWidth(Width_t lwidth) override;
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  REveVector GetLineStart() const;
63  REveVector GetLineEnd() const;
64 
65  void CopyVizParams(const REveElement *el) override;
66  void WriteVizParams(std::ostream &out, const TString &var) override;
67 
68  TClass *ProjectedClass(const REveProjection *p) const override;
69 
70  Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset) override;
71  void BuildRenderData() override;
72 
73  static Bool_t GetDefaultSmooth();
74  static void SetDefaultSmooth(Bool_t r);
75 };
76 
77 //------------------------------------------------------------------------------
78 // REveLineProjected
79 //------------------------------------------------------------------------------
80 
81 class REveLineProjected : public REveLine, public REveProjected {
82 private:
83  REveLineProjected(const REveLineProjected &); // Not implemented
84  REveLineProjected &operator=(const REveLineProjected &); // Not implemented
85 
86 protected:
87  void SetDepthLocal(Float_t d) override;
88 
89 public:
90  REveLineProjected();
91  virtual ~REveLineProjected() {}
92 
93  void SetProjection(REveProjectionManager *mng, REveProjectable *model) override;
94  void UpdateProjection() override;
95  REveElement *GetProjectedAsElement() override { return this; }
96 };
97 
98 } // namespace Experimental
99 } // namespace ROOT
100 
101 #endif