Re: [ROOT] How to close a x3d view in a program

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Dec 10 2003 - 23:17:29 MET


Hi Andreas,

You can something like

root > .L MyX3D.C
root > MyX3D()
root > MyX3D(); etc

with 
//file MyX3D.C
TObject *x3d=0;
TCanvas *c1=0;
void MyX3D() {
    delete x3d;
    delete c1;
    c1 = new TCanvas("c1","x3d",200,10,640,480);

    TBRIK *brik = new TBRIK("BRIK","BRIK","void",200,150,150);

    TNode *node1 = new TNode("NODE1","NODE1","BRIK");
    node1->Draw();
	
    if (!gROOT->GetClass("TViewerX3D")) gSystem->Load("libX3d");
    x3d = new TViewerX3D(c1,"","X3D viewer",800,600);
}


Rene Brun

On 
Wed, 10 
Dec 2003, 
Andreas Zoglauer wrote:

> Hello!
> 
> 
> How do I close a x3d view from within a program, i.e. without using the 
> menu bar?
> 
> A long time ago it was possible to do it with
> gROOT->ProcessLine("R__x3d->CloseWindow()")
> 
> But that's no longer working in ROOT v3.10.1
> 
> 
> Any hint is appreciated,
> Andreas
> 
> 
> A small example macro is:
> 
> void MyX3D()
> {
>     gROOT->Reset();
>     c1 = new TCanvas("c1","x3d",200,10,640,480);
> 
>     brik = new TBRIK("BRIK","BRIK","void",200,150,150);
> 
>     node1 = new TNode("NODE1","NODE1","BRIK");
>     node1->Draw();
>     c1->Update();
>     c1->x3d();
> 
>     c1->Close();
> 
>     // Here I want a command with which I can close the x3d view,
>     // but I can not find one!
> 
>     delete c1;
> }
> 
> 
> 
> 
> 
> 



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:17 MET