Logo ROOT   6.21/01
Reference Guide
TMarker.h
Go to the documentation of this file.
1 // @(#)root/graf:$Id$
2 // Author: Rene Brun 12/05/95
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 
12 #ifndef ROOT_TMarker
13 #define ROOT_TMarker
14 
15 
16 #include "TAttMarker.h"
17 #include "TNamed.h"
18 #include "TAttBBox2D.h"
19 #include "GuiTypes.h"
20 
21 class TPoint;
22 
23 class TMarker : public TObject, public TAttMarker, public TAttBBox2D {
24 
25 protected:
26  Double_t fX; ///< X position of marker (left,center,etc..)
27  Double_t fY; ///< Y position of marker (left,center,etc..)
28 
29 public:
30  // TMarker status bits
31  enum {
32  kMarkerNDC = BIT(14) ///< Marker position is in NDC
33  };
34 
35  TMarker();
36  TMarker(Double_t x, Double_t y, Int_t marker);
37  TMarker(const TMarker &marker);
38  virtual ~TMarker();
39 
40  void Copy(TObject &marker) const;
41  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
42  virtual void Draw(Option_t *option="");
43  virtual void DrawMarker(Double_t x, Double_t y);
44  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
45  Double_t GetX() const {return fX;}
46  Double_t GetY() const {return fY;}
47  virtual void ls(Option_t *option="") const;
48  virtual void Paint(Option_t *option="");
49  virtual void PaintMarker(Double_t x, Double_t y);
50  virtual void PaintMarkerNDC(Double_t u, Double_t v);
51  virtual void Print(Option_t *option="") const;
52  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
53  virtual void SetNDC(Bool_t isNDC=kTRUE);
54  virtual void SetX(Double_t x) { fX = x;} // *MENU*
55  virtual void SetY(Double_t y) { fY = y;} // *MENU*
56 
57  virtual Rectangle_t GetBBox();
58  virtual TPoint GetBBoxCenter();
59  virtual void SetBBoxCenter(const TPoint &p);
60  virtual void SetBBoxCenterX(const Int_t x);
61  virtual void SetBBoxCenterY(const Int_t y);
62  virtual void SetBBoxX1(const Int_t x);
63  virtual void SetBBoxX2(const Int_t x);
64  virtual void SetBBoxY1(const Int_t y);
65  virtual void SetBBoxY2(const Int_t y);
66 
67  static void DisplayMarkerTypes();
68  static void DisplayMarkerLineWidths();
69 
70  ClassDef(TMarker,3) //Marker
71 };
72 
73 #endif
74 
virtual void DrawMarker(Double_t x, Double_t y)
Draw this marker with new coordinates.
Definition: TMarker.cxx:189
virtual void SetX(Double_t x)
Definition: TMarker.h:54
TMarker()
Marker default constructor.
Definition: TMarker.cxx:37
virtual void SetNDC(Bool_t isNDC=kTRUE)
Set NDC mode on if isNDC = kTRUE, off otherwise.
Definition: TMarker.cxx:347
virtual void Print(Option_t *option="") const
Dump this marker with its attributes.
Definition: TMarker.cxx:318
virtual void SetBBoxCenter(const TPoint &p)
Set center of the BoundingBox.
Definition: TMarker.cxx:407
const char Option_t
Definition: RtypesCore.h:62
virtual void SetBBoxCenterY(const Int_t y)
Set Y coordinate of the center of the BoundingBox.
Definition: TMarker.cxx:424
Double_t fX
X position of marker (left,center,etc..)
Definition: TMarker.h:26
#define BIT(n)
Definition: Rtypes.h:83
virtual void Draw(Option_t *option="")
Draw this marker with its current attributes.
Definition: TMarker.cxx:180
virtual void SetBBoxX1(const Int_t x)
Set left hand side of BoundingBox to a value (resize in x direction on left)
Definition: TMarker.cxx:433
Manages Markers.
Definition: TMarker.h:23
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void SetBBoxCenterX(const Int_t x)
Set X coordinate of the center of the BoundingBox.
Definition: TMarker.cxx:416
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Definition: TMarker.cxx:330
Double_t GetY() const
Definition: TMarker.h:46
Marker Attributes class.
Definition: TAttMarker.h:19
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:326
static void DisplayMarkerTypes()
Display the table of markers with their numbers.
Definition: TMarker.cxx:85
virtual void PaintMarker(Double_t x, Double_t y)
Draw this marker with new coordinates.
Definition: TMarker.cxx:302
Definition: TPoint.h:31
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TMarker.cxx:205
virtual void PaintMarkerNDC(Double_t u, Double_t v)
Draw this marker with new coordinates in NDC.
Definition: TMarker.cxx:311
virtual void Paint(Option_t *option="")
Paint this marker with its current attributes.
Definition: TMarker.cxx:288
virtual void SetBBoxX2(const Int_t x)
Set right hand side of BoundingBox to a value (resize in x direction on right)
Definition: TMarker.cxx:443
virtual Rectangle_t GetBBox()
Return the bounding Box of the Line.
Definition: TMarker.cxx:381
virtual void SetBBoxY1(const Int_t y)
Set top of BoundingBox to a value (resize in y direction on top)
Definition: TMarker.cxx:452
virtual ~TMarker()
Marker default destructor.
Definition: TMarker.cxx:57
Marker position is in NDC.
Definition: TMarker.h:32
double Double_t
Definition: RtypesCore.h:55
void Copy(TObject &marker) const
Copy this marker to marker.
Definition: TMarker.cxx:74
static void DisplayMarkerLineWidths()
Display the table of markers with different line widths and their numbers.
Definition: TMarker.cxx:118
Double_t y[n]
Definition: legend1.C:17
virtual void SetY(Double_t y)
Definition: TMarker.h:55
Mother of all ROOT objects.
Definition: TObject.h:37
virtual void ls(Option_t *option="") const
List this marker with its attributes.
Definition: TMarker.cxx:279
Abstract base class for elements drawn in the editor.
Definition: TAttBBox2D.h:19
virtual void SetBBoxY2(const Int_t y)
Set bottom of BoundingBox to a value (resize in y direction on bottom)
Definition: TMarker.cxx:462
Double_t fY
Y position of marker (left,center,etc..)
Definition: TMarker.h:27
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a marker.
Definition: TMarker.cxx:158
Double_t GetX() const
Definition: TMarker.h:45
virtual TPoint GetBBoxCenter()
Return the center of the BoundingBox as TPoint in pixels.
Definition: TMarker.cxx:396
const Bool_t kTRUE
Definition: RtypesCore.h:87