122 if (option && strlen(option)) opt = option;
140 if (size <= 0) size = 0.05;
141 const char* opt = option;
143 if (!opt || !opt[0]) opt =
"|>";
158 if (option && strlen(option)) opt = option;
186 gPad->GetPadPar(x1p,y1p,x2p,y2p);
202 gPad->GetRange(rx1,ry1,rx2,ry2);
203 Double_t rx = (x2ndc-x1ndc)/(rx2-rx1);
204 Double_t ry = (y2ndc-y1ndc)/(ry2-ry1);
218 Double_t cosT = (length > 0) ? (x2n-x1n)/length : 1.;
219 Double_t sinT = (length > 0) ? (y2n-y1n)/length : 0.;
224 x1ar[0] = x1n-sinT*dSize;
225 y1ar[0] = y1n+cosT*dSize;
226 x1ar[1] = x1n+sinT*dSize;
227 y1ar[1] = y1n-cosT*dSize;
229 for (
Int_t i=0; i<2; i++) {
230 x1ar[i] = (1/rx)*(x1ar[i]-x1ndc)+rx1;
231 y1ar[i] = (1/ry)*(y1ar[i]-y1ndc)+ry1;
233 gPad->PaintLine(x1ar[0],y1ar[0],x1ar[1],y1ar[1]);
238 x2ar[0] = x2n-sinT*dSize;
239 y2ar[0] = y2n+cosT*dSize;
240 x2ar[1] = x2n+sinT*dSize;
241 y2ar[1] = y2n-cosT*dSize;
243 for (
Int_t i=0; i<2; i++) {
244 x2ar[i] = (1/rx)*(x2ar[i]-x1ndc)+rx1;
245 y2ar[i] = (1/ry)*(y2ar[i]-y1ndc)+ry1;
247 gPad->PaintLine(x2ar[0],y2ar[0],x2ar[1],y2ar[1]);
248 opt(opt.
Length()-1) =
' ';
257 x2h = xm + cosT*rSize/2;
258 y2h = ym + sinT*rSize/2;
261 x1h = xm - cosT*rSize/2;
262 y1h = ym - sinT*rSize/2;
274 x1n = (1/rx)*(x1n-x1ndc)+rx1;
275 y1n = (1/ry)*(y1n-y1ndc)+ry1;
276 x2n = (1/rx)*(x2n-x1ndc)+rx1;
277 y2n = (1/ry)*(y2n-y1ndc)+ry1;
278 gPad->PaintLine(x1n,y1n,x2n,y2n);
284 x2ar[0] = x2h - rSize*cosT - sinT*dSize;
285 y2ar[0] = y2h - rSize*sinT + cosT*dSize;
288 x2ar[2] = x2h - rSize*cosT + sinT*dSize;
289 y2ar[2] = y2h - rSize*sinT - cosT*dSize;
294 for (
Int_t i=0; i<4; i++) {
295 x2ar[i] = (1/rx)*(x2ar[i]-x1ndc)+rx1;
296 y2ar[i] = (1/ry)*(y2ar[i]-y1ndc)+ry1;
302 gPad->PaintFillArea(3,x2ar,y2ar);
303 gPad->PaintPolyLine(4,x2ar,y2ar);
305 gPad->PaintPolyLine(4,x2ar,y2ar);
308 gPad->PaintPolyLine(3,x2ar,y2ar);
314 x1ar[0] = x1h + rSize*cosT + sinT*dSize;
315 y1ar[0] = y1h + rSize*sinT - cosT*dSize;
318 x1ar[2] = x1h + rSize*cosT - sinT*dSize;
319 y1ar[2] = y1h + rSize*sinT + cosT*dSize;
324 for (
Int_t i=0; i<4; i++) {
325 x1ar[i] = (1/rx)*(x1ar[i]-x1ndc)+rx1;
326 y1ar[i] = (1/ry)*(y1ar[i]-y1ndc)+ry1;
332 gPad->PaintFillArea(3,x1ar,y1ar);
333 gPad->PaintPolyLine(4,x1ar,y1ar);
335 gPad->PaintPolyLine(4,x1ar,y1ar);
338 gPad->PaintPolyLine(3,x1ar,y1ar);
355 out<<
"arrow = new TArrow("<<
fX1<<
","<<
fY1<<
","<<
fX2<<
","<<
fY2
362 out<<
" arrow->SetNDC();"<<std::endl;
365 out <<
" arrow->SetAngle(" <<
GetAngle() <<
");" << std::endl;
367 out<<
" arrow->Draw();"<<std::endl;
static const double x2[5]
static const double x1[5]
R__EXTERN TVirtualPS * gVirtualPS
Draw all kinds of Arrows.
static Float_t GetDefaultAngle()
Get default angle.
Float_t fArrowSize
Arrow Size.
static void SetDefaultOption(Option_t *Option)
Set default option.
static void SetDefaultArrowSize(Float_t ArrowSize)
Set default arrow sive.
static void SetDefaultAngle(Float_t Angle)
Set default angle.
static Float_t fgDefaultAngle
Default Arrow opening angle (degrees)
virtual void DrawArrow(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Float_t arrowsize=0, Option_t *option="")
Draw this arrow with new coordinates.
static Option_t * GetDefaultOption()
Get default option.
virtual void Draw(Option_t *option="")
Draw this arrow with its current attributes.
void Copy(TObject &arrow) const
Copy this arrow to arrow.
static Float_t fgDefaultArrowSize
Default Arrow Size.
TArrow()
Arrow default constructor.
virtual ~TArrow()
Arrow default destructor.
Float_t fAngle
Arrow opening angle (degrees)
Option_t * GetOption() const
static TString fgDefaultOption
Default Arrow shapes.
virtual void Paint(Option_t *option="")
Paint this arrow with its current attributes.
TString fOption
Arrow shapes.
virtual void PaintArrow(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Float_t arrowsize=0.05, Option_t *option=">")
Draw this arrow.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
virtual void SetAngle(Float_t angle=60)
static Float_t GetDefaultArrowSize()
Get default arrow size.
Fill Area Attributes class.
virtual Color_t GetFillColor() const
Return the fill area color.
void Copy(TAttFill &attfill) const
Copy this fill attributes to a new TAttFill.
virtual void Modify()
Change current fill area attributes if necessary.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
Save fill attributes as C++ statement(s) on output stream out.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineStyle(Style_t lstyle)
Set 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.
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.
Double_t fY1
Y of 1st point.
Double_t fX1
X of 1st point.
Double_t fX2
X of 2nd point.
@ kLineNDC
Use NDC coordinates.
Double_t fY2
Y of 2nd point.
void Copy(TObject &line) const
Copy this line to line.
Mother of all ROOT objects.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
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.
@ 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.
const char * Data() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
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)
Short_t Min(Short_t a, Short_t b)