56 fPlotInfo.
Form(
"(binx = %d; biny = %d; binz = %d; binc = %f)", binI, binJ, binK,
59 fPlotInfo =
"Switch to true color mode to get correct info";
185 gROOT->ProcessLineFast(
Form(
"((TGLPlotPainter *)0x%lx)->Paint()",
ULong_t(
this)));
190 Info(
"ProcessEvent",
"Switch to true color mode to use box cut");
203 glEnable(GL_DEPTH_TEST);
204 glEnable(GL_LIGHTING);
207 glEnable(GL_CULL_FACE);
210 glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
218 glDisable(GL_DEPTH_TEST);
219 glDisable(GL_LIGHTING);
220 glDisable(GL_LIGHT0);
221 glDisable(GL_CULL_FACE);
222 glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
242 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
255 const Int_t addI = frontPoint == 2 || frontPoint == 1 ? 1 : (iInit = nX - 1, irInit =
fCoord->
GetLastXBin(), -1);
256 const Int_t addJ = frontPoint == 2 || frontPoint == 3 ? 1 : (jInit = nY - 1, jrInit =
fCoord->
GetLastYBin(), -1);
275 for(
Int_t ir = irInit, i = iInit; addI > 0 ? i < nX : i >= 0; ir += addI, i += addI) {
276 for(
Int_t jr = jrInit, j = jInit; addJ > 0 ? j < nY : j >= 0; jr += addJ, j += addJ) {
278 for(
Int_t kr = krInit, k = kInit; addK > 0 ? k < nZ : k >= 0; kr += addK, k += addK) {
389 for (
UInt_t i = 0; i < trySize; ++i) {
391 if (level <= fMinMaxVal.first || level >=
fMinMaxVal.second)
401 paletteSize =
fLevels.size() - 1;
428 rgba[0] = tc[0] / 255.f;
429 rgba[1] = tc[1] / 255.f;
430 rgba[2] = tc[2] / 255.f;
439 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diffColor);
440 const Float_t specColor[] = {1.f, 1.f, 1.f, 1.f};
441 glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specColor);
442 glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 70.f);
void AddOption(const TString &stringOption)
"z" draw palette or not.
virtual const char * GetName() const
Returns name of object.
void DrawBox(Bool_t selectionPass, Int_t selected) const
Draw cut as a semi-transparent box.
Int_t GetFrontPoint() const
The nearest point.
void StartPan(Int_t px, Int_t py)
User clicks right mouse button (in a pad).
void RestoreModelviewMatrix() const
Camera for TGLPlotPainter and sub-classes.
Int_t GetFirstXBin() const
void SetVoxelColor(const Float_t *rgba) const
Set box color.
Int_t GetNYBins() const
Number of Y bins.
void MoveBox(Int_t px, Int_t py, Int_t axisID)
Move box cut along selected direction.
Int_t GetNumberContours() const
const Float_t gNullEmission[]
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
R__EXTERN TStyle * gStyle
void StartPan(Int_t px, Int_t py)
User clicks somewhere (px, py).
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Int_t GetPaletteSize() const
Get. Palette. Size.
const TGLVertex3 * Get3DBox() const
Get 3D box.
void DeInitGL() const
Return back some gl state variables.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Paint TH3 histograms as "voxels" - colored boxes, transparent if transfer function was specified...
Int_t GetNXBins() const
Number of X bins.
Short_t Min(Short_t a, Short_t b)
void TurnOnOff()
Turn the box cut on/off.
void DrawPalette() const
Draw. Palette.
const UChar_t * GetColour(Double_t z) const
Get color.
void DrawPalette(const TGLPlotCamera *camera, const TGLLevelPalette &palette)
Draw. Palette.
void DrawSectionXOZ() const
Noop.
void DrawPaletteAxis(const TGLPlotCamera *camera, const Range_t &minMax, Bool_t logZ)
user specified contour levels
virtual Double_t GetContourLevel(Int_t level) const
Return value of contour number level.
void Pan(Int_t px, Int_t py)
User's moving mouse cursor, with middle mouse button pressed (for pad).
virtual TObject * FindObject(const char *name) const
Delete a TObjLink object.
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
Int_t GetNZBins() const
Number of Z bins.
TGLVoxelPainter(const TGLVoxelPainter &)
virtual Int_t GetContour(Double_t *levels=0)
Return contour values into array levels if pointer levels is non zero.
void Apply(Double_t phi, Double_t theta) const
Applies rotations and translations before drawing.
std::vector< Double_t > fLevels
void Info(const char *location, const char *msgfmt,...)
void SetCamera() const
Viewport and projection.
Int_t GetFirstYBin() const
void SetYLog(Bool_t yLog)
If log changed, sections must be reset, set fModified.
char * GetPlotInfo(Int_t px, Int_t py)
Show box info (i, j, k, binContent).
void SetViewVolume(const TGLVertex3 *box)
'box' is the TGLPlotPainter's back box's coordinates.
void SetContours(const std::vector< Double_t > *contours)
Clear :)
void PreparePalette() const
Generate palette.
void ObjectIDToColor(Int_t objectID, Bool_t highColor)
Object id encoded as rgb triplet.
void DrawSectionXOY() const
Noop.
const Rgl::Range_t & GetZRangeScaled() const
Scaled range.
void RestoreProjectionMatrix() 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.
Int_t GetLastYBin() const
void ProcessEvent(Int_t event, Int_t px, Int_t py)
Remove sections, switch on/off box cut.
Class to manage histogram axis.
void DrawSectionYOZ() const
Noop.
void DrawPlot() const
Draw "voxels".
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.
char * Form(const char *fmt,...)
void SetXLog(Bool_t xLog)
If log changed, sections must be reset, set fModified.
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 DrawBox(Int_t selectedPart, Bool_t selectionPass, const std::vector< Double_t > &zLevels, Bool_t highColor) const
Draw back box for a plot.
Double_t GetYScale() const
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this function.
void InitGL() const
Initialize some gl state variables.
Bool_t Modified() const
Modified.
void SaveProjectionMatrix() const
Int_t GetFirstZBin() const
Bool_t SetRanges(const TH1 *hist, Bool_t errors=kFALSE, Bool_t zBins=kFALSE)
Set bin ranges, ranges.
const Rgl::Range_t & GetYRangeScaled() const
Scaled range.
Int_t GetLastXBin() const
void DrawPaletteAxis() const
Draw. Palette. Axis.
void SetZLog(Bool_t zLog)
If log changed, sections must be reset, set fModified.
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.
Bool_t InitGeometry()
Set ranges, find min and max bin content.
const Rgl::Range_t & GetXRangeScaled() const
Scaled range.
void FindVoxelColor(Double_t binContent, Float_t *rgba) const
Find box color.
Int_t GetLastZBin() const
Int_t GetHeight() const
viewport[3]
void SaveModelviewMatrix() const
TList * GetListOfFunctions() const
Bool_t GeneratePalette(UInt_t paletteSize, const Rgl::Range_t &zRange, Bool_t checkSize=kTRUE)
Try to find colors for palette.
TGLPlotCoordinates * fCoord
virtual void Paint()
Draw lego/surf/whatever you can.
const Float_t gOrangeEmission[]
Double_t GetZScale() const
Double_t GetXScale() const
const char * Data() const
const TGLVertex3 * Get2DBox() const
Get 2D box.
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.