Logo ROOT   6.08/07
Reference Guide
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"
15 #include "TEveProjectionManager.h"
16 #include "TEveTrans.h"
17 
18 #include "TTree.h"
19 #include "TTreePlayer.h"
20 #include "TF3.h"
21 
22 #include "TColor.h"
23 
24 /** \class TEvePointSet
25 \ingroup TEve
26 TEvePointSet is a render-element holding a collection of 3D points with
27 optional per-point TRef and an arbitrary number of integer ids (to
28 be used for signal, volume-id, track-id, etc).
29 
30 3D point representation is implemented in base-class TPolyMarker3D.
31 Per-point TRef is implemented in base-class TPointSet3D.
32 
33 By using the TEvePointSelector the points and integer ids can be
34 filled directly from a TTree holding the source data.
35 Setting of per-point TRef's is not supported.
36 
37 TEvePointSet is a TEveProjectable: it can be projected by using the
38 TEveProjectionManager class.
39 */
40 
42 
43 ////////////////////////////////////////////////////////////////////////////////
44 /// Constructor.
45 
47  TEveElement(),
48  TPointSet3D(n_points),
51  TQObject(),
52 
53  fTitle (),
54  fIntIds (0),
55  fIntIdsPerPoint (0)
56 {
57  fMarkerStyle = 20;
59 
60  // Override from TEveElement.
61  fPickable = kTRUE;
62 }
63 
64 ////////////////////////////////////////////////////////////////////////////////
65 /// Constructor.
66 
67 TEvePointSet::TEvePointSet(const char* name, Int_t n_points, ETreeVarType_e tv_type) :
68  TEveElement(),
69  TPointSet3D(n_points),
72  TQObject(),
73 
74  fTitle (),
75  fIntIds (0),
76  fIntIdsPerPoint (0)
77 {
78  fMarkerStyle = 20;
79  SetName(name);
81 
82  // Override from TEveElement.
83  fPickable = kTRUE;
84 }
85 
86 ////////////////////////////////////////////////////////////////////////////////
87 /// Copy constructor.
88 
90  TEveElement(e),
91  TPointSet3D(e),
94  TQObject(),
95 
96  fTitle (e.fTitle),
97  fIntIds (e.fIntIds ? new TArrayI(*e.fIntIds) : 0),
99 {
100 }
101 
102 ////////////////////////////////////////////////////////////////////////////////
103 /// Destructor.
104 
106 {
107  delete fIntIds;
108 }
109 
110 ////////////////////////////////////////////////////////////////////////////////
111 /// Clone points and all point-related information from point-set 'e'.
112 
114 {
115  // TPolyMarker3D
116  delete [] fP;
117  fN = e.fN;
118  if (fN > 0)
119  {
120  const Int_t nn = 3 * e.fN;
121  fP = new Float_t [nn];
122  for (Int_t i = 0; i < nn; i++) fP[i] = e.fP[i];
123  } else {
124  fP = 0;
125  }
127 
128  // TPointSet3D
129  CopyIds(e);
130 
131  // TEvePointSet
132  delete fIntIds;
133  fIntIds = e.fIntIds ? new TArrayI(*e.fIntIds) : 0;
135 }
136 
137 ////////////////////////////////////////////////////////////////////////////////
138 /// Return pointset icon.
139 
141 {
143 }
144 
145 ////////////////////////////////////////////////////////////////////////////////
146 /// Drop all data and set-up the data structures to recive new data.
147 /// n_points specifies the initial size of the arrays.
148 /// n_int_ids specifies the number of integer ids per point.
149 
150 void TEvePointSet::Reset(Int_t n_points, Int_t n_int_ids)
151 {
152  delete [] fP; fP = 0;
153  fN = n_points;
154  if (fN) {
155  fP = new Float_t [3*fN];
156  memset(fP, 0, 3*fN*sizeof(Float_t));
157  }
158  fLastPoint = -1;
159  ClearIds();
160  delete fIntIds; fIntIds = 0;
161  fIntIdsPerPoint = n_int_ids;
163  ResetBBox();
164 }
165 
166 ////////////////////////////////////////////////////////////////////////////////
167 /// Resizes internal array to allow additional n_points to be stored.
168 /// Returns the old size which is also the location where one can
169 /// start storing new data.
170 /// The caller is *obliged* to fill the new point slots.
171 
173 {
174  Int_t old_size = Size();
175  Int_t new_size = old_size + n_points;
176  SetPoint(new_size - 1, 0, 0, 0);
177  if (fIntIds)
178  fIntIds->Set(fIntIdsPerPoint * new_size);
179  return old_size;
180 }
181 
182 ////////////////////////////////////////////////////////////////////////////////
183 /// Assert that size of IntId array is compatible with the size of
184 /// the point array.
185 
187 {
188  Int_t exp_size = GetN()*fIntIdsPerPoint;
189  if (fIntIds->GetSize() < exp_size)
190  fIntIds->Set(exp_size);
191 }
192 
193 ////////////////////////////////////////////////////////////////////////////////
194 /// Return a pointer to integer ids of point with index p.
195 /// Existence of integer id array is checked, 0 is returned if it
196 /// does not exist.
197 /// Validity of p is *not* checked.
198 
200 {
201  if (fIntIds)
202  return fIntIds->GetArray() + p*fIntIdsPerPoint;
203  return 0;
204 }
205 
206 ////////////////////////////////////////////////////////////////////////////////
207 /// Return i-th integer id of point with index p.
208 /// Existence of integer id array is checked, kMinInt is returned if
209 /// it does not exist.
210 /// Validity of p and i is *not* checked.
211 
213 {
214  if (fIntIds)
215  return * (fIntIds->GetArray() + p*fIntIdsPerPoint + i);
216  return kMinInt;
217 }
218 
219 ////////////////////////////////////////////////////////////////////////////////
220 /// Set integer ids for the last point that was registered (most
221 /// probably via TPolyMarker3D::SetNextPoint(x,y,z)).
222 
224 {
226 }
227 
228 ////////////////////////////////////////////////////////////////////////////////
229 /// Set integer ids for point with index n.
230 
232 {
233  if (!fIntIds) return;
236  for (Int_t i=0; i<fIntIdsPerPoint; ++i)
237  x[i] = ids[i];
238 }
239 
240 ////////////////////////////////////////////////////////////////////////////////
241 /// Set marker style, propagate to projecteds.
242 
244 {
245  static const TEveException eh("TEvePointSet::SetMarkerStyle ");
246 
247  std::list<TEveProjected*>::iterator pi = fProjectedList.begin();
248  while (pi != fProjectedList.end())
249  {
250  TEvePointSet* pt = dynamic_cast<TEvePointSet*>(*pi);
251  if (pt)
252  {
253  pt->SetMarkerStyle(mstyle);
254  pt->StampObjProps();
255  }
256  ++pi;
257  }
259 }
260 
261 ////////////////////////////////////////////////////////////////////////////////
262 /// Set marker size, propagate to projecteds.
263 
265 {
266  static const TEveException eh("TEvePointSet::SetMarkerSize ");
267 
268  std::list<TEveProjected*>::iterator pi = fProjectedList.begin();
269  while (pi != fProjectedList.end())
270  {
271  TEvePointSet* pt = dynamic_cast<TEvePointSet*>(*pi);
272  if (pt)
273  {
274  pt->SetMarkerSize(msize);
275  pt->StampObjProps();
276  }
277  ++pi;
278  }
280 }
281 
282 ////////////////////////////////////////////////////////////////////////////////
283 /// Paint point-set.
284 
286 {
287  PaintStandard(this);
288 }
289 
290 ////////////////////////////////////////////////////////////////////////////////
291 /// Initialize point-set for new filling.
292 /// subIdNum gives the number of integer ids that can be assigned to
293 /// each point.
294 
296 {
297  if (subIdNum > 0) {
298  fIntIdsPerPoint = subIdNum;
299  if (!fIntIds)
301  else
303  } else {
304  delete fIntIds; fIntIds = 0;
305  fIntIdsPerPoint = 0;
306  }
307 }
308 
309 ////////////////////////////////////////////////////////////////////////////////
310 /// Called from TEvePointSelector when internal arrays of the tree-selector
311 /// are filled up and need to be processed.
312 /// Virtual from TEvePointSelectorConsumer.
313 
315 {
316  static const TEveException eh("TEvePointSet::TakeAction ");
317 
318  if(sel == 0)
319  throw(eh + "selector is <null>.");
320 
321  Int_t n = sel->GetNfill();
322  Int_t beg = GrowFor(n);
323 
324  // printf("TEvePointSet::TakeAction beg=%d n=%d size=%d nsubid=%d dim=%d\n",
325  // beg, n, Size(), sel->GetSubIdNum(), sel->GetDimension());
326 
327  Double_t *vx = sel->GetV1(), *vy = sel->GetV2(), *vz = sel->GetV3();
328  Float_t *p = fP + 3*beg;
329 
330  switch(fSourceCS) {
331  case kTVT_XYZ:
332  while(n-- > 0) {
333  p[0] = *vx; p[1] = *vy; p[2] = *vz;
334  p += 3;
335  ++vx; ++vy; ++vz;
336  }
337  break;
338  case kTVT_RPhiZ:
339  while(n-- > 0) {
340  p[0] = *vx * TMath::Cos(*vy); p[1] = *vx * TMath::Sin(*vy); p[2] = *vz;
341  p += 3;
342  ++vx; ++vy; ++vz;
343  }
344  break;
345  default:
346  throw(eh + "unknown tree variable type.");
347  }
348 
349  if (fIntIds) {
350  Double_t** subarr = new Double_t* [fIntIdsPerPoint];
351  for (Int_t i=0; i<fIntIdsPerPoint; ++i) {
352  subarr[i] = sel->GetVal(sel->GetDimension() - fIntIdsPerPoint + i);
353  if (subarr[i] == 0)
354  throw(eh + "sub-id array not available.");
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 
387 void TEvePointSet::WriteVizParams(std::ostream& out, const TString& var)
388 {
389  TEveElement::WriteVizParams(out, var);
390 
392 }
393 
394 ////////////////////////////////////////////////////////////////////////////////
395 /// Virtual from TEveProjectable, returns TEvePointSetProjected class.
396 
398 {
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
415 An array of point-sets with each point-set playing a role of a bin
416 in a histogram. When a new point is added to a TEvePointSetArray,
417 an additional separating quantity needs to be specified: it
418 determines into which TEvePointSet (bin) the point will actually be
419 stored. Underflow and overflow bins are automatically created but
420 they are not drawn by default.
421 
422 By using the TEvePointSelector the points and the separating
423 quantities can be filled directly from a TTree holding the source
424 data.
425 Setting of per-point TRef's is not supported.
426 
427 After the filling, the range of separating variable can be
428 controlled with a slider to choose a sub-set of PointSets that are
429 actually 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 
599 void 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 
607  RemoveElements();
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");
630  fBins[0]->SetRnrSelf(kFALSE);
631 
632  fBins[fNBins-1]->SetName("Overflow");
633  fBins[fNBins-1]->SetRnrSelf(kFALSE);
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  {
657  fBins[fLastBin]->SetNextPoint(x, y, z);
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)
672  fBins[fLastBin]->SetPointId(id);
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
727 Projected copy of a TEvePointSet.
728 */
730 
731 ////////////////////////////////////////////////////////////////////////////////
732 /// Default contructor.
733 
735  TEvePointSet (),
736  TEveProjected ()
737 {
738 }
739 
740 ////////////////////////////////////////////////////////////////////////////////
741 /// Set projection manager and projection model.
742 /// Virtual from TEveProjected.
743 
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 }
TEveTrans is a 4x4 transformation matrix for homogeneous coordinates stored internally in a column-ma...
Definition: TEveTrans.h:26
const Int_t kMinInt
Definition: Rtypes.h:104
Abstract base class for classes that hold results of a non-linear projection transformation.
virtual const TGPicture * GetListTreeIcon(Bool_t open=kFALSE)
Return pointset icon.
void SetRange(Double_t min, Double_t max)
Set active range of the separating quantity.
Int_t fDefPointSetCapacity
Definition: TEvePointSet.h:119
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 ...
short Style_t
Definition: RtypesCore.h:76
Int_t fIntIdsPerPoint
Definition: TEvePointSet.h:45
virtual Double_t * GetV2() const
const double pi
float Float_t
Definition: RtypesCore.h:53
float Size_t
Definition: RtypesCore.h:83
const char Option_t
Definition: RtypesCore.h:62
virtual void SetName(const char *name)
Change (i.e.
List_t fChildren
Definition: TEveElement.h:79
Bool_t fPickable
Definition: TEveElement.h:310
static const TGPicture * fgListTreeIcons[9]
Definition: TEveElement.h:63
List_t::iterator List_i
Definition: TEveElement.h:70
This is the ROOT implementation of the Qt object communication mechanism (see also http://www...
Definition: TQObject.h:53
Size_t fMarkerSize
Marker size.
Definition: TAttMarker.h:29
void ClearIds()
Clears the id-array. If ids are owned the TObjects are deleted.
virtual void PaintStandard(TObject *id)
Paint object – a generic implementation for EVE elements.
virtual void CopyVizParams(const TEveElement *el)
Copy visualization parameters from element el.
Basic string class.
Definition: TString.h:137
virtual Int_t Size(Bool_t under=kFALSE, Bool_t over=kFALSE) const
Get the total number of filled points.
TEvePointSetProjected()
Default contructor.
virtual void ClonePoints(const TEvePointSet &e)
Clone points and all point-related information from point-set &#39;e&#39;.
Short_t Min(Short_t a, Short_t b)
Definition: TMathBase.h:170
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual void SetMarkerStyle(Style_t mstyle=1)
Set marker style, propagate to projecteds.
int nbins[3]
virtual void SetProjection(TEveProjectionManager *mng, TEveProjectable *model)
Sets projection manager and reference in the projectable object.
virtual void UpdateProjection()
Re-apply the projection.
Int_t FloorNint(Double_t x)
Definition: TMath.h:476
virtual void RemoveElementsLocal()
Virtual from TEveElement, provide bin management.
const char * Class
Definition: TXMLSetup.cxx:64
virtual Int_t GetDimension() const
Definition: TSelectorDraw.h:82
Float_t * fBBox
Definition: TAttBBox.h:22
virtual void SetTitle(const char *t)
Definition: TEvePointSet.h:69
An array of point-sets with each point-set playing a role of a bin in a histogram.
Definition: TEvePointSet.h:107
virtual void SetMarkerColor(Color_t tcolor=1)
Set marker color, propagate to children.
Array of integers (32 bits per element).
Definition: TArrayI.h:29
virtual Double_t * GetV4() const
void SetMainColorPtr(Color_t *color)
Definition: TEveElement.h:267
virtual Style_t GetMarkerStyle() const
Return the marker style.
Definition: TAttMarker.h:37
Marker Attributes class.
Definition: TAttMarker.h:24
virtual TClass * ProjectedClass(const TEveProjection *p) const
Virtual from TEveProjectable, returns TEvePointSetProjected class.
Double_t x[n]
Definition: legend1.C:17
virtual Double_t * GetV3() const
Projected copy of a TEvePointSet.
Definition: TEvePointSet.h:170
TEvePointSetArray(const TEvePointSetArray &)
void SetPointId(TObject *id)
Set id of last point.
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
virtual ~TEvePointSet()
Destructor.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Definition: TAttMarker.h:43
virtual Size_t GetMarkerSize() const
Return the marker size.
Definition: TAttMarker.h:38
const Int_t * GetArray() const
Definition: TArrayI.h:45
virtual void SetMarkerColor(Color_t col)
Set the marker color.
Definition: TEvePointSet.h:81
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.
Definition: TAttMarker.cxx:229
Base-class for non-linear projections.
void SetOwnIds(Bool_t o)
Definition: TPointSet3D.h:56
void Set(Int_t n)
Set size of this array to n ints.
Definition: TArrayI.cxx:105
virtual void SetMarkerSize(Size_t msize=1)
Set marker size, propagate to projecteds.
Manager class for steering of projections and managing projected objects.
short Color_t
Definition: RtypesCore.h:79
TEvePointSelectorConsumer is a virtual base for classes that can be filled from TTree data via the TE...
Definition: TEveTreeTools.h:45
void Emit(const char *signal)
Acitvate signal without args.
Definition: TQObject.cxx:561
virtual void PointSelected(Int_t id)
Virtual method of base class TPointSet3D.
Style_t fMarkerStyle
Marker style.
Definition: TAttMarker.h:28
virtual void CopyVizParams(const TEveElement *el)
Copy visualization parameters from element el.
Abstract base-class for non-linear projectable objects.
virtual void PointSelected(Int_t n)
This virtual method is called from TPointSet3DGL when a point is selected.
virtual Double_t * GetV1() const
TPaveText * pt
void SetOwnIds(Bool_t o)
Propagate id-object ownership to children.
Int_t GetSize() const
Definition: TArray.h:49
Bool_t Fill(Double_t x, Double_t y, Double_t z, Double_t quant)
Add a new point.
TEveProjectable * fProjectable
virtual void SetDepthLocal(Float_t d)
Set depth (z-coordinate) of the projected points.
TEveProjectionManager * fManager
TMarker * m
Definition: textangle.C:8
char * Form(const char *fmt,...)
void StampObjProps()
Definition: TEveElement.h:397
TEvePointSet is a render-element holding a collection of 3D points with optional per-point TRef and a...
Definition: TEvePointSet.h:31
void ResetBBox()
Definition: TAttBBox.h:48
virtual Bool_t SetRnrSelf(Bool_t rnr)
Set render state of this element, i.e.
void CloseBins()
Call this after all the points have been filled.
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:81
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
Definition: TAttMarker.h:45
virtual void ComputeBBox()
Compute the bounding box of this points set.
Definition: TPointSet3D.cxx:90
virtual void AddElement(TEveElement *el)
Add el to the list of children.
virtual void Paint(Option_t *option="")
Paint point-set.
virtual void RemoveElementLocal(TEveElement *el)
Virtual from TEveElement, provide bin management.
virtual void TakeAction(TEvePointSelector *)
Called from TEvePointSelector when internal arrays of the tree-selector are filled up and need to be ...
virtual void SetProjection(TEveProjectionManager *proj, TEveProjectable *model)
Set projection manager and projection model.
void CopyIds(const TPointSet3D &t)
Copy id objects from point-set &#39;t&#39;.
Definition: TPointSet3D.cxx:61
void AssertIntIdsSize()
Assert that size of IntId array is compatible with the size of the point array.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Definition: TAttMarker.h:46
virtual void PointSelected(Int_t id)
Virtual method of base class TPointSet3D.
Double_t Cos(Double_t)
Definition: TMath.h:424
void ProjectPointfv(Float_t *v, Float_t d)
Project float array.
TEveProjection * GetProjection()
void SetPoint(Int_t n, Double_t x, Double_t y, Double_t z)
Set point n to x, y, z.
virtual Int_t SetNextPoint(Double_t x, Double_t y, Double_t z)
Set point following LastPoint to x, y, z.
virtual void InitFill(Int_t subIdNum)
Initialize point-set for new filling.
Int_t GrowFor(Int_t n_points)
Resizes internal array to allow additional n_points to be stored.
#define ClassImp(name)
Definition: Rtypes.h:279
Int_t GetPointIntId(Int_t p, Int_t i) const
Return i-th integer id of point with index p.
double Double_t
Definition: RtypesCore.h:55
TArrayI * fIntIds
Definition: TEvePointSet.h:44
Double_t y[n]
Definition: legend1.C:17
virtual void WriteVizParams(std::ostream &out, const TString &var)
Write visualization parameters.
virtual Int_t GetNfill() const
Definition: TSelectorDraw.h:86
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Definition: TRolke.cxx:630
void SetPointIntIds(Int_t *ids)
Set integer ids for the last point that was registered (most probably via TPolyMarker3D::SetNextPoint...
virtual void SetMarkerSize(Size_t msize=1)
Set marker size, propagate to children.
TEvePointSet ** fBins
Definition: TEvePointSet.h:118
virtual void TakeAction(TEvePointSelector *)
Called from TEvePointSelector when internal arrays of the tree-selector are filled up and need to be ...
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.
Mother of all ROOT objects.
Definition: TObject.h:37
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
ProjList_t fProjectedList
void SetDepthCommon(Float_t d, TEveElement *el, Float_t *bbox)
Utility function to update the z-values of the bounding-box.
virtual void RemoveElements()
Remove all elements.
virtual Int_t GetN() const
Definition: TPolyMarker3D.h:66
Short_t Max(Short_t a, Short_t b)
Definition: TMathBase.h:202
virtual void WriteVizParams(std::ostream &out, const TString &var)
Write-out visual parameters for this object.
Double_t Sin(Double_t)
Definition: TMath.h:421
virtual Float_t * GetP() const
Definition: TPolyMarker3D.h:67
Exception class thrown by TEve classes and macros.
Definition: TEveUtil.h:102
void SetPointId(TObject *id)
Set external object id of the last added point.
TEvePointSet(Int_t n_points=0, ETreeVarType_e tv_type=kTVT_XYZ)
Constructor.
Int_t * GetPointIntIds(Int_t p) const
Return a pointer to integer ids of point with index p.
virtual ~TEvePointSetArray()
Destructor: deletes the fBins array.
virtual Color_t GetMarkerColor() const
Return the marker color.
Definition: TAttMarker.h:36
virtual TEveTrans * PtrMainTrans(Bool_t create=kTRUE)
Return pointer to main transformation.
TPolyMarker3D using TPointSet3DGL for direct OpenGL rendering.
Definition: TPointSet3D.h:25
const int nn
Float_t * fP
Definition: TPolyMarker3D.h:44
ETreeVarType_e fSourceCS
Definition: TEveTreeTools.h:51
const Bool_t kTRUE
Definition: Rtypes.h:91
Color_t fMarkerColor
Marker color.
Definition: TAttMarker.h:27
virtual void SetMarkerStyle(Style_t mstyle=1)
Set marker style, propagate to children.
Int_t Nint(T x)
Definition: TMath.h:480
TString fOption
Definition: TPolyMarker3D.h:45
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:33
const Int_t n
Definition: legend1.C:16
void InitBins(const char *quant_name, Int_t nbins, Double_t min, Double_t max)
Initialize internal point-sets with given binning parameters.
Int_t CeilNint(Double_t x)
Definition: TMath.h:470
virtual Int_t Size() const
Definition: TPolyMarker3D.h:81
char name[80]
Definition: TGX11.cxx:109
TEvePointSelector is a sub-class of TSelectorDraw for direct extraction of point-like data from a Tre...
Definition: TEveTreeTools.h:66
TString fTitle
Definition: TEvePointSet.h:43
Double_t fMin
Index of the last filled TEvePointSet.
Definition: TEvePointSet.h:122