Logo ROOT   6.12/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 #include "TObject.h"
31 #include "TAttLine.h"
32 #include "TAttFill.h"
33 #include "TAtt3D.h"
34 
35 class TH1;
36 
37 class TMarker3DBox : public TObject, public TAttLine, public TAttFill,
38  public TAtt3D {
39 protected:
40  Float_t fX; // X coordinate of center of box
41  Float_t fY; // Y coordinate of center of box
42  Float_t fZ; // Z coordinate of center of box
43  Float_t fDx; // half length in x
44  Float_t fDy; // half length in y
45  Float_t fDz; // half length in z
46 
47  Float_t fTheta; // Angle of box z axis with respect to main Z axis
48  Float_t fPhi; // Angle of box x axis with respect to main Xaxis
49  TObject *fRefObject; // Pointer to an object
50 
51  TMarker3DBox(const TMarker3DBox&);
53 
54  enum { kTemporary = BIT(23) }; // Use TObject::fBits to record if we are temporary
55 
56 public:
57  TMarker3DBox();
59  Float_t dx, Float_t dy, Float_t dz,
60  Float_t theta, Float_t phi);
61  virtual ~TMarker3DBox();
62 
63  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
64  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
65  TObject *GetRefObject() const {return fRefObject;}
66  virtual void GetDirection(Float_t &theta, Float_t &phi) const {theta = fTheta; phi = fPhi;}
67  virtual void GetPosition(Float_t &x, Float_t &y, Float_t &z) const {x=fX; y=fY, z=fZ;}
68  virtual void GetSize(Float_t &dx, Float_t &dy, Float_t &dz) const {dx=fDx; dy=fDy; dz=fDz;}
69 
70  virtual void Paint(Option_t *option);
71  static void PaintH3(TH1 *h, Option_t *option);
72  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
73  virtual void SetPoints(Double_t *buff) const;
74  virtual void SetDirection(Float_t theta, Float_t phi);
75  virtual void SetPosition(Float_t x, Float_t y, Float_t z);
76  virtual void SetSize(Float_t dx, Float_t dy, Float_t dz);
77  virtual void SetRefObject(TObject *obj=0) {fRefObject = obj;}
78 
79  ClassDef(TMarker3DBox,2) //A special 3-D marker designed for event display
80 };
81 
82 #endif
virtual void SetRefObject(TObject *obj=0)
Definition: TMarker3DBox.h:77
virtual void GetDirection(Float_t &theta, Float_t &phi) const
Definition: TMarker3DBox.h:66
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
#define BIT(n)
Definition: Rtypes.h:78
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:65
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:19
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:40
Fill Area Attributes class.
Definition: TAttFill.h:19
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:320
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:68
Float_t fY
Definition: TMarker3DBox.h:41
TMarker3DBox & operator=(const TMarker3DBox &)
assignment operator
Float_t fTheta
Definition: TMarker3DBox.h:47
double Double_t
Definition: RtypesCore.h:55
Double_t y[n]
Definition: legend1.C:17
Float_t fPhi
Definition: TMarker3DBox.h:48
The TH1 histogram class.
Definition: TH1.h:56
TObject * fRefObject
Definition: TMarker3DBox.h:49
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:42
A special 3-D marker designed for event display.
Definition: TMarker3DBox.h:37
TMarker3DBox()
Marker3DBox default constructor.
Float_t fDx
Definition: TMarker3DBox.h:43
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:45
Line Attributes class.
Definition: TAttLine.h:18
Float_t fDy
Definition: TMarker3DBox.h:44
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:67
virtual void SetPoints(Double_t *buff) const
Set points.