102 glDepthMask(GL_FALSE);
104 if (!selectionPass) {
106 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
107 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
108 glEnable(GL_LINE_SMOOTH);
112 Float_t backColor[] = {0.9f, 0.9f, 0.9f, 0.85f};
116 if (!selectionPass) {
117 glMaterialfv(GL_FRONT, GL_DIFFUSE, backColor);
129 if (!selectionPass) {
132 else if (selected == 2)
140 if (!selectionPass) {
143 else if (selected == 3)
151 glDepthMask(GL_TRUE);
152 if (!selectionPass) {
156 glDisable(GL_LINE_SMOOTH);
171 glColor3d(0., 0., 0.);
187 DrawBack(selected, selectionPass, zLevels, highColor);
199 f3DBox[0].
Set(x.first, y.first, z.first);
200 f3DBox[1].
Set(x.second, y.first, z.first);
201 f3DBox[2].
Set(x.second, y.second, z.first);
202 f3DBox[3].
Set(x.first, y.second, z.first);
203 f3DBox[4].
Set(x.first, y.first, z.second);
204 f3DBox[5].
Set(x.second, y.first, z.second);
205 f3DBox[6].
Set(x.second, y.second, z.second);
206 f3DBox[7].
Set(x.first, y.second, z.second);
234 return v1.
Z() < v2.
Z();
247 glGetDoublev(GL_MODELVIEW_MATRIX, mvMatrix);
249 glGetDoublev(GL_PROJECTION_MATRIX, prMatrix);
250 Int_t viewport[4] = {0};
251 glGetIntegerv(GL_VIEWPORT, viewport);
261 for (
Int_t i = 0; i < 4; ++i) {
262 gluProject(
f3DBox[i].
X(),
f3DBox[i].
Y(), zMin, mvMatrix, prMatrix, viewport,
264 gluProject(
f3DBox[i].
X(),
f3DBox[i].
Y(), zMax, mvMatrix, prMatrix, viewport,
267 gluProject(uBox[i][0], uBox[i][1], -0.5, mvMatrix, prMatrix, viewport,
269 gluProject(uBox[i][0], uBox[i][1], 0.5, mvMatrix, prMatrix, viewport,
278 for (
Int_t i = 0; i < 8; ++i) {
321 const std::vector<Double_t> &zLevels)
const 328 if (!selectionPass) {
330 glColor3d(0., 0., 0.);
336 glLineStipple(1, stipple);
346 for (
UInt_t i = 0; i < zLevels.size(); ++i) {
348 glVertex3d(lineCaps[plane][0], lineCaps[plane][1], zLevels[i]);
349 glVertex3d(lineCaps[plane][2], lineCaps[plane][3], zLevels[i]);
Int_t GetFrontPoint() const
The nearest point.
const TColor * fFrameColor
void DrawQuadFilled(const TGLVertex3 &v0, const TGLVertex3 &v1, const TGLVertex3 &v2, const TGLVertex3 &v3, const TGLVector3 &normal)
Draw quad face.
const Float_t gNullEmission[]
std::pair< Double_t, Double_t > Range_t
void DrawBack(Int_t selectedPart, Bool_t selectionPass, const std::vector< Double_t > &zLevels, Bool_t highColor) const
const TGLVertex3 * Get3DBox() const
Get 3D box.
static Float_t GetScreenScalingFactor()
Returns scaling factor between screen points and GL viewport pixels.
const Bool_t fXOYSelectable
void Set(Double_t x, Double_t y, Double_t z)
virtual void GetRGB(Float_t &r, Float_t &g, Float_t &b) const
void DrawQuadOutline(const TGLVertex3 &v1, const TGLVertex3 &v2, const TGLVertex3 &v3, const TGLVertex3 &v4)
Draw quad outline.
3 component (x/y/z) vertex class.
static const Double_t fgNormals[][3]
void DrawBackPlane(Int_t plane, Bool_t selectionPass, const std::vector< Double_t > &zLevels) const
Draw back plane with number 'plane'.
static const Int_t fgBackPairs[][2]
3 component (x/y/z) vector class.
Implementation of a box around a histogram/function for plot-painters.
void ObjectIDToColor(Int_t objectID, Bool_t highColor)
Object id encoded as rgb triplet.
TGLPlotBox(Bool_t xoySelectable, Bool_t xozSelectable, Bool_t yozSelectable)
Constructor.
static void InitializeIfNeeded()
Initialize globals that require other libraries to be initialized.
const Float_t gGreenEmission[]
const Float_t gRedEmission[]
static const Int_t fgFrontPairs[][2]
Int_t FindFrontPoint() const
Convert 3d points into window coordinate system and find the nearest.
Bool_t fSelectablePairs[4][2]
void DrawBox(Int_t selectedPart, Bool_t selectionPass, const std::vector< Double_t > &zLevels, Bool_t highColor) const
Draw back box for a plot.
static const Int_t fgFramePlanes[][4]
void SetFrameColor(const TColor *color)
Back box color.
The color creation and management class.
virtual ~TGLPlotBox()
Empty dtor to suppress g++ warnings.
you should not use this method at all Int_t Int_t z
Int_t Compare(const void *item1, const void *item2)
void SetPlotBox(const Rgl::Range_t &xRange, const Rgl::Range_t &yRange, const Rgl::Range_t &zRange)
Set up a frame box.
const TGLVertex3 * Get2DBox() const
Get 2D box.