19#include "TGLIncludes.h"
41 fC = SetModelDynCast<TEveJetCone>(obj);
74 for (
Int_t i = 0; i < NP; ++i,
angle += angle_step)
90 glPushAttrib(GL_ENABLE_BIT);
91 glDisable(GL_LIGHTING);
100 glBegin(GL_LINE_LOOP);
101 for (
Int_t i = 0; i < NP; ++i)
128 glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT | GL_LIGHTING_BIT);
130 glDisable(GL_CULL_FACE);
131 glEnable(GL_NORMALIZE);
133 glLightModeliv(GL_LIGHT_MODEL_TWO_SIDE, &lmts);
144 prev = i; i = next; ++next;
146 glBegin(GL_TRIANGLES);
151 glNormal3fv(prev_normal);
152 glVertex3fv(
fP[prev]);
154 glNormal3fv(prev_normal + curr_normal);
157 glNormal3fv(curr_normal);
160 prev_normal = curr_normal;
164 ++next;
if (next >= NP) next = 0;
191 fM = SetModelDynCast<TEveJetConeProjected>(obj);
193 return fC !=
nullptr;
206 struct less_eve_vec_phi_t
209 {
return a.Phi() <
b.Phi(); }
218 static const TEveException kEH(
"TEveJetConeProjectedGL::CalculatePoints ");
232 for (
Int_t i = 0; i < 3; ++i)
247 if (tM >
fC->
fThetaC && tm < fC->fThetaC)
249 fP.reserve(
fP.size() + 1);
256 fP.reserve(
fP.size() + 1);
262 for (
Int_t i = 0; i < NP; ++i)
265 std::sort(
fP.begin() + 1,
fP.end(), less_eve_vec_phi_t());
271 throw kEH +
"Unsupported projection type.";
282 glBegin(GL_LINE_LOOP);
283 for (
Int_t i = 0; i < NP; ++i)
285 glVertex3fv(
fP[i].Arr());
297 for (
Int_t i = 0; i < NP; ++i)
299 glVertex3fv(
fP[i].Arr());
339 glPushAttrib(GL_ENABLE_BIT);
340 glDisable(GL_LIGHTING);
344 glEnable(GL_POLYGON_OFFSET_FILL);
345 glPolygonOffset(1.0f, 1.0f);
352 glEnable(GL_LINE_SMOOTH);
float Float_t
Float 4 bytes (float)
const char Option_t
Option string (const char)
Option_t Option_t TPoint TPoint angle
Exception class thrown by TEve classes and macros.
OpenGL renderer class for TEveJetCone.
void SetBBox() override
Set bounding box.
virtual void CalculatePoints() const
Calculate points for drawing.
std::vector< TEveVector > fP
void DLCacheClear() override
Clear DL cache and reset internal point array.
TEveJetConeGL()
Constructor.
void DirectDraw(TGLRnrCtx &rnrCtx) const override
Render with OpenGL.
void Draw(TGLRnrCtx &rnrCtx) const override
Draw the cone.
Bool_t SetModel(TObject *obj, const Option_t *opt=nullptr) override
Set model object.
void RenderOutline() const
Draw jet outline.
void RenderPolygon() const
Draw jet surface.
TEveJetConeProjected * fM
void DirectDraw(TGLRnrCtx &rnrCtx) const override
Render with OpenGL.
void Draw(TGLRnrCtx &rnrCtx) const override
Draw the cone.
void SetBBox() override
Set bounding box.
Bool_t SetModel(TObject *obj, const Option_t *opt=nullptr) override
Set model object.
void CalculatePoints() const override
Calculate points for drawing.
TEveJetConeProjectedGL()
Constructor.
Projection of TEveJetCone.
Draws a jet cone with leading particle is specified in (eta,phi) and cone radius is given.
TEveVector CalcBaseVec(Float_t eta, Float_t phi) const
Returns point on the base of the cone with given eta and phi.
TEveProjectionManager * GetManager() const
TEveProjectable * GetProjectable() const
TEveProjection * GetProjection()
Base-class for non-linear projections.
void ProjectVector(TEveVector &v, Float_t d)
Project TEveVector.
virtual void Draw(TGLRnrCtx &rnrCtx) const
Draw the GL drawable, using draw flags.
TObject * fExternalObj
! Also plays the role of ID.
virtual void DLCacheClear()
Clear all entries for all LODs for this drawable from the display list cache but keeping the reserved...
Base-class for direct OpenGL renderers.
void SetAxisAlignedBBox(Float_t xmin, Float_t xmax, Float_t ymin, Float_t ymax, Float_t zmin, Float_t zmax)
Set axis-aligned bounding-box.
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Bool_t IsDrawPassOutlineLine() const
static void Color(const TGLColor &color)
Set color from TGLColor.
static Float_t LineWidth()
Get the line-width, taking the global scaling into account.
Mother of all ROOT objects.
constexpr Double_t PiOver2()
T * Cross(const T v1[3], const T v2[3], T out[3])
Calculates the Cross Product of two vectors: out = [v1 x v2].
constexpr Double_t TwoPi()