103 glDepthMask(GL_FALSE);
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);
130 if (!selectionPass) {
133 else if (selected == 2)
141 if (!selectionPass) {
144 else if (selected == 3)
152 glDepthMask(GL_TRUE);
153 if (!selectionPass) {
157 glDisable(GL_LINE_SMOOTH);
172 glColor3d(0., 0., 0.);
188 DrawBack(selected, selectionPass, zLevels, highColor);
200 f3DBox[0].
Set(x.first, y.first, z.first);
201 f3DBox[1].
Set(x.second, y.first, z.first);
202 f3DBox[2].
Set(x.second, y.second, z.first);
203 f3DBox[3].
Set(x.first, y.second, z.first);
204 f3DBox[4].
Set(x.first, y.first, z.second);
205 f3DBox[5].
Set(x.second, y.first, z.second);
206 f3DBox[6].
Set(x.second, y.second, z.second);
207 f3DBox[7].
Set(x.first, y.second, z.second);
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 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.