131 axis.TAxis3D::Copy(*
this);
140 for (
Int_t i = 0; i < 3; i++)
173 for (
int i = 0; i < 3; i++) {
222 auto &parent = *
gPad;
224 auto view = parent.GetView();
246 Double_t min[3], max[3], viewCenter[3], viewCenterNDC[3];
248 view->GetRange(min, max);
249 for (
Int_t i = 0; i < 3; i++)
250 viewCenter[i] = (max[i] + min[i]) / 2;
251 view->WCtoNDC(viewCenter, viewCenterNDC);
254 pointNDC[0] = (inter->x0 + inter->x1) / 2;
255 pointNDC[1] = (inter->y0 + inter->y1) / 2;
256 pointNDC[2] = viewCenterNDC[2];
257 view->NDCtoWC(pointNDC, center);
259 for (
Int_t i = 0; i < 3; i++)
260 oldSize[i] =
size[i] = (max[i] - min[i]) / 2;
265 for (
Int_t i = 0; i < 3; i++)
268 pointNDC[0] = inter->x0;
269 pointNDC[1] = inter->y0;
271 view->NDCtoWC(pointNDC, newEdge);
272 for (
Int_t i = 0; i < 3; i++) {
274 if (newSize / oldSize[i] > 0.002)
277 size[i] = oldSize[i];
280 pointNDC[0] = inter->x1;
281 pointNDC[1] = inter->y1;
283 view->NDCtoWC(pointNDC, newEdge);
284 for (
Int_t i = 0; i < 3; i++) {
286 if (newSize / oldSize[i] > 0.002)
289 size[i] = oldSize[i];
292 for (
Int_t i = 0; i < 3; i++) {
293 max[i] = center[i] +
size[i];
294 min[i] = center[i] -
size[i];
296 view->SetRange(min, max);
301 parent.FreeInteractive(
this);
303 parent.UpdateAsync();
315 return (
char*)
"axis3d";
344 Int_t ix1, ix2, iy1, iy2, iz1, iz2;
349 Error(
"PaintAxis",
"no TView in current pad");
357 view->
AxisVertex(ang, av, ix1, ix2, iy1, iy2, iz1, iz2);
358 for (i = 1; i <= 8; ++i) {
359 r[i*3 - 3] = av[i*3 - 3] + av[i*3 - 2]*cosa;
360 r[i*3 - 2] = av[i*3 - 2]*sina;
361 r[i*3 - 1] = av[i*3 - 1];
383 memset(chopax,0,
sizeof(chopax));
386 ax[0] =
x1[0]; ax[1] =
x2[0];
387 ay[0] =
x1[1]; ay[1] =
x2[1];
388 logAx =
gPad->GetLogx();
392 ax[0] =
y1[0]; ax[1] =
y2[0];
393 ay[0] =
y1[1]; ay[1] =
y2[1];
394 logAx =
gPad->GetLogy();
397 ax[0] = z1[0]; ax[1] = z2[0];
398 ay[0] = z1[1]; ay[1] = z2[1];
399 strlcpy(chopax,
"SDH+=",10);
400 logAx =
gPad->GetLogz();
411 if (ax[0] > ax[1]) strlcpy(chopax,
"SDHV=+",10);
412 else strlcpy(chopax,
"SDHV=-",10);
416 strlcpy(chopax,
"SDH+=",10);
420 strlcat(chopax,
"G",10);
439 enum { kCenterTitle =
BIT(12) };
451 if (
fAxis[i].GetTimeDisplay()) {
452 strlcat(chopax,
"t",10);
453 if (strlen(
fAxis[i].GetTimeFormatOnly()) == 0) {
460 axis->
PaintAxis(ax[0], ay[0], ax[1], ay[1], bmin, bmax, ndiv, chopax);
471 if (!view &&
gPad) view =
gPad->GetView();
477 for (i =0; i<3;i++) min[i] = (max[i]+min[i])/2;
479 min[0] =
x[0]; min[1] =
x[1];
482 for (i=0;i<3;i++) point3D[i] =
x[i];
556 char achoice = toupper(axis[0]);
557 if (achoice ==
'X')
return 0;
558 if (achoice ==
'Y')
return 1;
559 if (achoice ==
'Z')
return 2;
569 if (ax < 0)
return 0;
579 if (ax < 0)
return 0;
589 if (ax < 0)
return 0;
599 if (ax < 0)
return 0;
609 if (ax < 0)
return 0;
619 if (ax < 0)
return 0;
629 if (ax < 0)
return 0;
639 if (ax < 0)
return 0;
646 Int_t i = AxisChoice(axis); \
648 if (i == -1) { i = 0; nax = 3;}\
649 for (Int_t ax=i;ax<nax+i;ax++)
736 if (!thisPad) thisPad =
gPad;
753 if (!thisPad) thisPad =
gPad;
754 if (thisPad && thisPad->
GetView() ) {
781 if (!thisPad) thisPad =
gPad;
782 if (thisPad && thisPad->
GetView()) {
787 if (o !=
l->Last()) {
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
short Style_t
Style number (short)
short Color_t
Color number (short)
char Char_t
Character 1 byte (char)
float Float_t
Float 4 bytes (float)
const char Option_t
Option string (const char)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
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 r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char y1
R__EXTERN TStyle * gStyle
virtual Color_t GetLabelColor() const
virtual Int_t GetNdivisions() const
virtual Color_t GetAxisColor() const
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title.
virtual Float_t GetLabelOffset() const
virtual void SetAxisColor(Color_t color=1, Float_t alpha=1.)
Set color of the line axis and tick marks.
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels.
virtual Style_t GetLabelFont() const
virtual void SetLabelOffset(Float_t offset=0.005)
Set distance between the axis and the labels.
virtual void SetLabelFont(Style_t font=62)
Set labels' font.
virtual Float_t GetLabelSize() const
virtual Float_t GetTickLength() const
virtual void ResetAttAxis(Option_t *option="")
Reset axis attributes.
virtual Float_t GetTitleOffset() const
virtual void SetTickLength(Float_t length=0.03)
Set tick mark length.
virtual void SetNdivisions(Int_t n=510, Bool_t optim=kTRUE)
Set the number of divisions for this axis.
virtual void SetLabelColor(Color_t color=1, Float_t alpha=1.)
Set color of labels.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
void MoveCursor(TVirtualPad &parent, Int_t px, Int_t py)
TAxis3DInteractive(TVirtualPad &parent, Int_t px, Int_t py)
The 3D axis painter class.
static TAxis3D * ToggleRulers(TVirtualPad *pad=nullptr)
Turn ON / OFF the "Ruler", TAxis3D object attached to the current pad.
virtual Float_t GetLabelSize(Option_t *axis="X") const
Get label size.
virtual void SetNdivisions(Int_t n=510, Option_t *axis="*")
Set number of divisions.
void UseCurrentStyle() override
Replace current attributes by current style.
void Paint(Option_t *option="") override
Paint axis over 3D view on the TPad.
void PaintAxis(TGaxis *axis, Float_t ang)
Draw the axis for TView object.
virtual void SetLabelOffset(Float_t offset=0.005, Option_t *axis="*")
Set label offset.
void Browse(TBrowser *b) override
Add all 3 axes to the TBrowser.
virtual void SetLabelFont(Style_t font=62, Option_t *axis="*")
Set label font.
virtual Style_t GetLabelFont(Option_t *axis="X") const
Get label font.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a line.
virtual Float_t GetLabelOffset(Option_t *axis="X") const
Get label offset.
virtual void SetAxisRange(Double_t xmin, Double_t xmax, Option_t *axis="*")
Set axis range.
virtual Float_t GetTickLength(Option_t *axis="X") const
Get tick mark length.
virtual void SetLabelSize(Float_t size=0.02, Option_t *axis="*")
Set label size.
Int_t AxisChoice(Option_t *axis) const
Return the axis index by its name.
static TAxis3D * GetPadAxis(TVirtualPad *pad=nullptr)
Returns the "pad" Axis3D object pointer if any.
virtual Color_t GetAxisColor(Option_t *axis="X") const
Get axis color.
virtual void SetAxisColor(Color_t color=1, Option_t *axis="*")
Set axis color.
char * GetObjectInfo(Int_t px, Int_t py) const override
Dummy method returns the const char * to "axis3d".
virtual Color_t GetLabelColor(Option_t *axis="X") const
Get label color.
virtual Float_t GetTitleOffset(Option_t *axis="X") const
Get title offset.
static TAxis3D * ToggleZoom(TVirtualPad *pad=nullptr)
Turn ON / OFF the "Ruler" and "zoom mode" of the TAxis3D object attached to the current pad (if pad =...
void InitSet()
Initialization.
virtual Int_t GetNdivisions(Option_t *axis="X") const
Get number of divisions.
void Copy(TObject &hnew) const override
Copy axis3d.
static const char * fgRulerName
virtual void SetTickLength(Float_t length=0.02, Option_t *axis="*")
Set tick mark length.
virtual void SetLabelColor(Color_t color=1, Option_t *axis="*")
Set label color.
TAxis3D()
Normal constructor.
static Double_t * PixeltoXYZ(Double_t px, Double_t py, Double_t *point3D, TView *view=nullptr)
Convert "screen pixel" coordinates to some center of 3D WC coordinate if view and gPad present.
virtual void SetTitleOffset(Float_t offset=1, Option_t *axis="*")
Set title offset.
TAxis * fSelected
! The selected axis to play with
Class to manage histogram axis.
const char * GetTitle() const override
Returns title of object.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to an axis.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
virtual void Set(Int_t nbins, Double_t xmin, Double_t xmax)
Initialize axis with fix bins.
void SaveAttributes(std::ostream &out, const char *name, const char *subname) override
Save axis attributes as C++ statement(s) on output stream out.
virtual void SetRange(Int_t first=0, Int_t last=0)
Set the viewing range for the axis using bin numbers.
Using a TBrowser one can browse all ROOT objects.
void SetTimeFormat(const char *tformat)
Change the format used for time plotting.
virtual void PaintAxis(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, Double_t &wmin, Double_t &wmax, Int_t &ndiv, Option_t *chopt="", Double_t gridlength=0, Bool_t drawGridOnly=kFALSE)
Control function to draw an axis.
void SetTitleOffset(Float_t titleoffset=1)
void SetLabelFont(Int_t labelfont)
void SetTitleSize(Float_t titlesize)
virtual void SetTitle(const char *title="")
Change the title of the axis.
void SetLabelOffset(Float_t labeloffset)
void SetLabelColor(Int_t labelcolor)
void SetTickSize(Float_t ticksize)
void SetLabelSize(Float_t labelsize)
void SetOption(Option_t *option="")
To set axis options.
The TNamed class is the base class for all named ROOT classes.
void Copy(TObject &named) const override
Copy this to obj.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
Mother of all ROOT objects.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
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 Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
@ kCanDelete
if object in a list can be deleted
void SetAxisColor(Color_t color=1, Option_t *axis="X")
Set color to draw the axis line and tick marks.
void SetTitleFont(Style_t font=62, Option_t *axis="X")
void SetTitleOffset(Float_t offset=1, Option_t *axis="X")
Specify a parameter offset to control the distance between the axis and the axis title.
void SetTitleColor(Color_t color=1, Option_t *axis="X")
void SetLabelFont(Style_t font=62, Option_t *axis="X")
Set font number used to draw axis labels.
void SetLabelOffset(Float_t offset=0.005, Option_t *axis="X")
Set offset between axis and axis labels.
void SetTitleSize(Float_t size=0.02, Option_t *axis="X")
void SetTickLength(Float_t length=0.03, Option_t *axis="X")
Set the tick marks length for an axis.
void SetNdivisions(Int_t n=510, Option_t *axis="X")
Set the number of divisions to draw an axis.
void SetLabelColor(Color_t color=1, Option_t *axis="X")
Set axis labels color.
void SetLabelSize(Float_t size=0.04, Option_t *axis="X")
Set size of axis labels.
virtual Double_t * GetRmax()=0
virtual void SetAxisNDC(const Double_t *x1, const Double_t *x2, const Double_t *y1, const Double_t *y2, const Double_t *z1, const Double_t *z2)=0
virtual Double_t * GetRmin()=0
virtual void WCtoNDC(const Float_t *pw, Float_t *pn)=0
virtual void NDCtoWC(const Float_t *pn, Float_t *pw)=0
virtual void GetRange(Float_t *min, Float_t *max)=0
virtual void AxisVertex(Double_t ang, Double_t *av, Int_t &ix1, Int_t &ix2, Int_t &iy1, Int_t &iy2, Int_t &iz1, Int_t &iz2)=0
Helper class to store interactive parameters for individual objects Should be used via gPad->Interact...
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual void Modified(Bool_t flag=1)=0
virtual TList * GetListOfPrimitives() const =0
virtual void UpdateAsync()=0
virtual Double_t AbsPixeltoX(Double_t px)=0
virtual void PaintBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t *option="")=0
virtual Double_t AbsPixeltoY(Double_t py)=0
virtual TView * GetView() const =0
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t ATan(Double_t)
Returns the principal value of the arc tangent of x, expressed in radians.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.