Changeset 1325 for trunk/MagicSoft/Mars/mgui
- Timestamp:
- 04/30/02 12:00:44 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/mgui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mgui/MCamDisplay.cc
r1268 r1325 27 27 // 28 28 MCamDisplay::MCamDisplay(MGeomCam *geom) 29 : fAutoScale(kTRUE), fMinPhe(-2), fMaxPhe(50), fW(0), fH(0), fDrawingPad(NULL) 30 { 31 fGeomCam = geom; // FIXME: Clone doesn't work! (MGeomCam*)geom->Clone();29 : fAutoScale(kTRUE), fMinPhe(-2), fMaxPhe(50), fW(0), fH(0), fDrawingPad(NULL), fIsAllocated(kFALSE) 30 { 31 fGeomCam = (MGeomCam*)geom; // FIXME: Clone doesn't work! (MGeomCam*)geom->Clone(); 32 32 33 33 // … … 53 53 // set the color palette for the TBox elements 54 54 // 55 #if ROOT_VERSION_CODE < ROOT_VERSION(3,01,06) 55 56 gStyle->SetPalette(1, 0); 57 #else 58 gStyle->SetPalette(51, 0); 59 #endif 56 60 57 61 // … … 81 85 MCamDisplay::~MCamDisplay() 82 86 { 87 fPixels->Delete(); 88 fLegend->Delete(); 89 fLegText->Delete(); 90 83 91 delete fPixels; 84 92 delete fLegend; 85 93 delete fLegText; 86 94 87 delete fGeomCam; 95 // delete fGeomCam; 96 97 if (fIsAllocated) 98 delete fDrawingPad; 88 99 } 89 100 … … 157 168 // gPad->SetFixedAspectRatio() 158 169 170 if (fDrawingPad) 171 return; 172 159 173 // 160 174 // if no canvas is yet existing to draw into, create a new one 161 175 // 162 176 if (!gPad) 177 { 163 178 fDrawingPad = new TCanvas("CamDisplay", "Magic Camera Display", 0, 0, 750, 600); 179 fIsAllocated = kTRUE; 180 } 164 181 else 182 { 165 183 fDrawingPad = gPad; 184 fIsAllocated = kFALSE; 185 } 166 186 167 187 fDrawingPad->SetBorderMode(0); … … 176 196 // Setup the correct environment 177 197 // 198 #if ROOT_VERSION_CODE < ROOT_VERSION(3,01,06) 178 199 gStyle->SetPalette(1, 0); 200 #else 201 gStyle->SetPalette(51, 0); 202 #endif 179 203 180 204 gPad->SetFillColor(22); … … 220 244 void MCamDisplay::DrawPhotNum(const MCerPhotEvt *event) 221 245 { 246 if (!event) 247 return; 248 222 249 if (!fDrawingPad) 223 250 Draw(); -
trunk/MagicSoft/Mars/mgui/MCamDisplay.h
r1203 r1325 38 38 UInt_t fH; // Height of canvas 39 39 TVirtualPad *fDrawingPad; // pad in which we are drawing 40 Bool_t fIsAllocated; 40 41 41 42 TBox *GetBox(Int_t i) { return (TBox*) fLegend->At(i); }
Note:
See TracChangeset
for help on using the changeset viewer.