Changeset 2467 for trunk/MagicSoft/Mars/mimage
- Timestamp:
- 11/04/03 14:12:44 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mimage/MHillas.cc
r2386 r2467 82 82 // Default constructor. 83 83 // 84 MHillas::MHillas(const char *name, const char *title) : fEllipse(NULL)84 MHillas::MHillas(const char *name, const char *title) 85 85 { 86 86 fName = name ? name : "MHillas"; … … 88 88 89 89 Reset(); 90 91 fEllipse = new TEllipse;92 90 } 93 91 … … 98 96 MHillas::~MHillas() 99 97 { 100 Clear();101 98 } 102 99 … … 115 112 fMeanX = 0; 116 113 fMeanY = 0; 117 118 Clear();119 114 } 120 115 … … 143 138 // -------------------------------------------------------------------------- 144 139 // 145 // Instead of adding MHillas itself to the Pad (s. AppendPad in TObject) 146 // we create an ellipse, which is added to the Pad by its Draw function 147 // You can remove it by deleting the Ellipse Object (s. Clear()) 148 // 149 void MHillas::Draw(Option_t *opt) 150 { 151 Clear(); 152 140 // Paint the ellipse corresponding to the parameters 141 // 142 void MHillas::Paint(Option_t *opt) 143 { 153 144 if (fLength<0 || fWidth<0) 154 145 return; 155 146 156 fEllipse = new TEllipse(fMeanX, fMeanY, fLength, fWidth,147 TEllipse e(fMeanX, fMeanY, fLength, fWidth, 157 148 0, 360, fDelta*kRad2Deg+180); 158 149 159 fEllipse->SetLineWidth(2); 160 fEllipse->Draw(); 161 } 162 163 // -------------------------------------------------------------------------- 164 // 165 // If a TEllipse object exists it is deleted 166 // 167 void MHillas::Clear(Option_t *) 168 { 169 if (!fEllipse) 170 return; 171 172 delete fEllipse; 173 174 fEllipse = NULL; 175 } 176 150 e.SetLineWidth(2); 151 e.Paint(); 152 } 177 153 178 154 // --------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.