[ROOT] Erasing a TPolyLine and TLine

From: Kevin Reil (reil@cosmic.utah.edu)
Date: Tue Jul 18 2000 - 05:44:45 MEST


TCanvas *c1 = new TCanvas (stuff);
TCanvas *c2= new TCanvas(stuff);

vector<TLine*> lines1;
vector<TPolyLine3D*> lines2;

for each event
{
c1->cd();
for (int i=0; i<numlines; ++i) {	
	TLine *tl = new TLine(stuff)
	tl->Draw();
	lines1.push_back(tl);
}

similar for 3D lines on canvas 2.

I draw/create them just fine.  But I want to clear the vectors of 
lines between events and cannot seem to erase them.  Suggestions?

I am not sure if it is my c++ or simple lack of knowledge about the 
"deleting" of lines rom canvases.

When I creating an instance of *tl and then push it to the vector is it 
being lost over the next loop.  IE should I create a vector<TLine> lines; 
and push_back(*tl)?

-------------------------------------------
- Kevin Reil                              -
- 244A INSCC                              -
- (801) 587-9744                          -
- http://www.physics.utah.edu/~reil       -
- reil@physics.utah.edu                   -
-------------------------------------------
- And my father dwelt in a tent.          -
-------------------------------------------



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:30 MET