Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 "TObject.h"
17#include "TAttMarker.h"
18#include "TAttBBox2D.h"
19
20class TPoint;
21
22class TMarker : public TObject, public TAttMarker, public TAttBBox2D {
23
24protected:
25 Double_t fX; ///< X position of marker (left,center,etc..)
26 Double_t fY; ///< Y position of marker (left,center,etc..)
27
28public:
29 // TMarker status bits
30 enum {
31 kMarkerNDC = BIT(14) ///< Marker position is in NDC
32 };
33
34 TMarker();
35 TMarker(Double_t x, Double_t y, Int_t marker);
36 TMarker(const TMarker &marker);
37 ~TMarker() override;
38
39 void Copy(TObject &marker) const override;
40 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
41 void Draw(Option_t *option="") override;
43 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
44 Double_t GetX() const {return fX;}
45 Double_t GetY() const {return fY;}
46 void ls(Option_t *option="") const override;
47 void Paint(Option_t *option="") override;
48 virtual void PaintMarker(Double_t x, Double_t y);
49 virtual void PaintMarkerNDC(Double_t u, Double_t v);
50 void Print(Option_t *option="") const override;
51 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
52 virtual void SetNDC(Bool_t isNDC=kTRUE);
53 virtual void SetX(Double_t x) { fX = x;} // *MENU*
54 virtual void SetY(Double_t y) { fY = y;} // *MENU*
55
56 Rectangle_t GetBBox() override;
57 TPoint GetBBoxCenter() override;
58 void SetBBoxCenter(const TPoint &p) override;
59 void SetBBoxCenterX(const Int_t x) override;
60 void SetBBoxCenterY(const Int_t y) override;
61 void SetBBoxX1(const Int_t x) override;
62 void SetBBoxX2(const Int_t x) override;
63 void SetBBoxY1(const Int_t y) override;
64 void SetBBoxY2(const Int_t y) override;
65
66 static void DisplayMarkerTypes();
67 static void DisplayMarkerLineWidths();
68
70};
71
72#endif
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
double Double_t
Definition RtypesCore.h:59
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define BIT(n)
Definition Rtypes.h:85
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t option
Abstract base class for elements drawn in the editor.
Definition TAttBBox2D.h:19
Marker Attributes class.
Definition TAttMarker.h:19
Manages Markers.
Definition TMarker.h:22
Double_t fX
X position of marker (left,center,etc..)
Definition TMarker.h:25
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
Definition TMarker.cxx:221
void ls(Option_t *option="") const override
List this marker with its attributes.
Definition TMarker.cxx:295
virtual void SetX(Double_t x)
Definition TMarker.h:53
void SetBBoxCenterY(const Int_t y) override
Set Y coordinate of the center of the BoundingBox.
Definition TMarker.cxx:445
virtual void SetNDC(Bool_t isNDC=kTRUE)
Set NDC mode on if isNDC = kTRUE, off otherwise.
Definition TMarker.cxx:364
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
Definition TMarker.cxx:347
@ kMarkerNDC
Marker position is in NDC.
Definition TMarker.h:31
~TMarker() override
Marker default destructor.
Definition TMarker.cxx:75
TMarker()
Marker default constructor.
Definition TMarker.cxx:55
Double_t fY
Y position of marker (left,center,etc..)
Definition TMarker.h:26
TPoint GetBBoxCenter() override
Return the center of the BoundingBox as TPoint in pixels.
Definition TMarker.cxx:414
virtual void SetY(Double_t y)
Definition TMarker.h:54
void SetBBoxCenterX(const Int_t x) override
Set X coordinate of the center of the BoundingBox.
Definition TMarker.cxx:436
void SetBBoxY1(const Int_t y) override
Set top of BoundingBox to a value (resize in y direction on top)
Definition TMarker.cxx:476
void SetBBoxY2(const Int_t y) override
Set bottom of BoundingBox to a value (resize in y direction on bottom)
Definition TMarker.cxx:487
void Copy(TObject &marker) const override
Copy this marker to marker.
Definition TMarker.cxx:92
void Paint(Option_t *option="") override
Paint this marker with its current attributes.
Definition TMarker.cxx:304
virtual TMarker * DrawMarker(Double_t x, Double_t y)
Draw this marker with new coordinates.
Definition TMarker.cxx:204
virtual void PaintMarker(Double_t x, Double_t y)
Draw this marker with new coordinates.
Definition TMarker.cxx:319
Rectangle_t GetBBox() override
Return the bounding Box of the Line.
Definition TMarker.cxx:398
void SetBBoxX1(const Int_t x) override
Set left hand side of BoundingBox to a value (resize in x direction on left)
Definition TMarker.cxx:455
static void DisplayMarkerLineWidths()
Display the table of markers with different line widths and their numbers.
Definition TMarker.cxx:134
void Print(Option_t *option="") const override
Dump this marker with its attributes.
Definition TMarker.cxx:335
void SetBBoxCenter(const TPoint &p) override
Set center of the BoundingBox.
Definition TMarker.cxx:426
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a marker.
Definition TMarker.cxx:172
Double_t GetX() const
Definition TMarker.h:44
void SetBBoxX2(const Int_t x) override
Set right hand side of BoundingBox to a value (resize in x direction on right)
Definition TMarker.cxx:466
static void DisplayMarkerTypes()
Display the table of markers with their numbers.
Definition TMarker.cxx:103
virtual void PaintMarkerNDC(Double_t u, Double_t v)
Draw this marker with new coordinates in NDC.
Definition TMarker.cxx:328
Double_t GetY() const
Definition TMarker.h:45
Mother of all ROOT objects.
Definition TObject.h:41
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Rectangle structure (maps to the X11 XRectangle structure)
Definition GuiTypes.h:361
th1 Draw()