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"
24
25class TRandom;
26
27namespace ROOT {
28namespace Experimental {
29
30///////////////////////////////////////////////////////////////////////////////
31/// REveStraightLineSet
32/// Set of straight lines with optional markers along the lines.
33///////////////////////////////////////////////////////////////////////////////
34
36 public REveProjectable,
37 public TAttLine,
38 public TAttMarker,
39 public TAttBBox
40{
41private:
42 REveStraightLineSet(const REveStraightLineSet&); // Not implemented
44
45public:
46 struct Line_t
47 {
51
53 Float_t x2, Float_t y2, Float_t z2) : fId(-1)
54 {
55 fV1[0] = x1, fV1[1] = y1, fV1[2] = z1;
56 fV2[0] = x2, fV2[1] = y2, fV2[2] = z2;
57 }
58 };
59
60 struct Marker_t
61 {
64
65 Marker_t(Float_t x, Float_t y, Float_t z, Int_t line_id) : fLineId(line_id)
66 {
67 fV[0] = x, fV[1] = y, fV[2] = z;
68 }
69 };
70
71protected:
74
75 Bool_t fOwnLinesIds; // Flag specifying if id-objects are owned by the line-set
76 Bool_t fOwnMarkersIds; // Flag specifying if id-objects are owned by the line-set
77
80
82
83 Line_t *fLastLine{nullptr}; ///<!
84
85public:
86 REveStraightLineSet(const std::string &n="StraightLineSet", const std::string &t="");
88
89 void SetLineColor(Color_t col) override { SetMainColor(col); }
90
91 Line_t *AddLine(Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2);
92 Line_t *AddLine(const REveVector& p1, const REveVector& p2);
93 Marker_t *AddMarker(Float_t x, Float_t y, Float_t z, Int_t line_id=-1);
94 Marker_t *AddMarker(const REveVector& p, Int_t line_id=-1);
95 Marker_t *AddMarker(Int_t line_id, Float_t pos);
96
97 void SetLine(int idx, Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2);
98 void SetLine(int idx, const REveVector& p1, const REveVector& p2);
99
102
103 virtual Bool_t GetRnrMarkers() { return fRnrMarkers; }
104 virtual Bool_t GetRnrLines() { return fRnrLines; }
105 virtual Bool_t GetDepthTest() { return fDepthTest; }
106
107 virtual void SetRnrMarkers(Bool_t x) { fRnrMarkers = x; }
108 virtual void SetRnrLines(Bool_t x) { fRnrLines = x; }
109 virtual void SetDepthTest(Bool_t x) { fDepthTest = x; }
110
111 void CopyVizParams(const REveElement* el) override;
112 void WriteVizParams(std::ostream& out, const TString& var) override;
113
114 TClass* ProjectedClass(const REveProjection* p) const override;
115
116 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
117 void BuildRenderData() override;
118
119 void ComputeBBox() override;
120};
121
122
123///////////////////////////////////////////////////////////////////////////////
124/// REveStraightLineSetProjected
125/// Projected copy of a REveStraightLineSet.
126///////////////////////////////////////////////////////////////////////////////
127
129 public REveProjected
130{
131private:
134
135protected:
136 void SetDepthLocal(Float_t d) override;
137
138public:
141
142 void SetProjection(REveProjectionManager* mng, REveProjectable* model) override;
143 void UpdateProjection() override;
144 REveElement* GetProjectedAsElement() override { return this; }
145};
146
147} // namespace Experimental
148} // namespace ROOT
149
150#endif
#define d(i)
Definition: RSha256.hxx:102
static const double x2[5]
static const double x1[5]
int Int_t
Definition: RtypesCore.h:41
short Marker_t
Definition: RtypesCore.h:77
bool Bool_t
Definition: RtypesCore.h:59
short Color_t
Definition: RtypesCore.h:79
float Float_t
Definition: RtypesCore.h:53
virtual void SetMainColor(Color_t color)
Set main color of the element.
REveProjectionManager Manager class for steering of projections and managing projected objects.
REveProjection Base for specific classes that implement non-linear projections.
REveStraightLineSetProjected Projected copy of a REveStraightLineSet.
REveStraightLineSetProjected(const REveStraightLineSetProjected &)
REveStraightLineSetProjected & operator=(const REveStraightLineSetProjected &)
void UpdateProjection() override
Callback that actually performs the projection.
REveElement * GetProjectedAsElement() override
Returns this projected dynamic-casted to REveElement.
void SetDepthLocal(Float_t d) override
Set depth (z-coordinate) of the projected points.
void SetProjection(REveProjectionManager *mng, REveProjectable *model) override
Set projection manager and model object.
REveStraightLineSet Set of straight lines with optional markers along the lines.
Line_t * AddLine(Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2)
Add a line.
Marker_t * AddMarker(Float_t x, Float_t y, Float_t z, Int_t line_id=-1)
Add a marker with given position.
TClass * ProjectedClass(const REveProjection *p) const override
Return class of projected object.
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Fill core part of JSON representation.
void BuildRenderData() override
Crates 3D point array for rendering.
void ComputeBBox() override
Compute bounding-box.
REveStraightLineSet & operator=(const REveStraightLineSet &)
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.
void CopyVizParams(const REveElement *el) override
Copy visualization parameters from element el.
void WriteVizParams(std::ostream &out, const TString &var) override
Write visualization parameters.
void SetLineColor(Color_t col) override
Set the line color.
REveStraightLineSet(const REveStraightLineSet &)
Helper for management of bounding-box information.
Definition: TAttBBox.h:18
Line Attributes class.
Definition: TAttLine.h:18
Marker Attributes class.
Definition: TAttMarker.h:19
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:75
This is the base class for the ROOT Random number generators.
Definition: TRandom.h:27
Basic string class.
Definition: TString.h:131
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
const Int_t n
Definition: legend1.C:16
VSD Structures.
Definition: StringConv.hxx:21
Line_t(Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2)
Marker_t(Float_t x, Float_t y, Float_t z, Int_t line_id)