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