15#include "TGLIncludes.h"
63 : fFrameColor(nullptr),
105 if (!selectionPass) {
107 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
108 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
109 glEnable(GL_LINE_SMOOTH);
113 Float_t backColor[] = {0.9f, 0.9f, 0.9f, 0.85f};
117 if (!selectionPass) {
118 glMaterialfv(GL_FRONT, GL_DIFFUSE, backColor);
126 ObjectIDToColor(1, highColor);
130 if (!selectionPass) {
133 else if (selected == 2)
137 ObjectIDToColor(2, highColor);
141 if (!selectionPass) {
144 else if (selected == 3)
148 ObjectIDToColor(3, highColor);
153 if (!selectionPass) {
157 glDisable(GL_LINE_SMOOTH);
172 glColor3d(0., 0., 0.);
188 DrawBack(selected, selectionPass, zLevels, highColor);
235 return v1.Z() <
v2.Z();
248 glGetDoublev(GL_MODELVIEW_MATRIX, mvMatrix);
250 glGetDoublev(GL_PROJECTION_MATRIX, prMatrix);
251 Int_t viewport[4] = {0};
252 glGetIntegerv(GL_VIEWPORT, viewport);
262 for (
Int_t i = 0; i < 4; ++i) {
263 gluProject(
f3DBox[i].
X(),
f3DBox[i].Y(), zMin, mvMatrix, prMatrix, viewport,
265 gluProject(
f3DBox[i].
X(),
f3DBox[i].Y(), zMax, mvMatrix, prMatrix, viewport,
268 gluProject(uBox[i][0], uBox[i][1], -0.5, mvMatrix, prMatrix, viewport,
270 gluProject(uBox[i][0], uBox[i][1], 0.5, mvMatrix, prMatrix, viewport,
279 for (
Int_t i = 0; i < 8; ++i) {
322 const std::vector<Double_t> &zLevels)
const
329 if (!selectionPass) {
331 glColor3d(0., 0., 0.);
337 glLineStipple(1, stipple);
347 for (
UInt_t i = 0; i < zLevels.size(); ++i) {
349 glVertex3d(lineCaps[plane][0], lineCaps[plane][1], zLevels[i]);
350 glVertex3d(lineCaps[plane][2], lineCaps[plane][3], zLevels[i]);
Int_t Compare(const void *item1, const void *item2)
The color creation and management class.
virtual void GetRGB(Float_t &r, Float_t &g, Float_t &b) const
Implementation of a box around a histogram/function for plot-painters.
const TColor * fFrameColor
Int_t FindFrontPoint() const
Convert 3d points into window coordinate system and find the nearest.
virtual ~TGLPlotBox()
Empty dtor to suppress g++ warnings.
static const Int_t fgFrontPairs[][2]
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.
static const Int_t fgFramePlanes[][4]
const TGLVertex3 * Get2DBox() const
Get 2D box.
const Bool_t fXOYSelectable
TGLPlotBox(Bool_t xoySelectable, Bool_t xozSelectable, Bool_t yozSelectable)
Constructor.
static const Int_t fgBackPairs[][2]
void DrawBack(Int_t selectedPart, Bool_t selectionPass, const std::vector< Double_t > &zLevels, Bool_t highColor) const
static const Double_t fgNormals[][3]
void DrawBox(Int_t selectedPart, Bool_t selectionPass, const std::vector< Double_t > &zLevels, Bool_t highColor) const
Draw back box for a plot.
void DrawBackPlane(Int_t plane, Bool_t selectionPass, const std::vector< Double_t > &zLevels) const
Draw back plane with number 'plane'.
void SetFrameColor(const TColor *color)
Back box color.
Bool_t fSelectablePairs[4][2]
Int_t GetFrontPoint() const
The nearest point.
static void InitializeIfNeeded()
Initialize globals that require other libraries to be initialized.
static Float_t GetScreenScalingFactor()
Returns scaling factor between screen points and GL viewport pixels.
3 component (x/y/z) vector class.
3 component (x/y/z) vertex class.
void Set(Double_t x, Double_t y, Double_t z)
const Float_t gNullEmission[]
const Float_t gRedEmission[]
std::pair< Double_t, Double_t > Range_t
const Float_t gGreenEmission[]