Re: problem with loaded function

Pasha Murat (murat@cdfsga.fnal.gov)
Sun, 28 Sep 1997 18:20:45 GMT


Fons Rademakers writes:
> Hi Pasha,
>
> the answer is scope. In the function example the TPaveLabel pel
> is deleted as soon as the function returns (stack variable goes out
> of scope and dtor deletes it from canvas). Use new to create TPaveLabel.
>

Hi Fons,

suppose that I have a complex object, say , drift chamber, drawing of which
requires ~10**5 graphics primitives to be put on the screen (hits, wires...)
- CDF central drift chamber for example has 3*10**4 wires:

class DRIFT_CHAMBER : public TObject {
...
void Draw (Option_t* opt);
...
};

DRIFT_CHAMBER DriftChamber;

How it is possible to draw a DriftChamber thing on the screen w/o allocating
dynamically an object per graphics primitive, but having
DRIFT_CHAMBER::Draw method drawing all of them?

Some time ago we ran into a problem with having object per primitive with OpenGL,
where there is a limit on the number of objects to be put into selection stack...

Thanks a lot, Pasha.