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
28
29constexpr Int_t kDimension = 3;
30
31/** \class TPolyMarker3D
32\ingroup g3d
33A 3D polymarker.
34
35It has three constructors.
36
37First one, without any parameters TPolyMarker3D(), we call 'default
38constructor' and it's used in a case that just an initialisation is
39needed (i.e. pointer declaration).
40
41Example:
42
43~~~ {.cpp}
44 TPolyMarker3D *pm = new TPolyMarker3D;
45~~~
46
47Second one, takes, usually, two parameters, n (number of points) and
48marker (marker style). Third parameter is optional.
49
50Example:
51
52~~~ {.cpp}
53 TPolyMarker3D (150, 1);
54~~~
55
56Third one takes, usually, three parameters, n (number of points), *p
57(pointer to an array of 3D points), and marker (marker style). Fourth
58parameter is optional.
59
60Example:
61
62~~~ {.cpp}
63 Float_t *ptr = new Float_t [150*3];
64 ... ... ...
65 ... ... ...
66 ... ... ...
67 TPolyMarker3D (150, ptr, 1);
68~~~
69*/
70
71////////////////////////////////////////////////////////////////////////////////
72/// 3-D polymarker default constructor.
73
75{
76 fName = "TPolyMarker3D";
77}
78
79////////////////////////////////////////////////////////////////////////////////
80/// 3-D polymarker normal constructor with initialization to 0.
81
83{
84 fName = "TPolyMarker3D";
86 SetMarkerStyle(marker);
88 if (n <= 0)
89 return;
90
91 fN = n;
92 fP = new Float_t [kDimension*fN];
93 for (Int_t i = 0; i < kDimension*fN; i++) fP[i] = 0;
94}
95
96////////////////////////////////////////////////////////////////////////////////
97/// 3-D polymarker constructor. Polymarker is initialized with p.
98
101{
102 fName = "TPolyMarker3D";
103 SetMarkerStyle(marker);
105 fOption = option;
106 if (n <= 0)
107 return;
108
109 fN = n;
110 fP = new Float_t [kDimension*fN];
111 if (p) {
112 for (Int_t i = 0; i < kDimension*fN; i++)
113 fP[i] = p[i];
114 fLastPoint = fN-1;
115 } else
116 memset(fP,0,kDimension*fN*sizeof(Float_t));
117}
118
119////////////////////////////////////////////////////////////////////////////////
120/// 3-D polymarker constructor. Polymarker is initialized with p
121/// (cast to float).
122
125{
126 fName = "TPolyMarker3D";
127 SetMarkerStyle(marker);
129 fOption = option;
130 if (n <= 0)
131 return;
132
133 fN = n;
134 fP = new Float_t [kDimension*fN];
135 if (p) {
136 for (Int_t i = 0; i < kDimension*fN; i++)
137 fP[i] = (Float_t) p[i];
138 fLastPoint = fN-1;
139 } else
140 memset(fP,0,kDimension*fN*sizeof(Float_t));
141}
142
143////////////////////////////////////////////////////////////////////////////////
144/// assignment operator
145
147{
148 if(this != &tp3)
149 tp3.TPolyMarker3D::Copy(*this);
150 return *this;
151}
152
153////////////////////////////////////////////////////////////////////////////////
154/// 3-D polymarker destructor.
155
157{
158 fN = 0;
159 if (fP) delete [] fP;
160 fLastPoint = -1;
161}
162
163////////////////////////////////////////////////////////////////////////////////
164/// 3-D polymarker copy ctor.
165
167{
168 p.TPolyMarker3D::Copy(*this);
169}
170
171////////////////////////////////////////////////////////////////////////////////
172/// Copy polymarker to polymarker obj.
173
175{
176 auto &tgt = static_cast<TPolyMarker3D &>(obj);
177 TObject::Copy(obj);
179 tgt.fN = fN;
180 if (tgt.fP)
181 delete [] tgt.fP;
182 if (fN > 0) {
183 tgt.fP = new Float_t [kDimension*fN];
184 for (Int_t i = 0; i < kDimension*fN; i++)
185 tgt.fP[i] = fP[i];
186 } else {
187 tgt.fP = nullptr;
188 }
189 tgt.fOption = fOption;
190 tgt.fLastPoint = fLastPoint;
191 tgt.fName = fName;
192}
193
194////////////////////////////////////////////////////////////////////////////////
195/// Compute distance from point px,py to a 3-D polymarker.
196/// Compute the closest distance of approach from point px,py to each segment
197/// of the polymarker.
198/// Returns when the distance found is below DistanceMaximum.
199/// The distance is computed in pixels units.
200
202{
203 const Int_t inaxis = 7;
204 Int_t dist = 9999;
205
206 Int_t puxmin = gPad->XtoAbsPixel(gPad->GetUxmin());
207 Int_t puymin = gPad->YtoAbsPixel(gPad->GetUymin());
208 Int_t puxmax = gPad->XtoAbsPixel(gPad->GetUxmax());
209 Int_t puymax = gPad->YtoAbsPixel(gPad->GetUymax());
210
211 // return if point is not in the user area
212 if (px < puxmin - inaxis) return dist;
213 if (py > puymin + inaxis) return dist;
214 if (px > puxmax + inaxis) return dist;
215 if (py < puymax - inaxis) return dist;
216
217 TView *view = gPad->GetView();
218 if (!view) return dist;
219 Int_t i, dpoint;
220 Float_t xndc[3];
221 Int_t x1,y1;
222 Double_t u,v;
223 for (i=0;i<Size();i++) {
224 view->WCtoNDC(&fP[3*i], xndc);
225 u = (Double_t)xndc[0];
226 v = (Double_t)xndc[1];
227 if (u < gPad->GetUxmin() || u > gPad->GetUxmax()) continue;
228 if (v < gPad->GetUymin() || v > gPad->GetUymax()) continue;
229 x1 = gPad->XtoAbsPixel(u);
230 y1 = gPad->YtoAbsPixel(v);
232 + ((Double_t)py-y1)*((Double_t)py-y1))));
233 if (dpoint < dist) dist = dpoint;
234 }
235 return dist;
236}
237
238////////////////////////////////////////////////////////////////////////////////
239/// Draws 3-D polymarker with its current attributes.
240
245
246////////////////////////////////////////////////////////////////////////////////
247/// Draw this 3-D polymarker with new coordinates. Creates a new
248/// polymarker which will be adopted by the pad in which it is drawn.
249/// Does not change the original polymarker (should be static method).
250
252{
254 newpolymarker->fN = n;
256 for (Int_t i = 0; i < kDimension*fN; i++) newpolymarker->fP[i] = p[i];
257 newpolymarker->SetMarkerStyle(GetMarkerStyle());
258 newpolymarker->fOption = fOption;
259 newpolymarker->fLastPoint = fLastPoint;
260 newpolymarker->SetBit(kCanDelete);
261 newpolymarker->AppendPad(option);
262}
263
264////////////////////////////////////////////////////////////////////////////////
265/// Execute action corresponding to one event.
266
268{
269 if (!gPad) return;
270 if (gPad->GetView()) gPad->GetView()->ExecuteRotateView(event, px, py);
271}
272
273////////////////////////////////////////////////////////////////////////////////
274/// List this 3-D polymarker.
275
277{
279 std::cout << " TPolyMarker3D N=" << Size() <<" Option="<<option<<std::endl;
280}
281
282////////////////////////////////////////////////////////////////////////////////
283/// Merge polymarkers in the collection in this polymarker
284
286{
287 if (!li) return 0;
288 TIter next(li);
289
290 //first loop to count the number of entries
292 Int_t npoints = Size();
293 while ((pm = (TPolyMarker3D*)next())) {
294 if (!pm->InheritsFrom(TPolyMarker3D::Class())) {
295 Error("Add","Attempt to add object of class: %s to a %s",pm->ClassName(),this->ClassName());
296 return -1;
297 }
298 npoints += pm->Size();
299 }
300 Int_t currPoint = Size();
301
302 //extend this polymarker to hold npoints
303 SetPoint(npoints-1,0,0,0);
304
305 //merge all polymarkers
306 next.Reset();
307 while ((pm = (TPolyMarker3D*)next())) {
308 Int_t np = pm->Size();
309 Float_t *p = pm->GetP();
310 for (Int_t i = 0; i < np; i++) {
311 SetPoint(currPoint++, p[3*i], p[3*i+1], p[3*i+2]);
312 }
313 }
314 return npoints;
315}
316
317////////////////////////////////////////////////////////////////////////////////
318/// Paint a TPolyMarker3D.
319
321{
322 // No need to continue if there is nothing to paint
323 if (Size() <= 0) return;
324
325 static TBuffer3D buffer(TBuffer3DTypes::kMarker);
326
327 buffer.ClearSectionsValid();
328
329 // Section kCore
330 buffer.fID = this;
331 buffer.fColor = GetMarkerColor();
332 buffer.fTransparency = 0;
333 buffer.fLocalFrame = kFALSE;
335
336 // We fill kCore and kRawSizes on first pass and try with viewer
337 TVirtualViewer3D * viewer3D = gPad->GetViewer3D();
338 if (!viewer3D) return;
339 Int_t reqSections = viewer3D->AddObject(buffer);
341 return;
342 }
343
345 if (!buffer.SetRawSizes(Size(), 3*Size(), 1, 1, 0, 0)) {
346 return;
347 }
349 }
350
352 // Points
353 for (UInt_t i=0; i<3*buffer.NbPnts(); i++) {
354 buffer.fPnts[i] = (Double_t)fP[i];
355 }
356
357 // Transform points - we don't support local->global matrix
358 // so always work in global reference frame
359 if (gGeometry) {
360 Double_t dlocal[3];
361 Double_t dmaster[3];
362 for (UInt_t j=0; j<buffer.NbPnts(); j++) {
363 dlocal[0] = buffer.fPnts[3*j];
364 dlocal[1] = buffer.fPnts[3*j+1];
365 dlocal[2] = buffer.fPnts[3*j+2];
367 buffer.fPnts[3*j] = dmaster[0];
368 buffer.fPnts[3*j+1] = dmaster[1];
369 buffer.fPnts[3*j+2] = dmaster[2];
370 }
371 }
372
373 // Basic colors: 0, 1, ... 7
374 Int_t c = (((GetMarkerColor()) %8) -1) * 4;
375 if (c < 0) c = 0;
376
377 // Segments
378 buffer.fSegs[0] = c;
379
381
383 }
384
385 viewer3D->AddObject(buffer);
386}
387
388////////////////////////////////////////////////////////////////////////////////
389/// Paint 3-d histogram h with 3-d polymarkers.
390
392{
393 const Int_t kMaxEntry = 100000;
394 Int_t in, bin, binx, biny, binz;
395
396 TAxis *xaxis = h->GetXaxis();
397 TAxis *yaxis = h->GetYaxis();
398 TAxis *zaxis = h->GetZaxis();
399 Double_t entry = 0;
400 for (binz=zaxis->GetFirst();binz<=zaxis->GetLast();binz++) {
401 for (biny=yaxis->GetFirst();biny<=yaxis->GetLast();biny++) {
402 for (binx=xaxis->GetFirst();binx<=xaxis->GetLast();binx++) {
403 bin = h->GetBin(binx,biny,binz);
404 entry += h->GetBinContent(bin);
405 }
406 }
407 }
408
409 // if histogram has too many entries, rescale it
410 // never draw more than kMaxEntry markers, otherwise this kills
411 // the X server
412 Double_t scale = 1.;
414
415 //Create or modify 3-d view object
416 TView *view = gPad->GetView();
417 if (!view) {
418 gPad->Range(-1,-1,1,1);
419 view = TView::CreateView(1,nullptr,nullptr);
420 if (!view) return;
421 }
422 view->SetRange(xaxis->GetBinLowEdge(xaxis->GetFirst()),
423 yaxis->GetBinLowEdge(yaxis->GetFirst()),
424 zaxis->GetBinLowEdge(zaxis->GetFirst()),
425 xaxis->GetBinUpEdge(xaxis->GetLast()),
426 yaxis->GetBinUpEdge(yaxis->GetLast()),
427 zaxis->GetBinUpEdge(zaxis->GetLast()));
428
429 view->PadRange(gPad->GetFrameFillColor());
430
431 if (entry == 0) return;
434 pm3d->SetMarkerStyle(h->GetMarkerStyle());
435 pm3d->SetMarkerColor(h->GetMarkerColor());
436 pm3d->SetMarkerSize(h->GetMarkerSize());
437 gPad->Modified(kTRUE);
438
439 entry = 0;
440 Double_t x,y,z,xw,yw,zw,xp,yp,zp;
442 for (binz=zaxis->GetFirst();binz<=zaxis->GetLast();binz++) {
443 z = zaxis->GetBinLowEdge(binz);
444 zw = zaxis->GetBinWidth(binz);
445 for (biny=yaxis->GetFirst();biny<=yaxis->GetLast();biny++) {
446 y = yaxis->GetBinLowEdge(biny);
447 yw = yaxis->GetBinWidth(biny);
448 for (binx=xaxis->GetFirst();binx<=xaxis->GetLast();binx++) {
449 x = xaxis->GetBinLowEdge(binx);
450 xw = xaxis->GetBinWidth(binx);
451 bin = h->GetBin(binx,biny,binz);
452 ncounts = Int_t(h->GetBinContent(bin)*scale+0.5);
453 for (in=0;in<ncounts;in++) {
454 xp = x + xw*gRandom->Rndm();
455 yp = y + yw*gRandom->Rndm();
456 zp = z + zw*gRandom->Rndm();
457 pm3d->SetPoint(Int_t(entry),xp,yp,zp);
458 entry++;
459 }
460 }
461 }
462 }
463 pm3d->Paint(option);
464 delete pm3d;
465}
466
467////////////////////////////////////////////////////////////////////////////////
468/// Print 3-D polymarker with its attributes on stdout.
469
471{
472 printf("TPolyMarker3D N=%d, Option=%s\n",fN,option);
473 TString opt = option;
474 opt.ToLower();
475 if (opt.Contains("all")) {
476 for (Int_t i=0;i<Size();i++) {
478 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]);
479 }
480 }
481}
482
483////////////////////////////////////////////////////////////////////////////////
484/// Save primitive as a C++ statement(s) on output stream.
485
487{
488 std::vector<Double_t> arr(Size() * 3);
489 for (Int_t i = 0; i < Size() * 3; i++)
490 arr[i] = fP[i];
491
492 TString vectname = SavePrimitiveVector(out, "pmarker3D", Size() * 3, arr.data(), kTRUE);
493
494 SavePrimitiveConstructor(out, Class(), "pmarker3D",
495 TString::Format("%d, %s.data(), %d, \"%s\"", Size(), vectname.Data(), GetMarkerStyle(),
496 TString(fOption).ReplaceSpecialCppChars().Data()),
497 kFALSE);
498
499 out << " pmarker3D->SetName(\"" << TString(GetName()).ReplaceSpecialCppChars() << "\");\n";
500
501 SaveMarkerAttributes(out, "pmarker3D", 1, 1, 1);
502 SavePrimitiveDraw(out, "pmarker3D", option);
503}
504
505////////////////////////////////////////////////////////////////////////////////
506/// Change (i.e. set) the name of the TNamed.
507/// WARNING: if the object is a member of a THashTable or THashList container
508/// the container must be Rehash()'ed after SetName(). For example the list
509/// of objects in the current directory is a THashList.
510
512{
513 fName = name;
514 if (gPad && TestBit(kMustCleanup)) gPad->Modified();
515}
516
517////////////////////////////////////////////////////////////////////////////////
518/// Set point following LastPoint to x, y, z.
519/// Returns index of the point (new last point).
520
527
528////////////////////////////////////////////////////////////////////////////////
529/// Set point n to x, y, z.
530/// If n is more then the current TPolyMarker3D size (n > fN) then
531/// the polymarker will be resized to contain at least n points.
532
534{
535 if (n < 0) return;
536 if (!fP || n >= fN) {
537 // re-allocate the object
538 Int_t newN = TMath::Max(2*fN,n+1);
540 if (fP && fN){
542 memset(&savepoint[kDimension*fN],0,(newN-fN)*sizeof(Float_t));
543 delete [] fP;
544 }
545 fP = savepoint;
546 fN = newN;
547 }
548 fP[kDimension*n ] = x;
549 fP[kDimension*n+1] = y;
550 fP[kDimension*n+2] = z;
552}
553
554////////////////////////////////////////////////////////////////////////////////
555/// Re-initialize polymarker with n points from p. If p=0 initialize with 0.
556/// if n <= 0 the current array of points is deleted.
557
559{
560 SetMarkerStyle(marker);
561 fOption = option;
562 if (n <= 0) {
563 fN = 0;
564 fLastPoint = -1;
565 delete [] fP;
566 fP = nullptr;
567 return;
568 }
569 fN = n;
570 if (fP) delete [] fP;
571 fP = new Float_t [3*fN];
572 if (p) {
573 for (Int_t i = 0; i < fN; i++) {
574 fP[3*i] = p[3*i];
575 fP[3*i+1] = p[3*i+1];
576 fP[3*i+2] = p[3*i+2];
577 }
578 } else {
579 memset(fP,0,kDimension*fN*sizeof(Float_t));
580 }
581 fLastPoint = fN-1;
582}
583
584////////////////////////////////////////////////////////////////////////////////
585/// Re-initialize polymarker with n points from p. If p=0 initialize with 0.
586/// if n <= 0 the current array of points is deleted.
587
589{
590 SetMarkerStyle(marker);
591 fOption = option;
592 if (n <= 0) {
593 fN = 0;
594 fLastPoint = -1;
595 delete [] fP;
596 fP = nullptr;
597 return;
598 }
599 fN = n;
600 if (fP) delete [] fP;
601 fP = new Float_t [3*fN];
602 if (p) {
603 for (Int_t i = 0; i < fN; i++) {
604 fP[3*i] = (Float_t) p[3*i];
605 fP[3*i+1] = (Float_t) p[3*i+1];
606 fP[3*i+2] = (Float_t) p[3*i+2];
607 }
608 } else {
609 memset(fP,0,kDimension*fN*sizeof(Float_t));
610 }
611 fLastPoint = fN-1;
612}
613
614////////////////////////////////////////////////////////////////////////////////
615/// Stream a 3-D polymarker object.
616
618{
620 if (b.IsReading()) {
621 Version_t R__v = b.ReadVersion(&R__s, &R__c);
622 if (R__v > 2) b.ClassBegin(TPolyMarker3D::IsA());
623 if (R__v > 2) b.ClassMember("TObject");
625 if (R__v > 2) b.ClassMember("TAttMarker");
627 if (R__v > 2) b.ClassMember("fN","Int_t");
628 b >> fN;
629 if (fN) {
630 if (R__v > 2) b.ClassMember("fP","Float_t", kDimension*fN);
631 fP = new Float_t[kDimension*fN];
632 b.ReadFastArray(fP,kDimension*fN);
633 }
634 fLastPoint = fN-1;
635 if (R__v > 2) b.ClassMember("fOption","TString");
637 if (R__v > 2) b.ClassMember("fName","TString");
638 if (R__v > 1) fName.Streamer(b);
639 if (R__v > 2) b.ClassEnd(TPolyMarker3D::IsA());
640 b.CheckByteCount(R__s, R__c, TPolyMarker3D::IsA());
641 } else {
642 R__c = b.WriteVersion(TPolyMarker3D::IsA(), kTRUE);
643 b.ClassBegin(TPolyMarker3D::IsA());
644 b.ClassMember("TObject");
646 b.ClassMember("TAttMarker");
648 b.ClassMember("fN","Int_t");
649 Int_t size = Size();
650 b << size;
651 if (size) {
652 b.ClassMember("fP","Float_t", kDimension*size);
653 b.WriteFastArray(fP, kDimension*size);
654 }
655 b.ClassMember("fOption","TString");
657 b.ClassMember("fName","TString");
659 b.ClassEnd(TPolyMarker3D::IsA());
660 b.SetByteCount(R__c, kTRUE);
661 }
662}
663
664////////////////////////////////////////////////////////////////////////////////
665/// Fills the parameters x, y, z with the coordinate of the n-th point
666/// n must be between 0 and Size() - 1.
667
669{
670 if (n < 0 || n >= Size()) return;
671 if (!fP) return;
672 x = fP[kDimension*n ];
673 y = fP[kDimension*n+1];
674 z = fP[kDimension*n+2];
675}
676
677////////////////////////////////////////////////////////////////////////////////
678/// Fills the parameters x, y, z with the coordinate of the n-th point
679/// n must be between 0 and Size() - 1.
680
682{
683 if (n < 0 || n >= Size()) return;
684 if (!fP) return;
685 x = (Double_t)fP[kDimension*n ];
686 y = (Double_t)fP[kDimension*n+1];
687 z = (Double_t)fP[kDimension*n+2];
688}
689
690
#define b(i)
Definition RSha256.hxx:100
#define c(i)
Definition RSha256.hxx:101
#define h(i)
Definition RSha256.hxx:106
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
short Version_t
Class version identifier (short)
Definition RtypesCore.h:79
short Marker_t
Marker number (short)
Definition RtypesCore.h:97
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:71
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
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 option
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 np
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t SetMarkerStyle
Option_t Option_t TPoint TPoint const char y1
char name[80]
Definition TGX11.cxx:110
R__EXTERN TGeometry * gGeometry
Definition TGeometry.h:158
constexpr Int_t kDimension
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: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 void Modify()
Change current marker attributes if necessary.
virtual Style_t GetMarkerStyle() const
Return the marker style.
Definition TAttMarker.h:33
virtual Color_t GetMarkerColor() const
Return the marker color.
Definition TAttMarker.h:32
void Copy(TAttMarker &attmarker) const
Copy this marker attributes to a new TAttMarker.
virtual void Streamer(TBuffer &)
Class to manage histogram axis.
Definition TAxis.h:32
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:114
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:113
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:109
void Reset()
Mother of all ROOT objects.
Definition TObject.h:41
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:202
static TString SavePrimitiveVector(std::ostream &out, const char *prefix, Int_t len, Double_t *arr, Bool_t empty_line=kFALSE)
Save array in the output stream "out" as vector.
Definition TObject.cxx:788
virtual void Streamer(TBuffer &)
Stream an object of class TObject.
Definition TObject.cxx:972
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
Definition TObject.cxx:203
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:864
virtual void Copy(TObject &object) const
Copy this to obj.
Definition TObject.cxx:159
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1071
static void SavePrimitiveDraw(std::ostream &out, const char *variable_name, Option_t *option=nullptr)
Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
Definition TObject.cxx:822
static void SavePrimitiveConstructor(std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
Save object constructor in the output stream "out".
Definition TObject.cxx:771
@ kCanDelete
if object in a list can be deleted
Definition TObject.h:68
@ kMustCleanup
if object destructor must call RecursiveRemove()
Definition TObject.h:70
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.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
static TClass * Class()
virtual void DrawPolyMarker(Int_t n, Float_t *p, Marker_t marker, Option_t *option="")
Draw this 3-D polymarker with new coordinates.
~TPolyMarker3D() override
3-D polymarker destructor.
void SetPoint(Int_t n, Double_t x, Double_t y, Double_t z)
Set point n to x, y, z.
const char * GetName() const override
Returns name of object.
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 Int_t Size() const
virtual void SetName(const char *name)
Change (i.e.
TPolyMarker3D & operator=(const TPolyMarker3D &)
assignment operator
void Copy(TObject &polymarker) const override
Copy polymarker to polymarker obj.
void Streamer(TBuffer &) override
Stream a 3-D polymarker object.
void ls(Option_t *option="") const override
List this 3-D polymarker.
virtual Int_t SetNextPoint(Double_t x, Double_t y, Double_t z)
Set point following LastPoint to x, y, z.
TClass * IsA() const override
void Paint(Option_t *option="") override
Paint a TPolyMarker3D.
void Print(Option_t *option="") const override
Print 3-D polymarker with its attributes on stdout.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a 3-D polymarker.
void Draw(Option_t *option="") override
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:2898
Double_t Rndm() override
Machine independent random number generator.
Definition TRandom.cxx:558
Basic string class.
Definition TString.h:138
void ToLower()
Change string to lower-case.
Definition TString.cxx:1189
TString & ReplaceSpecialCppChars()
Find special characters which are typically used in printf() calls and replace them by appropriate es...
Definition TString.cxx:1121
virtual void Streamer(TBuffer &)
Stream a string object.
Definition TString.cxx:1418
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2384
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:640
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=nullptr, const Double_t *rmax=nullptr)
Create a concrete default 3-d view via the plug-in manager.
Definition TView.cxx:26
virtual void PadRange(Int_t rback)=0
virtual void SetRange(const Double_t *min, const Double_t *max)=0
Abstract 3D shapes viewer.
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)
Returns the largest of a and b.
Definition TMathBase.h:251
Double_t Sqrt(Double_t x)
Returns the square root of x.
Definition TMath.h:673
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Definition TMathBase.h:199