Hi Mark, I suggest to read the chapter about Object Ownership in the Users Guide. When TPad::Clear is called, all objects that have their kCanDelete bit set are automatically deleted. This bit is set by most graphics objects constructors (but not TPolyLine3D). In the latest CVS, I have fixed this problem in the TPolyLine3D constructors. You do not need to import the latest CVS, just call TPolyLine3D *pl = new TPolyLine3D(....);; pl->SetBit(kCanDelete); kCanDelete declared in TObject Rene Brun On Fri, 21 Feb 2003, Mark Messier wrote: > > Hello, > > I'm working on an event display for the E907 experiment at FNAL and was > wondering if someone could outline the "correct" way to draw a detector > geometry and a set of TMarker3D, TPolyMarker3D, TPolyLine3D, and > TMarker3DBox together on a single pad. Unfortunately my code is a little > complicated, but here are the essentials of what I'm doing: > > // Once when display is created... > { > fFrontView = new TPad("fFrontView","FrontView",x1,y1,x2,y2); > fFrontViewV = new TView(r1, r2, 1); > fFrontView->SetView(fFrontViewV); > fFrontView->Draw(); > } > > { > // For each new event > > // Inserting this clear results in a core dump on the second event > // fFrontView->Clear(); > fFrontView->cd(); > > // Draw the detector using a TGeoVolume. If I remove the "same" I get a > // core dump > GMIPPGeo::Instance()->Top()->Draw("same"); > > // Draw collection of markers, lines etc... > f3DDisp->Draw(); > } > > The problem with this is that the TPolyLine3D's do not get cleared from > event to event (strangely the markers do get cleared). Seems that the TPad > remembers some things but not others. If I try to clear the pad > (TPad->Clear()) I get a core dump. What am I missing? > > Thanks for any help, > Mark > ========================================================================== > Mark Messier e-mail: messier@indiana.edu > Department of Physics http://www.physics.indiana.edu/~messier > Indiana University Phone: (812) 855-0236 > Bloomington, IN 47405 Fax: (812) 855-0440 > >
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:09 MET