16#include "TGLIncludes.h" 
   43   const TAxis *xa = 
h->GetXaxis();
 
   44   const TAxis *ya = 
h->GetYaxis();
 
   45   const TAxis *za = 
h->GetZaxis();
 
   70   return fPainter->DistancetoPrimitive(px, py);
 
   87   static char message[] = 
"TH3 composition";
 
  127   static char message[] = 
"TH3 composition";
 
  243         gROOT->ProcessLineFast(
Form(
"((TGLPlotPainter *)0x%zx)->Paint()", (
size_t)
this));
 
  248         Info(
"ProcessEvent", 
"Switch to true color mode to use box cut");
 
  261   glEnable(GL_DEPTH_TEST);
 
  262   glEnable(GL_LIGHTING);
 
  264   glEnable(GL_CULL_FACE);
 
  267   glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 
GL_TRUE);
 
  275   glDisable(GL_DEPTH_TEST);
 
  276   glDisable(GL_LIGHTING);
 
  277   glDisable(GL_LIGHT0);
 
  278   glDisable(GL_CULL_FACE);
 
  279   glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 
GL_FALSE);
 
  293      glEnable(GL_POLYGON_OFFSET_FILL);
 
  294      glPolygonOffset(1.f, 1.f);
 
  308   const Int_t addI = frontPoint == 2 || frontPoint == 1 ? 1 : (iInit = nX - 1, irInit = 
fCoord->
GetLastXBin(), -1);
 
  309   const Int_t addJ = frontPoint == 2 || frontPoint == 3 ? 1 : (jInit = nY - 1, jrInit = 
fCoord->
GetLastYBin(), -1);
 
  328      for(
Int_t ir = irInit, i = iInit; addI > 0 ? i < nX : i >= 0; ir += addI, i += addI) {
 
  329         for(
Int_t jr = jrInit, j = jInit; addJ > 0 ? j < nY : j >= 0; jr += addJ, j += addJ) {
 
  330            for(
Int_t kr = krInit, k = kInit; addK > 0 ? k < nZ : k >= 0; kr += addK, k += addK) {
 
  331               const Double_t binContent = 
h->GetBinContent(ir, jr, kr);
 
  358   glDisable(GL_POLYGON_OFFSET_FILL);
 
  360   glColor4d(0., 0., 0., 0.25);
 
  361   glPolygonMode(GL_FRONT, GL_LINE);
 
  364   glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 
  366   glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
 
  374      for(
Int_t ir = irInit, i = iInit; addI > 0 ? i < nX : i >= 0; ir += addI, i += addI) {
 
  375         for(
Int_t jr = jrInit, j = jInit; addJ > 0 ? j < nY : j >= 0; jr += addJ, j += addJ) {
 
  376            for(
Int_t kr = krInit, k = kInit; addK > 0 ? k < nZ : k >= 0; kr += addK, k += addK) {
 
  397   glPolygonMode(GL_FRONT, GL_FILL);
 
  405   Float_t diffColor[] = {0.8f, 0.8f, 0.8f, 0.05f};
 
  409         c->GetRGB(diffColor[0], diffColor[1], diffColor[2]);
 
  411   glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diffColor);
 
  412   const Float_t specColor[] = {1.f, 1.f, 1.f, 1.f};
 
  413   glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specColor);
 
  414   glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 70.f);
 
  421void AxisError(
const TString & errorMsg)
 
  423   Error(
"TGLTH3Composition::AddTH3", 
"%s", errorMsg.
Data());
 
  424   throw std::runtime_error(errorMsg.
Data());
 
  433      AxisError(
"New hist has different number of bins along " + axisName);
 
  439   if (firstBin1 != firstBin2)
 
  440      AxisError(
"New hist has different first bin along " + axisName);
 
  442   if (lastBin1 != lastBin2)
 
  443      AxisError(
"New hist has different last bin along " + axisName);
 
  448      AxisError(
"New hist has different low edge along " + axisName);
 
  450      AxisError(
"New hist has different low edge along " + axisName);
 
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 Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
virtual void Set(Int_t nbins, Double_t xmin, Double_t xmax)
Initialize axis with fix bins.
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.
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.
The histogram painter class using OpenGL.
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.
const char * Data() const
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.