Ignore:
Timestamp:
10/20/03 21:32:30 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MParContainer.cc

    r2411 r2416  
    114114TObject *MParContainer::Clone(const char *newname) const
    115115{
     116
    116117   MParContainer *named = (MParContainer*)TObject::Clone();
    117118   if (newname && strlen(newname)) named->SetName(newname);
     
    583584    return ((TEnv&)env).GetValue(prefix, dflt);
    584585}
    585 
    586 // --------------------------------------------------------------------------
    587 //
    588 // DrawTS which is a thread safe version of Draw. Draw
    589 // are also overwritten to call DrawTS. Please overwrite
    590 // the TS version of the member function if you want to implement
    591 // Draw for your class. Classes which overwrites Draw instead
    592 // should work well, too, except in multithreaded environments like Mona.
    593 //
    594 // The static version maybe called dor any TObject. For you class it is
    595 // 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 mbase
    609     //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. DrawClone
    632 // are also overwritten to call DrawCloneTS. Please overwrite
    633 // the TS version of the member function if you want to implement
    634 // DrawClone for your class. Classes which overwrites DrawClone instead
    635 // should work well, too, except in multithreaded environments like Mona
    636 //
    637 // The static version maybe called dor any TObject. For you class it is
    638 // 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 pad
    643     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     else
    658         DrawTS(newobj, pad, strlen(option) ? option : obj->GetDrawOption());
    659 
    660     return newobj;
    661 }
Note: See TracChangeset for help on using the changeset viewer.