15#include "TGLIncludes.h"
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};
114 fFrameColor->GetRGB(backColor[0], backColor[1], backColor[2]);
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]);
unsigned short UShort_t
Unsigned Short integer 2 bytes (unsigned short).
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
Int_t Compare(const void *item1, const void *item2)
const TColor * fFrameColor
Int_t FindFrontPoint() const
Convert 3d points into window coordinate system and find the nearest.
const Bool_t fYOZSelectable
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.
const Bool_t fXOZSelectable
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 DrawQuadFilled(const TGLVertex3 &v0, const TGLVertex3 &v1, const TGLVertex3 &v2, const TGLVertex3 &v3, const TGLVector3 &normal)
Draw quad face.
const Float_t gNullEmission[]
void ObjectIDToColor(Int_t objectID, Bool_t highColor)
Object id encoded as rgb triplet.
const Float_t gRedEmission[]
std::pair< Double_t, Double_t > Range_t
const Float_t gGreenEmission[]
void DrawQuadOutline(const TGLVertex3 &v1, const TGLVertex3 &v2, const TGLVertex3 &v3, const TGLVertex3 &v4)
Draw quad outline.