Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TPolyMarker3D.cxx
Go to the documentation of this file.
1// @(#)root/g3d:$Id$
2// Author: Nenad Buncic 21/08/95
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, 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 "TView.h"
13#include "TPolyMarker3D.h"
14#include "TVirtualPad.h"
15#include "TRandom.h"
16#include "TBuffer.h"
17#include "TBuffer3D.h"
18#include "TBuffer3DTypes.h"
19#include "TVirtualViewer3D.h"
20#include "TGeometry.h"
21#include "TH1.h"
22#include "TROOT.h"
23#include "TMath.h"
24
25#include <cassert>
26#include <iostream>
27
29
30constexpr Int_t kDimension = 3;
31
32/** \class TPolyMarker3D
33\ingroup g3d
34A 3D polymarker.
35
36It has three constructors.
37
38First one, without any parameters TPolyMarker3D(), we call 'default
39constructor' and it's used in a case that just an initialisation is
40needed (i.e. pointer declaration).
41
42Example:
43
44~~~ {.cpp}
45 TPolyMarker3D *pm = new TPolyMarker3D;
46~~~
47
48Second one, takes, usually, two parameters, n (number of points) and
49marker (marker style). Third parameter is optional.
50
51Example:
52
53~~~ {.cpp}
54 TPolyMarker3D (150, 1);
55~~~
56
57Third one takes, usually, three parameters, n (number of points), *p
58(pointer to an array of 3D points), and marker (marker style). Fourth
59parameter is optional.
60
61Example:
62
63~~~ {.cpp}
64 Float_t *ptr = new Float_t [150*3];
65 ... ... ...
66 ... ... ...
67 ... ... ...
68 TPolyMarker3D (150, ptr, 1);
69~~~
70*/
71
72////////////////////////////////////////////////////////////////////////////////
73/// 3-D polymarker default constructor.
74
76{
77 fN = 0;
78 fP = 0;
79 fLastPoint = -1;
80 fName = "TPolyMarker3D";
81}
82
83////////////////////////////////////////////////////////////////////////////////
84/// 3-D polymarker normal constructor with initialization to 0.
85
87{
88 fName = "TPolyMarker3D";
89 fOption = option;
90 SetMarkerStyle(marker);
92 fLastPoint = -1;
93 if (n <= 0) {
94 fN = 0;
95 fP = 0;
96 return;
97 }
98
99 fN = n;
100 fP = new Float_t [kDimension*fN];
101 for (Int_t i = 0; i < kDimension*fN; i++) fP[i] = 0;
102}
103
104////////////////////////////////////////////////////////////////////////////////
105/// 3-D polymarker constructor. Polymarker is initialized with p.
106
108 Option_t *option)
109{
110 fName = "TPolyMarker3D";
111 SetMarkerStyle(marker);
113 fOption = option;
114 fLastPoint = -1;
115 if (n <= 0) {
116 fN = 0;
117 fP = 0;
118 return;
119 }
120
121 fN = n;
122 fP = new Float_t [kDimension*fN];
123 if (p) {
124 for (Int_t i = 0; i < kDimension*fN; i++)
125 fP[i] = p[i];
126 fLastPoint = fN-1;
127 } else
128 memset(fP,0,kDimension*fN*sizeof(Float_t));
129}
130
131////////////////////////////////////////////////////////////////////////////////
132/// 3-D polymarker constructor. Polymarker is initialized with p
133/// (cast to float).
134
136 Option_t *option)
137{
138 fName = "TPolyMarker3D";
139 SetMarkerStyle(marker);
141 fOption = option;
142 fLastPoint = -1;
143 if (n <= 0) {
144 fN = 0;
145 fP = 0;
146 return;
147 }
148
149 fN = n;
150 fP = new Float_t [kDimension*fN];
151 if (p) {
152 for (Int_t i = 0; i < kDimension*fN; i++)
153 fP[i] = (Float_t) p[i];
154 fLastPoint = fN-1;
155 } else
156 memset(fP,0,kDimension*fN*sizeof(Float_t));
157}
158
159////////////////////////////////////////////////////////////////////////////////
160/// assignment operator
161
163{
164 if(this != &tp3)
165 tp3.TPolyMarker3D::Copy(*this);
166 return *this;
167}
168
169////////////////////////////////////////////////////////////////////////////////
170/// 3-D polymarker destructor.
171
173{
174 fN = 0;
175 if (fP) delete [] fP;
176 fLastPoint = -1;
177}
178
179////////////////////////////////////////////////////////////////////////////////
180/// 3-D polymarker copy ctor.
181
183 TObject(p), TAttMarker(p), TAtt3D(p)
184{
185 fN = 0;
186 fP = 0;
187 fLastPoint = -1;
188 p.TPolyMarker3D::Copy(*this);
189}
190
191////////////////////////////////////////////////////////////////////////////////
192/// Copy polymarker to polymarker obj.
193
195{
196 auto &tgt = static_cast<TPolyMarker3D &>(obj);
197 TObject::Copy(obj);
198 TAttMarker::Copy(tgt);
199 tgt.fN = fN;
200 if (tgt.fP)
201 delete [] tgt.fP;
202 if (fN > 0) {
203 tgt.fP = new Float_t [kDimension*fN];
204 for (Int_t i = 0; i < kDimension*fN; i++)
205 tgt.fP[i] = fP[i];
206 } else {
207 tgt.fP = nullptr;
208 }
209 tgt.fOption = fOption;
210 tgt.fLastPoint = fLastPoint;
211 tgt.fName = fName;
212}
213
214////////////////////////////////////////////////////////////////////////////////
215/// Compute distance from point px,py to a 3-D polymarker.
216/// Compute the closest distance of approach from point px,py to each segment
217/// of the polymarker.
218/// Returns when the distance found is below DistanceMaximum.
219/// The distance is computed in pixels units.
220
222{
223 const Int_t inaxis = 7;
224 Int_t dist = 9999;
225
226 Int_t puxmin = gPad->XtoAbsPixel(gPad->GetUxmin());
227 Int_t puymin = gPad->YtoAbsPixel(gPad->GetUymin());
228 Int_t puxmax = gPad->XtoAbsPixel(gPad->GetUxmax());
229 Int_t puymax = gPad->YtoAbsPixel(gPad->GetUymax());
230
231 // return if point is not in the user area
232 if (px < puxmin - inaxis) return dist;
233 if (py > puymin + inaxis) return dist;
234 if (px > puxmax + inaxis) return dist;
235 if (py < puymax - inaxis) return dist;
236
237 TView *view = gPad->GetView();
238 if (!view) return dist;
239 Int_t i, dpoint;
240 Float_t xndc[3];
241 Int_t x1,y1;
242 Double_t u,v;
243 for (i=0;i<Size();i++) {
244 view->WCtoNDC(&fP[3*i], xndc);
245 u = (Double_t)xndc[0];
246 v = (Double_t)xndc[1];
247 if (u < gPad->GetUxmin() || u > gPad->GetUxmax()) continue;
248 if (v < gPad->GetUymin() || v > gPad->GetUymax()) continue;
249 x1 = gPad->XtoAbsPixel(u);
250 y1 = gPad->YtoAbsPixel(v);
251 dpoint = Int_t(TMath::Sqrt((((Double_t)px-x1)*((Double_t)px-x1)
252 + ((Double_t)py-y1)*((Double_t)py-y1))));
253 if (dpoint < dist) dist = dpoint;
254 }
255 return dist;
256}
257
258////////////////////////////////////////////////////////////////////////////////
259/// Draws 3-D polymarker with its current attributes.
260
262{
263 AppendPad(option);
264}
265
266////////////////////////////////////////////////////////////////////////////////
267/// Draw this 3-D polymarker with new coordinates. Creates a new
268/// polymarker which will be adopted by the pad in which it is drawn.
269/// Does not change the original polymarker (should be static method).
270
272{
273 TPolyMarker3D *newpolymarker = new TPolyMarker3D();
274 newpolymarker->fN = n;
275 newpolymarker->fP = new Float_t [kDimension*fN];
276 for (Int_t i = 0; i < kDimension*fN; i++) newpolymarker->fP[i] = p[i];
277 newpolymarker->SetMarkerStyle(GetMarkerStyle());
278 newpolymarker->fOption = fOption;
279 newpolymarker->fLastPoint = fLastPoint;
280 newpolymarker->SetBit(kCanDelete);
281 newpolymarker->AppendPad(option);
282}
283
284////////////////////////////////////////////////////////////////////////////////
285/// Execute action corresponding to one event.
286
288{
289 if (!gPad) return;
290 if (gPad->GetView()) gPad->GetView()->ExecuteRotateView(event, px, py);
291}
292
293////////////////////////////////////////////////////////////////////////////////
294/// List this 3-D polymarker.
295
296void TPolyMarker3D::ls(Option_t *option) const
297{
299 std::cout << " TPolyMarker3D N=" << Size() <<" Option="<<option<<std::endl;
300}
301
302////////////////////////////////////////////////////////////////////////////////
303/// Merge polymarkers in the collection in this polymarker
304
306{
307 if (!li) return 0;
308 TIter next(li);
309
310 //first loop to count the number of entries
311 TPolyMarker3D *pm;
312 Int_t npoints = Size();
313 while ((pm = (TPolyMarker3D*)next())) {
314 if (!pm->InheritsFrom(TPolyMarker3D::Class())) {
315 Error("Add","Attempt to add object of class: %s to a %s",pm->ClassName(),this->ClassName());
316 return -1;
317 }
318 npoints += pm->Size();
319 }
320 Int_t currPoint = Size();
321
322 //extend this polymarker to hold npoints
323 SetPoint(npoints-1,0,0,0);
324
325 //merge all polymarkers
326 next.Reset();
327 while ((pm = (TPolyMarker3D*)next())) {
328 Int_t np = pm->Size();
329 Float_t *p = pm->GetP();
330 for (Int_t i = 0; i < np; i++) {
331 SetPoint(currPoint++, p[3*i], p[3*i+1], p[3*i+2]);
332 }
333 }
334 return npoints;
335}
336
337////////////////////////////////////////////////////////////////////////////////
338/// Paint a TPolyMarker3D.
339
341{
342 // No need to continue if there is nothing to paint
343 if (Size() <= 0) return;
344
345 static TBuffer3D buffer(TBuffer3DTypes::kMarker);
346
347 buffer.ClearSectionsValid();
348
349 // Section kCore
350 buffer.fID = this;
351 buffer.fColor = GetMarkerColor();
352 buffer.fTransparency = 0;
353 buffer.fLocalFrame = kFALSE;
355
356 // We fill kCore and kRawSizes on first pass and try with viewer
357 TVirtualViewer3D * viewer3D = gPad->GetViewer3D();
358 if (!viewer3D) return;
359 Int_t reqSections = viewer3D->AddObject(buffer);
360 if (reqSections == TBuffer3D::kNone) {
361 return;
362 }
363
364 if (reqSections & TBuffer3D::kRawSizes) {
365 if (!buffer.SetRawSizes(Size(), 3*Size(), 1, 1, 0, 0)) {
366 return;
367 }
369 }
370
371 if ((reqSections & TBuffer3D::kRaw) && buffer.SectionsValid(TBuffer3D::kRawSizes)) {
372 // Points
373 for (UInt_t i=0; i<3*buffer.NbPnts(); i++) {
374 buffer.fPnts[i] = (Double_t)fP[i];
375 }
376
377 // Transform points - we don't support local->global matrix
378 // so always work in global reference frame
379 if (gGeometry) {
380 Double_t dlocal[3];
381 Double_t dmaster[3];
382 for (UInt_t j=0; j<buffer.NbPnts(); j++) {
383 dlocal[0] = buffer.fPnts[3*j];
384 dlocal[1] = buffer.fPnts[3*j+1];
385 dlocal[2] = buffer.fPnts[3*j+2];
386 gGeometry->Local2Master(&dlocal[0],&dmaster[0]);
387 buffer.fPnts[3*j] = dmaster[0];
388 buffer.fPnts[3*j+1] = dmaster[1];
389 buffer.fPnts[3*j+2] = dmaster[2];
390 }
391 }
392
393 // Basic colors: 0, 1, ... 7
394 Int_t c = (((GetMarkerColor()) %8) -1) * 4;
395 if (c < 0) c = 0;
396
397 // Segments
398 buffer.fSegs[0] = c;
399
401
403 }
404
405 viewer3D->AddObject(buffer);
406}
407
408////////////////////////////////////////////////////////////////////////////////
409/// Paint 3-d histogram h with 3-d polymarkers.
410
412{
413 const Int_t kMaxEntry = 100000;
414 Int_t in, bin, binx, biny, binz;
415
416 TAxis *xaxis = h->GetXaxis();
417 TAxis *yaxis = h->GetYaxis();
418 TAxis *zaxis = h->GetZaxis();
419 Double_t entry = 0;
420 for (binz=zaxis->GetFirst();binz<=zaxis->GetLast();binz++) {
421 for (biny=yaxis->GetFirst();biny<=yaxis->GetLast();biny++) {
422 for (binx=xaxis->GetFirst();binx<=xaxis->GetLast();binx++) {
423 bin = h->GetBin(binx,biny,binz);
424 entry += h->GetBinContent(bin);
425 }
426 }
427 }
428
429 // if histogram has too many entries, rescale it
430 // never draw more than kMaxEntry markers, otherwise this kills
431 // the X server
432 Double_t scale = 1.;
433 if (entry > kMaxEntry) scale = kMaxEntry/Double_t(entry);
434
435 //Create or modify 3-d view object
436 TView *view = gPad->GetView();
437 if (!view) {
438 gPad->Range(-1,-1,1,1);
439 view = TView::CreateView(1,0,0);
440 if (!view) return;
441 }
442 view->SetRange(xaxis->GetBinLowEdge(xaxis->GetFirst()),
443 yaxis->GetBinLowEdge(yaxis->GetFirst()),
444 zaxis->GetBinLowEdge(zaxis->GetFirst()),
445 xaxis->GetBinUpEdge(xaxis->GetLast()),
446 yaxis->GetBinUpEdge(yaxis->GetLast()),
447 zaxis->GetBinUpEdge(zaxis->GetLast()));
448
449 view->PadRange(gPad->GetFrameFillColor());
450
451 if (entry == 0) return;
452 Int_t nmk = Int_t(TMath::Min(Double_t(kMaxEntry),entry));
453 TPolyMarker3D *pm3d = new TPolyMarker3D(nmk);
454 pm3d->SetMarkerStyle(h->GetMarkerStyle());
455 pm3d->SetMarkerColor(h->GetMarkerColor());
456 pm3d->SetMarkerSize(h->GetMarkerSize());
457 gPad->Modified(kTRUE);
458
459 entry = 0;
460 Double_t x,y,z,xw,yw,zw,xp,yp,zp;
461 Int_t ncounts;
462 for (binz=zaxis->GetFirst();binz<=zaxis->GetLast();binz++) {
463 z = zaxis->GetBinLowEdge(binz);
464 zw = zaxis->GetBinWidth(binz);
465 for (biny=yaxis->GetFirst();biny<=yaxis->GetLast();biny++) {
466 y = yaxis->GetBinLowEdge(biny);
467 yw = yaxis->GetBinWidth(biny);
468 for (binx=xaxis->GetFirst();binx<=xaxis->GetLast();binx++) {
469 x = xaxis->GetBinLowEdge(binx);
470 xw = xaxis->GetBinWidth(binx);
471 bin = h->GetBin(binx,biny,binz);
472 ncounts = Int_t(h->GetBinContent(bin)*scale+0.5);
473 for (in=0;in<ncounts;in++) {
474 xp = x + xw*gRandom->Rndm();
475 yp = y + yw*gRandom->Rndm();
476 zp = z + zw*gRandom->Rndm();
477 pm3d->SetPoint(Int_t(entry),xp,yp,zp);
478 entry++;
479 }
480 }
481 }
482 }
483 pm3d->Paint(option);
484 delete pm3d;
485}
486
487////////////////////////////////////////////////////////////////////////////////
488/// Print 3-D polymarker with its attributes on stdout.
489
491{
492 printf("TPolyMarker3D N=%d, Option=%s\n",fN,option);
493 TString opt = option;
494 opt.ToLower();
495 if (opt.Contains("all")) {
496 for (Int_t i=0;i<Size();i++) {
498 printf(" x[%d]=%g, y[%d]=%g, z[%d]=%g\n",i,fP[3*i],i,fP[3*i+1],i,fP[3*i+2]);
499 }
500 }
501}
502
503////////////////////////////////////////////////////////////////////////////////
504/// Save primitive as a C++ statement(s) on output stream.
505
506void TPolyMarker3D::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
507{
508 char quote = '"';
509 out<<" "<<std::endl;
510 if (gROOT->ClassSaved(TPolyMarker3D::Class())) {
511 out<<" ";
512 } else {
513 out<<" TPolyMarker3D *";
514 }
515 out<<"pmarker3D = new TPolyMarker3D("<<fN<<","<<GetMarkerStyle()<<","<<quote<<fOption<<quote<<");"<<std::endl;
516 out<<" pmarker3D->SetName("<<quote<<GetName()<<quote<<");"<<std::endl;
517
518 SaveMarkerAttributes(out,"pmarker3D",1,1,1);
519
520 for (Int_t i=0;i<Size();i++) {
521 out<<" pmarker3D->SetPoint("<<i<<","<<fP[3*i]<<","<<fP[3*i+1]<<","<<fP[3*i+2]<<");"<<std::endl;
522 }
523 out<<" pmarker3D->Draw();"<<std::endl;
524}
525
526////////////////////////////////////////////////////////////////////////////////
527/// Change (i.e. set) the name of the TNamed.
528/// WARNING: if the object is a member of a THashTable or THashList container
529/// the container must be Rehash()'ed after SetName(). For example the list
530/// of objects in the current directory is a THashList.
531
533{
534 fName = name;
535 if (gPad && TestBit(kMustCleanup)) gPad->Modified();
536}
537
538////////////////////////////////////////////////////////////////////////////////
539/// Set point following LastPoint to x, y, z.
540/// Returns index of the point (new last point).
541
543{
544 fLastPoint++;
545 SetPoint(fLastPoint, x, y, z);
546 return fLastPoint;
547}
548
549////////////////////////////////////////////////////////////////////////////////
550/// Set point n to x, y, z.
551/// If n is more then the current TPolyMarker3D size (n > fN) then
552/// the polymarker will be resized to contain at least n points.
553
555{
556 if (n < 0) return;
557 if (!fP || n >= fN) {
558 // re-allocate the object
559 Int_t newN = TMath::Max(2*fN,n+1);
560 Float_t *savepoint = new Float_t [kDimension*newN];
561 if (fP && fN){
562 memcpy(savepoint,fP,kDimension*fN*sizeof(Float_t));
563 memset(&savepoint[kDimension*fN],0,(newN-fN)*sizeof(Float_t));
564 delete [] fP;
565 }
566 fP = savepoint;
567 fN = newN;
568 }
569 fP[kDimension*n ] = x;
570 fP[kDimension*n+1] = y;
571 fP[kDimension*n+2] = z;
573}
574
575////////////////////////////////////////////////////////////////////////////////
576/// Re-initialize polymarker with n points from p. If p=0 initialize with 0.
577/// if n <= 0 the current array of points is deleted.
578
580{
581 SetMarkerStyle(marker);
582 fOption = option;
583 if (n <= 0) {
584 fN = 0;
585 fLastPoint = -1;
586 delete [] fP;
587 fP = 0;
588 return;
589 }
590 fN = n;
591 if (fP) delete [] fP;
592 fP = new Float_t [3*fN];
593 if (p) {
594 for (Int_t i = 0; i < fN; i++) {
595 fP[3*i] = p[3*i];
596 fP[3*i+1] = p[3*i+1];
597 fP[3*i+2] = p[3*i+2];
598 }
599 } else {
600 memset(fP,0,kDimension*fN*sizeof(Float_t));
601 }
602 fLastPoint = fN-1;
603}
604
605////////////////////////////////////////////////////////////////////////////////
606/// Re-initialize polymarker with n points from p. If p=0 initialize with 0.
607/// if n <= 0 the current array of points is deleted.
608
610{
611 SetMarkerStyle(marker);
612 fOption = option;
613 if (n <= 0) {
614 fN = 0;
615 fLastPoint = -1;
616 delete [] fP;
617 fP = 0;
618 return;
619 }
620 fN = n;
621 if (fP) delete [] fP;
622 fP = new Float_t [3*fN];
623 if (p) {
624 for (Int_t i = 0; i < fN; i++) {
625 fP[3*i] = (Float_t) p[3*i];
626 fP[3*i+1] = (Float_t) p[3*i+1];
627 fP[3*i+2] = (Float_t) p[3*i+2];
628 }
629 } else {
630 memset(fP,0,kDimension*fN*sizeof(Float_t));
631 }
632 fLastPoint = fN-1;
633}
634
635////////////////////////////////////////////////////////////////////////////////
636/// Stream a 3-D polymarker object.
637
638void TPolyMarker3D::Streamer(TBuffer &b)
639{
640 UInt_t R__s, R__c;
641 if (b.IsReading()) {
642 Version_t R__v = b.ReadVersion(&R__s, &R__c);
643 if (R__v > 2) b.ClassBegin(TPolyMarker3D::IsA());
644 if (R__v > 2) b.ClassMember("TObject");
645 TObject::Streamer(b);
646 if (R__v > 2) b.ClassMember("TAttMarker");
647 TAttMarker::Streamer(b);
648 if (R__v > 2) b.ClassMember("fN","Int_t");
649 b >> fN;
650 if (fN) {
651 if (R__v > 2) b.ClassMember("fP","Float_t", kDimension*fN);
652 fP = new Float_t[kDimension*fN];
653 b.ReadFastArray(fP,kDimension*fN);
654 }
655 fLastPoint = fN-1;
656 if (R__v > 2) b.ClassMember("fOption","TString");
657 fOption.Streamer(b);
658 if (R__v > 2) b.ClassMember("fName","TString");
659 if (R__v > 1) fName.Streamer(b);
660 if (R__v > 2) b.ClassEnd(TPolyMarker3D::IsA());
661 b.CheckByteCount(R__s, R__c, TPolyMarker3D::IsA());
662 } else {
663 R__c = b.WriteVersion(TPolyMarker3D::IsA(), kTRUE);
664 b.ClassBegin(TPolyMarker3D::IsA());
665 b.ClassMember("TObject");
666 TObject::Streamer(b);
667 b.ClassMember("TAttMarker");
668 TAttMarker::Streamer(b);
669 b.ClassMember("fN","Int_t");
670 Int_t size = Size();
671 b << size;
672 if (size) {
673 b.ClassMember("fP","Float_t", kDimension*size);
674 b.WriteFastArray(fP, kDimension*size);
675 }
676 b.ClassMember("fOption","TString");
677 fOption.Streamer(b);
678 b.ClassMember("fName","TString");
679 fName.Streamer(b);
680 b.ClassEnd(TPolyMarker3D::IsA());
681 b.SetByteCount(R__c, kTRUE);
682 }
683}
684
685////////////////////////////////////////////////////////////////////////////////
686/// Fills the parameters x, y, z with the coordinate of the n-th point
687/// n must be between 0 and Size() - 1.
688
690{
691 if (n < 0 || n >= Size()) return;
692 if (!fP) return;
693 x = fP[kDimension*n ];
694 y = fP[kDimension*n+1];
695 z = fP[kDimension*n+2];
696}
697
698////////////////////////////////////////////////////////////////////////////////
699/// Fills the parameters x, y, z with the coordinate of the n-th point
700/// n must be between 0 and Size() - 1.
701
703{
704 if (n < 0 || n >= Size()) return;
705 if (!fP) return;
706 x = (Double_t)fP[kDimension*n ];
707 y = (Double_t)fP[kDimension*n+1];
708 z = (Double_t)fP[kDimension*n+2];
709}
710
711
#define b(i)
Definition RSha256.hxx:100
#define c(i)
Definition RSha256.hxx:101
#define h(i)
Definition RSha256.hxx:106
static const double x1[5]
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Definition RtypesCore.h:45
short Version_t
Definition RtypesCore.h:65
short Marker_t
Definition RtypesCore.h:90
unsigned int UInt_t
Definition RtypesCore.h:46
const Bool_t kFALSE
Definition RtypesCore.h:101
double Double_t
Definition RtypesCore.h:59
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
R__EXTERN TGeometry * gGeometry
Definition TGeometry.h:158
constexpr Int_t kDimension
#define gROOT
Definition TROOT.h:404
R__EXTERN TRandom * gRandom
Definition TRandom.h:62
#define gPad
int currPoint
Definition X3DBuffer.c:17
Use this attribute class when an object should have 3D capabilities.
Definition TAtt3D.h:19
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 Modify()
Change current marker attributes if necessary.
virtual Style_t GetMarkerStyle() const
Return the marker style.
Definition TAttMarker.h:32
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Definition TAttMarker.h:38
virtual Color_t GetMarkerColor() const
Return the marker color.
Definition TAttMarker.h:31
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
Definition TAttMarker.h:40
void Copy(TAttMarker &attmarker) const
Copy this marker attributes to a new TAttMarker.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Definition TAttMarker.h:41
Class to manage histogram axis.
Definition TAxis.h:30
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
Definition TAxis.cxx:518
Int_t GetLast() const
Return last bin on the axis i.e.
Definition TAxis.cxx:469
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
Definition TAxis.cxx:540
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
Definition TAxis.cxx:528
Int_t GetFirst() const
Return first bin on the axis i.e.
Definition TAxis.cxx:458
Generic 3D primitive description class.
Definition TBuffer3D.h:18
UInt_t NbPnts() const
Definition TBuffer3D.h:80
Bool_t SectionsValid(UInt_t mask) const
Definition TBuffer3D.h:67
void ClearSectionsValid()
Clear any sections marked valid.
void SetSectionsValid(UInt_t mask)
Definition TBuffer3D.h:65
Int_t * fSegs
Definition TBuffer3D.h:113
Bool_t fLocalFrame
Definition TBuffer3D.h:90
Int_t fColor
Definition TBuffer3D.h:88
Short_t fTransparency
Definition TBuffer3D.h:89
TObject * fID
Definition TBuffer3D.h:87
Bool_t SetRawSizes(UInt_t reqPnts, UInt_t reqPntsCapacity, UInt_t reqSegs, UInt_t reqSegsCapacity, UInt_t reqPols, UInt_t reqPolsCapacity)
Set kRaw tessellation section of buffer with supplied sizes.
Double_t * fPnts
Definition TBuffer3D.h:112
Buffer base class used for serializing objects.
Definition TBuffer.h:43
Collection abstract base class.
Definition TCollection.h:65
virtual void Local2Master(Double_t *local, Double_t *master)
Convert one point from local system to master reference system.
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:58
void Reset()
Mother of all ROOT objects.
Definition TObject.h:41
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:201
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition TObject.cxx:200
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
Definition TObject.cxx:177
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:766
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition TObject.cxx:515
virtual void Copy(TObject &object) const
Copy this to obj.
Definition TObject.cxx:133
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:963
@ kCanDelete
if object in a list can be deleted
Definition TObject.h:62
@ kMustCleanup
if object destructor must call RecursiveRemove()
Definition TObject.h:64
A 3D polymarker.
static void PaintH3(TH1 *h, Option_t *option)
Paint 3-d histogram h with 3-d polymarkers.
virtual Int_t Merge(TCollection *list)
Merge polymarkers in the collection in this polymarker.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream.
virtual void DrawPolyMarker(Int_t n, Float_t *p, Marker_t marker, Option_t *option="")
Draw this 3-D polymarker with new coordinates.
void SetPoint(Int_t n, Double_t x, Double_t y, Double_t z)
Set point n to x, y, z.
virtual void GetPoint(Int_t n, Float_t &x, Float_t &y, Float_t &z) const
Fills the parameters x, y, z with the coordinate of the n-th point n must be between 0 and Size() - 1...
virtual void SetPolyMarker(Int_t n, Float_t *p, Marker_t marker, Option_t *option="")
Re-initialize polymarker with n points from p.
virtual ~TPolyMarker3D()
3-D polymarker destructor.
virtual Int_t Size() const
virtual const char * GetName() const
Returns name of object.
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
virtual void SetName(const char *name)
Change (i.e.
TPolyMarker3D & operator=(const TPolyMarker3D &)
assignment operator
virtual void Paint(Option_t *option="")
Paint a TPolyMarker3D.
virtual Float_t * GetP() const
virtual void Copy(TObject &polymarker) const
Copy polymarker to polymarker obj.
virtual Int_t SetNextPoint(Double_t x, Double_t y, Double_t z)
Set point following LastPoint to x, y, z.
virtual void Print(Option_t *option="") const
Print 3-D polymarker with its attributes on stdout.
virtual void ls(Option_t *option="") const
List this 3-D polymarker.
Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a 3-D polymarker.
virtual void Draw(Option_t *option="")
Draws 3-D polymarker with its current attributes.
TPolyMarker3D()
3-D polymarker default constructor.
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
Definition TROOT.cxx:2819
virtual Double_t Rndm()
Machine independent random number generator.
Definition TRandom.cxx:552
Basic string class.
Definition TString.h:136
void ToLower()
Change string to lower-case.
Definition TString.cxx:1150
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:624
See TView3D.
Definition TView.h:25
virtual void WCtoNDC(const Float_t *pw, Float_t *pn)=0
static TView * CreateView(Int_t system=1, const Double_t *rmin=0, const Double_t *rmax=0)
Create a concrete default 3-d view via the plug-in manager.
Definition TView.cxx:27
virtual void PadRange(Int_t rback)=0
virtual void SetRange(const Double_t *min, const Double_t *max)=0
Abstract 3D shapes viewer.
virtual Int_t AddObject(const TBuffer3D &buffer, Bool_t *addChildren=0)=0
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
Short_t Max(Short_t a, Short_t b)
Definition TMathBase.h:208
Double_t Sqrt(Double_t x)
Definition TMath.h:641
Short_t Min(Short_t a, Short_t b)
Definition TMathBase.h:176