48 fAngle = fgDefaultAngle;
102 ((
TArrow&)arrow).Copy(*
this);
125 if (option && strlen(option)) opt = option;
144 if (size <= 0) size = 0.05;
145 const char* opt = option;
147 if (!opt || !opt[0]) opt =
"|>";
163 if (option && strlen(option)) opt = option;
185 Int_t ix1,iy1,ix2,iy2;
189 gPad->GetPadPar(x1p,y1p,x2p,y2p);
190 ix1 = (
Int_t)(iw*x1p);
191 iy1 = (
Int_t)(ih*y1p);
192 ix2 = (
Int_t)(iw*x2p);
193 iy2 = (
Int_t)(ih*y2p);
205 gPad->GetRange(rx1,ry1,rx2,ry2);
206 Double_t rx = (x2ndc-x1ndc)/(rx2-rx1);
207 Double_t ry = (y2ndc-y1ndc)/(ry2-ry1);
210 Double_t x1n, y1n, x2n, y2n, xm, ym;
211 x1n = rx*(
x1-rx1)+x1ndc;
212 x2n = rx*(
x2-rx1)+x1ndc;
213 y1n = ry*(y1-ry1)+y1ndc;
214 y2n = ry*(y2-ry1)+y1ndc;
225 cosT = (x2n-x1n)/length;
226 sinT = (y2n-y1n)/length;
234 x1ar[0] = x1n-sinT*dSize;
235 y1ar[0] = y1n+cosT*dSize;
236 x1ar[1] = x1n+sinT*dSize;
237 y1ar[1] = y1n-cosT*dSize;
239 for (i=0; i<2; i++) {
240 x1ar[i] = (1/rx)*(x1ar[i]-x1ndc)+rx1;
241 y1ar[i] = (1/ry)*(y1ar[i]-y1ndc)+ry1;
243 gPad->PaintLine(x1ar[0],y1ar[0],x1ar[1],y1ar[1]);
247 x2ar[0] = x2n-sinT*dSize;
248 y2ar[0] = y2n+cosT*dSize;
249 x2ar[1] = x2n+sinT*dSize;
250 y2ar[1] = y2n-cosT*dSize;
252 for (i=0; i<2; i++) {
253 x2ar[i] = (1/rx)*(x2ar[i]-x1ndc)+rx1;
254 y2ar[i] = (1/ry)*(y2ar[i]-y1ndc)+ry1;
256 gPad->PaintLine(x2ar[0],y2ar[0],x2ar[1],y2ar[1]);
257 opt(opt.
Length()-1) =
' ';
266 x2h = xm + cosT*rSize/2;
267 y2h = ym + sinT*rSize/2;
270 x1h = xm - cosT*rSize/2;
271 y1h = ym - sinT*rSize/2;
276 x2ar[0] = x2h - rSize*cosT - sinT*dSize;
277 y2ar[0] = y2h - rSize*sinT + cosT*dSize;
280 x2ar[2] = x2h - rSize*cosT + sinT*dSize;
281 y2ar[2] = y2h - rSize*sinT - cosT*dSize;
287 x1ar[0] = x1h + rSize*cosT + sinT*dSize;
288 y1ar[0] = y1h + rSize*sinT - cosT*dSize;
291 x1ar[2] = x1h + rSize*cosT - sinT*dSize;
292 y1ar[2] = y1h + rSize*sinT + cosT*dSize;
299 x2n = x2n-cosT*rSize;
300 y2n = y2n-sinT*rSize;
303 x1n = x1n+cosT*rSize;
304 y1n = y1n+sinT*rSize;
306 x1n = (1/rx)*(x1n-x1ndc)+rx1;
307 y1n = (1/ry)*(y1n-y1ndc)+ry1;
308 x2n = (1/rx)*(x2n-x1ndc)+rx1;
309 y2n = (1/ry)*(y2n-y1ndc)+ry1;
310 gPad->PaintLine(x1n,y1n,x2n,y2n);
315 for (i=0; i<4; i++) {
316 x2ar[i] = (1/rx)*(x2ar[i]-x1ndc)+rx1;
317 y2ar[i] = (1/ry)*(y2ar[i]-y1ndc)+ry1;
323 gPad->PaintFillArea(3,x2ar,y2ar);
324 gPad->PaintPolyLine(4,x2ar,y2ar);
326 gPad->PaintPolyLine(4,x2ar,y2ar);
329 gPad->PaintPolyLine(3,x2ar,y2ar);
334 for (i=0; i<4; i++) {
335 x1ar[i] = (1/rx)*(x1ar[i]-x1ndc)+rx1;
336 y1ar[i] = (1/ry)*(y1ar[i]-y1ndc)+ry1;
342 gPad->PaintFillArea(3,x1ar,y1ar);
343 gPad->PaintPolyLine(4,x1ar,y1ar);
345 gPad->PaintPolyLine(4,x1ar,y1ar);
348 gPad->PaintPolyLine(3,x1ar,y1ar);
365 out<<
"arrow = new TArrow("<<
fX1<<
","<<
fY1<<
","<<
fX2<<
","<<
fY2 372 out <<
" arrow->SetAngle(" <<
GetAngle() <<
");" << std::endl;
375 out<<
" arrow->Draw();"<<std::endl;
virtual void Paint(Option_t *option="")
Paint this arrow with its current attributes.
Double_t fX1
X of 1st point.
static Float_t GetDefaultAngle()
Get default angle.
void Copy(TObject &arrow) const
Copy this arrow to arrow.
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.
Short_t Min(Short_t a, Short_t b)
void ToLower()
Change string to lower-case.
Double_t fX2
X of 2nd point.
static void SetDefaultAngle(Float_t Angle)
Set default angle.
virtual void Modify()
Change current line attributes if necessary.
static TString fgDefaultOption
Default Arrow shapes.
static Float_t fgDefaultArrowSize
Default Arrow Size.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
if object in a list can be deleted
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
static const double x2[5]
Fill Area Attributes class.
static Float_t GetDefaultArrowSize()
Get default arrow size.
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.
virtual void Draw(Option_t *option="")
Draw this arrow with its current attributes.
virtual void Modify()
Change current fill area attributes if necessary.
static void SetDefaultOption(Option_t *Option)
Set default option.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
virtual Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
static void SetDefaultArrowSize(Float_t ArrowSize)
Set default arrow sive.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
double Angle(const Vector1 &v1, const Vector2 &v2)
Find Angle between two vectors.
Double_t fY1
Y of 1st point.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
static Float_t fgDefaultAngle
Default Arrow opening angle (degrees)
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.
TArrow()
Arrow default constructor.
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.
Float_t fAngle
Arrow opening angle (degrees)
static const double x1[5]
Option_t * GetOption() const
virtual Color_t GetFillColor() const
Return the fill area color.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Mother of all ROOT objects.
static Option_t * GetDefaultOption()
Get default option.
void Copy(TObject &line) const
Copy this line to line.
TAttFill()
AttFill default constructor.
R__EXTERN TVirtualPS * gVirtualPS
Double_t fY2
Y of 2nd point.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Double_t Sqrt(Double_t x)
TString fOption
Arrow shapes.
Float_t fArrowSize
Arrow Size.
Draw all kinds of Arrows.
virtual ~TArrow()
Arrow default destructor.
TLine()
Line default constructor.
void Copy(TAttFill &attfill) const
Copy this fill attributes to a new TAttFill.
virtual void SetAngle(Float_t angle=60)
const char * Data() const