ROOT  6.06/09
Reference Guide
TGLPlotBox.h
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 // Author: Timur Pocheptsov 31/08/2006
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2006, 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_TGLPlotFrame
13 #define ROOT_TGLPlotFrame
14 
15 #include <vector>
16 
17 #ifndef ROOT_Rtypes
18 #include "Rtypes.h"
19 #endif
20 #ifndef ROOT_TGLUtil
21 #include "TGLUtil.h"
22 #endif
23 
24 class TColor;
25 
26 /*
27  TGLPlotBox draws a box behind a plot.
28 */
29 
30 class TGLPlotBox {
31 private:
36 
38 
40  mutable TGLVertex3 f2DBox[8];
41  mutable TGLVertex3 f2DBoxU[8];
42  mutable Int_t fFrontPoint;
43 
44  //The sizes of a "unit" cube.
48 
51 
52 public:
53 
54  TGLPlotBox(Bool_t xoySelectable, Bool_t xozSelectable, Bool_t yozSelectable);
55  //ClassDef macro adds some virtual functions,
56  //so, to supress g++ warnings virtual destructor declared.
57  virtual ~TGLPlotBox();
58 
59  void DrawBox(Int_t selectedPart, Bool_t selectionPass,
60  const std::vector<Double_t> &zLevels,
61  Bool_t highColor)const;
62 
63  void SetPlotBox(const Rgl::Range_t &xRange,
64  const Rgl::Range_t &yRange,
65  const Rgl::Range_t &zRange);
66  void SetPlotBox(const Rgl::Range_t &xRange, Double_t rangeXU,
67  const Rgl::Range_t &yRange, Double_t rangeYU,
68  const Rgl::Range_t &zRange, Double_t rangeZU);
69 
70  void SetFrameColor(const TColor *color);
71 
72  Int_t FindFrontPoint()const;
73  Int_t GetFrontPoint()const;
74 
75  const TGLVertex3 *Get3DBox()const;
76  const TGLVertex3 *Get2DBox()const;
77 
78  static const Int_t fgFramePlanes[][4];
79  static const Int_t fgBackPairs[][2];
80  static const Int_t fgFrontPairs[][2];
81  static const Double_t fgNormals[][3];
82 
83  void SetDrawFront(Bool_t d) {fDrawFront = d;}
84  Bool_t GetDrawFront() const {return fDrawFront;}
85 
86  void SetDrawBack(Bool_t d) {fDrawBack = d;}
87  Bool_t GetDrawBack() const {return fDrawBack;}
88 
89 private:
90  void DrawBack(Int_t selectedPart, Bool_t selectionPass, const std::vector<Double_t> &zLevels, Bool_t highColor)const;
91  void DrawFront()const;
92  void DrawBackPlane(Int_t plane, Bool_t selectionPass,
93  const std::vector<Double_t> &zLevels)const;
94 
95  ClassDef(TGLPlotBox, 0)//Back box for plot.
96 };
97 
98 #endif
const TColor * fFrameColor
Definition: TGLPlotBox.h:32
TGLVertex3 f2DBoxU[8]
Definition: TGLPlotBox.h:41
std::pair< Double_t, Double_t > Range_t
Definition: TGLUtil.h:1197
void DrawBack(Int_t selectedPart, Bool_t selectionPass, const std::vector< Double_t > &zLevels, Bool_t highColor) const
Definition: TGLPlotBox.cxx:97
const Bool_t fXOYSelectable
Definition: TGLPlotBox.h:33
const Bool_t fXOZSelectable
Definition: TGLPlotBox.h:34
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Bool_t fDrawBack
Definition: TGLPlotBox.h:49
Int_t FindFrontPoint() const
Convert 3d points into window coordinate system and find the nearest.
Definition: TGLPlotBox.cxx:244
TGLVertex3 f2DBox[8]
Definition: TGLPlotBox.h:40
#define ClassDef(name, id)
Definition: Rtypes.h:254
3 component (x/y/z) vertex class.
Definition: TGLUtil.h:86
void SetDrawBack(Bool_t d)
Definition: TGLPlotBox.h:86
static const Double_t fgNormals[][3]
Definition: TGLPlotBox.h:81
Bool_t fDrawFront
Definition: TGLPlotBox.h:50
void SetDrawFront(Bool_t d)
Definition: TGLPlotBox.h:83
static const Int_t fgBackPairs[][2]
Definition: TGLPlotBox.h:79
Bool_t GetDrawBack() const
Definition: TGLPlotBox.h:87
Implementation of a box around a histogram/function for plot-painters.
Definition: TGLPlotBox.h:30
Int_t fFrontPoint
Definition: TGLPlotBox.h:42
Bool_t GetDrawFront() const
Definition: TGLPlotBox.h:84
TGLPlotBox(Bool_t xoySelectable, Bool_t xozSelectable, Bool_t yozSelectable)
Constructor.
Definition: TGLPlotBox.cxx:61
TGLVertex3 f3DBox[8]
Definition: TGLPlotBox.h:39
static const Int_t fgFrontPairs[][2]
Definition: TGLPlotBox.h:80
Double_t fRangeYU
Definition: TGLPlotBox.h:46
Bool_t fSelectablePairs[4][2]
Definition: TGLPlotBox.h:37
Double_t fRangeXU
Definition: TGLPlotBox.h:45
const Bool_t fYOZSelectable
Definition: TGLPlotBox.h:35
const TGLVertex3 * Get2DBox() const
Get 2D box.
Definition: TGLPlotBox.cxx:311
static const Int_t fgFramePlanes[][4]
Definition: TGLPlotBox.h:78
void DrawBackPlane(Int_t plane, Bool_t selectionPass, const std::vector< Double_t > &zLevels) const
Draw back plane with number 'plane'.
Definition: TGLPlotBox.cxx:320
double Double_t
Definition: RtypesCore.h:55
void DrawBox(Int_t selectedPart, Bool_t selectionPass, const std::vector< Double_t > &zLevels, Bool_t highColor) const
Draw back box for a plot.
Definition: TGLPlotBox.cxx:183
void SetFrameColor(const TColor *color)
Back box color.
Definition: TGLPlotBox.cxx:225
The color creation and management class.
Definition: TColor.h:23
virtual ~TGLPlotBox()
Empty dtor to suppress g++ warnings.
Definition: TGLPlotBox.cxx:91
const TGLVertex3 * Get3DBox() const
Get 3D box.
Definition: TGLPlotBox.cxx:302
Int_t GetFrontPoint() const
The nearest point.
Definition: TGLPlotBox.cxx:293
void DrawFront() const
Definition: TGLPlotBox.cxx:162
Double_t fRangeZU
Definition: TGLPlotBox.h:47
void SetPlotBox(const Rgl::Range_t &xRange, const Rgl::Range_t &yRange, const Rgl::Range_t &zRange)
Set up a frame box.
Definition: TGLPlotBox.cxx:197