#pragma link C++ class AliEveCascadeEditor+;
#pragma link C++ class AliEveCascadeList+;
#pragma link C++ class AliEveCascadeListEditor+;
-//
+
// AliEveV0
#pragma link C++ class AliEveV0+;
#pragma link C++ class AliEveV0List+;
#pragma link C++ class AliEveV0Editor+;
#pragma link C++ class AliEveV0ListEditor+;
+
+// TEveJetCone
+#pragma link C++ class TEveJetCone+;
+#pragma link C++ class TEveJetConeEditor+;
+#pragma link C++ class TEveJetConeGL+;
--- /dev/null
+// @(#)root/eve:$Id$
+// Author: Matevz Tadel 2007
+
+/*************************************************************************
+ * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
+ * All rights reserved. *
+ * *
+ * For the licensing terms see $ROOTSYS/LICENSE. *
+ * For the list of contributors see $ROOTSYS/README/CREDITS. *
+ *************************************************************************/
+
+#include "TEveJetCone.h"
+#include "TEveTrans.h"
+
+#include "TBuffer3D.h"
+#include "TBuffer3DTypes.h"
+#include "TVirtualPad.h"
+#include "TVirtualViewer3D.h"
+
+//______________________________________________________________________________
+// Description of TEveJetCone
+//
+// The base must have at least three points.
+
+ClassImp(TEveJetCone)
+
+//______________________________________________________________________________
+TEveJetCone::TEveJetCone(const Text_t* n, const Text_t* t) :
+ TEveElementList(n, t, kTRUE),
+ TAttBBox(),
+ fApex(),
+ fBasePoints()
+{
+ // Constructor.
+
+ fColor = kYellow;
+}
+
+
+/******************************************************************************/
+
+//______________________________________________________________________________
+void TEveJetCone::ComputeBBox()
+{
+ // Compute bounding-box of the data.
+
+ BBoxInit();
+ BBoxCheckPoint(fApex);
+ for (vTEveVector_ci i = fBasePoints.begin(); i != fBasePoints.end(); ++i)
+ {
+ BBoxCheckPoint(*i);
+ }
+}
+
+//______________________________________________________________________________
+void TEveJetCone::Paint(Option_t*)
+{
+ // Paint object.
+ // This is for direct rendering (using TEveJetConeGL class).
+
+ static const TEveException eh("TEveJetCone::Paint ");
+
+ if (fRnrSelf == kFALSE) return;
+
+ TBuffer3D buff(TBuffer3DTypes::kGeneric);
+
+ // Section kCore
+ buff.fID = this;
+ buff.fColor = GetMainColor();
+ buff.fTransparency = GetMainTransparency();
+ if (HasMainTrans())
+ RefMainTrans().SetBuffer3D(buff);
+ buff.SetSectionsValid(TBuffer3D::kCore);
+
+ Int_t reqSections = gPad->GetViewer3D()->AddObject(buff);
+ if (reqSections != TBuffer3D::kNone)
+ Error(eh, "only direct GL rendering supported.");
+}
--- /dev/null
+// @(#)root/eve:$Id$
+// Author: Matevz Tadel 2007
+
+/*************************************************************************
+ * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
+ * All rights reserved. *
+ * *
+ * For the licensing terms see $ROOTSYS/LICENSE. *
+ * For the list of contributors see $ROOTSYS/README/CREDITS. *
+ *************************************************************************/
+
+#ifndef ROOT_TEveJetCone
+#define ROOT_TEveJetCone
+
+#include "TEveElement.h"
+#include "TEveVSDStructs.h"
+#include "TAttBBox.h"
+
+class TEveJetCone : public TEveElementList,
+ public TAttBBox
+{
+ friend class TEveJetConeGL;
+
+private:
+ TEveJetCone(const TEveJetCone&); // Not implemented
+ TEveJetCone& operator=(const TEveJetCone&); // Not implemented
+
+protected:
+ typedef std::vector<TEveVector> vTEveVector_t;
+ typedef vTEveVector_t::iterator vTEveVector_i;
+ typedef vTEveVector_t::const_iterator vTEveVector_ci;
+
+ TEveVector fApex;
+ vTEveVector_t fBasePoints;
+
+public:
+ TEveJetCone(const Text_t* n="TEveJetCone", const Text_t* t="");
+ virtual ~TEveJetCone() {}
+
+ void SetApex(const TEveVector& a) { fApex = a; }
+ void AddBasePoint(const TEveVector& p) { fBasePoints.push_back(p); }
+
+ // void SetBaseFromEtaPhi(radius, eta, phi, deta, dphi);
+
+ virtual Bool_t CanEditMainTransparency() const { return kTRUE; }
+
+ // For TAttBBox:
+ virtual void ComputeBBox();
+ // If painting is needed:
+ virtual void Paint(Option_t* option="");
+
+ ClassDef(TEveJetCone, 0); // Short description.
+};
+
+#endif
--- /dev/null
+// @(#)root/eve:$Id$
+// Author: Matevz Tadel 2007
+
+/*************************************************************************
+ * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
+ * All rights reserved. *
+ * *
+ * For the licensing terms see $ROOTSYS/LICENSE. *
+ * For the list of contributors see $ROOTSYS/README/CREDITS. *
+ *************************************************************************/
+
+#include "TEveJetConeEditor.h"
+#include "TEveJetCone.h"
+
+#include "TVirtualPad.h"
+#include "TColor.h"
+
+// Cleanup these includes:
+#include "TGLabel.h"
+#include "TGButton.h"
+#include "TGNumberEntry.h"
+#include "TGColorSelect.h"
+#include "TGDoubleSlider.h"
+
+
+//______________________________________________________________________________
+// GUI editor for TEveJetCone.
+//
+
+ClassImp(TEveJetConeEditor)
+
+//______________________________________________________________________________
+TEveJetConeEditor::TEveJetConeEditor(const TGWindow *p, Int_t width, Int_t height,
+ UInt_t options, Pixel_t back) :
+ TGedFrame(p, width, height, options | kVerticalFrame, back),
+ fM(0)
+ // Initialize widget pointers to 0
+{
+ // Constructor.
+
+ MakeTitle("TEveJetCone");
+
+ // Create widgets
+ // fXYZZ = new TGSomeWidget(this, ...);
+ // AddFrame(fXYZZ, new TGLayoutHints(...));
+ // fXYZZ->Connect("SignalName()", "Reve::TEveJetConeEditor", this, "DoXYZZ()");
+}
+
+/******************************************************************************/
+
+//______________________________________________________________________________
+void TEveJetConeEditor::SetModel(TObject* obj)
+{
+ // Set model object.
+
+ fM = dynamic_cast<TEveJetCone*>(obj);
+
+ // Set values of widgets
+ // fXYZZ->SetValue(fM->GetXYZZ());
+}
+
+/******************************************************************************/
+
+// Implements callback/slot methods
+
+//______________________________________________________________________________
+// void TEveJetConeEditor::DoXYZZ()
+// {
+// // Slot for XYZZ.
+//
+// fM->SetXYZZ(fXYZZ->GetValue());
+// Update();
+// }
--- /dev/null
+// @(#)root/eve:$Id$
+// Author: Matevz Tadel 2007
+
+/*************************************************************************
+ * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
+ * All rights reserved. *
+ * *
+ * For the licensing terms see $ROOTSYS/LICENSE. *
+ * For the list of contributors see $ROOTSYS/README/CREDITS. *
+ *************************************************************************/
+
+#ifndef ROOT_TEveJetConeEditor
+#define ROOT_TEveJetConeEditor
+
+#include "TGedFrame.h"
+
+class TGButton;
+class TGCheckButton;
+class TGNumberEntry;
+class TGColorSelect;
+
+class TEveJetCone;
+
+class TEveJetConeEditor : public TGedFrame
+{
+private:
+ TEveJetConeEditor(const TEveJetConeEditor&); // Not implemented
+ TEveJetConeEditor& operator=(const TEveJetConeEditor&); // Not implemented
+
+protected:
+ TEveJetCone *fM; // Model object.
+
+ // Declare widgets
+ // TGSomeWidget* fXYZZ;
+
+public:
+ TEveJetConeEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30,
+ UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground());
+ virtual ~TEveJetConeEditor() {}
+
+ virtual void SetModel(TObject* obj);
+
+ // Declare callback/slot methods
+ // void DoXYZZ();
+
+ ClassDef(TEveJetConeEditor, 0); // GUI editor for TEveJetCone.
+};
+
+#endif
--- /dev/null
+// @(#)root/eve:$Id$
+// Author: Matevz Tadel 2007
+
+/*************************************************************************
+ * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
+ * All rights reserved. *
+ * *
+ * For the licensing terms see $ROOTSYS/LICENSE. *
+ * For the list of contributors see $ROOTSYS/README/CREDITS. *
+ *************************************************************************/
+
+#include "TEveJetConeGL.h"
+#include "TEveJetCone.h"
+
+#include "TMath.h"
+
+#include "TGLRnrCtx.h"
+#include "TGLIncludes.h"
+
+//______________________________________________________________________________
+// OpenGL renderer class for TEveJetCone.
+//
+
+ClassImp(TEveJetConeGL)
+
+//______________________________________________________________________________
+TEveJetConeGL::TEveJetConeGL() :
+ TGLObject(), fM(0)
+{
+ // Constructor.
+
+ // fDLCache = kFALSE; // Disable display list.
+}
+
+/******************************************************************************/
+
+//______________________________________________________________________________
+Bool_t TEveJetConeGL::SetModel(TObject* obj, const Option_t* /*opt*/)
+{
+ // Set model object.
+
+ if (SetModelCheckClass(obj, TEveJetCone::Class())) {
+ fM = dynamic_cast<TEveJetCone*>(obj);
+ return kTRUE;
+ }
+ return kFALSE;
+}
+
+//______________________________________________________________________________
+void TEveJetConeGL::SetBBox()
+{
+ // Set bounding box.
+
+ // !! This ok if master sub-classed from TAttBBox
+ SetAxisAlignedBBox(((TEveJetCone*)fExternalObj)->AssertBBox());
+}
+
+/******************************************************************************/
+
+//______________________________________________________________________________
+void TEveJetConeGL::DirectDraw(TGLRnrCtx & rnrCtx) const
+{
+ // Render with OpenGL.
+
+ printf("TEveJetConeGL::DirectDraw LOD %d\n", rnrCtx.CombiLOD());
+
+ glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT);
+
+ glDisable(GL_CULL_FACE);
+ glEnable(GL_NORMALIZE);
+
+ glBegin(GL_TRIANGLE_FAN);
+ glVertex3fv(fM->fApex);
+ if ( fM->fBasePoints.size() > 2)
+ {
+ TEveJetCone::vTEveVector_ci prev = fM->fBasePoints.end(); --prev;
+ TEveJetCone::vTEveVector_ci i = fM->fBasePoints.begin();
+ TEveJetCone::vTEveVector_ci next = i; ++next;
+
+ TEveVector norm_buf;
+ TEveVector beg_normal = TMath::Cross((*i - fM->fApex).Arr(), (*next - *prev).Arr(), norm_buf.Arr());
+
+ glNormal3fv(beg_normal);
+ glVertex3fv(fM->fBasePoints.front());
+
+ prev = i; i = next; ++next;
+
+ while (i != fM->fBasePoints.begin())
+ {
+ glNormal3fv(TMath::Cross((*i - fM->fApex).Arr(), (*next - *prev).Arr(), norm_buf.Arr()));
+ glVertex3fv(*i);
+
+ prev = i;
+ i = next;
+ ++next; if (next == fM->fBasePoints.end()) next = fM->fBasePoints.begin();
+ }
+
+ glNormal3fv(beg_normal);
+ glVertex3fv(fM->fBasePoints.front());
+ }
+ glEnd();
+
+ glPopAttrib();
+}
--- /dev/null
+// @(#)root/eve:$Id$
+// Author: Matevz Tadel 2007
+
+/*************************************************************************
+ * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
+ * All rights reserved. *
+ * *
+ * For the licensing terms see $ROOTSYS/LICENSE. *
+ * For the list of contributors see $ROOTSYS/README/CREDITS. *
+ *************************************************************************/
+
+#ifndef ROOT_TEveJetConeGL
+#define ROOT_TEveJetConeGL
+
+#include "TGLObject.h"
+
+class TGLViewer;
+class TGLScene;
+
+class TEveJetCone;
+
+class TEveJetConeGL : public TGLObject
+{
+private:
+ TEveJetConeGL(const TEveJetConeGL&); // Not implemented
+ TEveJetConeGL& operator=(const TEveJetConeGL&); // Not implemented
+
+protected:
+ TEveJetCone *fM; // Model object.
+
+public:
+ TEveJetConeGL();
+ virtual ~TEveJetConeGL() {}
+
+ virtual Bool_t SetModel(TObject* obj, const Option_t* opt=0);
+ virtual void SetBBox();
+
+ virtual void DirectDraw(TGLRnrCtx & rnrCtx) const;
+
+ // To support two-level selection
+ // virtual Bool_t SupportsSecondarySelect() const { return kTRUE; }
+ // virtual void ProcessSelection(TGLRnrCtx & rnrCtx, TGLSelectRecord & rec);
+
+ ClassDef(TEveJetConeGL, 0); // GL renderer class for TEveJetCone.
+};
+
+#endif