12 #ifndef ROOT7_REvePointSet
13 #define ROOT7_REvePointSet
25 namespace Experimental {
34 class REvePointSet :
public REveElement,
35 public REveProjectable,
39 friend class REvePointSetArray;
42 REvePointSet &operator=(
const REvePointSet &);
45 std::vector<REveVector> fPoints;
50 REvePointSet(
const std::string& name=
"",
const std::string& title=
"", Int_t n_points = 0);
51 REvePointSet(
const REvePointSet &e);
52 virtual ~REvePointSet();
54 REvePointSet *CloneElement()
const override {
return new REvePointSet(*
this); }
56 virtual void ClonePoints(
const REvePointSet &e);
58 void Reset(Int_t n_points = 0);
59 Int_t GrowFor(Int_t n_points);
61 int SetNextPoint(
float x,
float y,
float z);
62 int SetPoint(
int n,
float x,
float y,
float z);
64 int GetCapacity()
const {
return fCapacity; }
65 int GetSize()
const {
return fSize; }
67 REveVector& RefPoint(
int n) { assert (n < fSize);
return fPoints[n]; }
68 const REveVector& RefPoint(
int n)
const { assert (n < fSize);
return fPoints[n]; }
70 void SetMarkerColor(Color_t col)
override { SetMainColor(col); }
71 void SetMarkerStyle(Style_t mstyle = 1)
override;
72 void SetMarkerSize(Size_t msize = 1)
override;
74 void CopyVizParams(
const REveElement *el)
override;
75 void WriteVizParams(std::ostream &out,
const TString &var)
override;
77 TClass* ProjectedClass(
const REveProjection *p)
const override;
79 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset)
override;
80 void BuildRenderData()
override;
82 void ComputeBBox()
override;
84 void PointSelected(Int_t
id);
93 class REvePointSetArray :
public REveElement,
94 public REveProjectable,
97 REvePointSetArray(
const REvePointSetArray &);
98 REvePointSetArray &operator=(
const REvePointSetArray &);
101 REvePointSet **fBins{
nullptr};
102 Int_t fDefPointSetCapacity;
105 Double_t fMin, fCurMin;
106 Double_t fMax, fCurMax;
108 std::string fQuantName;
111 REvePointSetArray(
const std::string &name =
"REvePointSetArray",
const std::string &title =
"");
112 virtual ~REvePointSetArray();
114 void RemoveElementLocal(REveElement *el)
override;
115 void RemoveElementsLocal()
override;
117 void SetMarkerColor(Color_t tcolor = 1)
override;
118 void SetMarkerStyle(Style_t mstyle = 1)
override;
119 void SetMarkerSize(Size_t msize = 1)
override;
121 Int_t Size(Bool_t under = kFALSE, Bool_t over = kFALSE)
const;
123 void InitBins(
const std::string& quant_name, Int_t nbins, Double_t min, Double_t max);
124 Bool_t Fill(Double_t x, Double_t y, Double_t z, Double_t quant);
127 Int_t GetDefPointSetCapacity()
const {
return fDefPointSetCapacity; }
128 void SetDefPointSetCapacity(Int_t c) { fDefPointSetCapacity = c; }
130 Int_t GetNBins()
const {
return fNBins; }
131 REvePointSet *GetBin(Int_t bin)
const {
return fBins[bin]; }
133 Double_t GetMin()
const {
return fMin; }
134 Double_t GetCurMin()
const {
return fCurMin; }
135 Double_t GetMax()
const {
return fMax; }
136 Double_t GetCurMax()
const {
return fCurMax; }
138 void SetRange(Double_t min, Double_t max);
146 class REvePointSetProjected :
public REvePointSet,
150 REvePointSetProjected(
const REvePointSetProjected &);
151 REvePointSetProjected &operator=(
const REvePointSetProjected &);
154 void SetDepthLocal(Float_t d)
override;
157 REvePointSetProjected();
158 virtual ~REvePointSetProjected() {}
160 void SetProjection(REveProjectionManager *proj, REveProjectable *model)
override;
161 void UpdateProjection()
override;
162 REveElement *GetProjectedAsElement()
override {
return this; }
164 void PointSelected(Int_t
id);