Re: TPolyLine3D::Draw() before and after saving

Rene Brun (Rene.Brun@cern.ch)
Tue, 25 May 1999 11:21:06 +0000


Hi Valeri,
Following your previous report about TPolymarker3D, I already fixed
this problem in the development version. TPolyLine3D in 2.21/08 did not
restore correctly the member fLastPoint.

Rene Brun

Tioukov Valeri wrote:
>
> Hi rooters,
>
> In the following macro I create the TPolyLine3D consisting from 2
> points. If I do l->Draw() it draws "-" as expected.
> After saving to file and restoring it draws "L" instead where the 3-d
> point is 0,0,0.
>
> Seems very strange, because l->Print() gives 2 points as well.
>
> --------------------------------------l.C--------------------
> TCanvas sky( "sky", "???", 300, 10, 700, 500 );
>
> void w()
> {
> Float_t p[2][3] = {1,1,1,2,1,1};
> TPolyLine3D *l = new TPolyLine3D(2,p);
> TFile f("l.root","RECREATE");
> l->Write("l");
> f.Write();
> f.Close();
> TView *v = new TView(1);
> v->SetRange(0,0,0,3,3,3);
> l->Draw();
> }
>
> void r()
> {
> TFile f("l.root");
> l->Print();
> TView *v = new TView(1);
> v->SetRange(0,0,0,3,3,3);
> l->Draw();
>
> Float_t *p = l->GetP();
> for(int i=0; i< l->GetN(); i++)
> printf("%d %f %f %f\n", i,p[3*i+0],p[3*i+1],p[3*i+2]);
> }
> -------------------------------------------------------------------
>
> Output is:
>
> root [0] .L l.C
> root [1] w()
> root [2] r()
> TPolyLine3D Printing N=2 Option=
> 0 1.000000 1.000000 1.000000
> 1 2.000000 1.000000 1.000000
> root [3]
>
> Regards
> Valeri