Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
19#include "ROOT/REveElement.hxx"
22#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,
40private:
43
44public:
45 struct Line_t
46 {
50
52 Float_t x2, Float_t y2, Float_t z2) : fId(-1)
53 {
54 fV1[0] = x1; fV1[1] = y1; fV1[2] = z1;
55 fV2[0] = x2; fV2[1] = y2; fV2[2] = z2;
56 }
57 };
58
59 struct Marker_t
60 {
63
64 Marker_t(Float_t x, Float_t y, Float_t z, Int_t line_id) : fLineId(line_id)
65 {
66 fV[0] = x; fV[1] = y; fV[2] = z;
67 }
68 };
69
70protected:
73
74 Bool_t fOwnLinesIds; // Flag specifying if id-objects are owned by the line-set
75 Bool_t fOwnMarkersIds; // Flag specifying if id-objects are owned by the line-set
76
79
81
82 Line_t *fLastLine{nullptr}; ///<!
83
84public:
85 REveStraightLineSet(const std::string &n="StraightLineSet", const std::string &t="");
87
88 void SetLineColor(Color_t col) override { SetMainColor(col); }
89
91 Line_t *AddLine(const REveVector& p1, const REveVector& p2);
92 Marker_t *AddMarker(Float_t x, Float_t y, Float_t z, Int_t line_id=-1);
93 Marker_t *AddMarker(const REveVector& p, Int_t line_id=-1);
94 Marker_t *AddMarker(Int_t line_id, Float_t pos);
95
96 void SetLine(int idx, Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2);
97 void SetLine(int idx, const REveVector& p1, const REveVector& p2);
98
101
102 virtual Bool_t GetRnrMarkers() { return fRnrMarkers; }
103 virtual Bool_t GetRnrLines() { return fRnrLines; }
104 virtual Bool_t GetDepthTest() { return fDepthTest; }
105
106 virtual void SetRnrMarkers(Bool_t x) { fRnrMarkers = x; }
107 virtual void SetRnrLines(Bool_t x) { fRnrLines = x; }
108 virtual void SetDepthTest(Bool_t x) { fDepthTest = x; }
109
110 void CopyVizParams(const REveElement* el) override;
111 void WriteVizParams(std::ostream& out, const TString& var) override;
112
113 TClass* ProjectedClass(const REveProjection* p) const override;
114
115 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
116 void BuildRenderData() override;
117
118 void ComputeBBox() override;
119};
120
121///////////////////////////////////////////////////////////////////////////////
122/// REveStraightLineSetProjected
123/// Projected copy of a REveStraightLineSet.
124///////////////////////////////////////////////////////////////////////////////
125
127 public REveProjected
128{
129private:
132
133protected:
134 void SetDepthLocal(Float_t d) override;
135
136public:
139
140 void SetProjection(REveProjectionManager* mng, REveProjectable* model) override;
141 void UpdateProjection() override;
142 REveElement* GetProjectedAsElement() override { return this; }
143};
144
145} // namespace Experimental
146} // namespace ROOT
147
148#endif
#define d(i)
Definition RSha256.hxx:102
short Color_t
Color number (short)
Definition RtypesCore.h:100
short Marker_t
Marker number (short)
Definition RtypesCore.h:98
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:72
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char y1
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 &)=delete
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.
REveStraightLineSetProjected & operator=(const REveStraightLineSetProjected &)=delete
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
Fill the bounding box (virtual from REveElement).
REveStraightLineSet(const REveStraightLineSet &)=delete
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.
REveStraightLineSet & operator=(const REveStraightLineSet &)=delete
void WriteVizParams(std::ostream &out, const TString &var) override
Write visualization parameters.
void SetLineColor(Color_t col) override
Set the line color.
Line Attributes class.
Definition TAttLine.h:21
Marker Attributes class.
Definition TAttMarker.h:22
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:84
This is the base class for the ROOT Random number generators.
Definition TRandom.h:28
Basic string class.
Definition TString.h:137
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
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)