Logo ROOT  
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
TMarker3DBox::fX
Float_t fX
Definition: TMarker3DBox.h:40
TMarker3DBox::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Definition: TMarker3DBox.cxx:351
TMarker3DBox::fDz
Float_t fDz
Definition: TMarker3DBox.h:45
TMarker3DBox::DistancetoPrimitive
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a Marker3DBox.
Definition: TMarker3DBox.cxx:139
Option_t
const char Option_t
Definition: RtypesCore.h:66
TMarker3DBox::GetDirection
virtual void GetDirection(Float_t &theta, Float_t &phi) const
Definition: TMarker3DBox.h:66
TMarker3DBox::GetPosition
virtual void GetPosition(Float_t &x, Float_t &y, Float_t &z) const
Definition: TMarker3DBox.h:67
TMarker3DBox::fDx
Float_t fDx
Definition: TMarker3DBox.h:43
Float_t
float Float_t
Definition: RtypesCore.h:57
TMarker3DBox::ExecuteEvent
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TMarker3DBox.cxx:181
Int_t
int Int_t
Definition: RtypesCore.h:45
TMarker3DBox::~TMarker3DBox
virtual ~TMarker3DBox()
Marker3DBox shape default destructor.
Definition: TMarker3DBox.cxx:128
x
Double_t x[n]
Definition: legend1.C:17
TAtt3D
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:19
TMarker3DBox::PaintH3
static void PaintH3(TH1 *h, Option_t *option)
Paint 3-d histogram h with marker3dboxes.
Definition: TMarker3DBox.cxx:291
TAttLine.h
TMarker3DBox::SetPosition
virtual void SetPosition(Float_t x, Float_t y, Float_t z)
Set position.
Definition: TMarker3DBox.cxx:396
TMarker3DBox::SetRefObject
virtual void SetRefObject(TObject *obj=0)
Definition: TMarker3DBox.h:77
TMarker3DBox::operator=
TMarker3DBox & operator=(const TMarker3DBox &)
assignment operator
Definition: TMarker3DBox.cxx:105
TAttFill.h
TAttLine
Line Attributes class.
Definition: TAttLine.h:18
TAtt3D.h
TMarker3DBox::fY
Float_t fY
Definition: TMarker3DBox.h:41
h
#define h(i)
Definition: RSha256.hxx:106
TMarker3DBox::SetDirection
virtual void SetDirection(Float_t theta, Float_t phi)
Set direction.
Definition: TMarker3DBox.cxx:377
TMarker3DBox
A special 3-D marker designed for event display.
Definition: TMarker3DBox.h:38
TMarker3DBox::kTemporary
@ kTemporary
Definition: TMarker3DBox.h:54
TMarker3DBox::Paint
virtual void Paint(Option_t *option)
Paint marker 3D box.
Definition: TMarker3DBox.cxx:190
BIT
#define BIT(n)
Definition: Rtypes.h:85
y
Double_t y[n]
Definition: legend1.C:17
TMarker3DBox::fPhi
Float_t fPhi
Definition: TMarker3DBox.h:48
TMarker3DBox::fZ
Float_t fZ
Definition: TMarker3DBox.h:42
TMarker3DBox::fRefObject
TObject * fRefObject
Definition: TMarker3DBox.h:49
TMarker3DBox::fDy
Float_t fDy
Definition: TMarker3DBox.h:44
Double_t
double Double_t
Definition: RtypesCore.h:59
TObject.h
TMarker3DBox::GetSize
virtual void GetSize(Float_t &dx, Float_t &dy, Float_t &dz) const
Definition: TMarker3DBox.h:68
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TH1
TH1 is the base class of all histogram classes in ROOT.
Definition: TH1.h:58
TMarker3DBox::SetPoints
virtual void SetPoints(Double_t *buff) const
Set points.
Definition: TMarker3DBox.cxx:406
TAttFill
Fill Area Attributes class.
Definition: TAttFill.h:19
TMarker3DBox::TMarker3DBox
TMarker3DBox()
Marker3DBox default constructor.
Definition: TMarker3DBox.cxx:48
TMarker3DBox::SetSize
virtual void SetSize(Float_t dx, Float_t dy, Float_t dz)
Set size.
Definition: TMarker3DBox.cxx:386
TMarker3DBox::fTheta
Float_t fTheta
Definition: TMarker3DBox.h:47
TMarker3DBox::GetRefObject
TObject * GetRefObject() const
Definition: TMarker3DBox.h:65