Logo ROOT   6.10/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 #include "Rtypes.h"
18 #include "TGLUtil.h"
19 
20 class TColor;
21 
22 /*
23  TGLPlotBox draws a box behind a plot.
24 */
25 
26 class TGLPlotBox {
27 private:
32 
34 
36  mutable TGLVertex3 f2DBox[8];
37  mutable TGLVertex3 f2DBoxU[8];
38  mutable Int_t fFrontPoint;
39 
40  //The sizes of a "unit" cube.
44 
47 
48 public:
49 
50  TGLPlotBox(Bool_t xoySelectable, Bool_t xozSelectable, Bool_t yozSelectable);
51  //ClassDef macro adds some virtual functions,
52  //so, to supress g++ warnings virtual destructor declared.
53  virtual ~TGLPlotBox();
54 
55  void DrawBox(Int_t selectedPart, Bool_t selectionPass,
56  const std::vector<Double_t> &zLevels,
57  Bool_t highColor)const;
58 
59  void SetPlotBox(const Rgl::Range_t &xRange,
60  const Rgl::Range_t &yRange,
61  const Rgl::Range_t &zRange);
62  void SetPlotBox(const Rgl::Range_t &xRange, Double_t rangeXU,
63  const Rgl::Range_t &yRange, Double_t rangeYU,
64  const Rgl::Range_t &zRange, Double_t rangeZU);
65 
66  void SetFrameColor(const TColor *color);
67 
68  Int_t FindFrontPoint()const;
69  Int_t GetFrontPoint()const;
70 
71  const TGLVertex3 *Get3DBox()const;
72  const TGLVertex3 *Get2DBox()const;
73 
74  static const Int_t fgFramePlanes[][4];
75  static const Int_t fgBackPairs[][2];
76  static const Int_t fgFrontPairs[][2];
77  static const Double_t fgNormals[][3];
78 
79  void SetDrawFront(Bool_t d) {fDrawFront = d;}
80  Bool_t GetDrawFront() const {return fDrawFront;}
81 
82  void SetDrawBack(Bool_t d) {fDrawBack = d;}
83  Bool_t GetDrawBack() const {return fDrawBack;}
84 
85 private:
86  void DrawBack(Int_t selectedPart, Bool_t selectionPass, const std::vector<Double_t> &zLevels, Bool_t highColor)const;
87  void DrawFront()const;
88  void DrawBackPlane(Int_t plane, Bool_t selectionPass,
89  const std::vector<Double_t> &zLevels)const;
90 
91  ClassDef(TGLPlotBox, 0)//Back box for plot.
92 };
93 
94 #endif
Int_t GetFrontPoint() const
The nearest point.
Definition: TGLPlotBox.cxx:294
const TColor * fFrameColor
Definition: TGLPlotBox.h:28
TGLVertex3 f2DBoxU[8]
Definition: TGLPlotBox.h:37
std::pair< Double_t, Double_t > Range_t
Definition: TGLUtil.h:1193
void DrawBack(Int_t selectedPart, Bool_t selectionPass, const std::vector< Double_t > &zLevels, Bool_t highColor) const
Definition: TGLPlotBox.cxx:98
const TGLVertex3 * Get3DBox() const
Get 3D box.
Definition: TGLPlotBox.cxx:303
const Bool_t fXOYSelectable
Definition: TGLPlotBox.h:29
const Bool_t fXOZSelectable
Definition: TGLPlotBox.h:30
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Bool_t fDrawBack
Definition: TGLPlotBox.h:45
Bool_t GetDrawFront() const
Definition: TGLPlotBox.h:80
TGLVertex3 f2DBox[8]
Definition: TGLPlotBox.h:36
#define ClassDef(name, id)
Definition: Rtypes.h:297
3 component (x/y/z) vertex class.
Definition: TGLUtil.h:82
void SetDrawBack(Bool_t d)
Definition: TGLPlotBox.h:82
static const Double_t fgNormals[][3]
Definition: TGLPlotBox.h:77
void DrawBackPlane(Int_t plane, Bool_t selectionPass, const std::vector< Double_t > &zLevels) const
Draw back plane with number &#39;plane&#39;.
Definition: TGLPlotBox.cxx:321
Bool_t fDrawFront
Definition: TGLPlotBox.h:46
void SetDrawFront(Bool_t d)
Definition: TGLPlotBox.h:79
static const Int_t fgBackPairs[][2]
Definition: TGLPlotBox.h:75
Implementation of a box around a histogram/function for plot-painters.
Definition: TGLPlotBox.h:26
Int_t fFrontPoint
Definition: TGLPlotBox.h:38
TGLPlotBox(Bool_t xoySelectable, Bool_t xozSelectable, Bool_t yozSelectable)
Constructor.
Definition: TGLPlotBox.cxx:62
TGLVertex3 f3DBox[8]
Definition: TGLPlotBox.h:35
static const Int_t fgFrontPairs[][2]
Definition: TGLPlotBox.h:76
Int_t FindFrontPoint() const
Convert 3d points into window coordinate system and find the nearest.
Definition: TGLPlotBox.cxx:245
Double_t fRangeYU
Definition: TGLPlotBox.h:42
Bool_t fSelectablePairs[4][2]
Definition: TGLPlotBox.h:33
Double_t fRangeXU
Definition: TGLPlotBox.h:41
const Bool_t fYOZSelectable
Definition: TGLPlotBox.h:31
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:184
static const Int_t fgFramePlanes[][4]
Definition: TGLPlotBox.h:74
double Double_t
Definition: RtypesCore.h:55
void SetFrameColor(const TColor *color)
Back box color.
Definition: TGLPlotBox.cxx:226
The color creation and management class.
Definition: TColor.h:19
virtual ~TGLPlotBox()
Empty dtor to suppress g++ warnings.
Definition: TGLPlotBox.cxx:92
Bool_t GetDrawBack() const
Definition: TGLPlotBox.h:83
void DrawFront() const
Definition: TGLPlotBox.cxx:163
Double_t fRangeZU
Definition: TGLPlotBox.h:43
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:198
const TGLVertex3 * Get2DBox() const
Get 2D box.
Definition: TGLPlotBox.cxx:312