Logo ROOT   6.12/07
Reference Guide
TEveBoxGL.h
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Author: Matevz Tadel, 2010
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TEveBoxGL
13 #define ROOT_TEveBoxGL
14 
15 #include "TGLObject.h"
16 
17 class TGLViewer;
18 class TGLScene;
19 
20 class TEveBox;
21 class TEveBoxProjected;
22 
23 //------------------------------------------------------------------------------
24 // TEveBoxGL
25 //------------------------------------------------------------------------------
26 
27 class TEveBoxGL : public TGLObject
28 {
29 private:
30  TEveBoxGL(const TEveBoxGL&); // Not implemented
31  TEveBoxGL& operator=(const TEveBoxGL&); // Not implemented
32 
33 protected:
34  TEveBox *fM; // Model object.
35 
36  void RenderOutline (const Float_t p[8][3]) const;
37  void RenderBoxStdNorm (const Float_t p[8][3]) const;
38  void RenderBoxAutoNorm(const Float_t p[8][3]) const;
39 
40 public:
41  TEveBoxGL();
42  virtual ~TEveBoxGL() {}
43 
44  virtual Bool_t SetModel(TObject* obj, const Option_t* opt=0);
45  virtual void SetBBox();
46 
47  virtual void Draw(TGLRnrCtx& rnrCtx) const;
48  virtual void DirectDraw(TGLRnrCtx& rnrCtx) const;
49 
50  virtual Bool_t IgnoreSizeForOfInterest() const { return kTRUE; }
51 
52  // To support two-level selection
53  // virtual Bool_t SupportsSecondarySelect() const { return kTRUE; }
54  // virtual void ProcessSelection(TGLRnrCtx & rnrCtx, TGLSelectRecord & rec);
55 
56  ClassDef(TEveBoxGL, 0); // GL renderer class for TEveBox.
57 };
58 
59 
60 //------------------------------------------------------------------------------
61 // TEveBoxProjectedGL
62 //------------------------------------------------------------------------------
63 
65 {
66 private:
67  TEveBoxProjectedGL(const TEveBoxProjectedGL&); // Not implemented
68  TEveBoxProjectedGL& operator=(const TEveBoxProjectedGL&); // Not implemented
69 
70 protected:
71  TEveBoxProjected *fM; // Model object.
72 
73  void RenderPoints(Int_t mode) const;
74 
75 public:
77  virtual ~TEveBoxProjectedGL() {}
78 
79  virtual Bool_t SetModel(TObject* obj, const Option_t* opt=0);
80  virtual void SetBBox();
81 
82  virtual void Draw(TGLRnrCtx& rnrCtx) const;
83  virtual void DirectDraw(TGLRnrCtx& rnrCtx) const;
84 
85  virtual Bool_t IgnoreSizeForOfInterest() const { return kTRUE; }
86 
87  // To support two-level selection
88  // virtual Bool_t SupportsSecondarySelect() const { return kTRUE; }
89  // virtual void ProcessSelection(TGLRnrCtx & rnrCtx, TGLSelectRecord & rec);
90 
91  ClassDef(TEveBoxProjectedGL, 0); // GL renderer class for TEveBoxProjected.
92 };
93 
94 #endif
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Definition: TGLRnrCtx.h:40
virtual void Draw(TGLRnrCtx &rnrCtx) const
Render with OpenGL.
Definition: TEveBoxGL.cxx:176
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
3D box with arbitrary vertices (cuboid).
Definition: TEveBox.h:21
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
void RenderBoxAutoNorm(const Float_t p[8][3]) const
Render box, calculate normals on the fly from first three points.
Definition: TEveBoxGL.cxx:133
Projection of TEveBox.
Definition: TEveBox.h:56
OpenGL renderer class for TEveBoxProjected.
Definition: TEveBoxGL.h:64
#define ClassDef(name, id)
Definition: Rtypes.h:320
virtual ~TEveBoxProjectedGL()
Definition: TEveBoxGL.h:77
Base-class for direct OpenGL renderers.
Definition: TGLObject.h:21
TEveBoxGL & operator=(const TEveBoxGL &)
TEveBox * fM
Definition: TEveBoxGL.h:34
OpenGL renderer class for TEveBox.
Definition: TEveBoxGL.h:27
void RenderBoxStdNorm(const Float_t p[8][3]) const
Render box with standard axis-aligned normals.
Definition: TEveBoxGL.cxx:98
Base GL viewer object - used by both standalone and embedded (in pad) GL.
Definition: TGLViewer.h:53
virtual Bool_t IgnoreSizeForOfInterest() const
Return true if size of this shape should be ignored when determining if the object should be drawn...
Definition: TEveBoxGL.h:85
void RenderOutline(const Float_t p[8][3]) const
Render box with without normals.
Definition: TEveBoxGL.cxx:78
virtual void DirectDraw(TGLRnrCtx &rnrCtx) const
Render with OpenGL, create display-list.
Definition: TEveBoxGL.cxx:203
virtual ~TEveBoxGL()
Definition: TEveBoxGL.h:42
Mother of all ROOT objects.
Definition: TObject.h:37
TGLScene provides management and rendering of ROOT's default 3D /object representation as logical and...
Definition: TGLScene.h:30
virtual void SetBBox()
Set bounding box.
Definition: TEveBoxGL.cxx:48
virtual Bool_t SetModel(TObject *obj, const Option_t *opt=0)
Set model object.
Definition: TEveBoxGL.cxx:39
const Bool_t kTRUE
Definition: RtypesCore.h:87
TEveBoxGL()
Constructor.
Definition: TEveBoxGL.cxx:30
virtual Bool_t IgnoreSizeForOfInterest() const
Return true if size of this shape should be ignored when determining if the object should be drawn...
Definition: TEveBoxGL.h:50
TEveBoxProjected * fM
Definition: TEveBoxGL.h:71