46 fAngle = fgDefaultAngle;
79 fAngle = fgDefaultAngle;
80 fArrowSize = arrowsize;
97 fAngle = fgDefaultAngle;
99 arrow.TArrow::Copy(*
this);
139 if (!opt || !*opt) opt =
"|>";
169 auto &parent = *
gPad;
171 Int_t iw = parent.GetWw();
172 Int_t ih = parent.GetWh();
174 parent.GetPadPar(x1p,y1p,x2p,y2p);
179 if (ix1==ix2||iy1==iy2)
return;
182 TString opt = option;
199 parent.GetRange(rx1,ry1,rx2,ry2);
200 Double_t rx = (x2ndc-x1ndc)/(rx2-rx1);
201 Double_t ry = (y2ndc-y1ndc)/(ry2-ry1);
223 xarr[0] = x1n-sinT*dSize;
224 yarr[0] = y1n+cosT*dSize;
225 xarr[1] = x1n+sinT*dSize;
226 yarr[1] = y1n-cosT*dSize;
231 xarr[
cnt] = x2n-sinT*dSize;
232 yarr[
cnt] = y2n+cosT*dSize;
233 xarr[
cnt+1] = x2n+sinT*dSize;
234 yarr[
cnt+1] = y2n-cosT*dSize;
236 opt(opt.
Length()-1) =
' ';
245 x2h = xm + cosT*rSize/2;
246 y2h = ym + sinT*rSize/2;
249 x1h = xm - cosT*rSize/2;
250 y1h = ym - sinT*rSize/2;
262 xarr[
cnt] = x1n; xarr[
cnt+1] = x2n;
263 yarr[
cnt] = y1n; yarr[
cnt+1] = y2n;
267 xarr[i] = (1/rx)*(xarr[i]-x1ndc)+rx1;
268 yarr[i] = (1/ry)*(yarr[i]-y1ndc)+ry1;
271 parent.PaintSegments(cnt/2, xarr, yarr);
277 x2ar[0] = x2h - rSize*cosT - sinT*dSize;
278 y2ar[0] = y2h - rSize*sinT + cosT*dSize;
281 x2ar[2] = x2h - rSize*cosT + sinT*dSize;
282 y2ar[2] = y2h - rSize*sinT - cosT*dSize;
287 for (
Int_t i=0; i<4; i++) {
288 x2ar[i] = (1/rx)*(x2ar[i]-x1ndc)+rx1;
289 y2ar[i] = (1/ry)*(y2ar[i]-y1ndc)+ry1;
292 parent.GetPainter()->SetLineStyle(1);
294 parent.PaintFillArea(3,x2ar,y2ar);
295 parent.PaintPolyLine(4,x2ar,y2ar);
297 parent.PaintPolyLine(4,x2ar,y2ar);
300 parent.PaintPolyLine(3,x2ar,y2ar);
306 x1ar[0] = x1h + rSize*cosT + sinT*dSize;
307 y1ar[0] = y1h + rSize*sinT - cosT*dSize;
310 x1ar[2] = x1h + rSize*cosT - sinT*dSize;
311 y1ar[2] = y1h + rSize*sinT + cosT*dSize;
316 for (
Int_t i=0; i<4; i++) {
317 x1ar[i] = (1/rx)*(x1ar[i]-x1ndc)+rx1;
318 y1ar[i] = (1/ry)*(y1ar[i]-y1ndc)+ry1;
321 parent.GetPainter()->SetLineStyle(1);
323 parent.PaintFillArea(3,x1ar,y1ar);
324 parent.PaintPolyLine(4,x1ar,y1ar);
326 parent.PaintPolyLine(4,x1ar,y1ar);
329 parent.PaintPolyLine(3,x1ar,y1ar);
344 gPad->GetY1() +
v2 * (
gPad->GetY2() -
gPad->GetY1()), arrowsize, option);
353 TString::Format(
"%g, %g, %g, %g, %g, \"%s\"",
fX1,
fY1,
fX2,
fY2,
fArrowSize,
354 TString(
GetOption()).ReplaceSpecialCppChars().Data()));
360 out <<
" arrow->SetNDC();\n";
363 out <<
" arrow->SetAngle(" <<
GetAngle() <<
");\n";
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
virtual void PaintArrow(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Float_t arrowsize=0.05, Option_t *option=">")
Option_t * GetOption() const override
Float_t fArrowSize
Arrow Size.
static Float_t fgDefaultAngle
Default Arrow opening angle (degrees).
virtual TArrow * DrawArrow(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Float_t arrowsize=0, Option_t *option="")
static Float_t fgDefaultArrowSize
Default Arrow Size.
void Paint(Option_t *option="") override
This method must be overridden if a class wants to paint itself.
static void SetDefaultAngle(Float_t Angle)
Float_t fAngle
Arrow opening angle (degrees).
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
static TString fgDefaultOption
Default Arrow shapes.
static void SetDefaultArrowSize(Float_t ArrowSize)
static void SetDefaultOption(Option_t *Option)
virtual void PaintArrowNDC(Double_t u1, Double_t v1, Double_t u2, Double_t v2, Float_t arrowsize=0.05, Option_t *option=">")
static Option_t * GetDefaultOption()
TString fOption
Arrow shapes.
void Draw(Option_t *option="") override
Default Draw method for all objects.
static Float_t GetDefaultArrowSize()
virtual void SetAngle(Float_t angle=60)
void Copy(TObject &arrow) const override
Copy this to obj.
static Float_t GetDefaultAngle()
virtual Color_t GetFillColor() const
Return the fill area color.
void Copy(TAttFill &attfill) const
virtual void ModifyOn(TVirtualPad &pad)
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
virtual void ModifyOn(TVirtualPad &pad)
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
void Copy(TAttLine &attline) const
Use the TLine constructor to create a simple line.
@ kLineNDC
Use NDC coordinates.
Double_t fY1
Y of 1st point.
Double_t fX1
X of 1st point.
void Copy(TObject &line) const override
Copy this line to line.
Double_t fX2
X of 2nd point.
Double_t fY2
Y of 2nd point.
Mother of all ROOT objects.
Bool_t TestBit(UInt_t f) const
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.
static void SavePrimitiveDraw(std::ostream &out, const char *variable_name, Option_t *option=nullptr)
Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
static void SavePrimitiveConstructor(std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
Save object constructor in the output stream "out".
@ kCanDelete
if object in a list can be deleted
void ToLower()
Change string to lower-case.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
double Angle(const Vector1 &v1, const Vector2 &v2)
Find Angle between two vectors.
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.
Double_t Tan(Double_t)
Returns the tangent of an angle of x radians.
BVH_ALWAYS_INLINE T length(const Vec< T, N > &v)