From 277da4e256d08e560c020cc94ae75f398aa71453 Mon Sep 17 00:00:00 2001 From: Olivier Couet <Olivier.Couet@cern.ch> Date: Tue, 15 Nov 2005 14:04:51 +0000 Subject: [PATCH] - Mods to make the rules checker happy git-svn-id: http://root.cern.ch/svn/root/trunk@13243 27541ba8-7e3a-0410-8455-c3a389f83636 --- graf/inc/TAttImage.h | 6 +- graf/inc/TBox.h | 4 +- graf/inc/TCrown.h | 30 ++++---- graf/inc/TEllipse.h | 86 +++++++++++----------- graf/inc/TFrame.h | 26 +++---- graf/src/TBox.cxx | 121 +++++++++++++++---------------- graf/src/TCrown.cxx | 102 +++++++++++++------------- graf/src/TCurlyArc.cxx | 139 ++++++++++++++++++++++------------- graf/src/TCurlyLine.cxx | 155 +++++++++++++++++++++++++++------------- graf/src/TCutG.cxx | 53 ++++++++------ graf/src/TDiamond.cxx | 139 +++++++++++++++++------------------ graf/src/TEllipse.cxx | 140 ++++++++++++++++++------------------ graf/src/TFrame.cxx | 32 ++++----- 13 files changed, 562 insertions(+), 471 deletions(-) diff --git a/graf/inc/TAttImage.h b/graf/inc/TAttImage.h index 0cb1b9cdbe0..3efe87120b7 100644 --- a/graf/inc/TAttImage.h +++ b/graf/inc/TAttImage.h @@ -1,4 +1,4 @@ -// @(#)root/graf:$Name: $:$Id: TAttImage.h,v 1.6 2005/04/07 14:43:35 rdm Exp $ +// @(#)root/graf:$Name: $:$Id: TAttImage.h,v 1.7 2005/06/21 17:09:26 brun Exp $ // Author: Reiner Rohlfs 24/03/02 /************************************************************************* @@ -143,9 +143,9 @@ public: virtual void SetConstRatio(Bool_t constRatio = kTRUE); // *TOGGLE* virtual void SetPaletteEnabled(Bool_t on = kTRUE) { fPaletteEnabled = on; } virtual void SetImageCompression(UInt_t lcompression) - { fImageCompression = (lcompression > 100) ? 100 : lcompression; } // *MENU* + { fImageCompression = (lcompression > 100) ? 100 : lcompression; } // *MENU* virtual void SetImageQuality(EImageQuality lquality) - { fImageQuality = lquality;} // *SUBMENU* + { fImageQuality = lquality;} // *SUBMENU* virtual void SetPalette(const TImagePalette *palette); virtual void StartPaletteEditor(); // *MENU* virtual void EditorClosed() { fPaletteEditor = 0; } diff --git a/graf/inc/TBox.h b/graf/inc/TBox.h index e3062d8dbb1..19a66d102e5 100644 --- a/graf/inc/TBox.h +++ b/graf/inc/TBox.h @@ -1,4 +1,4 @@ -// @(#)root/graf:$Name: $:$Id: TBox.h,v 1.4 2002/10/31 07:27:34 brun Exp $ +// @(#)root/graf:$Name: $:$Id: TBox.h,v 1.5 2003/07/15 12:50:26 brun Exp $ // Author: Rene Brun 12/12/94 /************************************************************************* @@ -52,7 +52,7 @@ public: TBox(Double_t x1, Double_t y1,Double_t x2, Double_t y2); TBox(const TBox &box); virtual ~TBox(); - void Copy(TObject &box) const; + void Copy(TObject &box) const; virtual Int_t DistancetoPrimitive(Int_t px, Int_t py); virtual void Draw(Option_t *option=""); virtual void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2); diff --git a/graf/inc/TCrown.h b/graf/inc/TCrown.h index d71214976b2..6ad6102a0ce 100644 --- a/graf/inc/TCrown.h +++ b/graf/inc/TCrown.h @@ -1,4 +1,4 @@ -// @(#)root/graf:$Name: $:$Id: TCrown.h,v 1.1 2002/08/09 20:47:16 brun Exp $ +// @(#)root/graf:$Name: $:$Id: TCrown.h,v 1.2 2002/10/31 07:27:34 brun Exp $ // Author: Rene Brun 08/08/2002 /************************************************************************* @@ -30,20 +30,20 @@ class TCrown : public TEllipse { public: - TCrown(); - TCrown(Double_t x1, Double_t y1,Double_t radin, Double_t radout - , Double_t phimin=0,Double_t phimax=360); - TCrown(const TCrown &crown); - virtual ~TCrown(); - void Copy(TObject &crown) const; - virtual Int_t DistancetoPrimitive(Int_t px, Int_t py); - virtual void DrawCrown(Double_t x1, Double_t y1, Double_t radin, Double_t radout - ,Double_t phimin=0, Double_t phimax=360, Option_t *option=""); - virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py); - virtual void Paint(Option_t *option=""); - virtual void SavePrimitive(ofstream &out, Option_t *option); - - ClassDef(TCrown,1) //A crown or segment of crown + TCrown(); + TCrown(Double_t x1, Double_t y1,Double_t radin, Double_t radout, + Double_t phimin=0,Double_t phimax=360); + TCrown(const TCrown &crown); + virtual ~TCrown(); + void Copy(TObject &crown) const; + virtual Int_t DistancetoPrimitive(Int_t px, Int_t py); + virtual void DrawCrown(Double_t x1, Double_t y1, Double_t radin, Double_t radout, + Double_t phimin=0, Double_t phimax=360, Option_t *option=""); + virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py); + virtual void Paint(Option_t *option=""); + virtual void SavePrimitive(ofstream &out, Option_t *option); + + ClassDef(TCrown,1) //A crown or segment of crown }; #endif diff --git a/graf/inc/TEllipse.h b/graf/inc/TEllipse.h index ab1c8a1dde3..80531e0ea3c 100644 --- a/graf/inc/TEllipse.h +++ b/graf/inc/TEllipse.h @@ -1,4 +1,4 @@ -// @(#)root/graf:$Name: $:$Id: TEllipse.h,v 1.6 2003/09/18 15:53:52 brun Exp $ +// @(#)root/graf:$Name: $:$Id: TEllipse.h,v 1.7 2004/03/22 15:56:27 rdm Exp $ // Author: Rene Brun 16/10/95 /************************************************************************* @@ -35,51 +35,51 @@ class TEllipse : public TObject, public TAttLine, public TAttFill { protected: - Double_t fX1; //X coordinate of centre - Double_t fY1; //Y coordinate of centre - Double_t fR1; //first radius - Double_t fR2; //second radius - Double_t fPhimin; //Minimum angle (degrees) - Double_t fPhimax; //Maximum angle (degrees) - Double_t fTheta; //Rotation angle (degrees) + Double_t fX1; //X coordinate of centre + Double_t fY1; //Y coordinate of centre + Double_t fR1; //first radius + Double_t fR2; //second radius + Double_t fPhimin; //Minimum angle (degrees) + Double_t fPhimax; //Maximum angle (degrees) + Double_t fTheta; //Rotation angle (degrees) public: - // TEllipse status bits - enum { - kNoEdges = BIT(9) // don't draw lines connecting center to edges - }; - TEllipse(); - TEllipse(Double_t x1, Double_t y1,Double_t r1,Double_t r2=0,Double_t phimin=0, Double_t phimax=360,Double_t theta=0); - TEllipse(const TEllipse &ellipse); - virtual ~TEllipse(); - void Copy(TObject &ellipse) const; - virtual Int_t DistancetoPrimitive(Int_t px, Int_t py); - virtual void Draw(Option_t *option=""); - virtual void DrawEllipse(Double_t x1, Double_t y1, Double_t r1,Double_t r2,Double_t phimin, Double_t phimax,Double_t theta,Option_t *option=""); - virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py); - Double_t GetX1() const {return fX1;} - Double_t GetY1() const {return fY1;} - Double_t GetR1() const {return fR1;} - Double_t GetR2() const {return fR2;} - Double_t GetPhimin() const {return fPhimin;} - Double_t GetPhimax() const {return fPhimax;} - Double_t GetTheta() const {return fTheta;} - Bool_t GetNoEdges() const; - virtual void ls(Option_t *option="") const; - virtual void Paint(Option_t *option=""); - virtual void PaintEllipse(Double_t x1, Double_t y1, Double_t r1,Double_t r2,Double_t phimin, Double_t phimax,Double_t theta,Option_t *option=""); - virtual void Print(Option_t *option="") const; - virtual void SavePrimitive(ofstream &out, Option_t *option); - virtual void SetNoEdges(Bool_t noEdges=kTRUE); // *TOGGLE* *GETTER=GetNoEdges - virtual void SetPhimin(Double_t phi=0) {fPhimin=phi;} // *MENU* - virtual void SetPhimax(Double_t phi=360) {fPhimax=phi;} // *MENU* - virtual void SetR1(Double_t r1) {fR1=r1;} // *MENU* - virtual void SetR2(Double_t r2) {fR2=r2;} // *MENU* - virtual void SetTheta(Double_t theta=0) {fTheta=theta;} // *MENU* - virtual void SetX1(Double_t x1) {fX1=x1;} // *MENU* - virtual void SetY1(Double_t y1) {fY1=y1;} // *MENU* + // TEllipse status bits + enum { + kNoEdges = BIT(9) // don't draw lines connecting center to edges + }; + TEllipse(); + TEllipse(Double_t x1, Double_t y1,Double_t r1,Double_t r2=0,Double_t phimin=0, Double_t phimax=360,Double_t theta=0); + TEllipse(const TEllipse &ellipse); + virtual ~TEllipse(); + void Copy(TObject &ellipse) const; + virtual Int_t DistancetoPrimitive(Int_t px, Int_t py); + virtual void Draw(Option_t *option=""); + virtual void DrawEllipse(Double_t x1, Double_t y1, Double_t r1,Double_t r2,Double_t phimin, Double_t phimax,Double_t theta,Option_t *option=""); + virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py); + Double_t GetX1() const {return fX1;} + Double_t GetY1() const {return fY1;} + Double_t GetR1() const {return fR1;} + Double_t GetR2() const {return fR2;} + Double_t GetPhimin() const {return fPhimin;} + Double_t GetPhimax() const {return fPhimax;} + Double_t GetTheta() const {return fTheta;} + Bool_t GetNoEdges() const; + virtual void ls(Option_t *option="") const; + virtual void Paint(Option_t *option=""); + virtual void PaintEllipse(Double_t x1, Double_t y1, Double_t r1,Double_t r2,Double_t phimin, Double_t phimax,Double_t theta,Option_t *option=""); + virtual void Print(Option_t *option="") const; + virtual void SavePrimitive(ofstream &out, Option_t *option); + virtual void SetNoEdges(Bool_t noEdges=kTRUE); // *TOGGLE* *GETTER=GetNoEdges + virtual void SetPhimin(Double_t phi=0) {fPhimin=phi;} // *MENU* + virtual void SetPhimax(Double_t phi=360) {fPhimax=phi;} // *MENU* + virtual void SetR1(Double_t r1) {fR1=r1;} // *MENU* + virtual void SetR2(Double_t r2) {fR2=r2;} // *MENU* + virtual void SetTheta(Double_t theta=0) {fTheta=theta;} // *MENU* + virtual void SetX1(Double_t x1) {fX1=x1;} // *MENU* + virtual void SetY1(Double_t y1) {fY1=y1;} // *MENU* - ClassDef(TEllipse,2) //An ellipse + ClassDef(TEllipse,2) //An ellipse }; #endif diff --git a/graf/inc/TFrame.h b/graf/inc/TFrame.h index 99a9f34b848..1ecb3e9cac3 100644 --- a/graf/inc/TFrame.h +++ b/graf/inc/TFrame.h @@ -1,4 +1,4 @@ -// @(#)root/graf:$Name: $:$Id: TFrame.h,v 1.2 2000/06/13 10:56:12 brun Exp $ +// @(#)root/graf:$Name: $:$Id: TFrame.h,v 1.3 2002/10/31 07:27:34 brun Exp $ // Author: Rene Brun 31/10/96 /************************************************************************* @@ -30,18 +30,18 @@ class TFrame : public TWbox { public: - TFrame(); - TFrame(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2); - TFrame(const TFrame &frame); - virtual ~TFrame(); - void Copy(TObject &frame) const; - virtual void Draw(Option_t *option=""); - virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py); - virtual void Paint(Option_t *option=""); - virtual void Pop(); - virtual void SavePrimitive(ofstream &out, Option_t *option); - - ClassDef(TFrame,1) //Pad graphics frame + TFrame(); + TFrame(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2); + TFrame(const TFrame &frame); + virtual ~TFrame(); + void Copy(TObject &frame) const; + virtual void Draw(Option_t *option=""); + virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py); + virtual void Paint(Option_t *option=""); + virtual void Pop(); + virtual void SavePrimitive(ofstream &out, Option_t *option); + + ClassDef(TFrame,1) //Pad graphics frame }; #endif diff --git a/graf/src/TBox.cxx b/graf/src/TBox.cxx index a47e0bd73f7..2762bb5f49b 100644 --- a/graf/src/TBox.cxx +++ b/graf/src/TBox.cxx @@ -1,4 +1,4 @@ -// @(#)root/graf:$Name: $:$Id: TBox.cxx,v 1.17 2004/12/22 22:20:55 brun Exp $ +// @(#)root/graf:$Name: $:$Id: TBox.cxx,v 1.18 2005/08/29 14:43:30 brun Exp $ // Author: Rene Brun 12/12/94 /************************************************************************* @@ -41,8 +41,7 @@ ClassImp(TBox) //______________________________________________________________________________ TBox::TBox(): TObject(), TAttLine(), TAttFill() { -//*-*-*-*-*-*-*-*-*-*-*Box default constructor-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -//*-* ======================= + // Box default constructor. fTip = 0; } @@ -51,8 +50,8 @@ TBox::TBox(): TObject(), TAttLine(), TAttFill() TBox::TBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2) : TObject(), TAttLine(), TAttFill() { -//*-*-*-*-*-*-*-*-*-*-*Box standard constructor-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -//*-* ======================== + // Box standard constructor. + if (x2 >= x1) {fX1 =x1; fX2 = x2;} else {fX1 = x2; fX2 = x1;} if (y2 >= y1) {fY1 =y1; fY2 = y2;} @@ -64,8 +63,7 @@ TBox::TBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2) //______________________________________________________________________________ TBox::~TBox() { -//*-*-*-*-*-*-*-*-*-*-*Box destructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -//*-* ============== + // Box destructor. if (gPad) { gPad->CloseToolTip(fTip); @@ -76,14 +74,15 @@ TBox::~TBox() //______________________________________________________________________________ TBox::TBox(const TBox &box) : TObject(box), TAttLine(box), TAttFill(box) { + // Box copy constructor. + ((TBox&)box).TBox::Copy(*this); } //______________________________________________________________________________ void TBox::Copy(TObject &obj) const { -//*-*-*-*-*-*-*-*-*-*-*Copy a Box*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -//*-* ========== + // Copy a Box. TObject::Copy(obj); TAttLine::Copy(((TBox&)obj)); @@ -99,12 +98,11 @@ void TBox::Copy(TObject &obj) const //______________________________________________________________________________ Int_t TBox::DistancetoPrimitive(Int_t px, Int_t py) { -//*-*-*-*-*-*-*-*-*-*-*Compute distance from point px,py to a box*-*-*-*-*-* -//*-* ========================================== -// Compute the closest distance of approach from point px,py to the -// edges of this box. -// The distance is computed in pixels units. -// + // Compute distance from point px,py to a box. + // + // Compute the closest distance of approach from point px,py to the + // edges of this box. + // The distance is computed in pixels units. Int_t pxl, pyl, pxt, pyt; Int_t px1 = gPad->XtoAbsPixel(fX1); @@ -116,15 +114,13 @@ Int_t TBox::DistancetoPrimitive(Int_t px, Int_t py) if (py1 < py2) {pyl = py1; pyt = py2;} else {pyl = py2; pyt = py1;} -//*-*- Are we inside the box? -//*-* ====================== + // Are we inside the box? if (GetFillStyle()) { if ( (px >= pxl && px <= pxt) && (py >= pyl && py <= pyt) ) return 0; else return 9999; } -//*-*- Are we on the edges? -//*-* ==================== + // Are we on the edges? Int_t dxl = TMath::Abs(px - pxl); if (py < pyl) dxl += pyl - py; if (py > pyt) dxl += py - pyt; Int_t dxt = TMath::Abs(px - pxt); @@ -145,8 +141,7 @@ Int_t TBox::DistancetoPrimitive(Int_t px, Int_t py) //______________________________________________________________________________ void TBox::Draw(Option_t *option) { -//*-*-*-*-*-*-*-*-*-*-*Draw this box with its current attributes*-*-*-*-*-*-* -//*-* ========================================= + // Draw this box with its current attributes. AppendPad(option); @@ -155,8 +150,8 @@ void TBox::Draw(Option_t *option) //______________________________________________________________________________ void TBox::DrawBox(Double_t x1, Double_t y1,Double_t x2, Double_t y2) { -//*-*-*-*-*-*-*-*-*-*-*Draw this box with new coordinates*-*-*-*-*-*-*-*-*-* -//*-* ================================== + // Draw this box with new coordinates. + TBox *newbox = new TBox(x1,y1,x2,y2); TAttLine::Copy(*newbox); TAttFill::Copy(*newbox); @@ -167,34 +162,34 @@ void TBox::DrawBox(Double_t x1, Double_t y1,Double_t x2, Double_t y2) //______________________________________________________________________________ void TBox::ExecuteEvent(Int_t event, Int_t px, Int_t py) { -//*-*-*-*-*-*-*-*-*-*-*Execute action corresponding to one event*-*-*-* -//*-* ========================================= -// This member function is called when a BOX/WBOX/pAD object is clicked. -// -// If the mouse is clicked in one of the 4 corners of the box (pA,pB,pC,pD) -// the box is resized with the rubber rectangle. -// -// If the mouse is clicked inside the box, the box is moved. -// -// If the mouse is clicked on the 4 edges (pL,pR,pTop,pBot), the box is rscaled -// parallel to this edge (same as Motif window manager). -// -// pA pTop pB -// +--------------------------------------------+ -// | | -// | | -// | | -// pL| pINSIDE |pR -// | | -// | | -// | | -// | | -// +--------------------------------------------+ -// pD pBot pC -// -// Note that this function is duplicated on purpose by TPad::ExecuteEvent. -// If somebody modifies this function, may be similar changes should also -// be applied to TPad::ExecuteEvent. + // Execute action corresponding to one event. + // + // This member function is called when a BOX/WBOX/PAD object is clicked. + // + // If the mouse is clicked in one of the 4 corners of the box (pA,pB,pC,pD) + // the box is resized with the rubber rectangle. + // + // If the mouse is clicked inside the box, the box is moved. + // + // If the mouse is clicked on the 4 edges (pL,pR,pTop,pBot), the box is + // rescaled parallel to this edge (same as Motif window manager). + // + // pA pTop pB + // +--------------------------------------------+ + // | | + // | | + // | | + // pL| pINSIDE |pR + // | | + // | | + // | | + // | | + // +--------------------------------------------+ + // pD pBot pC + // + // Note that this function is duplicated on purpose by TPad::ExecuteEvent. + // If somebody modifies this function, may be similar changes should also + // be applied to TPad::ExecuteEvent. if (!gPad) return; if (!gPad->IsEditable() && event != kMouseEnter) return; @@ -325,8 +320,8 @@ again: if ((py > pyl+kMaxDiff && py < pyt-kMaxDiff) && TMath::Abs(px - pxt) < kMaxDiff) { // right edge - pxold = pxt; pyold = pyt; pR = kTRUE; - gPad->SetCursor(kRightSide); + pxold = pxt; pyold = pyt; pR = kTRUE; + gPad->SetCursor(kRightSide); } if ((px > pxl+kMaxDiff && px < pxt-kMaxDiff) && @@ -521,8 +516,8 @@ void TBox::HideToolTip(Int_t event) //______________________________________________________________________________ void TBox::ls(Option_t *) const { -//*-*-*-*-*-*-*-*-*-*-*-*List this box with its attributes*-*-*-*-*-*-*-*-* -//*-* ================================= + // List this box with its attributes. + TROOT::IndentLevel(); printf("%s X1= %f Y1=%f X2=%f Y2=%f\n",IsA()->GetName(),fX1,fY1,fX2,fY2); } @@ -530,16 +525,15 @@ void TBox::ls(Option_t *) const //______________________________________________________________________________ void TBox::Paint(Option_t *) { -//*-*-*-*-*-*-*-*-*-*-*Paint this box with its current attributes*-*-*-*-*-*-* -//*-* ========================================== + // Paint this box with its current attributes. + PaintBox(gPad->XtoPad(fX1),gPad->YtoPad(fY1),gPad->XtoPad(fX2),gPad->YtoPad(fY2)); } //______________________________________________________________________________ void TBox::PaintBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t *) { -//*-*-*-*-*-*-*-*-*-*-*Draw this box with new coordinates*-*-*-*-*-*-*-*-*-* -//*-* ================================== + // Draw this box with new coordinates. TAttLine::Modify(); //Change line attributes only if necessary TAttFill::Modify(); //Change fill area attributes only if necessary @@ -550,8 +544,7 @@ void TBox::PaintBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t //______________________________________________________________________________ void TBox::Print(Option_t *) const { -//*-*-*-*-*-*-*-*-*-*-*Dump this box with its attributes*-*-*-*-*-*-*-*-*-* -//*-* ================================= + // Dump this box with its attributes. printf("%s X1=%f Y1=%f X2=%f Y2=%f",IsA()->GetName(),fX1,fY1,fX2,fY2); if (GetLineColor() != 1) printf(" Color=%d",GetLineColor()); @@ -566,12 +559,12 @@ void TBox::Print(Option_t *) const //______________________________________________________________________________ void TBox::SavePrimitive(ofstream &out, Option_t *) { - // Save primitive as a C++ statement(s) on output stream out + // Save primitive as a C++ statement(s) on output stream out if (gROOT->ClassSaved(TBox::Class())) { - out<<" "; + out<<" "; } else { - out<<" TBox *"; + out<<" TBox *"; } out<<"box = new TBox("<<fX1<<","<<fY1<<","<<fX2<<","<<fY2<<");"<<endl; diff --git a/graf/src/TCrown.cxx b/graf/src/TCrown.cxx index d6bee2d4eb3..d094ebd9347 100644 --- a/graf/src/TCrown.cxx +++ b/graf/src/TCrown.cxx @@ -1,4 +1,4 @@ -// @(#)root/graf:$Name: $:$Id: TCrown.cxx,v 1.3 2002/10/31 07:27:35 brun Exp $ +// @(#)root/graf:$Name: $:$Id: TCrown.cxx,v 1.4 2005/01/13 21:39:40 brun Exp $ // Author: Rene Brun 108/08/2002 /************************************************************************* @@ -54,45 +54,45 @@ ClassImp(TCrown) //______________________________________________________________________________ TCrown::TCrown(): TEllipse() { -//*-*-*-*-*-*-*-*-*-*-*crown default constructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -//*-* ======================== + // Crown default constructor. } //______________________________________________________________________________ TCrown::TCrown(Double_t x1, Double_t y1,Double_t radin, Double_t radout,Double_t phimin,Double_t phimax) :TEllipse(x1,y1,radin,radout,phimin,phimax,0) { -//*-*-*-*-*-*-*-*-*-*-*Crown normal constructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -//*-* ======================= -// x1,y1 : coordinates of centre of crown -// radin : inner crown radius -// radout : outer crown radius -// phimin : min and max angle in degrees (default is 0-->360) -// phimax : -// -// When a crown sector only is drawn, the lines connecting the center -// of the crown to the edges are drawn by default. One can specify -// the drawing option "only" to not draw these lines. -// + // Crown normal constructor. + // + // x1,y1 : coordinates of centre of crown + // radin : inner crown radius + // radout : outer crown radius + // phimin : min and max angle in degrees (default is 0-->360) + // phimax : + // + // When a crown sector only is drawn, the lines connecting the center + // of the crown to the edges are drawn by default. One can specify + // the drawing option "only" to not draw these lines. + } //______________________________________________________________________________ TCrown::TCrown(const TCrown &crown) : TEllipse(crown) { + // Crown copy constructor. + ((TCrown&)crown).Copy(*this); } //______________________________________________________________________________ TCrown::~TCrown() { -// crown default destructor - + // Crown default destructor. } //______________________________________________________________________________ void TCrown::Copy(TObject &crown) const { -// Copy this crown to crown + // Copy this crown to crown. TEllipse::Copy(crown); } @@ -100,38 +100,38 @@ void TCrown::Copy(TObject &crown) const //______________________________________________________________________________ Int_t TCrown::DistancetoPrimitive(Int_t px, Int_t py) { -// Compute distance from point px,py to a crown -// -// if crown is filled, return OK if we are inside -// otherwise, crown is found if near the crown edges + // Compute distance from point px,py to a crown + // + // if crown is filled, return OK if we are inside + // otherwise, crown is found if near the crown edges - const Double_t kPI = TMath::Pi(); - Double_t x = gPad->AbsPixeltoX(px) - GetX1(); - Double_t y = gPad->AbsPixeltoY(py) - GetY1(); - Double_t r = TMath::Sqrt(x*x+y*y); + const Double_t kPI = TMath::Pi(); + Double_t x = gPad->AbsPixeltoX(px) - GetX1(); + Double_t y = gPad->AbsPixeltoY(py) - GetY1(); + Double_t r = TMath::Sqrt(x*x+y*y); - Int_t dist = 9999; - if (r > fR2) return dist; - if (r < fR1) return dist; - if (fPhimax-fPhimin < 360) { - Double_t phi = 180*TMath::ACos(x/r)/kPI; - if (phi < fPhimin) return dist; - if (phi > fPhimax) return dist; - } - - if (GetFillColor() && GetFillStyle()) { - return 0; - } else { - if (TMath::Abs(fR2-r)/fR2 < 0.02) return 0; - if (TMath::Abs(fR1-r)/fR1 < 0.02) return 0; - } - return dist; + Int_t dist = 9999; + if (r > fR2) return dist; + if (r < fR1) return dist; + if (fPhimax-fPhimin < 360) { + Double_t phi = 180*TMath::ACos(x/r)/kPI; + if (phi < fPhimin) return dist; + if (phi > fPhimax) return dist; + } + + if (GetFillColor() && GetFillStyle()) { + return 0; + } else { + if (TMath::Abs(fR2-r)/fR2 < 0.02) return 0; + if (TMath::Abs(fR1-r)/fR1 < 0.02) return 0; + } + return dist; } //______________________________________________________________________________ void TCrown::DrawCrown(Double_t x1, Double_t y1,Double_t radin,Double_t radout,Double_t phimin,Double_t phimax,Option_t *option) { -// Draw this crown with new coordinates + // Draw this crown with new coordinates TCrown *newcrown = new TCrown(x1, y1, radin, radout, phimin, phimax); TAttLine::Copy(*newcrown); @@ -142,9 +142,9 @@ void TCrown::DrawCrown(Double_t x1, Double_t y1,Double_t radin,Double_t radout,D //______________________________________________________________________________ void TCrown::ExecuteEvent(Int_t event, Int_t px, Int_t py) { -// Execute action corresponding to one event -// -// For the time being TEllipse::ExecuteEvent is OK + // Execute action corresponding to one event + // + // For the time being TEllipse::ExecuteEvent is OK TEllipse::ExecuteEvent(event,px,py); } @@ -152,7 +152,7 @@ void TCrown::ExecuteEvent(Int_t event, Int_t px, Int_t py) //______________________________________________________________________________ void TCrown::Paint(Option_t *) { -// Paint this crown with its current attributes + // Paint this crown with its current attributes const Double_t kPI = TMath::Pi(); const Int_t np = 40; @@ -193,9 +193,9 @@ void TCrown::Paint(Option_t *) gPad->PaintPolyLine(np+1,x,y); gPad->PaintPolyLine(np+1,&x[np+1],&y[np+1]); } - } else { + } else { //crown segment - if (GetFillColor() && GetFillStyle()) gPad->PaintFillArea(2*np+2,x,y); + if (GetFillColor() && GetFillStyle()) gPad->PaintFillArea(2*np+2,x,y); if (GetLineStyle()) gPad->PaintPolyLine(2*np+3,x,y); } } @@ -207,9 +207,9 @@ void TCrown::SavePrimitive(ofstream &out, Option_t *) out<<" "<<endl; if (gROOT->ClassSaved(TCrown::Class())) { - out<<" "; + out<<" "; } else { - out<<" TCrown *"; + out<<" TCrown *"; } out<<"crown = new TCrown("<<fX1<<","<<fY1<<","<<fR1<<","<<fR2 <<","<<fPhimin<<","<<fPhimax<<");"<<endl; diff --git a/graf/src/TCurlyArc.cxx b/graf/src/TCurlyArc.cxx index 5e762ae35fa..627e824931d 100644 --- a/graf/src/TCurlyArc.cxx +++ b/graf/src/TCurlyArc.cxx @@ -1,4 +1,4 @@ -// @(#)root/graf:$Name: $:$Id: TCurlyArc.cxx,v 1.8 2005/08/29 14:43:30 brun Exp $ +// @(#)root/graf:$Name: $:$Id: TCurlyArc.cxx,v 1.9 2005/10/31 21:49:23 brun Exp $ // Author: Otto Schaile 20/11/99 /************************************************************************* @@ -9,7 +9,7 @@ * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ -//________________________________________________________________________ +//______________________________________________________________________________ // // This class implements curly or wavy arcs typically used to draw Feynman diagrams. // Amplitudes and wavelengths may be specified in the constructors, @@ -22,7 +22,7 @@ <img src="gif/feynman.gif"> */ //End_Html -//________________________________________________________________________ +//______________________________________________________________________________ #include "Riostream.h" #include "TCurlyArc.h" @@ -37,15 +37,16 @@ Bool_t TCurlyArc::fgDefaultIsCurly = kTRUE; ClassImp(TCurlyArc) -//_____________________________________________________________________________________ + +//______________________________________________________________________________ TCurlyArc::TCurlyArc(Double_t x1, Double_t y1, Double_t rad, Double_t phimin, Double_t phimax, Double_t wl, Double_t amp) : fR1(rad), fPhimin(phimin),fPhimax(phimax) { - // create a new TCurlyarc with center (x1, y1) and radius rad. - // The wavelength and amplitude are given in percent of the line length - // phimin and phimax are given in degrees. + // create a new TCurlyarc with center (x1, y1) and radius rad. + // The wavelength and amplitude are given in percent of the line length + // phimin and phimax are given in degrees. fX1 = x1; fY1 = y1; @@ -56,11 +57,12 @@ TCurlyArc::TCurlyArc(Double_t x1, Double_t y1, Build(); } -//_____________________________________________________________________________________ + +//______________________________________________________________________________ void TCurlyArc::Build() { -//*-*-*-*-*-*-*-*-*-*-*Create a curly (Gluon) or wavy (Gamma) arc*-*-*-*-*-* -//*-* =========================================== + // Create a curly (Gluon) or wavy (Gamma) arc. + Double_t pixeltoX = 1; Double_t pixeltoY = 1; Double_t rPix = fR1; @@ -71,8 +73,6 @@ void TCurlyArc::Build() Double_t pyrange = - gPad->GetAbsHNDC()*wh; Double_t xrange = gPad->GetX2() - gPad->GetX1(); Double_t yrange = gPad->GetY2() - gPad->GetY1(); -// pixeltoX = gPad->GetPixeltoX(); -// pixeltoY = gPad->GetPixeltoY(); pixeltoX = xrange / pxrange; pixeltoY = yrange/pyrange; rPix = fR1 / pixeltoX; @@ -86,7 +86,6 @@ void TCurlyArc::Build() fX2 = length; fY2 = 0; TCurlyLine::Build(); -// TCurlyLine::Build(kTRUE); fX1 = x1sav; fY1 = y1sav; Double_t *xv= GetX(); @@ -104,16 +103,17 @@ void TCurlyArc::Build() if (gPad) gPad->Modified(); } + //______________________________________________________________________________ Int_t TCurlyArc::DistancetoPrimitive(Int_t px, Int_t py) { -//*-*-*-*-*-*-*-*-*-*-*Compute distance from point px,py to an arc*-*-*-* -//*-* =========================================== -// Compute the closest distance of approach from point px,py to this arc. -// The distance is computed in pixels units. -// -// static Int_t ncalls = 0; -//*-*- Compute distance of point to center of arc + // Compute distance from point px,py to an arc. + // + // Compute the closest distance of approach from point px,py to this arc. + // The distance is computed in pixels units. + // + + // Compute distance of point to center of arc Int_t pxc = gPad->XtoAbsPixel(fX1); Int_t pyc = gPad->YtoAbsPixel(fY1); Double_t dist = TMath::Sqrt(Double_t((pxc-px)*(pxc-px)+(pyc-py)*(pyc-py))); @@ -132,19 +132,19 @@ Int_t TCurlyArc::DistancetoPrimitive(Int_t px, Int_t py) return Int_t(distr); } + //______________________________________________________________________________ void TCurlyArc::ExecuteEvent(Int_t event, Int_t px, Int_t py) { -//*-*-*-*-*-*-*-*-*-*-*Execute action corresponding to one event*-*-*-* -//*-* ========================================= -// This member function is called when a TCurlyArc is clicked with the locator -// -// If Left button clicked on one of the line end points, this point -// follows the cursor until button is released. -// -// if Middle button clicked, the line is moved parallel to itself -// until the button is released. -// + // Execute action corresponding to one event. + // + // This member function is called when a TCurlyArc is clicked with the locator + // + // If Left button clicked on one of the line end points, this point + // follows the cursor until button is released. + // + // if Middle button clicked, the line is moved parallel to itself + // until the button is released. Int_t kMaxDiff = 10; const Int_t np = 10; @@ -167,7 +167,7 @@ void TCurlyArc::ExecuteEvent(Int_t event, Int_t px, Int_t py) if(dphi<0) dphi += 2 * pi; dphi /= np; phi0 = fPhimin * pi / 180; - for (i=0;i<=np;i++) { + for (i=0;i<=np;i++) { angle = Double_t(i)*dphi + phi0; dx = fR1*TMath::Cos(angle); dy = fR1*TMath::Sin(angle); @@ -193,7 +193,7 @@ void TCurlyArc::ExecuteEvent(Int_t event, Int_t px, Int_t py) pLx = gPad->XtoAbsPixel(-fR1+fX1); pRx = gPad->XtoAbsPixel( fR1+fX1); r1 = TMath::Abs(pLx-pRx)/2; -// a circle in pixels, radius measured along X + // a circle in pixels, radius measured along X pTy = gPad->YtoAbsPixel(fY1) + r1; pBy = gPad->YtoAbsPixel(fY1) - r1; @@ -292,7 +292,6 @@ void TCurlyArc::ExecuteEvent(Int_t event, Int_t px, Int_t py) if(dphi<0) dphi += 2 * pi; dphi /= np; phi0 = fPhimin * pi / 180; -// Double_t ur1 = gPad->PixeltoX(r1) - gPad->GetUxmin(); Double_t ur1 = r1; Int_t pX1 = gPad->XtoAbsPixel(fX1); Int_t pY1 = gPad->YtoAbsPixel(fY1); @@ -302,9 +301,6 @@ void TCurlyArc::ExecuteEvent(Int_t event, Int_t px, Int_t py) dy = ur1 * TMath::Sin(angle); x[i] = pX1 + (Int_t)dx; y[i] = pY1 + (Int_t)dy; - -// x[i] = gPad->XtoAbsPixel(fX1 + dx); -// y[i] = gPad->YtoAbsPixel(fY1 + dy); } if (fPhimax-fPhimin >= 360 ) { x[np+1] = x[0]; @@ -322,10 +318,10 @@ void TCurlyArc::ExecuteEvent(Int_t event, Int_t px, Int_t py) } } if (pINSIDE) { - dpx = px-pxold; dpy = py-pyold; - px1 += dpx; py1 += dpy; - for (i=0;i<=npe;i++) { x[i] += dpx; y[i] += dpy;} - for (i=0;i<npe;i++) gVirtualX->DrawLine(x[i], y[i], x[i+1], y[i+1]); + dpx = px-pxold; dpy = py-pyold; + px1 += dpx; py1 += dpy; + for (i=0;i<=npe;i++) { x[i] += dpx; y[i] += dpy;} + for (i=0;i<npe;i++) gVirtualX->DrawLine(x[i], y[i], x[i+1], y[i+1]); } pTx = pBx = px1; pRx = px1+r1; @@ -367,19 +363,21 @@ void TCurlyArc::ExecuteEvent(Int_t event, Int_t px, Int_t py) } } -//_____________________________________________________________________________________ -void TCurlyArc::SavePrimitive(ofstream &out, Option_t *){ - // Save primitive as a C++ statement(s) on output stream out + +//______________________________________________________________________________ +void TCurlyArc::SavePrimitive(ofstream &out, Option_t *) +{ + // Save primitive as a C++ statement(s) on output stream out if (gROOT->ClassSaved(TCurlyArc::Class())) { - out<<" "; + out<<" "; } else { - out<<" TCurlyArc *"; + out<<" TCurlyArc *"; } out<<"curlyarc = new TCurlyArc(" <<fX1<<","<<fY1<<","<<fR1<<","<<fPhimin<<","<<fPhimax<<"," <<fWaveLength<<","<<fAmplitude<<");"<<endl; - if (!fIsCurly) { + if (!fIsCurly) { out<<" curlyarc->SetWavy();"<<endl; } SaveLineAttributes(out,"curlyarc",1,1,1); @@ -387,51 +385,96 @@ void TCurlyArc::SavePrimitive(ofstream &out, Option_t *){ } -//_____________________________________________________________________________________ +//______________________________________________________________________________ void TCurlyArc::SetCenter(Double_t x, Double_t y) { + // Set Curly Arc center. + fX1 = x; fY1 = y; Build(); } + + +//______________________________________________________________________________ void TCurlyArc::SetRadius(Double_t x) { + // Set Curly Arc radius. + fR1 = x; Build(); } + + +//______________________________________________________________________________ void TCurlyArc::SetPhimin(Double_t x) { + // Set Curly Arc minimum Phi. + fPhimin = x; Build(); } + + +//______________________________________________________________________________ void TCurlyArc::SetPhimax(Double_t x) { + // Set Curly Arc maximum Phi. + fPhimax = x; Build(); } -//_____________________________________________________________________________________ + +//______________________________________________________________________________ void TCurlyArc::SetDefaultWaveLength(Double_t WaveLength) { + // Set default wave length. + fgDefaultWaveLength = WaveLength; } + + +//______________________________________________________________________________ void TCurlyArc::SetDefaultAmplitude(Double_t Amplitude) { + // Set default wave amplitude. + fgDefaultAmplitude = Amplitude ; } + + +//______________________________________________________________________________ void TCurlyArc::SetDefaultIsCurly(Bool_t IsCurly) { + // Set default "IsCurly". + fgDefaultIsCurly = IsCurly; } + + +//______________________________________________________________________________ Double_t TCurlyArc::GetDefaultWaveLength() { + // Get default wave length. + return fgDefaultWaveLength; } + + +//______________________________________________________________________________ Double_t TCurlyArc::GetDefaultAmplitude() { + // Get default wave amplitude. + return fgDefaultAmplitude; } + + +//______________________________________________________________________________ Bool_t TCurlyArc::GetDefaultIsCurly() { + // Get default "IsCurly". + return fgDefaultIsCurly; } diff --git a/graf/src/TCurlyLine.cxx b/graf/src/TCurlyLine.cxx index 1e0b1dc70a3..396fd93f6ac 100644 --- a/graf/src/TCurlyLine.cxx +++ b/graf/src/TCurlyLine.cxx @@ -1,4 +1,4 @@ -// @(#)root/graf:$Name: $:$Id: TCurlyLine.cxx,v 1.9 2005/08/29 14:43:30 brun Exp $ +// @(#)root/graf:$Name: $:$Id: TCurlyLine.cxx,v 1.10 2005/10/31 21:49:23 brun Exp $ // Author: Otto Schaile 20/11/99 /************************************************************************* @@ -9,7 +9,7 @@ * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ -//________________________________________________________________________ +//______________________________________________________________________________ // // This class implements curly or wavy polylines typically used to draw Feynman diagrams. // Amplitudes and wavelengths may be specified in the constructors, @@ -22,7 +22,7 @@ <img src="gif/feynman.gif"> */ //End_Html -//________________________________________________________________________ +//______________________________________________________________________________ #include "Riostream.h" #include "TCurlyLine.h" @@ -37,11 +37,12 @@ Bool_t TCurlyLine::fgDefaultIsCurly = kTRUE; ClassImp(TCurlyLine) + //______________________________________________________________________________ TCurlyLine::TCurlyLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Double_t wl, Double_t amp) { - // create a new TCurlyLine with starting point (x1, y1), end point (x2,y2) - // The wavelength and amplitude are given in percent of the pad height + // Create a new TCurlyLine with starting point (x1, y1), end point (x2,y2). + // The wavelength and amplitude are given in percent of the pad height. fX1 = x1; fY1 = y1; @@ -53,30 +54,26 @@ TCurlyLine::TCurlyLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Doubl Build(); } + //______________________________________________________________________________ void TCurlyLine::Build() { -//*-*-*-*-*-*-*-*-*-*-*Create a curly (Gluon) or wavy (Gamma) line*-*-*-*-*-* -//*-* =========================================== -//--- + // Create a curly (Gluon) or wavy (Gamma) line. + Double_t pixeltoX = 1; Double_t pixeltoY = 1; -//--- + Double_t wavelengthPix,amplitudePix, lengthPix, hPix; Double_t px1, py1, px2, py2; if (gPad) { - Double_t ww = (Double_t)gPad->GetWw(); - Double_t wh = (Double_t)gPad->GetWh(); - Double_t pxrange = gPad->GetAbsWNDC()*ww; - Double_t pyrange = - gPad->GetAbsHNDC()*wh; - Double_t xrange = gPad->GetX2() - gPad->GetX1(); - Double_t yrange = gPad->GetY2() - gPad->GetY1(); - -// pixeltoX = gPad->GetPixeltoX(); -// pixeltoY = gPad->GetPixeltoY(); - - pixeltoX = xrange / pxrange; - pixeltoY = yrange/pyrange; + Double_t ww = (Double_t)gPad->GetWw(); + Double_t wh = (Double_t)gPad->GetWh(); + Double_t pxrange = gPad->GetAbsWNDC()*ww; + Double_t pyrange = - gPad->GetAbsHNDC()*wh; + Double_t xrange = gPad->GetX2() - gPad->GetX1(); + Double_t yrange = gPad->GetY2() - gPad->GetY1(); + pixeltoX = xrange / pxrange; + pixeltoY = yrange/pyrange; hPix = TMath::Max(gPad->GetAbsHNDC() * gPad->GetWh(), gPad->GetAbsWNDC() * gPad->GetWw()); px1 = gPad->XtoAbsPixel(fX1); py1 = gPad->YtoAbsPixel(fY1); @@ -100,16 +97,16 @@ void TCurlyLine::Build() SetBit(kTooShort); return; } -// construct the curly / wavy line in pixel coordinates at angle 0 + // construct the curly / wavy line in pixel coordinates at angle 0 Double_t anglestep = 40; Double_t phimaxle = TMath::Pi() * 2. / anglestep ; Double_t dx = wavelengthPix / 40; Double_t len2pi = dx * anglestep; -// make sure there is a piece of straight line a both ends + // make sure there is a piece of straight line a both ends Double_t lengthcycle = 0.5 * len2pi + 2 * amplitudePix; -// if (fIsCurly) lengthcycle += amplitudePix; + // if (fIsCurly) lengthcycle += amplitudePix; Int_t nperiods = (Int_t)((lengthPix - lengthcycle) / len2pi); Double_t restlength = 0.5 * (lengthPix - nperiods * len2pi - lengthcycle); fNsteps = (Int_t)(anglestep * nperiods + anglestep / 2 + 4); @@ -122,7 +119,7 @@ void TCurlyLine::Build() Double_t x0 = amplitudePix + restlength; Int_t i; for(i = 2; i < fNsteps-1; i++){ -// distinguish between curly and wavy + // distinguish between curly and wavy if(fIsCurly) xv[i] = x0 + amplitudePix * TMath::Sin(phase); else xv[i] = x0; yv[i] = amplitudePix*TMath::Cos(phase); @@ -133,8 +130,8 @@ void TCurlyLine::Build() if (InheritsFrom("TCurlyArc")) return; // called by TCurlyArc -// rotate object and transform back to user coordinates - Double_t angle = TMath::ATan2(py2-py1, px2-px1); + // rotate object and transform back to user coordinates + Double_t angle = TMath::ATan2(py2-py1, px2-px1); if(angle < 0) angle += 2*TMath::Pi(); Double_t cosang = TMath::Cos(angle); @@ -145,8 +142,8 @@ void TCurlyLine::Build() xx = xv[i] * cosang - yv[i] * sinang; yy = xv[i] * sinang + yv[i] * cosang; if (gPad) { - xx *= pixeltoX; - yy *= pixeltoY; + xx *= pixeltoX; + yy *= pixeltoY; } xv[i] = xx + fX1; yv[i] = yy + fY1; @@ -154,28 +151,29 @@ void TCurlyLine::Build() if (gPad) gPad->Modified(); } + //______________________________________________________________________________ - Int_t TCurlyLine::DistancetoPrimitive(Int_t px, Int_t py) +Int_t TCurlyLine::DistancetoPrimitive(Int_t px, Int_t py) { -//*-*-*-*-*-*-*-*-*-*-*Compute distance from point px,py to a line*-*-*-*-*-* -//*-* =========================================== + // Compute distance from point px,py to a line. return DistancetoLine(px,py,fX1,fY1,fX2,fY2); } + //______________________________________________________________________________ void TCurlyLine::ExecuteEvent(Int_t event, Int_t px, Int_t py) { -//*-*-*-*-*-*-*-*-*-*-*Execute action corresponding to one event*-*-*-* -//*-* ========================================= -// This member function is called when a TCurlyLine is clicked with the locator -// -// If Left button clicked on one of the line end points, this point -// follows the cursor until button is released. -// -// if Middle button clicked, the line is moved parallel to itself -// until the button is released. -// + // Execute action corresponding to one event. + // + // This member function is called when a TCurlyLine is clicked with the locator + // + // If Left button clicked on one of the line end points, this point + // follows the cursor until button is released. + // + // if Middle button clicked, the line is moved parallel to itself + // until the button is released. + // Int_t kMaxDiff = 20; static Int_t d1,d2,px1,px2,py1,py2; @@ -268,14 +266,16 @@ void TCurlyLine::ExecuteEvent(Int_t event, Int_t px, Int_t py) } } -//_____________________________________________________________________________________ -void TCurlyLine::SavePrimitive(ofstream &out, Option_t *){ - // Save primitive as a C++ statement(s) on output stream out + +//______________________________________________________________________________ +void TCurlyLine::SavePrimitive(ofstream &out, Option_t *) +{ + // Save primitive as a C++ statement(s) on output stream out if (gROOT->ClassSaved(TCurlyLine::Class())) { - out<<" "; + out<<" "; } else { - out<<" TCurlyLine *"; + out<<" TCurlyLine *"; } out<<"curlyline = new TCurlyLine(" <<fX1<<","<<fY1<<","<<fX2<<","<<fY2<<"," @@ -287,63 +287,118 @@ void TCurlyLine::SavePrimitive(ofstream &out, Option_t *){ out<<" curlyline->Draw();"<<endl; } -//_____________________________________________________________________________________ + +//______________________________________________________________________________ void TCurlyLine::SetCurly() { + // Set curly. + fIsCurly = kTRUE; Build(); } + + +//______________________________________________________________________________ void TCurlyLine::SetWavy() { + // Set wavy. + fIsCurly = kFALSE; Build(); } + + +//______________________________________________________________________________ void TCurlyLine::SetWaveLength(Double_t x) { + // Set wave length. + fWaveLength = x; Build(); } + + +//______________________________________________________________________________ void TCurlyLine::SetAmplitude(Double_t x) { + // Set amplitude. + fAmplitude = x; Build(); } + + +//______________________________________________________________________________ void TCurlyLine::SetStartPoint(Double_t x, Double_t y) { + // Set start point. + fX1 = x; fY1 = y; Build(); } + + +//______________________________________________________________________________ void TCurlyLine::SetEndPoint(Double_t x, Double_t y) { + // Set edn point. + fX2 = x; fY2 = y; Build(); } -//_____________________________________________________________________________________ + +//______________________________________________________________________________ void TCurlyLine::SetDefaultWaveLength(Double_t WaveLength) { + // Set default wave length. + fgDefaultWaveLength = WaveLength; } + + +//______________________________________________________________________________ void TCurlyLine::SetDefaultAmplitude(Double_t Amplitude) { + // Set default amplitude. + fgDefaultAmplitude = Amplitude; } + + +//______________________________________________________________________________ void TCurlyLine::SetDefaultIsCurly(Bool_t IsCurly) { + // Set defaul "IsCurly". + fgDefaultIsCurly = IsCurly; } + + +//______________________________________________________________________________ Double_t TCurlyLine::GetDefaultWaveLength() { + // Get default wave length. + return fgDefaultWaveLength; } + + +//______________________________________________________________________________ Double_t TCurlyLine::GetDefaultAmplitude() { + // Get default amplitude. + return fgDefaultAmplitude; } + + +//______________________________________________________________________________ Bool_t TCurlyLine::GetDefaultIsCurly() { + // Get default "IsCurly". + return fgDefaultIsCurly; } - diff --git a/graf/src/TCutG.cxx b/graf/src/TCutG.cxx index 2a3eccad039..4ee69c90b34 100644 --- a/graf/src/TCutG.cxx +++ b/graf/src/TCutG.cxx @@ -1,4 +1,4 @@ -// @(#)root/graf:$Name: $:$Id: TCutG.cxx,v 1.16 2004/06/26 13:38:57 brun Exp $ +// @(#)root/graf:$Name: $:$Id: TCutG.cxx,v 1.17 2005/09/05 07:25:22 brun Exp $ // Author: Rene Brun 16/05/97 /************************************************************************* @@ -73,6 +73,7 @@ ClassImp(TCutG) //______________________________________________________________________________ TCutG::TCutG() : TGraph() { + // TCutG default constructor. fObjectX = 0; fObjectY = 0; @@ -94,6 +95,8 @@ TCutG::TCutG(const TCutG &cutg) TCutG::TCutG(const char *name, Int_t n) :TGraph(n) { + // TCutG normal constructor. + fObjectX = 0; fObjectY = 0; SetName(name); @@ -133,6 +136,8 @@ TCutG::TCutG(const char *name, Int_t n) TCutG::TCutG(const char *name, Int_t n, const Float_t *x, const Float_t *y) :TGraph(n,x,y) { + // TCutG normal constructor. + fObjectX = 0; fObjectY = 0; SetName(name); @@ -172,6 +177,8 @@ TCutG::TCutG(const char *name, Int_t n, const Float_t *x, const Float_t *y) TCutG::TCutG(const char *name, Int_t n, const Double_t *x, const Double_t *y) :TGraph(n,x,y) { + // TCutG normal constructor. + fObjectX = 0; fObjectY = 0; SetName(name); @@ -210,6 +217,7 @@ TCutG::TCutG(const char *name, Int_t n, const Double_t *x, const Double_t *y) //______________________________________________________________________________ TCutG::~TCutG() { + // TCutG destructor. delete fObjectX; delete fObjectY; @@ -266,23 +274,22 @@ Double_t TCutG::Integral(TH2 *h, Option_t *option) const //______________________________________________________________________________ Int_t TCutG::IsInside(Double_t x, Double_t y) const { -//*. Function which returns 1 if point x,y lies inside the -//*. polygon defined by the graph points -//*. 0 otherwise -//*. -//*. The loop is executed with the end-point coordinates of a -//*. line segment (X1,Y1)-(X2,Y2) and the Y-coordinate of a -//*. horizontal line. -//*. The counter inter is incremented if the line (X1,Y1)-(X2,Y2) -//*. intersects the horizontal line. -//*. In this case XINT is set to the X-coordinate of the -//*. intersection point. -//*. If inter is an odd number, then the point x,y is within -//*. the polygon. -//*. -//*. This routine is based on an original algorithm -//*. developed by R.Nierhaus. -//*. + // Function which returns 1 if point x,y lies inside the + // polygon defined by the graph points + // 0 otherwise + // + // The loop is executed with the end-point coordinates of a + // line segment (X1,Y1)-(X2,Y2) and the Y-coordinate of a + // horizontal line. + // The counter inter is incremented if the line (X1,Y1)-(X2,Y2) + // intersects the horizontal line. + // In this case XINT is set to the X-coordinate of the + // intersection point. + // If inter is an odd number, then the point x,y is within + // the polygon. + // + // This routine is based on an original algorithm + // developed by R.Nierhaus. return (Int_t)TMath::IsInside(x,y,fNpoints,fX,fY); } @@ -290,14 +297,14 @@ Int_t TCutG::IsInside(Double_t x, Double_t y) const //______________________________________________________________________________ void TCutG::SavePrimitive(ofstream &out, Option_t *option) { - // Save primitive as a C++ statement(s) on output stream out + // Save primitive as a C++ statement(s) on output stream out. char quote = '"'; out<<" "<<endl; if (gROOT->ClassSaved(TCutG::Class())) { - out<<" "; + out<<" "; } else { - out<<" TCutG *"; + out<<" TCutG *"; } out<<"cutg = new TCutG("<<quote<<GetName()<<quote<<","<<fNpoints<<");"<<endl; out<<" cutg->SetVarX("<<quote<<GetVarX()<<quote<<");"<<endl; @@ -318,6 +325,8 @@ void TCutG::SavePrimitive(ofstream &out, Option_t *option) //______________________________________________________________________________ void TCutG::SetVarX(const char *varx) { + // Set X variable. + fVarX = varx; delete fObjectX; fObjectX = 0; @@ -326,6 +335,8 @@ void TCutG::SetVarX(const char *varx) //______________________________________________________________________________ void TCutG::SetVarY(const char *vary) { + // Set Y variable. + fVarY = vary; delete fObjectY; fObjectY = 0; diff --git a/graf/src/TDiamond.cxx b/graf/src/TDiamond.cxx index 961053f8eb0..f810d20e80c 100644 --- a/graf/src/TDiamond.cxx +++ b/graf/src/TDiamond.cxx @@ -1,4 +1,4 @@ -// @(#)root/graf:$Name: $:$Id: TDiamond.cxx,v 1.7 2003/09/30 10:09:38 brun Exp $ +// @(#)root/graf:$Name: $:$Id: TDiamond.cxx,v 1.8 2005/08/29 14:43:30 brun Exp $ // Author: Rene Brun 22/06/96 /************************************************************************* @@ -43,8 +43,7 @@ ClassImp(TDiamond) //______________________________________________________________________________ TDiamond::TDiamond(): TPaveText() { -//*-*-*-*-*-*-*-*-*-*-*Diamond default constructor*-*-*-*-*-*-*-*-*-*-*-*-*-* -//*-* =========================== + // Diamond default constructor. } @@ -52,21 +51,21 @@ TDiamond::TDiamond(): TPaveText() TDiamond::TDiamond(Double_t x1, Double_t y1,Double_t x2, Double_t y2) :TPaveText(x1,y1,x2,y2) { -//*-*-*-*-*-*-*-*-*-*-*Diamond standard constructor*-*-*-*-*-*-*-*-*-*-*-*-* -//*-* ============================ + // Diamond standard constructor. } //______________________________________________________________________________ TDiamond::~TDiamond() { -//*-*-*-*-*-*-*-*-*-*-*Diamond destructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -//*-* ================== + // Diamond destructor. } //______________________________________________________________________________ TDiamond::TDiamond(const TDiamond &diamond) : TPaveText() { + // Copy constructor. + TBuffer b(TBuffer::kWrite); TDiamond *p = (TDiamond*)(&diamond); p->Streamer(b); @@ -78,12 +77,11 @@ TDiamond::TDiamond(const TDiamond &diamond) : TPaveText() //______________________________________________________________________________ Int_t TDiamond::DistancetoPrimitive(Int_t px, Int_t py) { -//*-*-*-*-*-*-*-*-*Compute distance from point px,py to a diamond*-*-*-*-*-* -//*-* ============================================== -// Compute the closest distance of approach from point px,py to the -// edges of this diamond. -// The distance is computed in pixels units. -// + // Compute distance from point px,py to a diamond. + // + // Compute the closest distance of approach from point px,py to the + // edges of this diamond. + // The distance is computed in pixels units. return TPaveText::DistancetoPrimitive(px,py); } @@ -91,8 +89,7 @@ Int_t TDiamond::DistancetoPrimitive(Int_t px, Int_t py) //______________________________________________________________________________ void TDiamond::Draw(Option_t *option) { -//*-*-*-*-*-*-*-*-*-*-*Draw this diamond with its current attributes*-*-*-*-*-* -//*-* ============================================= + // Draw this diamond with its current attributes. AppendPad(option); @@ -101,28 +98,27 @@ void TDiamond::Draw(Option_t *option) //______________________________________________________________________________ void TDiamond::ExecuteEvent(Int_t event, Int_t px, Int_t py) { -//*-*-*-*-*-*-*-*-*-*-*Execute action corresponding to one event*-*-*-* -//*-* ========================================= -// This member function is called when a Diamond object is clicked. -// -// If the mouse is clicked inside the diamond, the diamond is moved. -// -// If the mouse is clicked on the 4 tops (pL,pR,pTop,pBot), the diamond is rscaled. -// -// -// pTop -// +---------+ -// | / \ | -// | / \ | -// | / \ | -// pL|/pinside\|pR -// |\ /| -// | \ / | -// | \ / | -// | \ / | -// +---------+ -// pBot -// + // Execute action corresponding to one event. + // + // This member function is called when a Diamond object is clicked. + // + // If the mouse is clicked inside the diamond, the diamond is moved. + // + // If the mouse is clicked on the 4 tops (pL,pR,pTop,pBot), the diamond is rscaled. + // + // + // pTop + // +---------+ + // | / \ | + // | / \ | + // | / \ | + // pL|/pinside\|pR + // |\ /| + // | \ / | + // | \ / | + // | \ / | + // +---------+ + // pBot const Int_t kMaxDiff = 5; const Int_t kMinSize = 20; @@ -215,8 +211,8 @@ again: if ((TMath::Abs(py-(pyl+pyt)/2) < kMaxDiff) && (TMath::Abs(px - pxt) < kMaxDiff)) { // right edge - pxold = pxt; pyold = pyt; pR = kTRUE; - gPad->SetCursor(kRightSide); + pxold = pxt; pyold = pyt; pR = kTRUE; + gPad->SetCursor(kRightSide); } x1c = (py-pTy)*(pTx-pLx)/(pTy-pLy)+pTx; @@ -284,7 +280,7 @@ again: if (px2 < px1+kMinSize) { px2 = px1+kMinSize; wx = px2; } if (px2 > px2p) { px2 = px2p; wx = px2; } x[1] = px2; - x[0] = x[2] = x[4] = (px1+px2)/2; + x[0] = x[2] = x[4] = (px1+px2)/2; for (i=0;i<4;i++) gVirtualX->DrawLine(x[i], y[i], x[i+1], y[i+1]); } if (pINSIDE) { @@ -367,8 +363,7 @@ again: //______________________________________________________________________________ void TDiamond::Paint(Option_t *) { -//*-*-*-*-*-*-*-*-*-*-*Paint this diamond with its current attributes*-*-*-*-* -//*-* ============================================== + // Paint this diamond with its current attributes. Double_t x[7],y[7],depx,depy; Double_t x1 = fX1; @@ -379,32 +374,32 @@ void TDiamond::Paint(Option_t *) Int_t fillcolor = GetFillColor(); Int_t linecolor = GetLineColor(); if (fBorderSize) { - Double_t wy = gPad->PixeltoY(0) - gPad->PixeltoY(fBorderSize); - Double_t wx = gPad->PixeltoX(fBorderSize) - gPad->PixeltoX(0); - //*-*- Draw the frame top right - if (y2-y1>x2-x1) { - depx = wx; - depy = 0; - } - else if (y2-y1<x2-x1) { - depx = 0; - depy = -wy; - } - else { - depx = wx; - depy = -wy; - } - x[0] = x[2] = (x1+x2)/2+depx; - x[1] = x2+depx; - x[3] = x1+depx; - y[0] = y2+depy; - y[2] = y1+depy; - y[1] = y[3] =(y1+y2)/2+depy; - x[4] = x[0]; y[4] = y[0]; - SetFillStyle(fillstyle); - SetFillColor(linecolor); - TAttFill::Modify(); //Change fill area attributes only if necessary - gPad->PaintFillArea(4,x,y); + Double_t wy = gPad->PixeltoY(0) - gPad->PixeltoY(fBorderSize); + Double_t wx = gPad->PixeltoX(fBorderSize) - gPad->PixeltoX(0); + // Draw the frame top right + if (y2-y1>x2-x1) { + depx = wx; + depy = 0; + } + else if (y2-y1<x2-x1) { + depx = 0; + depy = -wy; + } + else { + depx = wx; + depy = -wy; + } + x[0] = x[2] = (x1+x2)/2+depx; + x[1] = x2+depx; + x[3] = x1+depx; + y[0] = y2+depy; + y[2] = y1+depy; + y[1] = y[3] =(y1+y2)/2+depy; + x[4] = x[0]; y[4] = y[0]; + SetFillStyle(fillstyle); + SetFillColor(linecolor); + TAttFill::Modify(); //Change fill area attributes only if necessary + gPad->PaintFillArea(4,x,y); } x[0] = x[2] = (x1+x2)/2; x[1] = x2; @@ -420,19 +415,19 @@ void TDiamond::Paint(Option_t *) gPad->PaintFillArea(4,x,y); gPad->PaintPolyLine(5,x,y); -// Paint list of primitives (test,etc) + // Paint list of primitives (test,etc) PaintPrimitives(kDiamond); } //______________________________________________________________________________ void TDiamond::SavePrimitive(ofstream &out, Option_t *) { - // Save primitive as a C++ statement(s) on output stream out + // Save primitive as a C++ statement(s) on output stream out. if (gROOT->ClassSaved(TDiamond::Class())) { - out<<" "; + out<<" "; } else { - out<<" TDiamond *"; + out<<" TDiamond *"; } out<<"diamond = new TDiamond("<<fX1<<","<<fY1<<","<<fX2<<","<<fY2<<");"<<endl; diff --git a/graf/src/TEllipse.cxx b/graf/src/TEllipse.cxx index 08552d91cf6..e2627cc6e69 100644 --- a/graf/src/TEllipse.cxx +++ b/graf/src/TEllipse.cxx @@ -1,4 +1,4 @@ -// @(#)root/graf:$Name: $:$Id: TEllipse.cxx,v 1.19 2005/01/13 21:39:40 brun Exp $ +// @(#)root/graf:$Name: $:$Id: TEllipse.cxx,v 1.20 2005/08/29 14:43:30 brun Exp $ // Author: Rene Brun 16/10/95 /************************************************************************* @@ -22,8 +22,8 @@ const Double_t kPI = 3.14159265358979323846; ClassImp(TEllipse) //______________________________________________________________________________ -//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*Ellipse class*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -//*-* ============= +// Ellipse class. +// // Ellipse is a general ellipse that can be truncated and rotated. // An Ellipse is defined by its center (x1,y1) and two radius r1 and r2. // A minimum and maximum angle may be specified (phimin, phimax). @@ -47,8 +47,8 @@ ClassImp(TEllipse) //______________________________________________________________________________ TEllipse::TEllipse(): TObject(), TAttLine(), TAttFill() { -//*-*-*-*-*-*-*-*-*-*-*Ellipse default constructor*-*-*-*-*-*-*-*-*-*-*-*-*-* -//*-* =========================== + // Ellipse default constructor. + fX1 = 0; fY1 = 0; fR1 = 1; @@ -57,12 +57,13 @@ TEllipse::TEllipse(): TObject(), TAttLine(), TAttFill() fPhimax = 360; fTheta = 0; } + //______________________________________________________________________________ TEllipse::TEllipse(Double_t x1, Double_t y1,Double_t r1,Double_t r2,Double_t phimin,Double_t phimax,Double_t theta) :TObject(), TAttLine(), TAttFill(0,1001) { -//*-*-*-*-*-*-*-*-*-*-*Ellipse normal constructor*-*-*-*-*-*-*-*-*-*-*-*-*-* -//*-* ========================== + // Ellipse normal constructor. + fX1 = x1; fY1 = y1; fR1 = r1; @@ -76,21 +77,22 @@ TEllipse::TEllipse(Double_t x1, Double_t y1,Double_t r1,Double_t r2,Double_t phi //______________________________________________________________________________ TEllipse::~TEllipse() { -//*-*-*-*-*-*-*-*-*-*-*Ellipse default destructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -//*-* ========================== + // Ellipse default destructor. + } //______________________________________________________________________________ TEllipse::TEllipse(const TEllipse &ellipse) : TObject(ellipse), TAttLine(ellipse), TAttFill(ellipse) { + // Copy constructor. + ((TEllipse&)ellipse).Copy(*this); } //______________________________________________________________________________ void TEllipse::Copy(TObject &obj) const { -//*-*-*-*-*-*-*-*-*-*-*Copy this ellipse to ellipse*-*-*-*-*-*-*-*-*-*-*-*-*-* -//*-* ============================ + // Copy this ellipse to ellipse. TObject::Copy(obj); TAttLine::Copy(((TEllipse&)obj)); @@ -107,47 +109,45 @@ void TEllipse::Copy(TObject &obj) const //______________________________________________________________________________ Int_t TEllipse::DistancetoPrimitive(Int_t px, Int_t py) { -//*-*-*-*-*-*-*-*-*-*-*Compute distance from point px,py to an ellipse*-*-*-* -//*-* =========================================== -// Compute the closest distance of approach from point px,py to this ellipse. -// The distance is computed in pixels units. -// + // Compute distance from point px,py to an ellipse. + // + // Compute the closest distance of approach from point px,py to this ellipse. + // The distance is computed in pixels units. - Double_t x = gPad->PadtoX(gPad->AbsPixeltoX(px)); - Double_t y = gPad->PadtoY(gPad->AbsPixeltoY(py)); + Double_t x = gPad->PadtoX(gPad->AbsPixeltoX(px)); + Double_t y = gPad->PadtoY(gPad->AbsPixeltoY(py)); - Double_t dxnr = x - fX1; - Double_t dynr = y - fY1; + Double_t dxnr = x - fX1; + Double_t dynr = y - fY1; - Double_t ct = TMath::Cos(kPI*GetTheta()/180.0); - Double_t st = TMath::Sin(kPI*GetTheta()/180.0); + Double_t ct = TMath::Cos(kPI*GetTheta()/180.0); + Double_t st = TMath::Sin(kPI*GetTheta()/180.0); - Double_t dx = dxnr*ct + dynr*st; - Double_t dy = -dxnr*st + dynr*ct; + Double_t dx = dxnr*ct + dynr*st; + Double_t dy = -dxnr*st + dynr*ct; - Double_t r1 = fR1; - Double_t r2 = fR2; + Double_t r1 = fR1; + Double_t r2 = fR2; - if (dx == 0 || r1 == 0 || r2 == 0) return 9999; - Double_t distp = TMath::Sqrt(dx*dx + dy*dy); + if (dx == 0 || r1 == 0 || r2 == 0) return 9999; + Double_t distp = TMath::Sqrt(dx*dx + dy*dy); - Double_t tana = dy/dx; - tana *= tana; - Double_t distr = TMath::Sqrt((1+tana)/(1.0/(r1*r1) + tana/(r2*r2))); - Int_t dist = 9999; - if (GetFillColor() && GetFillStyle()) { - if (distr > distp) dist = 0; - } else { - if (TMath::Abs(distr-distp)/(r1+r2) < 0.01) dist = 0; - } - return dist; + Double_t tana = dy/dx; + tana *= tana; + Double_t distr = TMath::Sqrt((1+tana)/(1.0/(r1*r1) + tana/(r2*r2))); + Int_t dist = 9999; + if (GetFillColor() && GetFillStyle()) { + if (distr > distp) dist = 0; + } else { + if (TMath::Abs(distr-distp)/(r1+r2) < 0.01) dist = 0; + } + return dist; } //______________________________________________________________________________ void TEllipse::Draw(Option_t *option) { -//*-*-*-*-*-*-*-*-*-*-*Draw this ellipse with its current attributes*-*-*-*-* -//*-* ========================================== + // Draw this ellipse with its current attributes. AppendPad(option); @@ -156,8 +156,8 @@ void TEllipse::Draw(Option_t *option) //______________________________________________________________________________ void TEllipse::DrawEllipse(Double_t x1, Double_t y1,Double_t r1,Double_t r2,Double_t phimin,Double_t phimax,Double_t theta,Option_t *option) { -//*-*-*-*-*-*-*-*-*-*-*Draw this ellipse with new coordinates*-*-*-*-*-*-*-*-* -//*-* ====================================== + // Draw this ellipse with new coordinates. + TEllipse *newellipse = new TEllipse(x1, y1, r1, r2, phimin, phimax,theta); TAttLine::Copy(*newellipse); TAttFill::Copy(*newellipse); @@ -169,17 +169,17 @@ void TEllipse::DrawEllipse(Double_t x1, Double_t y1,Double_t r1,Double_t r2,Doub //______________________________________________________________________________ void TEllipse::ExecuteEvent(Int_t event, Int_t px, Int_t py) { -//*-*-*-*-*-*-*-*-*-*-*Execute action corresponding to one event*-*-*-* -//*-* ========================================= -// This member function is called when a line is clicked with the locator -// -// If Left button clicked on one of the line end points, this point -// follows the cursor until button is released. -// -// if Middle button clicked, the line is moved parallel to itself -// until the button is released. -// -// NOTE that support for log scale is not implemented + // Execute action corresponding to one event. + // + // This member function is called when a line is clicked with the locator + // + // If Left button clicked on one of the line end points, this point + // follows the cursor until button is released. + // + // if Middle button clicked, the line is moved parallel to itself + // until the button is released. + // + // NOTE that support for log scale is not implemented Int_t kMaxDiff = 10; const Int_t kMinSize = 25; @@ -377,10 +377,10 @@ void TEllipse::ExecuteEvent(Int_t event, Int_t px, Int_t py) for (i=0;i<npe;i++) gVirtualX->DrawLine(x[i], y[i], x[i+1], y[i+1]); } if (pINSIDE) { - dpx = px-pxold; dpy = py-pyold; - px1 += dpx; py1 += dpy; - for (i=0;i<=npe;i++) { x[i] += dpx; y[i] += dpy;} - for (i=0;i<npe;i++) gVirtualX->DrawLine(x[i], y[i], x[i+1], y[i+1]); + dpx = px-pxold; dpy = py-pyold; + px1 += dpx; py1 += dpy; + for (i=0;i<=npe;i++) { x[i] += dpx; y[i] += dpy;} + for (i=0;i<npe;i++) gVirtualX->DrawLine(x[i], y[i], x[i+1], y[i+1]); } pTx = pBx = px1; pRx = px1+r1; @@ -425,8 +425,8 @@ void TEllipse::ExecuteEvent(Int_t event, Int_t px, Int_t py) //______________________________________________________________________________ void TEllipse::ls(Option_t *) const { -//*-*-*-*-*-*-*-*-*-*-*-*List this ellipse with its attributes*-*-*-*-*-*-*-* -//*-* ===================================== + // List this ellipse with its attributes. + TROOT::IndentLevel(); printf("%s: X1= %f Y1=%f R1=%f R2=%f\n",GetName(),fX1,fY1,fR1,fR2); } @@ -434,16 +434,15 @@ void TEllipse::ls(Option_t *) const //______________________________________________________________________________ void TEllipse::Paint(Option_t *option) { -//*-*-*-*-*-*-*-*-*-*-*Paint this ellipse with its current attributes*-*-*-*-* -//*-* ============================================== + // Paint this ellipse with its current attributes. + PaintEllipse(fX1,fY1,fR1,fR2,fPhimin,fPhimax,fTheta,option); } //______________________________________________________________________________ void TEllipse::PaintEllipse(Double_t, Double_t, Double_t, Double_t, Double_t phimin,Double_t phimax, Double_t theta,Option_t *option) { -//*-*-*-*-*-*-*-*-*-*-*Draw this ellipse with new coordinates*-*-*-*-*-*-*-*-* -//*-* ====================================== + // Draw this ellipse with new coordinates. const Int_t np = 200; static Double_t x[np+3], y[np+3]; @@ -488,8 +487,7 @@ void TEllipse::PaintEllipse(Double_t, Double_t, Double_t, Double_t, Double_t phi //______________________________________________________________________________ void TEllipse::Print(Option_t *) const { -//*-*-*-*-*-*-*-*-*-*-*Dump this ellipse with its attributes*-*-*-*-*-*-*-*-* -//*-* ===================================== + // Dump this ellipse with its attributes. printf("Ellipse: X1=%f Y1=%f R1=%f R2=%f",fX1,fY1,fR1,fR2); if (GetLineColor() != 1) printf(" Color=%d",GetLineColor()); @@ -501,13 +499,13 @@ void TEllipse::Print(Option_t *) const //______________________________________________________________________________ void TEllipse::SavePrimitive(ofstream &out, Option_t *) { - // Save primitive as a C++ statement(s) on output stream out + // Save primitive as a C++ statement(s) on output stream out out<<" "<<endl; if (gROOT->ClassSaved(TEllipse::Class())) { - out<<" "; + out<<" "; } else { - out<<" TEllipse *"; + out<<" TEllipse *"; } out<<"ellipse = new TEllipse("<<fX1<<","<<fY1<<","<<fR1<<","<<fR2 <<","<<fPhimin<<","<<fPhimax<<","<<fTheta<<");"<<endl; @@ -531,9 +529,9 @@ Bool_t TEllipse::GetNoEdges() const //______________________________________________________________________________ void TEllipse::SetNoEdges(Bool_t noEdges) { -// if noEdges = kTRUE the lines connecting the center to the edges -// will not be drawn. -// default is to draw the edges. + // if noEdges = kTRUE the lines connecting the center to the edges + // will not be drawn. + // default is to draw the edges. if (noEdges) SetBit(kNoEdges); else ResetBit(kNoEdges); diff --git a/graf/src/TFrame.cxx b/graf/src/TFrame.cxx index 592cb7c6e3e..3ab6cac63be 100644 --- a/graf/src/TFrame.cxx +++ b/graf/src/TFrame.cxx @@ -1,4 +1,4 @@ -// @(#)root/graf:$Name: $:$Id: TFrame.cxx,v 1.9 2005/02/21 12:04:18 brun Exp $ +// @(#)root/graf:$Name: $:$Id: TFrame.cxx,v 1.10 2005/08/29 14:43:30 brun Exp $ // Author: Rene Brun 31/10/96 /************************************************************************* @@ -24,8 +24,7 @@ ClassImp(TFrame) //______________________________________________________________________________ TFrame::TFrame(): TWbox() { -//*-*-*-*-*-*-*-*-*-*-*frame default constructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -//*-* ======================== + // Frame default constructor. } @@ -33,49 +32,47 @@ TFrame::TFrame(): TWbox() TFrame::TFrame(Double_t x1, Double_t y1,Double_t x2, Double_t y2) :TWbox(x1,y1,x2,y2) { -//*-*-*-*-*-*-*-*-*-*-*frame normal constructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -//*-* ======================= + // Frame normal constructor. + } //______________________________________________________________________________ TFrame::TFrame(const TFrame &frame) : TWbox(frame) { + // Frame copy constructor. + ((TFrame&)frame).Copy(*this); } //______________________________________________________________________________ TFrame::~TFrame() { -//*-*-*-*-*-*-*-*-*-*-*wbox default destructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -//*-* ======================= + // Frame default destructor. } //______________________________________________________________________________ void TFrame::Copy(TObject &frame) const { -//*-*-*-*-*-*-*-*-*-*-*Copy this frame to frame*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -//*-* ====================== + // Copy this frame to frame. + TWbox::Copy(frame); } //______________________________________________________________________________ void TFrame::Draw(Option_t *option) { -//*-*-*-*-*-*-*-*-*-*-*Draw this wbox with its current attributes*-*-*-*-*-*-* -//*-* ========================================== + // Draw this frame with its current attributes. AppendPad(option); - } //______________________________________________________________________________ void TFrame::ExecuteEvent(Int_t event, Int_t px, Int_t py) { -//*-*-*-*-*-*-*-*-*-*-*Execute action corresponding to one event*-*-*-* -//*-* ========================================= -// This member function is called when a TFrame object is clicked. -// + // Execute action corresponding to one event. + // + // This member function is called when a TFrame object is clicked. if (!gPad->IsEditable()) return; @@ -121,8 +118,7 @@ void TFrame::ExecuteEvent(Int_t event, Int_t px, Int_t py) //______________________________________________________________________________ void TFrame::Paint(Option_t *option) { -//*-*-*-*-*-*-*-*-*-*-*Paint this wbox with its current attributes*-*-*-*-*-*-* -//*-* =========================================== + // Paint this wbox with its current attributes. TWbox::Paint(option); -- GitLab