FACT++  1.0
void TPointGui::DrawPolLine ( TVirtualPad *  pad,
Double_t  r0,
Double_t  phi0,
Double_t  r1,
Double_t  phi1 
)
private

Definition at line 436 of file TPointGui.cc.

References i, and kBlue.

Referenced by DrawSet().

437 {
438  TView *view = pad->GetView();
439 
440  if (!view)
441  {
442  cout << "No View!" << endl;
443  return;
444  }
445  /*
446  if (r0<0)
447  {
448  r0 = -r0;
449  phi0 += 180;
450  }
451  if (r1<0)
452  {
453  r1 = -r1;
454  phi1 += 180;
455  }
456 
457  phi0 = fmod(phi0+360, 360);
458  phi1 = fmod(phi1+360, 360);
459 
460  if (phi1-phi0<-180)
461  phi1+=360;
462  */
463  TLine line;
464  line.SetLineWidth(2);
465  line.SetLineColor(kBlue);
466 
467  Double_t p0 = phi0<phi1?phi0:phi1;
468  Double_t p1 = phi0<phi1?phi1:phi0;
469 
470  if (phi0>phi1)
471  {
472  Double_t d = r1;
473  r1 = r0;
474  r0 = d;
475  }
476 
477  r0 /= 90;
478  r1 /= 90;
479 
480  Double_t dr = r1-r0;
481  Double_t dp = p1-p0;
482 
483  Double_t x0[3] = { r0*cos(p0*TMath::DegToRad()), r0*sin(p0*TMath::DegToRad()), 0};
484 
485  for (double i=p0+10; i<p1+10; i+=10)
486  {
487  if (i>p1)
488  i=p1;
489 
490  Double_t r = dr/dp*(i-p0)+r0;
491  Double_t p = TMath::DegToRad()*i;
492 
493  Double_t x1[3] = { r*cos(p), r*sin(p), 0};
494 
495  Double_t y0[3], y1[3];
496 
497  view->WCtoNDC(x0, y0);
498  view->WCtoNDC(x1, y1);
499 
500  line.DrawLine(y0[0], y0[1], y1[0], y1[1]);
501 
502  x0[0] = x1[0];
503  x0[1] = x1[1];
504  }
505 }
int i
Definition: db_dim_client.c:21
Set color Blue.
Definition: WindowLog.h:20

+ Here is the caller graph for this function: