123 if (option && strlen(option)) opt = option;
141 if (size <= 0) size = 0.05;
142 const char* opt = option;
144 if (!opt || !opt[0]) opt =
"|>";
159 if (option && strlen(option)) opt = option;
187 gPad->GetPadPar(x1p,y1p,x2p,y2p);
203 gPad->GetRange(rx1,ry1,rx2,ry2);
204 Double_t rx = (x2ndc-x1ndc)/(rx2-rx1);
205 Double_t ry = (y2ndc-y1ndc)/(ry2-ry1);
219 Double_t cosT = (length > 0) ? (x2n-x1n)/length : 1.;
220 Double_t sinT = (length > 0) ? (y2n-y1n)/length : 0.;
225 x1ar[0] = x1n-sinT*dSize;
226 y1ar[0] = y1n+cosT*dSize;
227 x1ar[1] = x1n+sinT*dSize;
228 y1ar[1] = y1n-cosT*dSize;
230 for (
Int_t i=0; i<2; i++) {
231 x1ar[i] = (1/rx)*(x1ar[i]-x1ndc)+rx1;
232 y1ar[i] = (1/ry)*(y1ar[i]-y1ndc)+ry1;
234 gPad->PaintLine(x1ar[0],y1ar[0],x1ar[1],y1ar[1]);
239 x2ar[0] = x2n-sinT*dSize;
240 y2ar[0] = y2n+cosT*dSize;
241 x2ar[1] = x2n+sinT*dSize;
242 y2ar[1] = y2n-cosT*dSize;
244 for (
Int_t i=0; i<2; i++) {
245 x2ar[i] = (1/rx)*(x2ar[i]-x1ndc)+rx1;
246 y2ar[i] = (1/ry)*(y2ar[i]-y1ndc)+ry1;
248 gPad->PaintLine(x2ar[0],y2ar[0],x2ar[1],y2ar[1]);
249 opt(opt.
Length()-1) =
' ';
258 x2h = xm + cosT*rSize/2;
259 y2h = ym + sinT*rSize/2;
262 x1h = xm - cosT*rSize/2;
263 y1h = ym - sinT*rSize/2;
275 x1n = (1/rx)*(x1n-x1ndc)+rx1;
276 y1n = (1/ry)*(y1n-y1ndc)+ry1;
277 x2n = (1/rx)*(x2n-x1ndc)+rx1;
278 y2n = (1/ry)*(y2n-y1ndc)+ry1;
279 gPad->PaintLine(x1n,y1n,x2n,y2n);
285 x2ar[0] = x2h - rSize*cosT - sinT*dSize;
286 y2ar[0] = y2h - rSize*sinT + cosT*dSize;
289 x2ar[2] = x2h - rSize*cosT + sinT*dSize;
290 y2ar[2] = y2h - rSize*sinT - cosT*dSize;
295 for (
Int_t i=0; i<4; i++) {
296 x2ar[i] = (1/rx)*(x2ar[i]-x1ndc)+rx1;
297 y2ar[i] = (1/ry)*(y2ar[i]-y1ndc)+ry1;
303 gPad->PaintFillArea(3,x2ar,y2ar);
304 gPad->PaintPolyLine(4,x2ar,y2ar);
306 gPad->PaintPolyLine(4,x2ar,y2ar);
309 gPad->PaintPolyLine(3,x2ar,y2ar);
315 x1ar[0] = x1h + rSize*cosT + sinT*dSize;
316 y1ar[0] = y1h + rSize*sinT - cosT*dSize;
319 x1ar[2] = x1h + rSize*cosT - sinT*dSize;
320 y1ar[2] = y1h + rSize*sinT + cosT*dSize;
325 for (
Int_t i=0; i<4; i++) {
326 x1ar[i] = (1/rx)*(x1ar[i]-x1ndc)+rx1;
327 y1ar[i] = (1/ry)*(y1ar[i]-y1ndc)+ry1;
333 gPad->PaintFillArea(3,x1ar,y1ar);
334 gPad->PaintPolyLine(4,x1ar,y1ar);
336 gPad->PaintPolyLine(4,x1ar,y1ar);
339 gPad->PaintPolyLine(3,x1ar,y1ar);
356 out<<
"arrow = new TArrow("<<
fX1<<
","<<
fY1<<
","<<
fX2<<
","<<
fY2
363 out<<
" arrow->SetNDC();"<<std::endl;
366 out <<
" arrow->SetAngle(" <<
GetAngle() <<
");" << std::endl;
368 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.
@ kLineNDC
Use NDC coordinates.
Double_t fX2
X of 2nd point.
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)