Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TEvePointSet.cxx
Go to the documentation of this file.
1// @(#)root/eve:$Id$
2// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2007, 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#include "TEvePointSet.h"
13
14#include "TEveManager.h"
16#include "TEveTrans.h"
17
18#include "TTree.h"
19#include "TTreePlayer.h"
20#include "TF3.h"
21
22/** \class TEvePointSet
23\ingroup TEve
24TEvePointSet is a render-element holding a collection of 3D points with
25optional per-point TRef and an arbitrary number of integer ids (to
26be used for signal, volume-id, track-id, etc).
27
283D point representation is implemented in base-class TPolyMarker3D.
29Per-point TRef is implemented in base-class TPointSet3D.
30
31By using the TEvePointSelector the points and integer ids can be
32filled directly from a TTree holding the source data.
33Setting of per-point TRef's is not supported.
34
35TEvePointSet is a TEveProjectable: it can be projected by using the
36TEveProjectionManager class.
37*/
38
40
41////////////////////////////////////////////////////////////////////////////////
42/// Constructor.
43
46 TPointSet3D(n_points),
49 TQObject(),
50
51 fTitle (),
52 fIntIds (0),
53 fIntIdsPerPoint (0)
54{
55 fMarkerStyle = 20;
57
58 // Override from TEveElement.
60}
61
62////////////////////////////////////////////////////////////////////////////////
63/// Constructor.
64
65TEvePointSet::TEvePointSet(const char* name, Int_t n_points, ETreeVarType_e tv_type) :
67 TPointSet3D(n_points),
70 TQObject(),
71
72 fTitle (),
73 fIntIds (0),
74 fIntIdsPerPoint (0)
75{
76 fMarkerStyle = 20;
79
80 // Override from TEveElement.
82}
83
84////////////////////////////////////////////////////////////////////////////////
85/// Copy constructor.
86
92 TQObject(),
93
94 fTitle (e.fTitle),
95 fIntIds (e.fIntIds ? new TArrayI(*e.fIntIds) : 0),
96 fIntIdsPerPoint (e.fIntIdsPerPoint)
97{
98}
99
100////////////////////////////////////////////////////////////////////////////////
101/// Destructor.
102
104{
105 delete fIntIds;
106}
107
108////////////////////////////////////////////////////////////////////////////////
109/// Clone points and all point-related information from point-set 'e'.
110
112{
113 // TPolyMarker3D
114 delete [] fP;
115 fN = e.fN;
116 if (fN > 0)
117 {
118 const Int_t nn = 3 * e.fN;
119 fP = new Float_t [nn];
120 for (Int_t i = 0; i < nn; i++) fP[i] = e.fP[i];
121 } else {
122 fP = 0;
123 }
124 fLastPoint = e.fLastPoint;
125
126 // TPointSet3D
127 CopyIds(e);
128
129 // TEvePointSet
130 delete fIntIds;
131 fIntIds = e.fIntIds ? new TArrayI(*e.fIntIds) : 0;
132 fIntIdsPerPoint = e.fIntIdsPerPoint;
133}
134
135////////////////////////////////////////////////////////////////////////////////
136/// Return pointset icon.
137
139{
141}
142
143////////////////////////////////////////////////////////////////////////////////
144/// Drop all data and set-up the data structures to recive new data.
145/// n_points specifies the initial size of the arrays.
146/// n_int_ids specifies the number of integer ids per point.
147
148void TEvePointSet::Reset(Int_t n_points, Int_t n_int_ids)
149{
150 delete [] fP; fP = 0;
151 fN = n_points;
152 if (fN) {
153 fP = new Float_t [3*fN];
154 memset(fP, 0, 3*fN*sizeof(Float_t));
155 }
156 fLastPoint = -1;
157 ClearIds();
158 delete fIntIds; fIntIds = 0;
159 fIntIdsPerPoint = n_int_ids;
161 ResetBBox();
162}
163
164////////////////////////////////////////////////////////////////////////////////
165/// Resizes internal array to allow additional n_points to be stored.
166/// Returns the old size which is also the location where one can
167/// start storing new data.
168/// The caller is *obliged* to fill the new point slots.
169
171{
172 Int_t old_size = Size();
173 Int_t new_size = old_size + n_points;
174 SetPoint(new_size - 1, 0, 0, 0);
175 if (fIntIds)
176 fIntIds->Set(fIntIdsPerPoint * new_size);
177 return old_size;
178}
179
180////////////////////////////////////////////////////////////////////////////////
181/// Assert that size of IntId array is compatible with the size of
182/// the point array.
183
185{
186 Int_t exp_size = GetN()*fIntIdsPerPoint;
187 if (fIntIds->GetSize() < exp_size)
188 fIntIds->Set(exp_size);
189}
190
191////////////////////////////////////////////////////////////////////////////////
192/// Return a pointer to integer ids of point with index p.
193/// Existence of integer id array is checked, 0 is returned if it
194/// does not exist.
195/// Validity of p is *not* checked.
196
198{
199 if (fIntIds)
200 return fIntIds->GetArray() + p*fIntIdsPerPoint;
201 return 0;
202}
203
204////////////////////////////////////////////////////////////////////////////////
205/// Return i-th integer id of point with index p.
206/// Existence of integer id array is checked, kMinInt is returned if
207/// it does not exist.
208/// Validity of p and i is *not* checked.
209
211{
212 if (fIntIds)
213 return * (fIntIds->GetArray() + p*fIntIdsPerPoint + i);
214 return kMinInt;
215}
216
217////////////////////////////////////////////////////////////////////////////////
218/// Set integer ids for the last point that was registered (most
219/// probably via TPolyMarker3D::SetNextPoint(x,y,z)).
220
222{
224}
225
226////////////////////////////////////////////////////////////////////////////////
227/// Set integer ids for point with index n.
228
230{
231 if (!fIntIds) return;
234 for (Int_t i=0; i<fIntIdsPerPoint; ++i)
235 x[i] = ids[i];
236}
237
238////////////////////////////////////////////////////////////////////////////////
239/// Set marker style, propagate to projecteds.
240
242{
243 static const TEveException eh("TEvePointSet::SetMarkerStyle ");
244
245 std::list<TEveProjected*>::iterator pi = fProjectedList.begin();
246 while (pi != fProjectedList.end())
247 {
248 TEvePointSet* pt = dynamic_cast<TEvePointSet*>(*pi);
249 if (pt)
250 {
251 pt->SetMarkerStyle(mstyle);
252 pt->StampObjProps();
253 }
254 ++pi;
255 }
257}
258
259////////////////////////////////////////////////////////////////////////////////
260/// Set marker size, propagate to projecteds.
261
263{
264 static const TEveException eh("TEvePointSet::SetMarkerSize ");
265
266 std::list<TEveProjected*>::iterator pi = fProjectedList.begin();
267 while (pi != fProjectedList.end())
268 {
269 TEvePointSet* pt = dynamic_cast<TEvePointSet*>(*pi);
270 if (pt)
271 {
272 pt->SetMarkerSize(msize);
273 pt->StampObjProps();
274 }
275 ++pi;
276 }
278}
279
280////////////////////////////////////////////////////////////////////////////////
281/// Paint point-set.
282
284{
285 PaintStandard(this);
286}
287
288////////////////////////////////////////////////////////////////////////////////
289/// Initialize point-set for new filling.
290/// subIdNum gives the number of integer ids that can be assigned to
291/// each point.
292
294{
295 if (subIdNum > 0) {
296 fIntIdsPerPoint = subIdNum;
297 if (!fIntIds)
299 else
301 } else {
302 delete fIntIds; fIntIds = 0;
303 fIntIdsPerPoint = 0;
304 }
305}
306
307////////////////////////////////////////////////////////////////////////////////
308/// Called from TEvePointSelector when internal arrays of the tree-selector
309/// are filled up and need to be processed.
310/// Virtual from TEvePointSelectorConsumer.
311
313{
314 static const TEveException eh("TEvePointSet::TakeAction ");
315
316 if(sel == 0)
317 throw(eh + "selector is <null>.");
318
319 Int_t n = sel->GetNfill();
320 Int_t beg = GrowFor(n);
321
322 // printf("TEvePointSet::TakeAction beg=%d n=%d size=%d nsubid=%d dim=%d\n",
323 // beg, n, Size(), sel->GetSubIdNum(), sel->GetDimension());
324
325 Double_t *vx = sel->GetV1(), *vy = sel->GetV2(), *vz = sel->GetV3();
326 Float_t *p = fP + 3*beg;
327
328 switch(fSourceCS) {
329 case kTVT_XYZ:
330 while(n-- > 0) {
331 p[0] = *vx; p[1] = *vy; p[2] = *vz;
332 p += 3;
333 ++vx; ++vy; ++vz;
334 }
335 break;
336 case kTVT_RPhiZ:
337 while(n-- > 0) {
338 p[0] = *vx * TMath::Cos(*vy); p[1] = *vx * TMath::Sin(*vy); p[2] = *vz;
339 p += 3;
340 ++vx; ++vy; ++vz;
341 }
342 break;
343 default:
344 throw(eh + "unknown tree variable type.");
345 }
346
347 if (fIntIds) {
348 Double_t** subarr = new Double_t* [fIntIdsPerPoint];
349 for (Int_t i=0; i<fIntIdsPerPoint; ++i) {
350 subarr[i] = sel->GetVal(sel->GetDimension() - fIntIdsPerPoint + i);
351 if (subarr[i] == 0) {
352 delete[] subarr;
353 throw(eh + "sub-id array not available.");
354 }
355 }
356 Int_t* ids = fIntIds->GetArray() + fIntIdsPerPoint*beg;
357 n = sel->GetNfill();
358 while (n-- > 0) {
359 for (Int_t i=0; i<fIntIdsPerPoint; ++i) {
360 ids[i] = TMath::Nint(*subarr[i]);
361 ++subarr[i];
362 }
363 ids += fIntIdsPerPoint;
364 }
365 delete [] subarr;
366 }
367}
368
369////////////////////////////////////////////////////////////////////////////////
370/// Copy visualization parameters from element el.
371
373{
374 const TEvePointSet* m = dynamic_cast<const TEvePointSet*>(el);
375 if (m)
376 {
377 TAttMarker::operator=(*m);
378 fOption = m->fOption;
379 }
380
382}
383
384////////////////////////////////////////////////////////////////////////////////
385/// Write visualization parameters.
386
387void TEvePointSet::WriteVizParams(std::ostream& out, const TString& var)
388{
390
392}
393
394////////////////////////////////////////////////////////////////////////////////
395/// Virtual from TEveProjectable, returns TEvePointSetProjected class.
396
398{
399 return TEvePointSetProjected::Class();
400}
401
402////////////////////////////////////////////////////////////////////////////////
403/// Virtual method of base class TPointSet3D. The function call is
404/// invoked with secondary selection in TPointSet3DGL.
405
407{
408 Emit("PointSelected(Int_t)", id);
410}
411
412//==============================================================================
413/** \class TEvePointSetArray
414\ingroup TEve
415An array of point-sets with each point-set playing a role of a bin
416in a histogram. When a new point is added to a TEvePointSetArray,
417an additional separating quantity needs to be specified: it
418determines into which TEvePointSet (bin) the point will actually be
419stored. Underflow and overflow bins are automatically created but
420they are not drawn by default.
421
422By using the TEvePointSelector the points and the separating
423quantities can be filled directly from a TTree holding the source
424data.
425Setting of per-point TRef's is not supported.
426
427After the filling, the range of separating variable can be
428controlled with a slider to choose a sub-set of PointSets that are
429actually shown.
430*/
431
433
434////////////////////////////////////////////////////////////////////////////////
435/// Constructor.
436
438 const char* title) :
439 TEveElement(),
440 TNamed(name, title),
441
442 fBins(0), fDefPointSetCapacity(128), fNBins(0), fLastBin(-1),
443 fMin(0), fCurMin(0), fMax(0), fCurMax(0),
444 fBinWidth(0),
445 fQuantName()
446{
447
449}
450
451////////////////////////////////////////////////////////////////////////////////
452/// Destructor: deletes the fBins array. Actual removal of
453/// elements done by TEveElement.
454
456{
457 // printf("TEvePointSetArray::~TEvePointSetArray()\n");
458 delete [] fBins; fBins = 0;
459}
460
461////////////////////////////////////////////////////////////////////////////////
462/// Virtual from TEveElement, provide bin management.
463
465{
466 for (Int_t i=0; i<fNBins; ++i) {
467 if (fBins[i] == el) {
468 fBins[i] = 0;
469 break;
470 }
471 }
472}
473
474////////////////////////////////////////////////////////////////////////////////
475/// Virtual from TEveElement, provide bin management.
476
478{
479 delete [] fBins; fBins = 0; fLastBin = -1;
480}
481
482////////////////////////////////////////////////////////////////////////////////
483/// Set marker color, propagate to children.
484
486{
487 static const TEveException eh("TEvePointSetArray::SetMarkerColor ");
488
489 for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
490 TAttMarker* m = dynamic_cast<TAttMarker*>((*i)->GetObject(eh));
491 if (m && m->GetMarkerColor() == fMarkerColor)
492 m->SetMarkerColor(tcolor);
493 }
495}
496
497////////////////////////////////////////////////////////////////////////////////
498/// Set marker style, propagate to children.
499
501{
502 static const TEveException eh("TEvePointSetArray::SetMarkerStyle ");
503
504 for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
505 TAttMarker* m = dynamic_cast<TAttMarker*>((*i)->GetObject(eh));
506 if (m && m->GetMarkerStyle() == fMarkerStyle)
507 m->SetMarkerStyle(mstyle);
508 }
510}
511
512////////////////////////////////////////////////////////////////////////////////
513/// Set marker size, propagate to children.
514
516{
517 static const TEveException eh("TEvePointSetArray::SetMarkerSize ");
518
519 for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
520 TAttMarker* m = dynamic_cast<TAttMarker*>((*i)->GetObject(eh));
521 if (m && m->GetMarkerSize() == fMarkerSize)
522 m->SetMarkerSize(msize);
523 }
525}
526
527////////////////////////////////////////////////////////////////////////////////
528/// Called from TEvePointSelector when internal arrays of the tree-selector
529/// are filled up and need to be processed.
530/// Virtual from TEvePointSelectorConsumer.
531
533{
534 static const TEveException eh("TEvePointSetArray::TakeAction ");
535
536 if (sel == 0)
537 throw eh + "selector is <null>.";
538
539 Int_t n = sel->GetNfill();
540
541 // printf("TEvePointSetArray::TakeAction n=%d\n", n);
542
543 Double_t *vx = sel->GetV1(), *vy = sel->GetV2(), *vz = sel->GetV3();
544 Double_t *qq = sel->GetV4();
545
546 if (qq == 0)
547 throw eh + "requires 4-d varexp.";
548
549 switch (fSourceCS)
550 {
551 case kTVT_XYZ:
552 {
553 while (n-- > 0)
554 {
555 Fill(*vx, *vy, *vz, *qq);
556 ++vx; ++vy; ++vz; ++qq;
557 }
558 break;
559 }
560 case kTVT_RPhiZ:
561 {
562 while (n-- > 0)
563 {
564 Fill(*vx * TMath::Cos(*vy), *vx * TMath::Sin(*vy), *vz, *qq);
565 ++vx; ++vy; ++vz; ++qq;
566 }
567 break;
568 }
569 default:
570 {
571 throw eh + "unknown tree variable type.";
572 }
573 }
574}
575
576////////////////////////////////////////////////////////////////////////////////
577/// Get the total number of filled points.
578/// 'under' and 'over' flags specify if under/overflow channels
579/// should be added to the sum.
580
582{
583 Int_t size = 0;
584 const Int_t min = under ? 0 : 1;
585 const Int_t max = over ? fNBins : fNBins - 1;
586 for (Int_t i = min; i < max; ++i)
587 {
588 if (fBins[i])
589 size += fBins[i]->Size();
590 }
591 return size;
592}
593
594////////////////////////////////////////////////////////////////////////////////
595/// Initialize internal point-sets with given binning parameters.
596/// The actual number of bins is nbins+2, bin 0 corresponding to
597/// underflow and bin nbin+1 to owerflow pointset.
598
599void TEvePointSetArray::InitBins(const char* quant_name,
600 Int_t nbins, Double_t min, Double_t max)
601{
602 static const TEveException eh("TEvePointSetArray::InitBins ");
603
604 if (nbins < 1) throw eh + "nbins < 1.";
605 if (min > max) throw eh + "min > max.";
606
608
609 fQuantName = quant_name;
610 fNBins = nbins + 2; // under/overflow
611 fLastBin = -1;
612 fMin = fCurMin = min;
613 fMax = fCurMax = max;
614 fBinWidth = (fMax - fMin)/(fNBins - 2);
615
616 fBins = new TEvePointSet* [fNBins];
617
618 for (Int_t i = 0; i < fNBins; ++i)
619 {
620 fBins[i] = new TEvePointSet
621 (Form("Slice %d [%4.3lf, %4.3lf]", i, fMin + (i-1)*fBinWidth, fMin + i*fBinWidth),
626 AddElement(fBins[i]);
627 }
628
629 fBins[0]->SetName("Underflow");
631
632 fBins[fNBins-1]->SetName("Overflow");
634}
635
636////////////////////////////////////////////////////////////////////////////////
637/// Add a new point. Appropriate point-set will be chosen based on
638/// the value of the separating quantity 'quant'.
639/// If the selected bin does not have an associated TEvePointSet
640/// the point is discarded and false is returned.
641
643{
644 fLastBin = TMath::FloorNint((quant - fMin)/fBinWidth) + 1;
645
646 if (fLastBin < 0)
647 {
648 fLastBin = 0;
649 }
650 else if (fLastBin > fNBins - 1)
651 {
652 fLastBin = fNBins - 1;
653 }
654
655 if (fBins[fLastBin] != 0)
656 {
658 return kTRUE;
659 }
660 else
661 {
662 return kFALSE;
663 }
664}
665
666////////////////////////////////////////////////////////////////////////////////
667/// Set external object id of the last added point.
668
670{
671 if (fLastBin >= 0)
673}
674
675////////////////////////////////////////////////////////////////////////////////
676/// Call this after all the points have been filled.
677/// At this point we can calculate bounding-boxes of individual
678/// point-sets.
679
681{
682 for (Int_t i=0; i<fNBins; ++i)
683 {
684 if (fBins[i] != 0)
685 {
686 fBins[i]->SetTitle(Form("N=%d", fBins[i]->Size()));
687 fBins[i]->ComputeBBox();
688 }
689 }
690 fLastBin = -1;
691}
692
693////////////////////////////////////////////////////////////////////////////////
694/// Propagate id-object ownership to children.
695
697{
698 for (Int_t i=0; i<fNBins; ++i)
699 {
700 if (fBins[i] != 0)
701 fBins[i]->SetOwnIds(o);
702 }
703}
704
705////////////////////////////////////////////////////////////////////////////////
706/// Set active range of the separating quantity.
707/// Appropriate point-sets are tagged for rendering.
708/// Over/underflow point-sets are left as they were.
709
711{
712 using namespace TMath;
713
714 fCurMin = min; fCurMax = max;
715 Int_t low_b = Max(0, FloorNint((min-fMin)/fBinWidth)) + 1;
716 Int_t high_b = Min(fNBins-2, CeilNint ((max-fMin)/fBinWidth));
717
718 for (Int_t i = 1; i < fNBins - 1; ++i)
719 {
720 if (fBins[i] != 0)
721 fBins[i]->SetRnrSelf(i>=low_b && i<=high_b);
722 }
723}
724
725/** \class TEvePointSetProjected
726\ingroup TEve
727Projected copy of a TEvePointSet.
728*/
730
731////////////////////////////////////////////////////////////////////////////////
732/// Default contructor.
733
735 TEvePointSet (),
737{
738}
739
740////////////////////////////////////////////////////////////////////////////////
741/// Set projection manager and projection model.
742/// Virtual from TEveProjected.
743
745 TEveProjectable* model)
746{
747 TEveProjected::SetProjection(proj, model);
748 CopyVizParams(dynamic_cast<TEveElement*>(model));
749}
750
751////////////////////////////////////////////////////////////////////////////////
752/// Set depth (z-coordinate) of the projected points.
753
755{
756 SetDepthCommon(d, this, fBBox);
757
758 Int_t n = Size();
759 Float_t *p = GetP() + 2;
760 for (Int_t i = 0; i < n; ++i, p+=3)
761 *p = fDepth;
762}
763
764////////////////////////////////////////////////////////////////////////////////
765/// Re-apply the projection.
766/// Virtual from TEveProjected.
767
769{
771 TEvePointSet &ps = * dynamic_cast<TEvePointSet*>(fProjectable);
772 TEveTrans *tr = ps.PtrMainTrans(kFALSE);
773
774 Int_t n = ps.Size();
775 Reset(n);
776 fLastPoint = n - 1;
777 Float_t *o = ps.GetP(), *p = GetP();
778 for (Int_t i = 0; i < n; ++i, o+=3, p+=3)
779 {
780 proj.ProjectPointfv(tr, o, p, fDepth);
781 }
782}
783
784////////////////////////////////////////////////////////////////////////////////
785/// Virtual method of base class TPointSet3D.
786/// Forward to projectable.
787
789{
790 TEvePointSet *ps = dynamic_cast<TEvePointSet*>(fProjectable);
791 ps->PointSelected(id);
792}
#define d(i)
Definition RSha256.hxx:102
#define e(i)
Definition RSha256.hxx:103
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
const Int_t kMinInt
Definition RtypesCore.h:113
float Size_t
Definition RtypesCore.h:96
const Bool_t kFALSE
Definition RtypesCore.h:101
double Double_t
Definition RtypesCore.h:59
short Color_t
Definition RtypesCore.h:92
short Style_t
Definition RtypesCore.h:89
float Float_t
Definition RtypesCore.h:57
const Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:364
char name[80]
Definition TGX11.cxx:110
char * Form(const char *fmt,...)
Array of integers (32 bits per element).
Definition TArrayI.h:27
void Set(Int_t n)
Set size of this array to n ints.
Definition TArrayI.cxx:105
const Int_t * GetArray() const
Definition TArrayI.h:43
Int_t GetSize() const
Definition TArray.h:47
void ResetBBox()
Definition TAttBBox.h:46
Float_t * fBBox
Definition TAttBBox.h:20
Marker Attributes class.
Definition TAttMarker.h:19
virtual void SaveMarkerAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1)
Save line attributes as C++ statement(s) on output stream out.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Definition TAttMarker.h:38
Color_t fMarkerColor
Marker color.
Definition TAttMarker.h:22
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
Definition TAttMarker.h:40
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Definition TAttMarker.h:41
Size_t fMarkerSize
Marker size.
Definition TAttMarker.h:24
Style_t fMarkerStyle
Marker style.
Definition TAttMarker.h:23
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:80
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition TEveElement.h:36
virtual TEveTrans * PtrMainTrans(Bool_t create=kTRUE)
Return pointer to main transformation.
virtual void AddElement(TEveElement *el)
Add el to the list of children.
List_t fChildren
Definition TEveElement.h:81
virtual void RemoveElements()
Remove all elements.
void SetMainColorPtr(Color_t *color)
virtual void CopyVizParams(const TEveElement *el)
Copy visualization parameters from element el.
static const TGPicture * fgListTreeIcons[9]
Definition TEveElement.h:65
virtual void WriteVizParams(std::ostream &out, const TString &var)
Write-out visual parameters for this object.
List_t::iterator List_i
Definition TEveElement.h:72
virtual void PaintStandard(TObject *id)
Paint object – a generic implementation for EVE elements.
virtual Bool_t SetRnrSelf(Bool_t rnr)
Set render state of this element, i.e.
Bool_t fPickable
Exception class thrown by TEve classes and macros.
Definition TEveUtil.h:102
TEvePointSelectorConsumer is a virtual base for classes that can be filled from TTree data via the TE...
TEvePointSelector is a sub-class of TSelectorDraw for direct extraction of point-like data from a Tre...
An array of point-sets with each point-set playing a role of a bin in a histogram.
virtual ~TEvePointSetArray()
Destructor: deletes the fBins array.
virtual void SetMarkerSize(Size_t msize=1)
Set marker size, propagate to children.
void SetRange(Double_t min, Double_t max)
Set active range of the separating quantity.
TEvePointSet ** fBins
Double_t fMin
Index of the last filled TEvePointSet.
virtual void SetMarkerColor(Color_t tcolor=1)
Set marker color, propagate to children.
void CloseBins()
Call this after all the points have been filled.
virtual void RemoveElementsLocal()
Virtual from TEveElement, provide bin management.
void InitBins(const char *quant_name, Int_t nbins, Double_t min, Double_t max)
Initialize internal point-sets with given binning parameters.
virtual void TakeAction(TEvePointSelector *)
Called from TEvePointSelector when internal arrays of the tree-selector are filled up and need to be ...
virtual Int_t Size(Bool_t under=kFALSE, Bool_t over=kFALSE) const
Get the total number of filled points.
TEvePointSetArray(const TEvePointSetArray &)
virtual void SetMarkerStyle(Style_t mstyle=1)
Set marker style, propagate to children.
void SetPointId(TObject *id)
Set external object id of the last added point.
Bool_t Fill(Double_t x, Double_t y, Double_t z, Double_t quant)
Add a new point.
void SetOwnIds(Bool_t o)
Propagate id-object ownership to children.
virtual void RemoveElementLocal(TEveElement *el)
Virtual from TEveElement, provide bin management.
Projected copy of a TEvePointSet.
virtual void PointSelected(Int_t id)
Virtual method of base class TPointSet3D.
virtual void UpdateProjection()
Re-apply the projection.
TEvePointSetProjected()
Default contructor.
virtual void SetDepthLocal(Float_t d)
Set depth (z-coordinate) of the projected points.
virtual void SetProjection(TEveProjectionManager *proj, TEveProjectable *model)
Set projection manager and projection model.
TEvePointSet is a render-element holding a collection of 3D points with optional per-point TRef and a...
virtual void InitFill(Int_t subIdNum)
Initialize point-set for new filling.
void AssertIntIdsSize()
Assert that size of IntId array is compatible with the size of the point array.
virtual TClass * ProjectedClass(const TEveProjection *p) const
Virtual from TEveProjectable, returns TEvePointSetProjected class.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set marker style, propagate to projecteds.
virtual const TGPicture * GetListTreeIcon(Bool_t open=kFALSE)
Return pointset icon.
virtual void TakeAction(TEvePointSelector *)
Called from TEvePointSelector when internal arrays of the tree-selector are filled up and need to be ...
void SetPointIntIds(Int_t *ids)
Set integer ids for the last point that was registered (most probably via TPolyMarker3D::SetNextPoint...
virtual void ClonePoints(const TEvePointSet &e)
Clone points and all point-related information from point-set 'e'.
Int_t GetPointIntId(Int_t p, Int_t i) const
Return i-th integer id of point with index p.
virtual void CopyVizParams(const TEveElement *el)
Copy visualization parameters from element el.
virtual void SetMarkerColor(Color_t col)
Set the marker color.
TArrayI * fIntIds
virtual void SetTitle(const char *t)
virtual void WriteVizParams(std::ostream &out, const TString &var)
Write visualization parameters.
void Reset(Int_t n_points=0, Int_t n_int_ids=0)
Drop all data and set-up the data structures to recive new data.
Int_t GrowFor(Int_t n_points)
Resizes internal array to allow additional n_points to be stored.
virtual ~TEvePointSet()
Destructor.
virtual void Paint(Option_t *option="")
Paint point-set.
virtual void SetMarkerSize(Size_t msize=1)
Set marker size, propagate to projecteds.
TEvePointSet(Int_t n_points=0, ETreeVarType_e tv_type=kTVT_XYZ)
Constructor.
virtual void PointSelected(Int_t id)
Virtual method of base class TPointSet3D.
Int_t fIntIdsPerPoint
Int_t * GetPointIntIds(Int_t p) const
Return a pointer to integer ids of point with index p.
Abstract base-class for non-linear projectable objects.
Abstract base class for classes that hold results of a non-linear projection transformation.
TEveProjectable * fProjectable
TEveProjectionManager * fManager
virtual void SetProjection(TEveProjectionManager *mng, TEveProjectable *model)
Sets projection manager and reference in the projectable object.
void SetDepthCommon(Float_t d, TEveElement *el, Float_t *bbox)
Utility function to update the z-values of the bounding-box.
Manager class for steering of projections and managing projected objects.
TEveProjection * GetProjection()
Base-class for non-linear projections.
void ProjectPointfv(Float_t *v, Float_t d)
Project float array.
TEveTrans is a 4x4 transformation matrix for homogeneous coordinates stored internally in a column-ma...
Definition TEveTrans.h:27
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition TGPicture.h:25
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
Mother of all ROOT objects.
Definition TObject.h:41
TPolyMarker3D using TPointSet3DGL for direct OpenGL rendering.
Definition TPointSet3D.h:22
virtual void ComputeBBox()
Compute the bounding box of this points set.
virtual void PointSelected(Int_t n)
This virtual method is called from TPointSet3DGL when a point is selected.
void SetOwnIds(Bool_t o)
Definition TPointSet3D.h:52
void ClearIds()
Clears the id-array. If ids are owned the TObjects are deleted.
void CopyIds(const TPointSet3D &t)
Copy id objects from point-set 't'.
void SetPointId(TObject *id)
Set id of last point.
void SetPoint(Int_t n, Double_t x, Double_t y, Double_t z)
Set point n to x, y, z.
virtual Int_t Size() const
virtual Int_t GetN() const
virtual void SetName(const char *name)
Change (i.e.
virtual Float_t * GetP() const
virtual Int_t SetNextPoint(Double_t x, Double_t y, Double_t z)
Set point following LastPoint to x, y, z.
This is the ROOT implementation of the Qt object communication mechanism (see also http://www....
Definition TQObject.h:48
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition TQObject.h:164
virtual Double_t * GetV4() const
See TSelectorDraw::GetVal.
virtual Double_t * GetV2() const
See TSelectorDraw::GetVal.
virtual Double_t * GetV1() const
See TSelectorDraw::GetVal.
virtual Int_t GetDimension() const
virtual Double_t * GetVal(Int_t i) const
Return the last values corresponding to the i-th component of the formula being processed (where the ...
virtual Double_t * GetV3() const
See TSelectorDraw::GetVal.
virtual Int_t GetNfill() const
Basic string class.
Definition TString.h:136
TPaveText * pt
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
TMath.
Definition TMathBase.h:35
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Definition TMath.h:663
Int_t FloorNint(Double_t x)
Definition TMath.h:657
Double_t Cos(Double_t)
Definition TMath.h:593
Double_t Sin(Double_t)
Definition TMath.h:589
auto * m
Definition textangle.C:8