| 1 |
// @(#)root/graf:$Name: $:$Id: TMultiGraph.cxx,v 1.9 2002/02/24 18:01:15 brun Exp $ |
// @(#)root/graf:$Name: $:$Id: TMultiGraph.cxx,v 1.10 2002/07/15 15:03:38 brun Exp $ |
| 2 |
// Author: Rene Brun 12/10/2000 |
// Author: Rene Brun 12/10/2000 |
| 3 |
|
|
| 4 |
/************************************************************************* |
/************************************************************************* |
| 70 |
|
|
| 71 |
|
|
| 72 |
if (!fGraphs) return; |
if (!fGraphs) return; |
| 73 |
|
TGraph *g; |
| 74 |
|
TIter next(fGraphs); |
| 75 |
|
while ((g = (TGraph*) next())) { |
| 76 |
|
g->ResetBit(kMustCleanup); |
| 77 |
|
} |
| 78 |
fGraphs->Delete(); |
fGraphs->Delete(); |
| 79 |
delete fGraphs; |
delete fGraphs; |
| 80 |
fGraphs = 0; |
fGraphs = 0; |
| 88 |
// add a new graph to the list of graphs |
// add a new graph to the list of graphs |
| 89 |
|
|
| 90 |
if (!fGraphs) fGraphs = new TList(); |
if (!fGraphs) fGraphs = new TList(); |
| 91 |
|
graph->SetBit(kMustCleanup); |
| 92 |
fGraphs->Add(graph,chopt); |
fGraphs->Add(graph,chopt); |
| 93 |
} |
} |
| 94 |
|
|
| 187 |
{ |
{ |
| 188 |
// paint all the graphs of this multigraph |
// paint all the graphs of this multigraph |
| 189 |
|
|
| 190 |
|
if (fGraphs->GetSize() == 0) return; |
| 191 |
|
|
| 192 |
char *l; |
char *l; |
| 193 |
static char chopt[33]; |
static char chopt[33]; |
| 194 |
Int_t nch = strlen(option); |
Int_t nch = strlen(option); |
| 342 |
} |
} |
| 343 |
|
|
| 344 |
//______________________________________________________________________________ |
//______________________________________________________________________________ |
| 345 |
|
void TMultiGraph::RecursiveRemove(TObject *obj) |
| 346 |
|
{ |
| 347 |
|
// Recursively remove this object from a list. Typically implemented |
| 348 |
|
// by classes that can contain mulitple references to a same object. |
| 349 |
|
|
| 350 |
|
if (!fGraphs) return; |
| 351 |
|
TObject *objr = fGraphs->Remove(obj); |
| 352 |
|
if (!objr) return; |
| 353 |
|
delete fHistogram; fHistogram = 0; |
| 354 |
|
if (gPad) gPad->Modified(); |
| 355 |
|
} |
| 356 |
|
|
| 357 |
|
//______________________________________________________________________________ |
| 358 |
void TMultiGraph::SavePrimitive(ofstream &out, Option_t *option) |
void TMultiGraph::SavePrimitive(ofstream &out, Option_t *option) |
| 359 |
{ |
{ |
| 360 |
// Save primitive as a C++ statement(s) on output stream out |
// Save primitive as a C++ statement(s) on output stream out |