15#include "TGLIncludes.h"
54 fPlotInfo.Form(
"(binx = %d; biny = %d; binz = %d; binc = %f)", binI, binJ, binK,
55 fHist->GetBinContent(binI, binJ, binK));
57 fPlotInfo =
"Switch to true color mode to get correct info";
82 for (
Int_t ir =
fCoord->GetFirstXBin(); ir <= fCoord->GetLastXBin(); ++ir) {
83 for (
Int_t jr =
fCoord->GetFirstYBin(); jr <= fCoord->GetLastYBin(); ++jr) {
84 for (
Int_t kr =
fCoord->GetFirstZBin(); kr <= fCoord->GetLastZBin(); ++kr) {
99 const TList *funcList =
fHist->GetListOfFunctions();
139 py =
fCamera->GetHeight() - py;
183 gROOT->ProcessLineFast(
Form(
"((TGLPlotPainter *)0x%zx)->Paint()", (
size_t)
this));
188 Info(
"ProcessEvent",
"Switch to true color mode to use box cut");
201 glEnable(GL_DEPTH_TEST);
202 glEnable(GL_LIGHTING);
205 glEnable(GL_CULL_FACE);
208 glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
216 glDisable(GL_DEPTH_TEST);
217 glDisable(GL_LIGHTING);
218 glDisable(GL_LIGHT0);
219 glDisable(GL_CULL_FACE);
220 glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
240 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
253 const Int_t addI = frontPoint == 2 || frontPoint == 1 ? 1 : (iInit = nX - 1, irInit =
fCoord->GetLastXBin(), -1);
254 const Int_t addJ = frontPoint == 2 || frontPoint == 3 ? 1 : (jInit = nY - 1, jrInit =
fCoord->GetLastYBin(), -1);
256 : (kInit = nZ - 1, krInit =
fCoord->GetLastZBin(),-1);
278 for(
Int_t ir = irInit, i = iInit; addI > 0 ? i < nX : i >= 0; ir += addI, i += addI) {
279 for(
Int_t jr = jrInit, j = jInit; addJ > 0 ? j < nY : j >= 0; jr += addJ, j += addJ) {
280 for(
Int_t kr = krInit, k = kInit; addK > 0 ? k < nZ : k >= 0; kr += addK, k += addK) {
288 if (
fBoxCut.IsActive() &&
fBoxCut.IsInCut(xMin, xMax, yMin, yMax, zMin, zMax))
291 binContent =
fHist->GetBinContent(ir, jr, kr);
292 if (binContent < wmin)
continue;
293 if (binContent > wmax) binContent = wmax;
395 for (
UInt_t i = 0; i < trySize; ++i) {
397 if (level <= fMinMaxVal.first || level >=
fMinMaxVal.second)
407 paletteSize =
fLevels.size() - 1;
415 if (!paletteSize && !(paletteSize =
gStyle->GetNumberContours()))
434 rgba[0] = tc[0] / 255.f;
435 rgba[1] = tc[1] / 255.f;
436 rgba[2] = tc[2] / 255.f;
445 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diffColor);
446 const Float_t specColor[] = {1.f, 1.f, 1.f, 1.f};
447 glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specColor);
448 glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 70.f);
int Int_t
Signed integer 4 bytes (int).
unsigned char UChar_t
Unsigned Character 1 byte (unsigned char).
char Char_t
Character 1 byte (char).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
float Float_t
Float 4 bytes (float).
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
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 Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
Camera for TGLPlotPainter and sub-classes.
Helper class for plot-painters holding information about axis ranges, numbers of bins and flags if ce...
TGLPlotPainter(TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord, Bool_t xoySelectable, Bool_t xozSelectable, Bool_t yozSelectable)
TGLPlotPainter's ctor.
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 MoveSection(Int_t px, Int_t py)
Create dynamic profile using selected plane.
void RestoreProjectionMatrix() const
void DrawPlot() const override
Draw "voxels".
void SetVoxelColor(const Float_t *rgba) const
Set box color.
void DrawSectionXOZ() const override
Noop.
void ProcessEvent(Int_t event, Int_t px, Int_t py) override
Remove sections, switch on/off box cut.
void Pan(Int_t px, Int_t py) override
User's moving mouse cursor, with middle mouse button pressed (for pad).
void AddOption(const TString &stringOption) override
"z" draw palette or not.
void PreparePalette() const
Generate palette.
void DrawPalette() const
Draw. Palette.
TGLVoxelPainter(const TGLVoxelPainter &)=delete
void DeInitGL() const override
Return back some gl state variables.
void InitGL() const override
Initialize some gl state variables.
void DrawSectionYOZ() const override
Noop.
char * GetPlotInfo(Int_t px, Int_t py) override
Show box info (i, j, k, binContent).
Bool_t InitGeometry() override
Set ranges, find min and max bin content.
void DrawPaletteAxis() const override
Draw. Palette. Axis.
void FindVoxelColor(Double_t binContent, Float_t *rgba) const
Find box color.
void StartPan(Int_t px, Int_t py) override
User clicks right mouse button (in a pad).
std::vector< Double_t > fLevels
void DrawSectionXOY() const override
Noop.
TH1 is the base class of all histogram classes in ROOT.
@ kUserContour
User specified contour levels.
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
const Float_t gNullEmission[]
void ObjectIDToColor(Int_t objectID, Bool_t highColor)
Object id encoded as rgb triplet.
void DrawPalette(const TGLPlotCamera *camera, const TGLLevelPalette &palette)
Draw. Palette.
void DrawPaletteAxis(const TGLPlotCamera *camera, const Range_t &minMax, Bool_t logZ)
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.
const Float_t gOrangeEmission[]
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.