Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TEveProjectionAxes.cxx
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Author: Matevz Tadel 2007
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 #include "TEveProjectionAxes.h"
13 #include "TEveProjectionManager.h"
14 #include "TMath.h"
15 
16 
17 /** \class TEveProjectionAxes
18 \ingroup TEve
19 Axes for non-linear projections. Show scale of TEveProjectionManager
20 children. With different step mode tick-marks can positioned
21 equidistant or placed with value monotonically increasing from lower left corner
22 of bounding box.
23 */
24 
25 ClassImp(TEveProjectionAxes);
26 
27 ////////////////////////////////////////////////////////////////////////////////
28 /// Constructor.
29 
30 TEveProjectionAxes::TEveProjectionAxes(TEveProjectionManager* m, Bool_t useCS) :
31  TEveElement(),
32  TNamed("TEveProjectionAxes", ""),
33  fManager(m),
34 
35  fUseColorSet(useCS),
36 
37  fLabMode(kValue),
38  fAxesMode(kAll),
39 
40  fDrawCenter(kFALSE),
41  fDrawOrigin(kFALSE)
42 {
43  fCanEditMainTrans = kFALSE;
44  fManager->AddDependent(this);
45 
46  // Axis attributes.
47  fNdivisions = 1010;
48  fLabelSize = 0.015;
49  fLabelColor = kGray+1;
50  fAxisColor = kGray+1;
51  fTickLength = 0.015;
52  fLabelOffset = 0.01;
53 }
54 
55 ////////////////////////////////////////////////////////////////////////////////
56 /// Destructor.
57 
58 TEveProjectionAxes::~TEveProjectionAxes()
59 {
60  fManager->RemoveDependent(this);
61 }
62 
63 ////////////////////////////////////////////////////////////////////////////////
64 /// Paint this object. Only direct rendering is supported.
65 
66 void TEveProjectionAxes::Paint(Option_t*)
67 {
68  PaintStandard(this);
69 }
70 
71 ////////////////////////////////////////////////////////////////////////////////
72 /// Virtual from TAttBBox; fill bounding-box information.
73 
74 void TEveProjectionAxes::ComputeBBox()
75 {
76  static const TEveException eH("TEveProjectionManager::ComputeBBox ");
77 
78  BBoxZero();
79  if(fManager == 0 || fManager->GetBBox() == 0)
80  return;
81 
82  for (Int_t i=0; i<6; ++i)
83  fBBox[i] = fManager->GetBBox()[i];
84 
85  AssertBBoxExtents(0.1);
86 }
87 
88 ////////////////////////////////////////////////////////////////////////////////
89 /// Return TEveProjectionAxes icon.
90 
91 const TGPicture* TEveProjectionAxes::GetListTreeIcon(Bool_t)
92 {
93  return TEveElement::fgListTreeIcons[6];
94 }