19#include "TGLIncludes.h"
67 assert(
fC->fNDiv > 2);
74 for (
Int_t i = 0; i < NP; ++i, angle += angle_step)
76 fP[i] =
fC->CalcBaseVec(angle);
90 glPushAttrib(GL_ENABLE_BIT);
91 glDisable(GL_LIGHTING);
100 glBegin(GL_LINE_LOOP);
101 for (
Int_t i = 0; i < NP; ++i)
108 glVertex3fv(
fC->fApex);
109 glVertex3fv(
fC->CalcBaseVec(angle));
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);
155 glVertex3fv(
fC->fApex);
157 glNormal3fv(curr_normal);
160 prev_normal = curr_normal;
164 ++next;
if (next >= NP) next = 0;
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)
241 fP[1] =
fC->CalcBaseVec(0);
247 if (tM >
fC->fThetaC && tm < fC->fThetaC)
249 fP.reserve(
fP.size() + 1);
251 fP.push_back(
fC->CalcBaseVec(
v.Eta(),
fC->fPhi));
256 fP.reserve(
fP.size() + 1);
258 fP.push_back(
fC->CalcBaseVec(
v.Eta(),
fC->fPhi));
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());
315 else if (
fM->fHighlightFrame && rnrCtx.
Highlight())
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);
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
TEveVectorT< Float_t > TEveVector
TRObject operator()(const T1 &t1) const
Exception class thrown by TEve classes and macros.
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.
TEveJetConeGL(const TEveJetConeGL &)=delete
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.
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...
TT * SetModelDynCast(TObject *obj)
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()