61 line.TLine::Copy(*
this);
69 src.TLine::Copy(*
this);
91 if (!
gPad)
return 9999;
137 static Int_t d1,d2,px1,px2,py1,py2;
138 static Int_t pxold, pyold, px1old, py1old, px2old, py2old;
139 static Double_t oldX1, oldY1, oldX2, oldY2;
140 static Bool_t p1, p2, pL, ndcsav;
146 if (!
gPad->IsEditable())
return;
179 d1 = abs(px1 - px) + abs(py1-py);
181 px1old = px1; py1old = py1;
186 d2 = abs(px2 - px) + abs(py2-py);
188 px2old = px2; py2old = py2;
195 pxold = px; pyold = py;
205 gVirtualX->DrawLine(px1old, py1old, px2, py2);
221 gVirtualX->DrawLine(px1, py1, px2old, py2old);
236 if (!opaque)
gVirtualX->DrawLine(px1, py1, px2, py2);
237 dx = px-pxold; dy = py-pyold;
238 px1 += dx; py1 += dy; px2 += dx; py2 += dy;
239 if (!opaque)
gVirtualX->DrawLine(px1, py1, px2, py2);
255 gPad->ShowGuidelines(
this, event,
'2',
true);
257 gPad->ShowGuidelines(
this, event,
'3',
true);
260 gPad->ShowGuidelines(
this, event,
'1',
true);
262 gPad->ShowGuidelines(
this, event,
'4',
true);
269 gPad->ShowGuidelines(
this, event,
'4',
true);
271 gPad->ShowGuidelines(
this, event,
'1',
true);
274 gPad->ShowGuidelines(
this, event,
'3',
true);
276 gPad->ShowGuidelines(
this, event,
'2',
true);
280 gPad->ShowGuidelines(
this, event,
'i',
true);
289 if (
gROOT->IsEscaped()) {
309 gPad->ShowGuidelines(
this, event);
312 dpx =
gPad->GetX2() -
gPad->GetX1();
313 dpy =
gPad->GetY2() -
gPad->GetY1();
356 if (!opaque)
gVirtualX->SetLineColor(-1);
365 event =
gVirtualX->RequestLocator(1,1,px,py);
438 out<<
"line = new TLine("<<
fX1<<
","<<
fY1<<
","<<
fX2<<
","<<
fY2<<
");"<<std::endl;
443 out<<
" line->SetNDC();"<<std::endl;
445 out<<
" line->Draw();"<<std::endl;
489 else fX2 =
gPad->AbsPixeltoX(px1-
l);
510 else fY2 =
gPad->AbsPixeltoY(py1+
l);
547 if (!
gPad)
return BBox;
548 Int_t px1, py1, px2, py2;
555 if (px1>px2) { tmp = px1; px1 = px2; px2 = tmp;}
556 if (py1>py2) { tmp = py1; py1 = py2; py2 = tmp;}
560 BBox.fWidth = px2-px1;
561 BBox.fHeight = py2-py1;
572 if (!
gPad)
return (
p);
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char DrawLine
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
Option_t Option_t TPoint TPoint const char y1
Abstract base class for elements drawn in the editor.
virtual void Streamer(TBuffer &)
virtual Color_t GetLineColor() const
Return the line color.
virtual Width_t GetLineWidth() const
Return the line width.
virtual Style_t GetLineStyle() const
Return the line style.
virtual void Modify()
Change current line attributes if necessary.
void Copy(TAttLine &attline) const
Copy this line attributes to a new TAttLine.
Int_t DistancetoLine(Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
Compute distance from point px,py to a line.
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Save line attributes as C++ statement(s) on output stream out.
Buffer base class used for serializing objects.
virtual Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr)=0
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
Use the TLine constructor to create a simple line.
void ls(Option_t *option="") const override
List this line with its attributes.
virtual void SetY2(Double_t y2)
Double_t fY1
Y of 1st point.
Double_t fX1
X of 1st point.
virtual void SetX2(Double_t x2)
@ kLineNDC
Use NDC coordinates.
@ kHorizontal
Line is horizontal.
@ kVertical
Line is vertical.
Bool_t IsVertical()
Check whether this line is to be drawn vertically.
virtual TLine * DrawLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this line with new coordinates.
void SetBBoxY1(const Int_t y) override
Set top of BoundingBox to a value (resize in y direction on top)
void SetVertical(Bool_t set=kTRUE)
Force the line to be drawn vertically.
virtual void PaintLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this line with new coordinates.
void SetBBoxCenterY(const Int_t y) override
Set Y coordinate of the center of the BoundingBox.
void SetBBoxX2(const Int_t x) override
Set right hand side of BoundingBox to a value (resize in x direction on right)
virtual TLine * DrawLineNDC(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this line with new coordinates in NDC.
Bool_t IsHorizontal()
Check whether this line is to be drawn horizontally.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
void Copy(TObject &line) const override
Copy this line to line.
void Print(Option_t *option="") const override
Dump this line with its attributes.
Double_t fX2
X of 2nd point.
void SetBBoxX1(const Int_t x) override
Set left hand side of BoundingBox to a value (resize in x direction on left)
void Paint(Option_t *option="") override
Paint this line with its current attributes.
void SetBBoxY2(const Int_t y) override
Set bottom of BoundingBox to a value (resize in y direction on bottom)
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a line.
TPoint GetBBoxCenter() override
Return the center of the BoundingBox as TPoint in pixels.
virtual void SetX1(Double_t x1)
TLine & operator=(const TLine &src)
Assignment operator.
Double_t fY2
Y of 2nd point.
virtual void PaintLineNDC(Double_t u1, Double_t v1, Double_t u2, Double_t v2)
Draw this line with new coordinates in NDC.
void Streamer(TBuffer &) override
Stream an object of class TLine.
void SetBBoxCenterX(const Int_t x) override
Set X coordinate of the center of the BoundingBox.
TClass * IsA() const override
virtual void SetY1(Double_t y1)
virtual void SetNDC(Bool_t isNDC=kTRUE)
Set NDC mode on if isNDC = kTRUE, off otherwise.
void SetBBoxCenter(const TPoint &p) override
Set center of the BoundingBox.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
Rectangle_t GetBBox() override
Return the bounding Box of the Line.
void SetHorizontal(Bool_t set=kTRUE)
Force the line to be drawn horizontally.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void Streamer(TBuffer &)
Stream an object of class TObject.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Copy(TObject &object) const
Copy this to obj.
@ kCanDelete
if object in a list can be deleted
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Sqrt(Double_t x)
Returns the square root of x.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Rectangle structure (maps to the X11 XRectangle structure)