Logo ROOT   6.16/01
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
35class TH1;
36
37class TMarker3DBox : public TObject, public TAttLine, public TAttFill,
38 public TAtt3D {
39protected:
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
53
54 enum { kTemporary = BIT(23) }; // Use TObject::fBits to record if we are temporary
55
56public:
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
#define h(i)
Definition: RSha256.hxx:106
int Int_t
Definition: RtypesCore.h:41
double Double_t
Definition: RtypesCore.h:55
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:324
#define BIT(n)
Definition: Rtypes.h:82
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:19
Fill Area Attributes class.
Definition: TAttFill.h:19
Line Attributes class.
Definition: TAttLine.h:18
The TH1 histogram class.
Definition: TH1.h:56
A special 3-D marker designed for event display.
Definition: TMarker3DBox.h:38
Float_t fDy
Definition: TMarker3DBox.h:44
virtual void SetPoints(Double_t *buff) const
Set points.
Float_t fDx
Definition: TMarker3DBox.h:43
virtual void SetSize(Float_t dx, Float_t dy, Float_t dz)
Set size.
TMarker3DBox & operator=(const TMarker3DBox &)
assignment operator
Float_t fX
Definition: TMarker3DBox.h:40
static void PaintH3(TH1 *h, Option_t *option)
Paint 3-d histogram h with marker3dboxes.
Float_t fY
Definition: TMarker3DBox.h:41
virtual void GetDirection(Float_t &theta, Float_t &phi) const
Definition: TMarker3DBox.h:66
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a Marker3DBox.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
TObject * GetRefObject() const
Definition: TMarker3DBox.h:65
Float_t fZ
Definition: TMarker3DBox.h:42
Float_t fDz
Definition: TMarker3DBox.h:45
virtual void SetRefObject(TObject *obj=0)
Definition: TMarker3DBox.h:77
virtual void GetSize(Float_t &dx, Float_t &dy, Float_t &dz) const
Definition: TMarker3DBox.h:68
virtual void SetDirection(Float_t theta, Float_t phi)
Set direction.
virtual void GetPosition(Float_t &x, Float_t &y, Float_t &z) const
Definition: TMarker3DBox.h:67
virtual void SetPosition(Float_t x, Float_t y, Float_t z)
Set position.
TMarker3DBox()
Marker3DBox default constructor.
virtual void Paint(Option_t *option)
Paint marker 3D box.
Float_t fPhi
Definition: TMarker3DBox.h:48
Float_t fTheta
Definition: TMarker3DBox.h:47
virtual ~TMarker3DBox()
Marker3DBox shape default destructor.
TObject * fRefObject
Definition: TMarker3DBox.h:49
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Mother of all ROOT objects.
Definition: TObject.h:37
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17