// @(#)root/g3d:$Id$
// Author: "Valery fine"   31/10/97

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/
#ifndef ROOT_TMarker3DBox
#define ROOT_TMarker3DBox


////////////////////////////////////////////////////////////////////////////
//                                                                        //
// TMarker3DBox                                                           //
//                                                                        //
// Marker3DBox is a special 3-D marker designed for event display.        //
// It has the following parameters:                                       //
//    fDx;              half length in X                                  //
//    fDy;              half length in Y                                  //
//    fDz;              half length in Z                                  //
//    fTranslation[3];  the coordinates of the center of the box          //
//    fDirCos[3];       the direction cosinus defining the orientation    //
//    fRefObject;       A reference to an object                          //
//                                                                        //
////////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TObject
#include "TObject.h"
#endif
#ifndef ROOT_TAttLine
#include "TAttLine.h"
#endif
#ifndef ROOT_TAttFill
#include "TAttFill.h"
#endif
#ifndef ROOT_TAtt3D
#include "TAtt3D.h"
#endif

class TH1;

class TMarker3DBox : public TObject, public TAttLine, public TAttFill,
                     public TAtt3D {
protected:
   Float_t  fX;               // X coordinate of center of box
   Float_t  fY;               // Y coordinate of center of box
   Float_t  fZ;               // Z coordinate of center of box
   Float_t  fDx;              // half length in x
   Float_t  fDy;              // half length in y
   Float_t  fDz;              // half length in z

   Float_t  fTheta;           // Angle of box z axis with respect to main Z axis
   Float_t  fPhi;             // Angle of box x axis with respect to main Xaxis
   TObject *fRefObject;       // Pointer to an object

   TMarker3DBox(const TMarker3DBox&);
   TMarker3DBox& operator=(const TMarker3DBox&);

   enum { kTemporary = BIT(23) }; // Use TObject::fBits to record if we are temporary

public:
   TMarker3DBox();
   TMarker3DBox(Float_t x, Float_t y, Float_t z,
                Float_t dx, Float_t dy, Float_t dz,
                Float_t theta, Float_t phi);
   virtual        ~TMarker3DBox();

   virtual Int_t   DistancetoPrimitive(Int_t px, Int_t py);
   virtual void    ExecuteEvent(Int_t event, Int_t px, Int_t py);
   TObject        *GetRefObject() const {return fRefObject;}
   virtual void    GetDirection(Float_t &theta, Float_t &phi) const {theta = fTheta; phi = fPhi;}
   virtual void    GetPosition(Float_t &x, Float_t &y, Float_t &z) const {x=fX; y=fY, z=fZ;}
   virtual void    GetSize(Float_t &dx, Float_t &dy, Float_t &dz) const {dx=fDx; dy=fDy; dz=fDz;}

   virtual void    Paint(Option_t *option);
   static  void    PaintH3(TH1 *h, Option_t *option);
   virtual void    SavePrimitive(std::ostream &out, Option_t *option = "");
   virtual void    SetPoints(Double_t *buff) const;
   virtual void    SetDirection(Float_t theta, Float_t phi);
   virtual void    SetPosition(Float_t x, Float_t y, Float_t z);
   virtual void    SetSize(Float_t dx, Float_t dy, Float_t dz);
   virtual void    SetRefObject(TObject *obj=0) {fRefObject = obj;}

   ClassDef(TMarker3DBox,2)  //A special 3-D marker designed for event display
};

#endif
 TMarker3DBox.h:1
 TMarker3DBox.h:2
 TMarker3DBox.h:3
 TMarker3DBox.h:4
 TMarker3DBox.h:5
 TMarker3DBox.h:6
 TMarker3DBox.h:7
 TMarker3DBox.h:8
 TMarker3DBox.h:9
 TMarker3DBox.h:10
 TMarker3DBox.h:11
 TMarker3DBox.h:12
 TMarker3DBox.h:13
 TMarker3DBox.h:14
 TMarker3DBox.h:15
 TMarker3DBox.h:16
 TMarker3DBox.h:17
 TMarker3DBox.h:18
 TMarker3DBox.h:19
 TMarker3DBox.h:20
 TMarker3DBox.h:21
 TMarker3DBox.h:22
 TMarker3DBox.h:23
 TMarker3DBox.h:24
 TMarker3DBox.h:25
 TMarker3DBox.h:26
 TMarker3DBox.h:27
 TMarker3DBox.h:28
 TMarker3DBox.h:29
 TMarker3DBox.h:30
 TMarker3DBox.h:31
 TMarker3DBox.h:32
 TMarker3DBox.h:33
 TMarker3DBox.h:34
 TMarker3DBox.h:35
 TMarker3DBox.h:36
 TMarker3DBox.h:37
 TMarker3DBox.h:38
 TMarker3DBox.h:39
 TMarker3DBox.h:40
 TMarker3DBox.h:41
 TMarker3DBox.h:42
 TMarker3DBox.h:43
 TMarker3DBox.h:44
 TMarker3DBox.h:45
 TMarker3DBox.h:46
 TMarker3DBox.h:47
 TMarker3DBox.h:48
 TMarker3DBox.h:49
 TMarker3DBox.h:50
 TMarker3DBox.h:51
 TMarker3DBox.h:52
 TMarker3DBox.h:53
 TMarker3DBox.h:54
 TMarker3DBox.h:55
 TMarker3DBox.h:56
 TMarker3DBox.h:57
 TMarker3DBox.h:58
 TMarker3DBox.h:59
 TMarker3DBox.h:60
 TMarker3DBox.h:61
 TMarker3DBox.h:62
 TMarker3DBox.h:63
 TMarker3DBox.h:64
 TMarker3DBox.h:65
 TMarker3DBox.h:66
 TMarker3DBox.h:67
 TMarker3DBox.h:68
 TMarker3DBox.h:69
 TMarker3DBox.h:70
 TMarker3DBox.h:71
 TMarker3DBox.h:72
 TMarker3DBox.h:73
 TMarker3DBox.h:74
 TMarker3DBox.h:75
 TMarker3DBox.h:76
 TMarker3DBox.h:77
 TMarker3DBox.h:78
 TMarker3DBox.h:79
 TMarker3DBox.h:80
 TMarker3DBox.h:81
 TMarker3DBox.h:82
 TMarker3DBox.h:83
 TMarker3DBox.h:84
 TMarker3DBox.h:85
 TMarker3DBox.h:86
 TMarker3DBox.h:87
 TMarker3DBox.h:88
 TMarker3DBox.h:89
 TMarker3DBox.h:90