> > 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? ROOT's "how to Draw objects" + source code answer this question: user has to provide UsersObject::Draw method which doesn't draw anything and UsersObject::Paint method which does drawing by using TPad::DrawPrimitive (Primitive here stands for Line, Polyline etc). An code example would be extremely helpful here, because in all the tutorials only Draw method is used... (I have to admit that "Draw" is far from being the best name for the function which appends a pointer to one object to another one) BTW, we have a potential problem here. If the same object is displayed in 2 windows (for example, default and zoomed views) user has to care about having 2 different copies of the same object - otherwise the same pointer will be deleted twice when both windows are closed... This problem could be solved by introducing a class (say, TPointer) describing a smart pointer which would know whether it has actually been allocated and therefore should be deleted by the destructor or it just clones already allocated pointer so delete operator should not be called for it? May be a class providing this functionality already exists but has a name which doesn't tell it? Regards, Pasha.
This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:26:21 MET