Logo ROOT   6.08/07
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 #ifndef ROOT_TAttMarker
17 #include "TAttMarker.h"
18 #endif
19 #ifndef ROOT_TNamed
20 #include "TNamed.h"
21 #endif
22 #ifndef ROOT_TAttBBox2D
23 #include "TAttBBox2D.h"
24 #endif
25 #ifndef ROOT_GuiTypes
26 #include "GuiTypes.h"
27 #endif
28 
29 class TPoint;
30 
31 class TMarker : public TObject, public TAttMarker, public TAttBBox2D {
32 
33 protected:
34  Double_t fX; ///< X position of marker (left,center,etc..)
35  Double_t fY; ///< Y position of marker (left,center,etc..)
36 
37 public:
38  // TMarker status bits
39  enum {
40  kMarkerNDC = BIT(14) ///< Marker position is in NDC
41  };
42 
43  TMarker();
44  TMarker(Double_t x, Double_t y, Int_t marker);
45  TMarker(const TMarker &marker);
46  virtual ~TMarker();
47 
48  void Copy(TObject &marker) const;
49  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
50  virtual void Draw(Option_t *option="");
51  virtual void DrawMarker(Double_t x, Double_t y);
52  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
53  Double_t GetX() const {return fX;}
54  Double_t GetY() const {return fY;}
55  virtual void ls(Option_t *option="") const;
56  virtual void Paint(Option_t *option="");
57  virtual void PaintMarker(Double_t x, Double_t y);
58  virtual void PaintMarkerNDC(Double_t u, Double_t v);
59  virtual void Print(Option_t *option="") const;
60  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
61  virtual void SetNDC(Bool_t isNDC=kTRUE);
62  virtual void SetX(Double_t x) { fX = x;} // *MENU*
63  virtual void SetY(Double_t y) { fY = y;} // *MENU*
64 
65  virtual Rectangle_t GetBBox();
66  virtual TPoint GetBBoxCenter();
67  virtual void SetBBoxCenter(const TPoint &p);
68  virtual void SetBBoxCenterX(const Int_t x);
69  virtual void SetBBoxCenterY(const Int_t y);
70  virtual void SetBBoxX1(const Int_t x);
71  virtual void SetBBoxX2(const Int_t x);
72  virtual void SetBBoxY1(const Int_t y);
73  virtual void SetBBoxY2(const Int_t y);
74 
75  static void DisplayMarkerTypes();
76 
77  ClassDef(TMarker,3) //Marker
78 };
79 
80 #endif
81 
virtual void DrawMarker(Double_t x, Double_t y)
Draw this marker with new coordinates.
Definition: TMarker.cxx:148
virtual void SetX(Double_t x)
Definition: TMarker.h:62
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:306
virtual void Print(Option_t *option="") const
Dump this marker with its attributes.
Definition: TMarker.cxx:277
virtual void SetBBoxCenter(const TPoint &p)
Set center of the BoundingBox.
Definition: TMarker.cxx:366
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:383
Double_t fX
X position of marker (left,center,etc..)
Definition: TMarker.h:34
#define BIT(n)
Definition: Rtypes.h:120
virtual void Draw(Option_t *option="")
Draw this marker with its current attributes.
Definition: TMarker.cxx:139
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:392
Manages Markers.
Definition: TMarker.h:31
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:375
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Definition: TMarker.cxx:289
Double_t GetY() const
Definition: TMarker.h:54
Marker Attributes class.
Definition: TAttMarker.h:24
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
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:261
Definition: TPoint.h:33
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TMarker.cxx:164
virtual void PaintMarkerNDC(Double_t u, Double_t v)
Draw this marker with new coordinates in NDC.
Definition: TMarker.cxx:270
virtual void Paint(Option_t *option="")
Paint this marker with its current attributes.
Definition: TMarker.cxx:247
SVector< double, 2 > v
Definition: Dict.h:5
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:402
virtual Rectangle_t GetBBox()
Return the bounding Box of the Line.
Definition: TMarker.cxx:340
virtual void SetBBoxY1(const Int_t y)
Set top of BoundingBox to a value (resize in y direction on top)
Definition: TMarker.cxx:411
virtual ~TMarker()
Marker default destructor.
Definition: TMarker.cxx:57
double Double_t
Definition: RtypesCore.h:55
void Copy(TObject &marker) const
Copy this marker to marker.
Definition: TMarker.cxx:74
Double_t y[n]
Definition: legend1.C:17
virtual void SetY(Double_t y)
Definition: TMarker.h:63
Marker position is in NDC.
Definition: TMarker.h:40
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:238
Abstract base class for elements drawn in the editor.
Definition: TAttBBox2D.h:23
virtual void SetBBoxY2(const Int_t y)
Set bottom of BoundingBox to a value (resize in y direction on bottom)
Definition: TMarker.cxx:421
Double_t fY
Y position of marker (left,center,etc..)
Definition: TMarker.h:35
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a marker.
Definition: TMarker.cxx:117
const Bool_t kTRUE
Definition: Rtypes.h:91
Double_t GetX() const
Definition: TMarker.h:53
virtual TPoint GetBBoxCenter()
Return the center of the BoundingBox as TPoint in pixels.
Definition: TMarker.cxx:355