Logo ROOT  
Reference Guide
REveStraightLineSet.hxx
Go to the documentation of this file.
1 // @(#)root/eve7:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
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 ROOT_REveStraightLineSet
13 #define ROOT_REveStraightLineSet
14 
15 #include "TNamed.h"
16 #include "TAttMarker.h"
17 #include "TAttLine.h"
18 #include "TAttBBox.h"
19 
20 #include "ROOT/REveElement.hxx"
23 #include "ROOT/REveTrans.hxx"
25 
26 class TRandom;
27 
28 namespace ROOT {
29 namespace Experimental {
30 
31 ///////////////////////////////////////////////////////////////////////////////
32 /// REveStraightLineSet
33 /// Set of straight lines with optional markers along the lines.
34 ///////////////////////////////////////////////////////////////////////////////
35 
37  public REveProjectable,
38  public TAttLine,
39  public TAttMarker,
40  public TAttBBox,
42 {
43 private:
46 
47 public:
48  struct Line_t
49  {
53 
55  Float_t x2, Float_t y2, Float_t z2) : fId(-1)
56  {
57  fV1[0] = x1; fV1[1] = y1; fV1[2] = z1;
58  fV2[0] = x2; fV2[1] = y2; fV2[2] = z2;
59  }
60  };
61 
62  struct Marker_t
63  {
64  Float_t fV[3];
66 
67  Marker_t(Float_t x, Float_t y, Float_t z, Int_t line_id) : fLineId(line_id)
68  {
69  fV[0] = x; fV[1] = y; fV[2] = z;
70  }
71  };
72 
73 protected:
76 
77  Bool_t fOwnLinesIds; // Flag specifying if id-objects are owned by the line-set
78  Bool_t fOwnMarkersIds; // Flag specifying if id-objects are owned by the line-set
79 
82 
84 
85  Line_t *fLastLine{nullptr}; ///<!
86 
87 public:
88  REveStraightLineSet(const std::string &n="StraightLineSet", const std::string &t="");
89  virtual ~REveStraightLineSet() {}
90 
91  void SetLineColor(Color_t col) override { SetMainColor(col); }
92 
93  Line_t *AddLine(Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2);
94  Line_t *AddLine(const REveVector& p1, const REveVector& p2);
95  Marker_t *AddMarker(Float_t x, Float_t y, Float_t z, Int_t line_id=-1);
96  Marker_t *AddMarker(const REveVector& p, Int_t line_id=-1);
97  Marker_t *AddMarker(Int_t line_id, Float_t pos);
98 
99  void SetLine(int idx, Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2);
100  void SetLine(int idx, const REveVector& p1, const REveVector& p2);
101 
104 
105  virtual Bool_t GetRnrMarkers() { return fRnrMarkers; }
106  virtual Bool_t GetRnrLines() { return fRnrLines; }
107  virtual Bool_t GetDepthTest() { return fDepthTest; }
108 
109  virtual void SetRnrMarkers(Bool_t x) { fRnrMarkers = x; }
110  virtual void SetRnrLines(Bool_t x) { fRnrLines = x; }
111  virtual void SetDepthTest(Bool_t x) { fDepthTest = x; }
112 
113  void CopyVizParams(const REveElement* el) override;
114  void WriteVizParams(std::ostream& out, const TString& var) override;
115 
116  TClass* ProjectedClass(const REveProjection* p) const override;
117 
118  Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
119  void BuildRenderData() override;
120 
121  void ComputeBBox() override;
122 };
123 
124 
125 ///////////////////////////////////////////////////////////////////////////////
126 /// REveStraightLineSetProjected
127 /// Projected copy of a REveStraightLineSet.
128 ///////////////////////////////////////////////////////////////////////////////
129 
131  public REveProjected
132 {
133 private:
136 
137 protected:
138  void SetDepthLocal(Float_t d) override;
139 
140 public:
143 
145  void UpdateProjection() override;
146  REveElement* GetProjectedAsElement() override { return this; }
147 };
148 
149 } // namespace Experimental
150 } // namespace ROOT
151 
152 #endif
ROOT::Experimental::REveStraightLineSet::Marker_t
Definition: REveStraightLineSet.hxx:63
ROOT::Experimental::REveProjected
Definition: REveProjectionBases.hxx:81
n
const Int_t n
Definition: legend1.C:16
ROOT::Experimental::REveStraightLineSet::BuildRenderData
void BuildRenderData() override
Crates 3D point array for rendering.
Definition: REveStraightLineSet.cxx:175
ROOT::Experimental::REveStraightLineSet::fOwnLinesIds
Bool_t fOwnLinesIds
Definition: REveStraightLineSet.hxx:77
ROOT::Experimental::REveStraightLineSet::GetLinePlex
REveChunkManager & GetLinePlex()
Definition: REveStraightLineSet.hxx:102
ROOT::Experimental::REveStraightLineSet::GetRnrLines
virtual Bool_t GetRnrLines()
Definition: REveStraightLineSet.hxx:106
ROOT::Experimental::REveStraightLineSetProjected::~REveStraightLineSetProjected
virtual ~REveStraightLineSetProjected()
Definition: REveStraightLineSet.hxx:142
ROOT::Experimental::REveSecondarySelectable
Definition: REveSecondarySelectable.hxx:25
ROOT::Experimental::REveStraightLineSet::Line_t::Line_t
Line_t(Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2)
Definition: REveStraightLineSet.hxx:54
ROOT::Experimental::REveStraightLineSet::Line_t::fId
Int_t fId
Definition: REveStraightLineSet.hxx:50
REveChunkManager.hxx
ROOT::Experimental::REveStraightLineSet::Marker_t::fV
Float_t fV[3]
Definition: REveStraightLineSet.hxx:64
REveProjectionBases.hxx
ROOT::Experimental::REveStraightLineSet::WriteCoreJson
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Fill core part of JSON representation.
Definition: REveStraightLineSet.cxx:157
REveTrans.hxx
TNamed.h
ROOT::Experimental::REveStraightLineSet::WriteVizParams
void WriteVizParams(std::ostream &out, const TString &var) override
Write visualization parameters.
Definition: REveStraightLineSet.cxx:141
ROOT::Experimental::REveStraightLineSet::Line_t::fV2
Float_t fV2[3]
Definition: REveStraightLineSet.hxx:52
ROOT::Experimental::REveStraightLineSet::fLinePlex
REveChunkManager fLinePlex
Definition: REveStraightLineSet.hxx:74
ROOT::Experimental::REveStraightLineSet::SetDepthTest
virtual void SetDepthTest(Bool_t x)
Definition: REveStraightLineSet.hxx:111
REveSecondarySelectable.hxx
ROOT::Experimental::REveStraightLineSet
REveStraightLineSet Set of straight lines with optional markers along the lines.
Definition: REveStraightLineSet.hxx:42
TAttMarker.h
Float_t
float Float_t
Definition: RtypesCore.h:57
Int_t
int Int_t
Definition: RtypesCore.h:45
ROOT::Experimental::REveStraightLineSet::AddLine
Line_t * AddLine(Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2)
Add a line.
Definition: REveStraightLineSet.cxx:48
ROOT::Experimental::REveStraightLineSetProjected::SetProjection
void SetProjection(REveProjectionManager *mng, REveProjectable *model) override
Set projection manager and model object.
Definition: REveStraightLineSet.cxx:259
x
Double_t x[n]
Definition: legend1.C:17
ROOT::Experimental::REveStraightLineSet::GetMarkerPlex
REveChunkManager & GetMarkerPlex()
Definition: REveStraightLineSet.hxx:103
ROOT::Experimental::REveStraightLineSetProjected::SetDepthLocal
void SetDepthLocal(Float_t d) override
Set depth (z-coordinate) of the projected points.
Definition: REveStraightLineSet.cxx:270
ROOT::Experimental::REveStraightLineSet::ComputeBBox
void ComputeBBox() override
Compute bounding-box.
Definition: REveStraightLineSet.cxx:218
TString
Basic string class.
Definition: TString.h:136
ROOT::Experimental::REveElement
Definition: REveElement.hxx:41
ROOT::Experimental::REveVectorT< Float_t >
Color_t
short Color_t
Definition: RtypesCore.h:83
ROOT::Experimental::REveStraightLineSet::REveStraightLineSet
REveStraightLineSet(const REveStraightLineSet &)=delete
bool
ROOT::Experimental::REveProjection
REveProjection Base for specific classes that implement non-linear projections.
Definition: REveProjections.hxx:30
x1
static const double x1[5]
Definition: RooGaussKronrodIntegrator1D.cxx:346
TAttBBox
Helper for management of bounding-box information.
Definition: TAttBBox.h:18
Marker_t
short Marker_t
Definition: RtypesCore.h:81
TAttLine.h
ROOT::Experimental::REveChunkManager
Definition: REveChunkManager.hxx:29
ROOT::Experimental::REveStraightLineSet::Marker_t::fLineId
Int_t fLineId
Definition: REveStraightLineSet.hxx:65
ROOT::Experimental::REveStraightLineSetProjected::GetProjectedAsElement
REveElement * GetProjectedAsElement() override
Returns this projected dynamic-casted to REveElement.
Definition: REveStraightLineSet.hxx:146
TRandom
This is the base class for the ROOT Random number generators.
Definition: TRandom.h:27
TAttLine
Line Attributes class.
Definition: TAttLine.h:18
REveElement.hxx
TAttBBox.h
ROOT::Experimental::REveStraightLineSetProjected::REveStraightLineSetProjected
REveStraightLineSetProjected(const REveStraightLineSetProjected &)=delete
ROOT::Experimental::REveStraightLineSet::SetLineColor
void SetLineColor(Color_t col) override
Set the line color.
Definition: REveStraightLineSet.hxx:91
ROOT::Experimental::REveStraightLineSet::ProjectedClass
TClass * ProjectedClass(const REveProjection *p) const override
Return class of projected object.
Definition: REveStraightLineSet.cxx:209
ROOT::Experimental::REveProjectable
Definition: REveProjectionBases.hxx:38
ROOT::Experimental::REveStraightLineSetProjected::operator=
REveStraightLineSetProjected & operator=(const REveStraightLineSetProjected &)=delete
ROOT::Experimental::REveStraightLineSet::fRnrLines
Bool_t fRnrLines
Definition: REveStraightLineSet.hxx:81
TAttMarker
Marker Attributes class.
Definition: TAttMarker.h:19
y
Double_t y[n]
Definition: legend1.C:17
ROOT::Experimental::REveStraightLineSet::fOwnMarkersIds
Bool_t fOwnMarkersIds
Definition: REveStraightLineSet.hxx:78
ROOT::Experimental::REveStraightLineSet::AddMarker
Marker_t * AddMarker(Float_t x, Float_t y, Float_t z, Int_t line_id=-1)
Add a marker with given position.
Definition: REveStraightLineSet.cxx:92
ROOT::Experimental::REveStraightLineSet::fDepthTest
Bool_t fDepthTest
Definition: REveStraightLineSet.hxx:83
ROOT::Experimental::REveStraightLineSet::CopyVizParams
void CopyVizParams(const REveElement *el) override
Copy visualization parameters from element el.
Definition: REveStraightLineSet.cxx:123
ROOT::Experimental::REveStraightLineSet::GetDepthTest
virtual Bool_t GetDepthTest()
Definition: REveStraightLineSet.hxx:107
ROOT::Experimental::REveStraightLineSet::Line_t::fV1
Float_t fV1[3]
Definition: REveStraightLineSet.hxx:51
ROOT::Experimental::REveStraightLineSet::SetLine
void SetLine(int idx, Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2)
Set line vertices with given index.
Definition: REveStraightLineSet.cxx:69
ROOT::Experimental::REveStraightLineSet::operator=
REveStraightLineSet & operator=(const REveStraightLineSet &)=delete
ROOT::Experimental::REveStraightLineSetProjected::UpdateProjection
void UpdateProjection() override
Callback that actually performs the projection.
Definition: REveStraightLineSet.cxx:294
ROOT::Experimental::REveStraightLineSet::fMarkerPlex
REveChunkManager fMarkerPlex
Definition: REveStraightLineSet.hxx:75
ROOT::Experimental::REveStraightLineSetProjected
REveStraightLineSetProjected Projected copy of a REveStraightLineSet.
Definition: REveStraightLineSet.hxx:132
TClass
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
ROOT::Experimental::REveStraightLineSet::fLastLine
Line_t * fLastLine
!
Definition: REveStraightLineSet.hxx:85
ROOT::Experimental::REveStraightLineSet::SetRnrMarkers
virtual void SetRnrMarkers(Bool_t x)
Definition: REveStraightLineSet.hxx:109
d
#define d(i)
Definition: RSha256.hxx:102
x2
static const double x2[5]
Definition: RooGaussKronrodIntegrator1D.cxx:364
ROOT::Experimental::REveStraightLineSet::Line_t
Definition: REveStraightLineSet.hxx:49
make_cnn_model.model
model
Definition: make_cnn_model.py:6
ROOT::Experimental::REveStraightLineSet::fRnrMarkers
Bool_t fRnrMarkers
Definition: REveStraightLineSet.hxx:80
ROOT::Experimental::REveProjectionManager
REveProjectionManager Manager class for steering of projections and managing projected objects.
Definition: REveProjectionManager.hxx:30
ROOT::Experimental::REveStraightLineSet::GetRnrMarkers
virtual Bool_t GetRnrMarkers()
Definition: REveStraightLineSet.hxx:105
ROOT
VSD Structures.
Definition: StringConv.hxx:21
ROOT::Experimental::REveStraightLineSet::~REveStraightLineSet
virtual ~REveStraightLineSet()
Definition: REveStraightLineSet.hxx:89
ROOT::Experimental::REveElement::SetMainColor
virtual void SetMainColor(Color_t color)
Set main color of the element.
Definition: REveElement.cxx:684
ROOT::Experimental::REveStraightLineSet::Marker_t::Marker_t
Marker_t(Float_t x, Float_t y, Float_t z, Int_t line_id)
Definition: REveStraightLineSet.hxx:67
ROOT::Experimental::REveStraightLineSetProjected::REveStraightLineSetProjected
REveStraightLineSetProjected()
Constructor.
Definition: REveStraightLineSet.cxx:251
int
ROOT::Experimental::REveStraightLineSet::SetRnrLines
virtual void SetRnrLines(Bool_t x)
Definition: REveStraightLineSet.hxx:110