43 fLegoType(kColorSimple),
65 fBinInfo.
Form(
"(binx = %d; biny = %d; binc = %f)", binI, binJ,
68 fBinInfo =
"Switch to true-color mode to obtain correct info";
118 if (
fXEdges[i].second > frame[1].
X())
122 if (
fXEdges[i].second < frame[0].
X())
130 if (
fXEdges[i].second > frame[1].
X())
134 if (
fXEdges[i].second < frame[0].
X())
148 if (
fYEdges[j].second > frame[2].
Y())
152 if (
fYEdges[j].second < frame[0].
Y())
160 if (
fYEdges[j].second > frame[2].
Y())
164 if (
fYEdges[j].second < frame[0].
Y())
439 if (legoPos + 4 < option.
Length() && isdigit(option[legoPos + 4])) {
440 switch (option[legoPos + 4] -
'0') {
458 if (ePos == legoPos + 1)
459 ePos = option.
Index(
"e", legoPos + 4);
470 glEnable(GL_DEPTH_TEST);
471 glEnable(GL_LIGHTING);
474 glEnable(GL_CULL_FACE);
477 glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
485 glDisable(GL_DEPTH_TEST);
486 glDisable(GL_LIGHTING);
487 glDisable(GL_LIGHT0);
488 glDisable(GL_CULL_FACE);
489 glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
527 glEnable(GL_POLYGON_OFFSET_FILL);
528 glPolygonOffset(1.
f, 1.
f);
533 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
544 const Int_t addI = frontPoint == 2 || frontPoint == 1 ? 1 : (iInit = nX - 1, irInit =
fCoord->
GetLastXBin(), -1);
545 const Int_t addJ = frontPoint == 2 || frontPoint == 3 ? 1 : (jInit = nY - 1, jrInit =
fCoord->
GetLastYBin(), -1);
558 for(
Int_t i = iInit, ir = irInit; addI > 0 ? i < nX : i >= 0; i += addI, ir += addI) {
559 for(
Int_t j = jInit, jr = jrInit; addJ > 0 ? j < nY : j >= 0; j += addJ, jr += addJ) {
593 glDisable(GL_POLYGON_OFFSET_FILL);
596 glColor3d(0., 0., 0.);
598 glColor4d(0., 0., 0., 0.4);
599 glPolygonMode(GL_FRONT, GL_LINE);
602 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
604 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
606 for(
Int_t i = iInit, ir = irInit; addI > 0 ? i < nX : i >= 0; i += addI, ir += addI) {
607 for(
Int_t j = jInit, jr = jrInit; addJ > 0 ? j < nY : j >= 0; j += addJ, jr += addJ) {
619 fYEdges[j].second, zMax, errorZMax);
624 glPolygonMode(GL_FRONT, GL_FILL);
641 glEnable(GL_POLYGON_OFFSET_FILL);
642 glPolygonOffset(1.
f, 1.
f);
695 glDisable(GL_POLYGON_OFFSET_FILL);
697 glColor3d(0., 0., 0.);
698 glPolygonMode(GL_FRONT, GL_LINE);
700 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
702 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
721 glPolygonMode(GL_FRONT, GL_FILL);
736 if (legoR > 1. || legoR < 0.)
742 glEnable(GL_POLYGON_OFFSET_FILL);
743 glPolygonOffset(1.
f, 1.
f);
800 glDisable(GL_POLYGON_OFFSET_FILL);
802 glColor3d(0., 0., 0.);
803 glPolygonMode(GL_FRONT, GL_LINE);
806 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
808 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
829 glPolygonMode(GL_FRONT, GL_FILL);
845 if (legoR > 1. || legoR < 0.)
850 glEnable(GL_POLYGON_OFFSET_FILL);
851 glPolygonOffset(1.
f, 1.
f);
922 glDisable(GL_POLYGON_OFFSET_FILL);
924 glColor3d(0., 0., 0.);
925 glPolygonMode(GL_FRONT, GL_LINE);
927 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
929 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
966 glPolygonMode(GL_FRONT, GL_FILL);
978 Float_t diffColor[] = {0.8f, 0.8f, 0.8f, 0.15f};
982 c->GetRGB(diffColor[0], diffColor[1], diffColor[2]);
984 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diffColor);
985 const Float_t specColor[] = {1.f, 1.f, 1.f, 1.f};
986 glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specColor);
987 glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 70.
f);
1006 glColor3d(1., 0., 0.);
1014 glBegin(GL_LINE_LOOP);
1042 glColor3d(1., 0., 0.);
1050 glBegin(GL_LINE_LOOP);
1082 gROOT->ProcessLineFast(
Form(
"((TGLPlotPainter *)0x%lx)->Paint()", (
ULong_t)
this));
1086 Info(
"ProcessEvent",
"Box cut does not exist for lego");
1105 if (zVal > frame[4].
Z())
1106 zVal = frame[4].
Z();
1107 else if (zVal < frame[0].
Z())
1108 zVal = frame[0].
Z();
void SetZLevels(TAxis *zAxis, Double_t zMin, Double_t zMax, Double_t zScale, std::vector< Double_t > &zLevels)
Camera for TGLPlotPainter and sub-classes.
Int_t GetNXBins() const
Number of X bins.
const Rgl::Range_t & GetZRangeScaled() const
Scaled range.
std::vector< Rgl::Range_t > fXEdges
Plot-painter implementing LEGO rendering of TH2 histograms in cartesian, polar, cylindrical and spher...
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
void MoveBox(Int_t px, Int_t py, Int_t axisID)
Move box cut along selected direction.
const Float_t gNullEmission[]
void DrawLegoSpherical() const
Lego in spherical system.
void swap(TDirectoryEntry &e1, TDirectoryEntry &e2) noexcept
std::pair< Double_t, Double_t > Range_t
Int_t GetLastXBin() const
R__EXTERN TStyle * gStyle
void StartPan(Int_t px, Int_t py)
User clicks somewhere (px, py).
void InitGL() const
Initialize some gl state variables.
Int_t GetNumberContours() const
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
Bool_t InitGeometryCylindrical()
Geometry for lego in cylindrical coords.
const Rgl::Range_t & GetYRangeScaled() const
Scaled range.
Short_t Min(Short_t a, Short_t b)
void StartPan(Int_t px, Int_t py)
User clicks on a lego with middle mouse button (middle for pad).
void TurnOnOff()
Turn the box cut on/off.
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
void ProcessEvent(Int_t event, Int_t px, Int_t py)
Remove all sections and repaint.
void DrawPalette() const
Draw.
void DrawPalette(const TGLPlotCamera *camera, const TGLLevelPalette &palette)
Draw. Palette.
void DrawPaletteAxis(const TGLPlotCamera *camera, const Range_t &minMax, Bool_t logZ)
void AddOption(const TString &stringOption)
Parse additional options.
Double_t GetZScale() const
Int_t GetFirstXBin() const
std::vector< CosSin_t > fCosSinTableY
Bool_t InitGeometryPolar()
Geometry for lego in polar coords.
Float_t GetLegoInnerR() const
Double_t GetZLength() const
Z length.
const char * Data() const
void EnableTexture(Int_t mode) const
Enable 1D texture.
void SaveProjectionMatrix() const
void DisableTexture() const
Disable 1D texture.
void DeInitGL() const
Return some gl states to original values.
3 component (x/y/z) vertex class.
void DrawTrapezoidTextured2(const Double_t ver[][2], Double_t zMin, Double_t zMax, Double_t tMin, Double_t tMax)
In polar coordinates, box became trapezoid.
Double_t Log10(Double_t x)
void Info(const char *location, const char *msgfmt,...)
void DrawSectionXOY() const
Empty. No such sections for lego.
user specified contour levels
Double_t GetXScale() const
void Apply(Double_t phi, Double_t theta) const
Applies rotations and translations before drawing.
void SetViewVolume(const TGLVertex3 *box)
'box' is the TGLPlotPainter's back box's coordinates.
std::vector< CosSin_t > fCosSinTableX
Bool_t InitGeometry()
Select method.
Bool_t GetZLog() const
Get Z log.
void RestoreProjectionMatrix() const
void ObjectIDToColor(Int_t objectID, Bool_t highColor)
Object id encoded as rgb triplet.
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 DrawError(Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax)
Bool_t GetYLog() const
Get Y log.
void DrawPaletteAxis() const
Draw. Palette. Axis.
Double_t GetTexCoord(Double_t z) const
Get tex coordinate.
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
void DrawSections() const
Draw sections (if any).
virtual Color_t GetFillColor() const
Return the fill area color.
Helper class for plot-painters holding information about axis ranges, numbers of bins and flags if ce...
void ResetModified()
Reset modified.
void Pan(Int_t px, Int_t py)
Pan camera.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t TestBit(UInt_t f) const
Bool_t ClampZ(Double_t &zVal) const
Clamp z value.
char * Form(const char *fmt,...)
char * GetPlotInfo(Int_t px, Int_t py)
Obtain bin's info (i, j, value).
void SaveModelviewMatrix() const
void DrawPlot() const
Select method corresponding to coordinate system.
virtual const char * GetName() const
Returns name of object.
Base class for plot-painters that provide GL rendering of various 2D and 3D histograms, functions and parametric surfaces.
std::vector< Double_t > fZLevels
void DrawLegoPolar() const
Lego in polar system.
void RestoreModelviewMatrix() const
Bool_t PreparePalette() const
Initialize color palette.
void DrawTrapezoidTextured(const Double_t ver[][2], Double_t zMin, Double_t zMax, Double_t tMin, Double_t tMax)
In polar coordinates, box became trapezoid.
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 GetFirstYBin() const
Int_t GetNYBins() const
Number of Y bins.
void DrawSectionYOZ() const
YOZ plane parallel section.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
void DrawSectionXOZ() const
XOZ plane parallel section.
The color creation and management class.
Bool_t SetRanges(const TH1 *hist, Bool_t errors=kFALSE, Bool_t zBins=kFALSE)
Set bin ranges, ranges.
void SetLegoColor() const
Set lego's color.
const TGLVertex3 * Get3DBox() const
Get 3D box.
Int_t GetFrontPoint() const
The nearest point.
Double_t GetYLength() const
Y length.
void DrawTrapezoid(const Double_t ver[][2], Double_t zMin, Double_t zMax, Bool_t color=kTRUE)
EGLCoordType GetCoordType() const
Get coordinates type.
Double_t GetFactor() const
Get factor.
const Rgl::Range_t & GetYRange() const
Y range.
const Rgl::Range_t & GetXRangeScaled() const
Scaled range.
Bool_t GetXLog() const
Get X log.
Double_t GetYScale() const
void StartMovement(Int_t px, Int_t py)
Start cut's movement.
void MoveSection(Int_t px, Int_t py)
Create dynamic profile using selected plane.
Short_t Max(Short_t a, Short_t b)
void SetPlotBox(const Rgl::Range_t &xRange, const Rgl::Range_t &yRange, const Rgl::Range_t &zRange)
Set up a frame box.
void DrawLegoCylindrical() const
Lego in cylindrical system.
Bool_t Modified() const
Modified.
Int_t GetLastYBin() const
std::vector< Rgl::Range_t > fYEdges
void DrawCylinder(TGLQuadric *quadric, Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax)
Cylinder for lego3.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual Double_t GetBinError(Int_t bin) const
Return value of error associated to bin number bin.
void DrawBoxFrontTextured(Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax, Double_t tMin, Double_t tMax, Int_t front)
Draws lego's bar as a 3d box LULULULU.
Bool_t InitGeometrySpherical()
Geometry for lego in spherical coords.
void DrawLegoCartesian() const
Lego in cartesian system.
Bool_t GeneratePalette(UInt_t paletteSize, const Rgl::Range_t &zRange, Bool_t checkSize=kTRUE)
Try to find colors for palette.
TGLPlotCoordinates * fCoord
virtual Float_t GetBarWidth() const
virtual void Paint()
Draw lego/surf/whatever you can.
const Float_t gOrangeEmission[]
void SetCamera() const
Viewport and projection.
Int_t GetHeight() const
viewport[3]
virtual Float_t GetBarOffset() const
void Pan(Int_t px, Int_t py)
Move lego or section.
const Rgl::Range_t & GetZRange() const
Z range.
Bool_t InitGeometryCartesian()
Geometry for lego in cartesian coords.