Logo ROOT   6.08/07
Reference Guide
TMarker3DBox.h
Go to the documentation of this file.
1 // @(#)root/g3d:$Id$
2 // Author: "Valery fine" 31/10/97
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, 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 #ifndef ROOT_TMarker3DBox
12 #define ROOT_TMarker3DBox
13 
14 
15 ////////////////////////////////////////////////////////////////////////////
16 // //
17 // TMarker3DBox //
18 // //
19 // Marker3DBox is a special 3-D marker designed for event display. //
20 // It has the following parameters: //
21 // fDx; half length in X //
22 // fDy; half length in Y //
23 // fDz; half length in Z //
24 // fTranslation[3]; the coordinates of the center of the box //
25 // fDirCos[3]; the direction cosinus defining the orientation //
26 // fRefObject; A reference to an object //
27 // //
28 ////////////////////////////////////////////////////////////////////////////
29 
30 #ifndef ROOT_TObject
31 #include "TObject.h"
32 #endif
33 #ifndef ROOT_TAttLine
34 #include "TAttLine.h"
35 #endif
36 #ifndef ROOT_TAttFill
37 #include "TAttFill.h"
38 #endif
39 #ifndef ROOT_TAtt3D
40 #include "TAtt3D.h"
41 #endif
42 
43 class TH1;
44 
45 class TMarker3DBox : public TObject, public TAttLine, public TAttFill,
46  public TAtt3D {
47 protected:
48  Float_t fX; // X coordinate of center of box
49  Float_t fY; // Y coordinate of center of box
50  Float_t fZ; // Z coordinate of center of box
51  Float_t fDx; // half length in x
52  Float_t fDy; // half length in y
53  Float_t fDz; // half length in z
54 
55  Float_t fTheta; // Angle of box z axis with respect to main Z axis
56  Float_t fPhi; // Angle of box x axis with respect to main Xaxis
57  TObject *fRefObject; // Pointer to an object
58 
59  TMarker3DBox(const TMarker3DBox&);
61 
62  enum { kTemporary = BIT(23) }; // Use TObject::fBits to record if we are temporary
63 
64 public:
65  TMarker3DBox();
67  Float_t dx, Float_t dy, Float_t dz,
68  Float_t theta, Float_t phi);
69  virtual ~TMarker3DBox();
70 
71  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
72  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
73  TObject *GetRefObject() const {return fRefObject;}
74  virtual void GetDirection(Float_t &theta, Float_t &phi) const {theta = fTheta; phi = fPhi;}
75  virtual void GetPosition(Float_t &x, Float_t &y, Float_t &z) const {x=fX; y=fY, z=fZ;}
76  virtual void GetSize(Float_t &dx, Float_t &dy, Float_t &dz) const {dx=fDx; dy=fDy; dz=fDz;}
77 
78  virtual void Paint(Option_t *option);
79  static void PaintH3(TH1 *h, Option_t *option);
80  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
81  virtual void SetPoints(Double_t *buff) const;
82  virtual void SetDirection(Float_t theta, Float_t phi);
83  virtual void SetPosition(Float_t x, Float_t y, Float_t z);
84  virtual void SetSize(Float_t dx, Float_t dy, Float_t dz);
85  virtual void SetRefObject(TObject *obj=0) {fRefObject = obj;}
86 
87  ClassDef(TMarker3DBox,2) //A special 3-D marker designed for event display
88 };
89 
90 #endif
virtual void SetRefObject(TObject *obj=0)
Definition: TMarker3DBox.h:85
virtual void GetDirection(Float_t &theta, Float_t &phi) const
Definition: TMarker3DBox.h:74
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
#define BIT(n)
Definition: Rtypes.h:120
TH1 * h
Definition: legend2.C:5
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a Marker3DBox.
TObject * GetRefObject() const
Definition: TMarker3DBox.h:73
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:21
virtual ~TMarker3DBox()
Marker3DBox shape default destructor.
int Int_t
Definition: RtypesCore.h:41
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
virtual void SetDirection(Float_t theta, Float_t phi)
Set direction.
Float_t fX
Definition: TMarker3DBox.h:48
Fill Area Attributes class.
Definition: TAttFill.h:24
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
static void PaintH3(TH1 *h, Option_t *option)
Paint 3-d histogram h with marker3dboxes.
virtual void GetSize(Float_t &dx, Float_t &dy, Float_t &dz) const
Definition: TMarker3DBox.h:76
Float_t fY
Definition: TMarker3DBox.h:49
TMarker3DBox & operator=(const TMarker3DBox &)
assignment operator
Float_t fTheta
Definition: TMarker3DBox.h:55
double Double_t
Definition: RtypesCore.h:55
Double_t y[n]
Definition: legend1.C:17
Float_t fPhi
Definition: TMarker3DBox.h:56
The TH1 histogram class.
Definition: TH1.h:80
TObject * fRefObject
Definition: TMarker3DBox.h:57
virtual void Paint(Option_t *option)
Paint marker 3D box.
Mother of all ROOT objects.
Definition: TObject.h:37
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
Float_t fZ
Definition: TMarker3DBox.h:50
A special 3-D marker designed for event display.
Definition: TMarker3DBox.h:45
TMarker3DBox()
Marker3DBox default constructor.
Float_t fDx
Definition: TMarker3DBox.h:51
virtual void SetPosition(Float_t x, Float_t y, Float_t z)
Set position.
virtual void SetSize(Float_t dx, Float_t dy, Float_t dz)
Set size.
Float_t fDz
Definition: TMarker3DBox.h:53
Line Attributes class.
Definition: TAttLine.h:24
Float_t fDy
Definition: TMarker3DBox.h:52
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
virtual void GetPosition(Float_t &x, Float_t &y, Float_t &z) const
Definition: TMarker3DBox.h:75
virtual void SetPoints(Double_t *buff) const
Set points.