59 p[0][0] = 0; p[0][1] = dy; p[0][2] = 0;
60 p[1][0] = dx; p[1][1] = dy; p[1][2] = 0;
61 p[2][0] = dx; p[2][1] = 0; p[2][2] = 0;
62 p[3][0] = 0; p[3][1] = 0; p[3][2] = 0;
64 p[4][0] = 0; p[4][1] = dy; p[4][2] = dz;
65 p[5][0] = dx; p[5][1] = dy; p[5][2] = dz;
66 p[6][0] = dx; p[6][1] = 0; p[6][2] = dz;
67 p[7][0] = 0; p[7][1] = 0; p[7][2] = dz;
78 glVertex3fv(p[0]); glVertex3fv(p[1]);
79 glVertex3fv(p[2]); glVertex3fv(p[3]);
82 glVertex3fv(p[7]); glVertex3fv(p[6]);
83 glVertex3fv(p[5]); glVertex3fv(p[4]);
86 glVertex3fv(p[0]); glVertex3fv(p[4]);
87 glVertex3fv(p[5]); glVertex3fv(p[1]);
90 glVertex3fv(p[3]); glVertex3fv(p[2]);
91 glVertex3fv(p[6]); glVertex3fv(p[7]);
94 glVertex3fv(p[0]); glVertex3fv(p[3]);
95 glVertex3fv(p[7]); glVertex3fv(p[4]);
98 glVertex3fv(p[1]); glVertex3fv(p[5]);
99 glVertex3fv(p[6]); glVertex3fv(p[2]);
111 Float_t d = sqrtf(o[0]*o[0] + o[1]*o[1] + o[2]*o[2]);
127 subtract_and_normalize(p[1], p[0], e[0]);
128 subtract_and_normalize(p[3], p[0], e[1]);
129 subtract_and_normalize(p[4], p[0], e[2]);
130 subtract_and_normalize(p[5], p[6], e[3]);
131 subtract_and_normalize(p[7], p[6], e[4]);
132 subtract_and_normalize(p[2], p[6], e[5]);
136 glVertex3fv(p[0]); glVertex3fv(p[1]);
137 glVertex3fv(p[2]); glVertex3fv(p[3]);
140 glVertex3fv(p[7]); glVertex3fv(p[6]);
141 glVertex3fv(p[5]); glVertex3fv(p[4]);
144 glVertex3fv(p[0]); glVertex3fv(p[4]);
145 glVertex3fv(p[5]); glVertex3fv(p[1]);
148 glVertex3fv(p[3]); glVertex3fv(p[2]);
149 glVertex3fv(p[6]); glVertex3fv(p[7]);
152 glVertex3fv(p[0]); glVertex3fv(p[3]);
153 glVertex3fv(p[7]); glVertex3fv(p[4]);
156 glVertex3fv(p[1]); glVertex3fv(p[5]);
157 glVertex3fv(p[6]); glVertex3fv(p[2]);
176 glNewList(
fBoxDL, GL_COMPILE);
193 gluCylinder(quad.
Get(), 0, 1, 1, nt, 1);
198 glTranslatef(0, 0, 1);
199 gluDisk(quad.
Get(), 0, 1, nt, 1);
250 fM = SetModelDynCast<TEveBoxSet>(obj);
297 glBegin(primitiveType);
305 if (boxSkip) {
Int_t s = boxSkip;
while (s--) bi.
next(); }
312 glEnable(GL_NORMALIZE);
320 glTranslatef(b.
fA, b.
fB, b.
fC);
321 glScalef (b.
fW, b.
fH, b.
fD);
324 AntiFlick(0.5
f, 0.5
f, 0.5
f);
327 if (boxSkip) {
Int_t s = boxSkip;
while (s--) bi.
next(); }
340 glTranslatef(b.
fA, b.
fB, b.
fC);
344 glTranslatef(-b.
fA, -b.
fB, -b.
fC);
346 if (boxSkip) {
Int_t s = boxSkip;
while (s--) bi.
next(); }
353 using namespace TMath;
355 glEnable(GL_NORMALIZE);
368 glRotatef(phi, 0, 0, 1);
369 glRotatef(90 - theta, 0, 1, 0);
370 glScalef (b.
fR, b.
fR,
h);
373 AntiFlick(0.0
f, 0.0
f, 0.5
f);
376 if (boxSkip) {
Int_t s = boxSkip;
while (s--) bi.
next(); }
383 using namespace TMath;
385 glEnable(GL_NORMALIZE);
398 glRotatef(phi, 0, 0, 1);
399 glRotatef(90 - theta, 0, 1, 0);
400 glRotatef(b.
fAngle, 0, 0, 1);
401 glScalef (b.
fR, b.
fR2,
h);
404 AntiFlick(0.0
f, 0.0
f, 0.5
f);
407 if (boxSkip) {
Int_t s = boxSkip;
while (s--) bi.
next(); }
414 throw(eH +
"unsupported box-type.");
438 glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT);
443 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
445 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
451 glDisable(GL_CULL_FACE);
void MakeDisplayList() const
Create a display-list for rendering a single box, based on the current box-type.
virtual void DLCacheDrop()
Drop all entries for all LODs for this drawable from the display list cache, WITHOUT returning the re...
A GL rendering class for TEveBoxSet.
const std::set< Int_t > * fSelection
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Bool_t SecSelection() const
Int_t PrimitiveType() const
Return GL primitive used to render the boxes, based on the render-mode specified in the model object...
TEveBoxSetGL()
Default constructor.
const std::set< Int_t > * fHighlightSet
Collection of 3D primitives (fixed-size boxes, boxes of different sizes, or arbitrary sexto-epipeds...
GLUquadric * Get()
Get the internal raw GLU quadric object. Created on first call.
virtual void DLCacheDrop()
Called when display lists have been destroyed externally and the internal display-list data needs to ...
TEveRGBAPalette * AssertPalette()
Make sure the TEveRGBAPalette pointer is not null.
Wrapper class for GLU quadric shape drawing object.
virtual Bool_t ShouldDLCache(const TGLRnrCtx &rnrCtx) const
Determines if display-list will be used for rendering.
void RenderBoxAutoNorm(const Float_t p[8][3]) const
Render box, calculate normals on the fly from first three points.
virtual Bool_t SetModel(TObject *obj, const Option_t *opt=0)
Set model object.
Bool_t IsDrawPassOutlineLine() const
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
virtual void DirectDraw(TGLRnrCtx &rnrCtx) const
Actual rendering code.
Double_t ATan2(Double_t, Double_t)
OpenGL renderer class for TEveDigitSet.
virtual ~TEveBoxSetGL()
Destructor.
virtual void DLCachePurge()
Purge all entries for all LODs for this drawable from the display list cache, returning the reserved ...
void RenderBoxes(TGLRnrCtx &rnrCtx) const
GL rendering for all box-types.
void MakeOriginBox(Float_t p[8][3], Float_t dx, Float_t dy, Float_t dz) const
Fill array p to represent a box (0,0,0) - (dx,dy,dz).
Double_t Sqrt(Double_t x)
void RenderBoxStdNorm(const Float_t p[8][3]) const
Render a box specified by points in array p with standard axis-aligned normals.
TEveRGBAPalette * fPalette
ERenderMode_e fRenderMode
T * Cross(const T v1[3], const T v2[3], T out[3])
Calculate the Cross Product of two vectors: out = [v1 x v2].
virtual Bool_t ShouldDLCache(const TGLRnrCtx &rnrCtx) const
Decide if display-list should be used for this pass rendering, as determined by rnrCtx.
static constexpr double s
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Mother of all ROOT objects.
you should not use this method at all Int_t Int_t z
constexpr Double_t RadToDeg()
Conversion from radian to degree: .
Bool_t next()
Go to next atom.
virtual void DLCachePurge()
Called when display-lists need to be returned to the system.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
void DrawFrameIfNeeded(TGLRnrCtx &rnrCtx) const
Make a decision if the frame should be drawn.
Exception class thrown by TEve classes and macros.
void PurgeDLRange(UInt_t base, Int_t size) const
External object is a fake.
Bool_t fDLCache
display-list validity bit-field
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Bool_t SetupColor(const TEveDigitSet::DigitBase_t &q) const
Set color for rendering of the specified digit.
virtual void Render(TGLRnrCtx &rnrCtx)
Interface for direct rendering from classes that include TEveBoxSet as a member.