76 fName =
"TPolyMarker3D";
84 fName =
"TPolyMarker3D";
102 fName =
"TPolyMarker3D";
126 fName =
"TPolyMarker3D";
149 tp3.TPolyMarker3D::Copy(*
this);
159 if (
fP)
delete []
fP;
168 p.TPolyMarker3D::Copy(*
this);
203 const Int_t inaxis = 7;
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;
218 if (!view)
return dist;
223 for (i=0;i<
Size();i++) {
227 if (u < gPad->GetUxmin() || u >
gPad->GetUxmax())
continue;
229 x1 =
gPad->XtoAbsPixel(u);
230 y1 =
gPad->YtoAbsPixel(
v);
233 if (dpoint < dist) dist = dpoint;
254 newpolymarker->
fN =
n;
270 if (
gPad->GetView())
gPad->GetView()->ExecuteRotateView(event, px, py);
279 std::cout <<
" TPolyMarker3D N=" <<
Size() <<
" Option="<<option<<std::endl;
295 Error(
"Add",
"Attempt to add object of class: %s to a %s",pm->
ClassName(),this->ClassName());
298 npoints += pm->
Size();
310 for (
Int_t i = 0; i < np; i++) {
323 if (
Size() <= 0)
return;
338 if (!viewer3D)
return;
363 dlocal[0] = buffer.
fPnts[3*j];
364 dlocal[1] = buffer.
fPnts[3*j+1];
365 dlocal[2] = buffer.
fPnts[3*j+2];
366 gGeometry->Local2Master(&dlocal[0],&dmaster[0]);
367 buffer.
fPnts[3*j] = dmaster[0];
368 buffer.
fPnts[3*j+1] = dmaster[1];
369 buffer.
fPnts[3*j+2] = dmaster[2];
393 const Int_t kMaxEntry = 100000;
394 Int_t in, bin, binx, biny, binz;
396 TAxis *xaxis =
h->GetXaxis();
397 TAxis *yaxis =
h->GetYaxis();
398 TAxis *zaxis =
h->GetZaxis();
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);
413 if (entry > kMaxEntry) scale = kMaxEntry/
Double_t(entry);
418 gPad->Range(-1,-1,1,1);
431 if (entry == 0)
return;
442 for (binz=zaxis->
GetFirst();binz<=zaxis->GetLast();binz++) {
445 for (biny=yaxis->
GetFirst();biny<=yaxis->GetLast();biny++) {
448 for (binx=xaxis->
GetFirst();binx<=xaxis->GetLast();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++) {
472 printf(
"TPolyMarker3D N=%d, Option=%s\n",
fN,option);
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]);
488 std::vector<Double_t> arr(
Size() * 3);
536 if (!
fP ||
n >=
fN) {
570 if (
fP)
delete []
fP;
573 for (
Int_t i = 0; i <
fN; i++) {
575 fP[3*i+1] = p[3*i+1];
576 fP[3*i+2] = p[3*i+2];
600 if (
fP)
delete []
fP;
603 for (
Int_t i = 0; i <
fN; i++) {
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");
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);
644 b.ClassMember(
"TObject");
646 b.ClassMember(
"TAttMarker");
648 b.ClassMember(
"fN",
"Int_t");
655 b.ClassMember(
"fOption",
"TString");
657 b.ClassMember(
"fName",
"TString");
660 b.SetByteCount(R__c,
kTRUE);
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
short Version_t
Class version identifier (short).
short Marker_t
Marker number (short).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
externTGeometry * gGeometry
constexpr Int_t kDimension
virtual Style_t GetMarkerStyle() const
Return the marker style.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual Color_t GetMarkerColor() const
Return the marker color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
void Copy(TAttMarker &attmarker) const
virtual void Streamer(TBuffer &)
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
virtual void SaveMarkerAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1)
Class to manage histogram axis.
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
Int_t GetLast() const
Return last bin on the axis i.e.
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
Int_t GetFirst() const
Return first bin on the axis i.e.
Generic 3D primitive description class.
Bool_t SectionsValid(UInt_t mask) const
void ClearSectionsValid()
Clear any sections marked valid.
void SetSectionsValid(UInt_t mask)
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.
Buffer base class used for serializing objects.
Collection abstract base class.
TH1 is the base class of all histogram classes in ROOT.
Bool_t TestBit(UInt_t f) const
virtual void Streamer(TBuffer &)
Stream an object of class TObject.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Copy(TObject &object) const
Copy this to obj.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
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.
TObject()
TObject constructor.
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".
static TString SavePrimitiveVector(std::ostream &out, const char *prefix, Int_t len, Double_t *arr, Int_t flag=0)
Save array in the output stream "out" as vector.
@ kCanDelete
if object in a list can be deleted
@ kMustCleanup
if object destructor must call RecursiveRemove()
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.
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 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.
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.
void ToLower()
Change string to lower-case.
TString & ReplaceSpecialCppChars()
Find special characters which are typically used in printf() calls and replace them by appropriate es...
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
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.
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=nullptr)=0
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Sqrt(Double_t x)
Returns the square root of x.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.