Logo ROOT   6.21/01
Reference Guide
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 &) = delete;
33 
34 protected:
38 
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);
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 &) = delete;
85 
86 protected:
87  void SetDepthLocal(Float_t d) override;
88 
89 public:
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
void SetRnrLine(Bool_t r)
Set rendering of line. Propagate to projected lines.
Definition: REveLine.cxx:113
short Style_t
Definition: RtypesCore.h:76
Returns the available number of logical cores.
Definition: StringConv.hxx:21
float Float_t
Definition: RtypesCore.h:53
REveLine(const std::string &name="", const std::string &title="", Int_t n_points=0)
Constructor.
Definition: REveLine.cxx:34
Basic string class.
Definition: TString.h:131
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Bool_t GetRnrLine() const
Definition: REveLine.hxx:52
void SetSmooth(Bool_t r)
Set smooth rendering. Propagate to projected lines.
Definition: REveLine.cxx:149
static Bool_t GetDefaultSmooth()
Get default value for smooth-line drawing flag.
Definition: REveLine.cxx:311
Float_t CalculateLineLength() const
Sum-up lengths of individual segments.
Definition: REveLine.cxx:209
void SetLineWidth(Width_t lwidth) override
Set line-style of the line.
Definition: REveLine.cxx:95
void ReduceSegmentLengths(Float_t max)
Make sure that no segment is longer than max.
Definition: REveLine.cxx:168
REveVector GetLineStart() const
Return the first point of the line.
Definition: REveLine.cxx:225
void SetLineColor(Color_t col) override
Set the line color.
Definition: REveLine.hxx:48
void CopyVizParams(const REveElement *el) override
Copy visualization parameters from element el.
Definition: REveLine.cxx:246
REveProjection Base for specific classes that implement non-linear projections.
short Color_t
Definition: RtypesCore.h:79
static void SetDefaultSmooth(Bool_t r)
Set default value for smooth-line drawing flag (default kFALSE).
Definition: REveLine.cxx:320
void SetMarkerColor(Color_t col) override
Set marker color. Propagate to projected lines.
Definition: REveLine.cxx:59
REveElement * GetProjectedAsElement() override
Returns this projected dynamic-casted to REveElement.
Definition: REveLine.hxx:95
void WriteVizParams(std::ostream &out, const TString &var) override
Write visualization parameters.
Definition: REveLine.cxx:263
ROOT::R::TRInterface & r
Definition: Object.C:4
virtual void SetMainColor(Color_t color)
Set main color of the element.
void UpdateProjection() override
Re-apply the projection.
Definition: REveLine.cxx:368
REveProjectionManager Manager class for steering of projections and managing projected objects...
REveVector GetLineEnd() const
Return the last point of the line.
Definition: REveLine.cxx:236
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:75
TClass * ProjectedClass(const REveProjection *p) const override
Virtual from REveProjectable, returns REvePointSetProjected class.
Definition: REveLine.cxx:277
void SetRnrPoints(Bool_t r)
Set rendering of points. Propagate to projected lines.
Definition: REveLine.cxx:131
short Width_t
Definition: RtypesCore.h:78
void BuildRenderData() override
Virtual from REveElement. Prepares render data for binary streaming to client.
Definition: REveLine.cxx:298
#define d(i)
Definition: RSha256.hxx:102
REveLineProjected & operator=(const REveLineProjected &)=delete
Bool_t GetRnrPoints() const
Definition: REveLine.hxx:53
Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset) override
Write core json.
Definition: REveLine.cxx:284
static Bool_t fgDefaultSmooth
Definition: REveLine.hxx:39
void SetProjection(REveProjectionManager *mng, REveProjectable *model) override
Set projection manager and projection model.
Definition: REveLine.cxx:344
auto * l
Definition: textangle.C:4
REveLine An arbitrary polyline with fixed line and marker attributes.
Definition: REveLine.hxx:28
void SetDepthLocal(Float_t d) override
Set depth (z-coordinate) of the projected points.
Definition: REveLine.cxx:354
REveLineProjected()
Default constructor.
Definition: REveLine.cxx:334
Line Attributes class.
Definition: TAttLine.h:18
Bool_t GetSmooth() const
Definition: REveLine.hxx:54
REveLine & operator=(const REveLine &)=delete
char name[80]
Definition: TGX11.cxx:109
void SetLineStyle(Style_t lstyle) override
Set line-style of the line.
Definition: REveLine.cxx:77