17#include "TGLIncludes.h"
51 fXaxis.
Set(
h->GetNbinsX(),
xa->GetBinLowEdge(
xa->GetFirst()),
xa->GetBinUpEdge(
xa->GetLast()));
52 fYaxis.
Set(
h->GetNbinsY(),
ya->GetBinLowEdge(
ya->GetFirst()),
ya->GetBinUpEdge(
ya->GetLast()));
53 fZaxis.
Set(
h->GetNbinsZ(),
za->GetBinLowEdge(
za->GetFirst()),
za->GetBinUpEdge(
za->GetLast()));
71 return fPainter->DistancetoPrimitive(px, py);
79 fPainter->ExecuteEvent(event, px, py);
88 static char message[] =
"TH3 composition";
102 fPainter = std::make_unique<TGLHistPainter>(
this);
128 static char message[] =
"TH3 composition";
244 gROOT->ProcessLineFast(
Form(
"((TGLPlotPainter *)0x%zx)->Paint()", (
size_t)
this));
249 Info(
"ProcessEvent",
"Switch to true color mode to use box cut");
425 throw std::runtime_error(
errorMsg.Data());
433 if (
a1->GetNbins() !=
a2->GetNbins())
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Class to manage histogram axis.
virtual void Set(Int_t nbins, Double_t xmin, Double_t xmax)
Initialize axis with fix bins.
The color creation and management class.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
void MoveBox(Int_t px, Int_t py, Int_t axisID)
Move box cut along selected direction.
Bool_t IsInCut(Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax) const
Check, if box defined by xmin/xmax etc. is in cut.
void DrawBox(Bool_t selectionPass, Int_t selected) const
Draw cut as a semi-transparent box.
void TurnOnOff()
Turn the box cut on/off.
void StartMovement(Int_t px, Int_t py)
Start cut's movement.
void SetPlotBox(const Rgl::Range_t &xRange, const Rgl::Range_t &yRange, const Rgl::Range_t &zRange)
Set up a frame box.
const TGLVertex3 * Get3DBox() const
Get 3D box.
const TGLVertex3 * Get2DBox() const
Get 2D box.
void DrawBox(Int_t selectedPart, Bool_t selectionPass, const std::vector< Double_t > &zLevels, Bool_t highColor) const
Draw back box for a plot.
Int_t GetFrontPoint() const
The nearest point.
Camera for TGLPlotPainter and sub-classes.
void StartPan(Int_t px, Int_t py)
User clicks somewhere (px, py).
void Apply(Double_t phi, Double_t theta) const
Applies rotations and translations before drawing.
void SetCamera() const
Viewport and projection.
void Pan(Int_t px, Int_t py)
Pan camera.
Int_t GetHeight() const
viewport[3]
void SetViewVolume(const TGLVertex3 *box)
'box' is the TGLPlotPainter's back box's coordinates.
Helper class for plot-painters holding information about axis ranges, numbers of bins and flags if ce...
void SetXLog(Bool_t xLog)
If log changed, sections must be reset, set fModified.
Bool_t SetRanges(const TH1 *hist, Bool_t errors=kFALSE, Bool_t zBins=kFALSE)
Set bin ranges, ranges.
Double_t GetYScale() const
const Rgl::Range_t & GetXRangeScaled() const
Scaled range.
Int_t GetFirstXBin() const
Int_t GetFirstYBin() const
const Rgl::Range_t & GetYRangeScaled() const
Scaled range.
void ResetModified()
Reset modified.
Bool_t Modified() const
Modified.
Double_t GetXScale() const
Double_t GetZScale() const
Int_t GetLastZBin() const
Int_t GetNXBins() const
Number of X bins.
Int_t GetFirstZBin() const
const Rgl::Range_t & GetZRangeScaled() const
Scaled range.
void SetZLog(Bool_t zLog)
If log changed, sections must be reset, set fModified.
void SetYLog(Bool_t yLog)
If log changed, sections must be reset, set fModified.
Int_t GetLastYBin() const
Int_t GetNYBins() const
Number of Y bins.
Int_t GetLastXBin() const
Int_t GetNZBins() const
Number of Z bins.
Base class for plot-painters that provide GL rendering of various 2D and 3D histograms,...
std::vector< Double_t > fZLevels
void RestoreModelviewMatrix() const
TGLPlotCoordinates * fCoord
void Paint() override
Draw lego/surf/whatever you can.
void SaveProjectionMatrix() const
void SaveModelviewMatrix() const
void RestoreProjectionMatrix() const
void ProcessEvent(Int_t event, Int_t px, Int_t py) override
Switch on/off box cut.
void StartPan(Int_t px, Int_t py) override
Move plot or box cut.
void DeInitGL() const override
Return back some gl state variables.
char * GetPlotInfo(Int_t px, Int_t py) override
Will be never called from TPad.
void Pan(Int_t px, Int_t py) override
User's moving mouse cursor, with middle mouse button pressed (for pad).
TGLTH3Composition * fData
void AddOption(const TString &option) override
No options for composition.
std::pair< Double_t, Double_t > fMinMaxVal
Bool_t InitGeometry() override
void InitGL() const override
Initialize some gl state variables.
void SetColor(Int_t color) const
Set material.
void DrawPlot() const override
Draw composition of TH3s.
TGLTH3CompositionPainter(TGLTH3Composition *data, TGLPlotCamera *camera, TGLPlotCoordinates *coord)
Ctor.
void AddTH3(const TH3 *hist, ETH3BinShape shape=kBox)
Add TH3 into collection.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Check if "this" is under cursor.
std::vector< TH3Pair_t > fHists
void Paint(Option_t *option) override
Paint a composition of 3d hists.
TGLTH3Composition()
I have to define it, since explicit copy ctor was declared.
char * GetObjectInfo(Int_t px, Int_t py) const override
I cannot show bin content in a status bar - since there can be several bins in one.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Mouse and keyboard events.
std::pair< const TH3 *, ETH3BinShape > TH3Pair_t
std::unique_ptr< TGLHistPainter > fPainter
TAxis fZaxis
Z axis descriptor.
TAxis fXaxis
X axis descriptor.
TAxis fYaxis
Y axis descriptor.
The 3-D histogram classes derived from the 1-D histogram classes.
void DrawBoxFront(Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax, Int_t fp)
Draws lego's bar as a 3d box.
void DrawSphere(TGLQuadric *quadric, Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax)
Cylinder for lego3.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.