Changeset 2416 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 10/20/03 21:32:30 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r2386 r2416 72 72 #include <fstream> // ofstream, SavePrimitive 73 73 74 #include <TRint.h> // gApplication, TRint::Class() 74 75 #include <TTime.h> // TTime 75 76 #include <TFile.h> // gFile … … 370 371 gSystem->ProcessEvents(); 371 372 #else 372 if (fDisplay) 373 gSystem->ProcessEvents(); 374 else 375 if (fProgress) 376 gClient->ProcessEventsFor(fProgress); 373 // FIXME: This is a workaround, because TApplication::Run is not thread safe against ProcessEvents 374 if (gApplication->InheritsFrom(TRint::Class())) 375 { 376 if (fDisplay) 377 gSystem->ProcessEvents(); 378 else 379 if (fProgress) 380 gClient->ProcessEventsFor(fProgress); 381 } 377 382 #endif 378 383 … … 469 474 { 470 475 fProgress->SetPosition(maxcnt>0 ? TMath::Min(maxcnt, entries) : entries); 476 // FIXME: This is a workaround, because TApplication::Run is not thread safe against ProcessEvents 477 if (gApplication->InheritsFrom(TRint::Class())) 478 { 471 479 #if ROOT_VERSION_CODE < ROOT_VERSION(3,02,06) 472 gSystem->ProcessEvents();480 gSystem->ProcessEvents(); 473 481 #else 474 gClient->ProcessEventsFor(fDisplay ? fDisplay->GetBar() : fProgress);482 gClient->ProcessEventsFor(fDisplay ? fDisplay->GetBar() : fProgress); 475 483 #endif 484 } 476 485 } 477 486 -
trunk/MagicSoft/Mars/mbase/MParContainer.cc
r2411 r2416 114 114 TObject *MParContainer::Clone(const char *newname) const 115 115 { 116 116 117 MParContainer *named = (MParContainer*)TObject::Clone(); 117 118 if (newname && strlen(newname)) named->SetName(newname); … … 583 584 return ((TEnv&)env).GetValue(prefix, dflt); 584 585 } 585 586 // --------------------------------------------------------------------------587 //588 // DrawTS which is a thread safe version of Draw. Draw589 // are also overwritten to call DrawTS. Please overwrite590 // the TS version of the member function if you want to implement591 // Draw for your class. Classes which overwrites Draw instead592 // should work well, too, except in multithreaded environments like Mona.593 //594 // The static version maybe called dor any TObject. For you class it is595 // called with a pointer to 'this' object.596 //597 void MParContainer::DrawTS(TObject *obj, TVirtualPad *pad, Option_t *option)598 {599 if (!obj)600 {601 gLog << warn << "MParContainer::DrawTS: obj==NULL" << endl;602 return;603 }604 605 if (!pad)606 pad = gPad;607 608 // FIXME: Move MH to mbase609 //if (!pad)610 // pad = MakeDefCanvas(this);611 612 if (!pad)613 {614 if (!gROOT->GetMakeDefCanvas())615 return;616 (gROOT->GetMakeDefCanvas())();617 pad = gPad;618 }619 620 if (!pad->IsEditable())621 return;622 623 obj->SetBit(kMustCleanup);624 625 pad->GetListOfPrimitives()->Add(obj, option);626 pad->Modified(kTRUE);627 }628 629 // --------------------------------------------------------------------------630 //631 // DrawCloneTS which is a thread safe version of DrawClone. DrawClone632 // are also overwritten to call DrawCloneTS. Please overwrite633 // the TS version of the member function if you want to implement634 // DrawClone for your class. Classes which overwrites DrawClone instead635 // should work well, too, except in multithreaded environments like Mona636 //637 // The static version maybe called dor any TObject. For you class it is638 // called with a pointer to 'this' object.639 //640 TObject *MParContainer::DrawCloneTS(const TObject *obj, TVirtualPad *pad, Option_t *option)641 {642 // Draw a clone of this object in the current pad643 if (!obj)644 return 0;645 646 TObject *newobj = obj->Clone();647 if (!newobj)648 return 0;649 650 /*651 gLog << dbg << "MParConatiner::DrawCloneTS - ";652 gLog << (int)newobj->InheritsFrom(MParContainer::Class()) << " ";653 gLog << pad << endl;654 */655 if (newobj->InheritsFrom(MParContainer::Class()))656 ((MParContainer*)newobj)->DrawTS(pad, strlen(option) ? option : obj->GetDrawOption());657 else658 DrawTS(newobj, pad, strlen(option) ? option : obj->GetDrawOption());659 660 return newobj;661 } -
trunk/MagicSoft/Mars/mbase/MParContainer.h
r2411 r2416 129 129 const char *GetEnvValue(const TEnv &env, TString prefix, const char *dflt) const; 130 130 131 static void DrawTS(TObject *obj, TVirtualPad *pad=NULL, Option_t *option="");132 virtual void DrawTS(TVirtualPad *pad=NULL, Option_t *option="")133 {134 DrawTS(this, pad, option);135 }136 void Draw(Option_t *option="") { DrawTS(NULL, option); }137 138 static TObject *DrawCloneTS(const TObject *obj, TVirtualPad *pad=NULL, Option_t *option="");139 virtual TObject *DrawCloneTS(TVirtualPad *pad=NULL, Option_t *option="") const140 {141 return DrawCloneTS(this, pad, option);142 }143 TObject *DrawClone(Option_t *option="") const144 {145 return DrawCloneTS(NULL, option);146 }147 148 131 ClassDef(MParContainer, 0) //The basis for all parameter containers 149 132 };
Note:
See TracChangeset
for help on using the changeset viewer.