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
39
40////////////////////////////////////////////////////////////////////////////////
41/// Constructor.
42
48 TQObject(),
49
50 fTitle (),
51 fIntIds (nullptr),
52 fIntIdsPerPoint (0)
53{
54 fMarkerStyle = 20;
56
57 // Override from TEveElement.
59}
60
61////////////////////////////////////////////////////////////////////////////////
62/// Constructor.
63
69 TQObject(),
70
71 fTitle (),
72 fIntIds (nullptr),
73 fIntIdsPerPoint (0)
74{
75 fMarkerStyle = 20;
78
79 // Override from TEveElement.
81}
82
83////////////////////////////////////////////////////////////////////////////////
84/// Copy constructor.
85
91 TQObject(),
92
93 fTitle (e.fTitle),
94 fIntIds (e.fIntIds ? new TArrayI(*e.fIntIds) : nullptr),
95 fIntIdsPerPoint (e.fIntIdsPerPoint)
96{
97}
98
99////////////////////////////////////////////////////////////////////////////////
100/// Destructor.
101
103{
104 delete fIntIds;
105}
106
107////////////////////////////////////////////////////////////////////////////////
108/// Clone points and all point-related information from point-set 'e'.
109
111{
112 // TPolyMarker3D
113 delete [] fP;
114 fN = e.fN;
115 if (fN > 0)
116 {
117 const Int_t nn = 3 * e.fN;
118 fP = new Float_t [nn];
119 for (Int_t i = 0; i < nn; i++) fP[i] = e.fP[i];
120 } else {
121 fP = nullptr;
122 }
123 fLastPoint = e.fLastPoint;
124
125 // TPointSet3D
126 CopyIds(e);
127
128 // TEvePointSet
129 delete fIntIds;
130 fIntIds = e.fIntIds ? new TArrayI(*e.fIntIds) : nullptr;
131 fIntIdsPerPoint = e.fIntIdsPerPoint;
132}
133
134////////////////////////////////////////////////////////////////////////////////
135/// Return pointset icon.
136
141
142////////////////////////////////////////////////////////////////////////////////
143/// Drop all data and set-up the data structures to recive new data.
144/// n_points specifies the initial size of the arrays.
145/// n_int_ids specifies the number of integer ids per point.
146
148{
149 delete [] fP; fP = nullptr;
150 fN = n_points;
151 if (fN) {
152 fP = new Float_t [3*fN];
153 memset(fP, 0, 3*fN*sizeof(Float_t));
154 }
155 fLastPoint = -1;
156 ClearIds();
157 delete fIntIds; fIntIds = nullptr;
160 ResetBBox();
161}
162
163////////////////////////////////////////////////////////////////////////////////
164/// Resizes internal array to allow additional n_points to be stored.
165/// Returns the old size which is also the location where one can
166/// start storing new data.
167/// The caller is *obliged* to fill the new point slots.
168
178
179////////////////////////////////////////////////////////////////////////////////
180/// Assert that size of IntId array is compatible with the size of
181/// the point array.
182
189
190////////////////////////////////////////////////////////////////////////////////
191/// Return a pointer to integer ids of point with index p.
192/// Existence of integer id array is checked, 0 is returned if it
193/// does not exist.
194/// Validity of p is *not* checked.
195
197{
198 if (fIntIds)
199 return fIntIds->GetArray() + p*fIntIdsPerPoint;
200 return nullptr;
201}
202
203////////////////////////////////////////////////////////////////////////////////
204/// Return i-th integer id of point with index p.
205/// Existence of integer id array is checked, kMinInt is returned if
206/// it does not exist.
207/// Validity of p and i is *not* checked.
208
210{
211 if (fIntIds)
212 return * (fIntIds->GetArray() + p*fIntIdsPerPoint + i);
213 return kMinInt;
214}
215
216////////////////////////////////////////////////////////////////////////////////
217/// Set integer ids for the last point that was registered (most
218/// probably via TPolyMarker3D::SetNextPoint(x,y,z)).
219
224
225////////////////////////////////////////////////////////////////////////////////
226/// Set integer ids for point with index n.
227
229{
230 if (!fIntIds) return;
233 for (Int_t i=0; i<fIntIdsPerPoint; ++i)
234 x[i] = ids[i];
235}
236
237////////////////////////////////////////////////////////////////////////////////
238/// Set marker style, propagate to projecteds.
239
241{
242 static const TEveException eh("TEvePointSet::SetMarkerStyle ");
243
244 std::list<TEveProjected*>::iterator pi = fProjectedList.begin();
245 while (pi != fProjectedList.end())
246 {
247 TEvePointSet* pt = dynamic_cast<TEvePointSet*>(*pi);
248 if (pt)
249 {
250 pt->SetMarkerStyle(mstyle);
251 pt->StampObjProps();
252 }
253 ++pi;
254 }
256}
257
258////////////////////////////////////////////////////////////////////////////////
259/// Set marker size, propagate to projecteds.
260
262{
263 static const TEveException eh("TEvePointSet::SetMarkerSize ");
264
265 std::list<TEveProjected*>::iterator pi = fProjectedList.begin();
266 while (pi != fProjectedList.end())
267 {
268 TEvePointSet* pt = dynamic_cast<TEvePointSet*>(*pi);
269 if (pt)
270 {
271 pt->SetMarkerSize(msize);
272 pt->StampObjProps();
273 }
274 ++pi;
275 }
277}
278
279////////////////////////////////////////////////////////////////////////////////
280/// Paint point-set.
281
283{
284 PaintStandard(this);
285}
286
287////////////////////////////////////////////////////////////////////////////////
288/// Initialize point-set for new filling.
289/// subIdNum gives the number of integer ids that can be assigned to
290/// each point.
291
293{
294 if (subIdNum > 0) {
296 if (!fIntIds)
298 else
300 } else {
301 delete fIntIds; fIntIds = nullptr;
302 fIntIdsPerPoint = 0;
303 }
304}
305
306////////////////////////////////////////////////////////////////////////////////
307/// Called from TEvePointSelector when internal arrays of the tree-selector
308/// are filled up and need to be processed.
309/// Virtual from TEvePointSelectorConsumer.
310
312{
313 static const TEveException eh("TEvePointSet::TakeAction ");
314
315 if(sel == nullptr)
316 throw(eh + "selector is <null>.");
317
318 Int_t n = sel->GetNfill();
319 Int_t beg = GrowFor(n);
320
321 // printf("TEvePointSet::TakeAction beg=%d n=%d size=%d nsubid=%d dim=%d\n",
322 // beg, n, Size(), sel->GetSubIdNum(), sel->GetDimension());
323
324 Double_t *vx = sel->GetV1(), *vy = sel->GetV2(), *vz = sel->GetV3();
325 Float_t *p = fP + 3*beg;
326
327 switch(fSourceCS) {
328 case kTVT_XYZ:
329 while(n-- > 0) {
330 p[0] = *vx; p[1] = *vy; p[2] = *vz;
331 p += 3;
332 ++vx; ++vy; ++vz;
333 }
334 break;
335 case kTVT_RPhiZ:
336 while(n-- > 0) {
337 p[0] = *vx * TMath::Cos(*vy); p[1] = *vx * TMath::Sin(*vy); p[2] = *vz;
338 p += 3;
339 ++vx; ++vy; ++vz;
340 }
341 break;
342 default:
343 throw(eh + "unknown tree variable type.");
344 }
345
346 if (fIntIds) {
348 for (Int_t i=0; i<fIntIdsPerPoint; ++i) {
349 subarr[i] = sel->GetVal(sel->GetDimension() - fIntIdsPerPoint + i);
350 if (subarr[i] == nullptr) {
351 delete[] subarr;
352 throw(eh + "sub-id array not available.");
353 }
354 }
356 n = sel->GetNfill();
357 while (n-- > 0) {
358 for (Int_t i=0; i<fIntIdsPerPoint; ++i) {
359 ids[i] = TMath::Nint(*subarr[i]);
360 ++subarr[i];
361 }
362 ids += fIntIdsPerPoint;
363 }
364 delete [] subarr;
365 }
366}
367
368////////////////////////////////////////////////////////////////////////////////
369/// Copy visualization parameters from element el.
370
372{
373 const TEvePointSet* m = dynamic_cast<const TEvePointSet*>(el);
374 if (m)
375 {
376 TAttMarker::operator=(*m);
377 fOption = m->fOption;
378 }
379
381}
382
383////////////////////////////////////////////////////////////////////////////////
384/// Write visualization parameters.
385
386void TEvePointSet::WriteVizParams(std::ostream& out, const TString& var)
387{
389
391}
392
393////////////////////////////////////////////////////////////////////////////////
394/// Virtual from TEveProjectable, returns TEvePointSetProjected class.
395
400
401////////////////////////////////////////////////////////////////////////////////
402/// Virtual method of base class TPointSet3D. The function call is
403/// invoked with secondary selection in TPointSet3DGL.
404
406{
407 Emit("PointSelected(Int_t)", id);
409}
410
411//==============================================================================
412/** \class TEvePointSetArray
413\ingroup TEve
414An array of point-sets with each point-set playing a role of a bin
415in a histogram. When a new point is added to a TEvePointSetArray,
416an additional separating quantity needs to be specified: it
417determines into which TEvePointSet (bin) the point will actually be
418stored. Underflow and overflow bins are automatically created but
419they are not drawn by default.
420
421By using the TEvePointSelector the points and the separating
422quantities can be filled directly from a TTree holding the source
423data.
424Setting of per-point TRef's is not supported.
425
426After the filling, the range of separating variable can be
427controlled with a slider to choose a sub-set of PointSets that are
428actually shown.
429*/
430
431
432////////////////////////////////////////////////////////////////////////////////
433/// Constructor.
434
436 const char* title) :
437 TEveElement(),
438 TNamed(name, title),
439
440 fBins(nullptr), fDefPointSetCapacity(128), fNBins(0), fLastBin(-1),
441 fMin(0), fCurMin(0), fMax(0), fCurMax(0),
442 fBinWidth(0),
443 fQuantName()
444{
445
447}
448
449////////////////////////////////////////////////////////////////////////////////
450/// Destructor: deletes the fBins array. Actual removal of
451/// elements done by TEveElement.
452
454{
455 // printf("TEvePointSetArray::~TEvePointSetArray()\n");
456 delete [] fBins; fBins = nullptr;
457}
458
459////////////////////////////////////////////////////////////////////////////////
460/// Virtual from TEveElement, provide bin management.
461
463{
464 for (Int_t i=0; i<fNBins; ++i) {
465 if (fBins[i] == el) {
466 fBins[i] = nullptr;
467 break;
468 }
469 }
470}
471
472////////////////////////////////////////////////////////////////////////////////
473/// Virtual from TEveElement, provide bin management.
474
476{
477 delete [] fBins; fBins = nullptr; fLastBin = -1;
478}
479
480////////////////////////////////////////////////////////////////////////////////
481/// Set marker color, propagate to children.
482
484{
485 static const TEveException eh("TEvePointSetArray::SetMarkerColor ");
486
487 for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
488 TAttMarker* m = dynamic_cast<TAttMarker*>((*i)->GetObject(eh));
489 if (m && m->GetMarkerColor() == fMarkerColor)
491 }
493}
494
495////////////////////////////////////////////////////////////////////////////////
496/// Set marker style, propagate to children.
497
499{
500 static const TEveException eh("TEvePointSetArray::SetMarkerStyle ");
501
502 for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
503 TAttMarker* m = dynamic_cast<TAttMarker*>((*i)->GetObject(eh));
504 if (m && m->GetMarkerStyle() == fMarkerStyle)
506 }
508}
509
510////////////////////////////////////////////////////////////////////////////////
511/// Set marker size, propagate to children.
512
514{
515 static const TEveException eh("TEvePointSetArray::SetMarkerSize ");
516
517 for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
518 TAttMarker* m = dynamic_cast<TAttMarker*>((*i)->GetObject(eh));
519 if (m && m->GetMarkerSize() == fMarkerSize)
521 }
523}
524
525////////////////////////////////////////////////////////////////////////////////
526/// Called from TEvePointSelector when internal arrays of the tree-selector
527/// are filled up and need to be processed.
528/// Virtual from TEvePointSelectorConsumer.
529
531{
532 static const TEveException eh("TEvePointSetArray::TakeAction ");
533
534 if (sel == nullptr)
535 throw eh + "selector is <null>.";
536
537 Int_t n = sel->GetNfill();
538
539 // printf("TEvePointSetArray::TakeAction n=%d\n", n);
540
541 Double_t *vx = sel->GetV1(), *vy = sel->GetV2(), *vz = sel->GetV3();
542 Double_t *qq = sel->GetV4();
543
544 if (qq == nullptr)
545 throw eh + "requires 4-d varexp.";
546
547 switch (fSourceCS)
548 {
549 case kTVT_XYZ:
550 {
551 while (n-- > 0)
552 {
553 Fill(*vx, *vy, *vz, *qq);
554 ++vx; ++vy; ++vz; ++qq;
555 }
556 break;
557 }
558 case kTVT_RPhiZ:
559 {
560 while (n-- > 0)
561 {
562 Fill(*vx * TMath::Cos(*vy), *vx * TMath::Sin(*vy), *vz, *qq);
563 ++vx; ++vy; ++vz; ++qq;
564 }
565 break;
566 }
567 default:
568 {
569 throw eh + "unknown tree variable type.";
570 }
571 }
572}
573
574////////////////////////////////////////////////////////////////////////////////
575/// Get the total number of filled points.
576/// 'under' and 'over' flags specify if under/overflow channels
577/// should be added to the sum.
578
580{
581 Int_t size = 0;
582 const Int_t min = under ? 0 : 1;
583 const Int_t max = over ? fNBins : fNBins - 1;
584 for (Int_t i = min; i < max; ++i)
585 {
586 if (fBins[i])
587 size += fBins[i]->Size();
588 }
589 return size;
590}
591
592////////////////////////////////////////////////////////////////////////////////
593/// Initialize internal point-sets with given binning parameters.
594/// The actual number of bins is nbins+2, bin 0 corresponding to
595/// underflow and bin nbin+1 to owerflow pointset.
596
598 Int_t nbins, Double_t min, Double_t max)
599{
600 static const TEveException eh("TEvePointSetArray::InitBins ");
601
602 if (nbins < 1) throw eh + "nbins < 1.";
603 if (min > max) throw eh + "min > max.";
604
606
608 fNBins = nbins + 2; // under/overflow
609 fLastBin = -1;
610 fMin = fCurMin = min;
611 fMax = fCurMax = max;
612 fBinWidth = (fMax - fMin)/(fNBins - 2);
613
614 fBins = new TEvePointSet* [fNBins];
615
616 for (Int_t i = 0; i < fNBins; ++i)
617 {
618 fBins[i] = new TEvePointSet
619 (Form("Slice %d [%4.3lf, %4.3lf]", i, fMin + (i-1)*fBinWidth, fMin + i*fBinWidth),
624 AddElement(fBins[i]);
625 }
626
627 fBins[0]->SetName("Underflow");
629
630 fBins[fNBins-1]->SetName("Overflow");
632}
633
634////////////////////////////////////////////////////////////////////////////////
635/// Add a new point. Appropriate point-set will be chosen based on
636/// the value of the separating quantity 'quant'.
637/// If the selected bin does not have an associated TEvePointSet
638/// the point is discarded and false is returned.
639
641{
643
644 if (fLastBin < 0)
645 {
646 fLastBin = 0;
647 }
648 else if (fLastBin > fNBins - 1)
649 {
650 fLastBin = fNBins - 1;
651 }
652
653 if (fBins[fLastBin] != nullptr)
654 {
656 return kTRUE;
657 }
658 else
659 {
660 return kFALSE;
661 }
662}
663
664////////////////////////////////////////////////////////////////////////////////
665/// Set external object id of the last added point.
666
668{
669 if (fLastBin >= 0)
671}
672
673////////////////////////////////////////////////////////////////////////////////
674/// Call this after all the points have been filled.
675/// At this point we can calculate bounding-boxes of individual
676/// point-sets.
677
679{
680 for (Int_t i=0; i<fNBins; ++i)
681 {
682 if (fBins[i] != nullptr)
683 {
684 fBins[i]->SetTitle(Form("N=%d", fBins[i]->Size()));
685 fBins[i]->ComputeBBox();
686 }
687 }
688 fLastBin = -1;
689}
690
691////////////////////////////////////////////////////////////////////////////////
692/// Propagate id-object ownership to children.
693
695{
696 for (Int_t i=0; i<fNBins; ++i)
697 {
698 if (fBins[i] != nullptr)
699 fBins[i]->SetOwnIds(o);
700 }
701}
702
703////////////////////////////////////////////////////////////////////////////////
704/// Set active range of the separating quantity.
705/// Appropriate point-sets are tagged for rendering.
706/// Over/underflow point-sets are left as they were.
707
709{
710 using namespace TMath;
711
712 fCurMin = min; fCurMax = max;
713 Int_t low_b = Max(0, FloorNint((min-fMin)/fBinWidth)) + 1;
714 Int_t high_b = Min(fNBins-2, CeilNint ((max-fMin)/fBinWidth));
715
716 for (Int_t i = 1; i < fNBins - 1; ++i)
717 {
718 if (fBins[i] != nullptr)
719 fBins[i]->SetRnrSelf(i>=low_b && i<=high_b);
720 }
721}
722
723/** \class TEvePointSetProjected
724\ingroup TEve
725Projected copy of a TEvePointSet.
726*/
727
728////////////////////////////////////////////////////////////////////////////////
729/// Default contructor.
730
736
737////////////////////////////////////////////////////////////////////////////////
738/// Set projection manager and projection model.
739/// Virtual from TEveProjected.
740
747
748////////////////////////////////////////////////////////////////////////////////
749/// Set depth (z-coordinate) of the projected points.
750
752{
753 SetDepthCommon(d, this, fBBox);
754
755 Int_t n = Size();
756 Float_t *p = GetP() + 2;
757 for (Int_t i = 0; i < n; ++i, p+=3)
758 *p = fDepth;
759}
760
761////////////////////////////////////////////////////////////////////////////////
762/// Re-apply the projection.
763/// Virtual from TEveProjected.
764
766{
768 TEvePointSet &ps = * dynamic_cast<TEvePointSet*>(fProjectable);
770
771 Int_t n = ps.Size();
772 Reset(n);
773 fLastPoint = n - 1;
774 Float_t *o = ps.GetP(), *p = GetP();
775 for (Int_t i = 0; i < n; ++i, o+=3, p+=3)
776 {
777 proj.ProjectPointfv(tr, o, p, fDepth);
778 }
779}
780
781////////////////////////////////////////////////////////////////////////////////
782/// Virtual method of base class TPointSet3D.
783/// Forward to projectable.
784
786{
787 TEvePointSet *ps = dynamic_cast<TEvePointSet*>(fProjectable);
788 ps->PointSelected(id);
789}
#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
short Style_t
Style number (short)
Definition RtypesCore.h:96
short Color_t
Color number (short)
Definition RtypesCore.h:99
float Size_t
Attribute size (float)
Definition RtypesCore.h:103
constexpr Int_t kMinInt
Definition RtypesCore.h:120
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:71
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
char name[80]
Definition TGX11.cxx:110
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2495
Array of integers (32 bits per element).
Definition TArrayI.h:27
void Set(Int_t n) override
Set size of this array to n ints.
Definition TArrayI.cxx:104
const Int_t * GetArray() const
Definition TArrayI.h:43
Int_t GetSize() const
Definition TArray.h:47
void ResetBBox()
Definition TAttBBox.h:57
Float_t * fBBox
Definition TAttBBox.h:20
Marker Attributes class.
Definition TAttMarker.h:20
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 Style_t GetMarkerStyle() const
Return the marker style.
Definition TAttMarker.h:33
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Definition TAttMarker.h:39
virtual Color_t GetMarkerColor() const
Return the marker color.
Definition TAttMarker.h:32
Color_t fMarkerColor
Marker color.
Definition TAttMarker.h:23
virtual Size_t GetMarkerSize() const
Return the marker size.
Definition TAttMarker.h:34
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
Definition TAttMarker.h:41
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Definition TAttMarker.h:46
Size_t fMarkerSize
Marker size.
Definition TAttMarker.h:25
Style_t fMarkerStyle
Marker style.
Definition TAttMarker.h:24
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:84
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:54
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...
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.
void SetMarkerSize(Size_t msize=1) override
Set marker size, propagate to children.
void TakeAction(TEvePointSelector *) override
Called from TEvePointSelector when internal arrays of the tree-selector are filled up and need to be ...
void CloseBins()
Call this after all the points have been filled.
~TEvePointSetArray() override
Destructor: deletes the fBins array.
void RemoveElementsLocal() override
Virtual from TEveElement, provide bin management.
void SetMarkerColor(Color_t tcolor=1) override
Set marker color, propagate to children.
void InitBins(const char *quant_name, Int_t nbins, Double_t min, Double_t max)
Initialize internal point-sets with given binning parameters.
virtual Int_t Size(Bool_t under=kFALSE, Bool_t over=kFALSE) const
Get the total number of filled points.
TEvePointSetArray(const TEvePointSetArray &)
void SetPointId(TObject *id)
Set external object id of the last added point.
void RemoveElementLocal(TEveElement *el) override
Virtual from TEveElement, provide bin management.
Bool_t Fill(Double_t x, Double_t y, Double_t z, Double_t quant)
Add a new point.
void SetMarkerStyle(Style_t mstyle=1) override
Set marker style, propagate to children.
void SetOwnIds(Bool_t o)
Propagate id-object ownership to children.
void UpdateProjection() override
Re-apply the projection.
static TClass * Class()
void PointSelected(Int_t id) override
Virtual method of base class TPointSet3D.
void SetProjection(TEveProjectionManager *proj, TEveProjectable *model) override
Set projection manager and projection model.
void SetDepthLocal(Float_t d) override
Set depth (z-coordinate) of the projected points.
TEvePointSetProjected()
Default contructor.
TEvePointSet is a render-element holding a collection of 3D points with optional per-point TRef and a...
void Paint(Option_t *option="") override
Paint point-set.
void AssertIntIdsSize()
Assert that size of IntId array is compatible with the size of the point array.
const TGPicture * GetListTreeIcon(Bool_t open=kFALSE) override
Return pointset icon.
void SetMarkerColor(Color_t col) override
Set the marker color.
~TEvePointSet() override
Destructor.
void CopyVizParams(const TEveElement *el) override
Copy visualization parameters from element el.
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'.
TClass * ProjectedClass(const TEveProjection *p) const override
Virtual from TEveProjectable, returns TEvePointSetProjected class.
Int_t GetPointIntId(Int_t p, Int_t i) const
Return i-th integer id of point with index p.
TArrayI * fIntIds
virtual void SetTitle(const char *t)
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.
TEvePointSet(Int_t n_points=0, ETreeVarType_e tv_type=kTVT_XYZ)
Constructor.
void SetMarkerStyle(Style_t mstyle=1) override
Set marker style, propagate to projecteds.
void WriteVizParams(std::ostream &out, const TString &var) override
Write visualization parameters.
void SetMarkerSize(Size_t msize=1) override
Set marker size, propagate to projecteds.
void PointSelected(Int_t id) override
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.
void TakeAction(TEvePointSelector *) override
Called from TEvePointSelector when internal arrays of the tree-selector are filled up and need to be ...
void InitFill(Int_t subIdNum) override
Initialize point-set for new filling.
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.
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 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 ComputeBBox() override
Compute the bounding box of this points set.
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
Basic string class.
Definition TString.h:138
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:704
Int_t FloorNint(Double_t x)
Returns the nearest integer of TMath::Floor(x).
Definition TMath.h:697
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Definition TMath.h:605
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Definition TMath.h:599
TMarker m
Definition textangle.C:8