How is it possible to access TViewerX3D object?

Hello,

How is it possible to access TViewerX3D object to change
background color for example?

Is it possible to save in any format a picture in the X3D
window?

Thanks a lot!!! :slight_smile:

Sincerely,
Sergei.

To save the x3D window as a gif file (for instance) you can use an external program like xv.
There is no method (yet) in TVirtualViewer3D to change the background color.

Yes, it works with Qt layer and Qt extention for the production ROOT version.
see: root.bnl.gov/QtRoot/QtRoot.html#x3d
root.bnl.gov/QtRoot/x3d.gif

Dear couet,

TViewerX3D inherits:

TViewerX3D -> TGMainFrame -> TGCompositeFrame -> TGFrame

and there is a member function TGFrame::SetBackgroundColor
so, I guess, had I had access to the TViewerX3D pointer
I could have changed the background color. Isn’t so?

Sincerely,
Sergei.

Dear Valeri,

The web-page suggests to replace the line

Plugin.TViewerX3D: * TViewerX3D X3d “TViewerX3D(TVirtualPad*,Option_t*,const char*,UInt_t,UInt_t)”

with line

Plugin.TViewerX3D: qt TQtViewerX3D QtX3d “TQtViewerX3D(TVirtualPad*,Option_t*,const char*,UInt_t,UInt_t)”

However I have the following in my system.rootrc file:

Plugin.TViewerX3D: x11 TViewerX3D X3d “TViewerX3D(TVirtualPad*,Option_t*,const char*,UInt_t,UInt_t)”

+Plugin.TViewerX3D: qt TQtViewerX3D QtX3d “TQtViewerX3D(TVirtualPad*,Option_t*,const char*,UInt_t,UInt_t)”

And If I delete “+” in the beginning of the second line TViewerX3D window
stops appearing at all :confused:

How should I fix it?

Sincerely,
Sergei.

[quote=“vaurynovich”]Dear couet,

TViewerX3D inherits:

TViewerX3D -> TGMainFrame -> TGCompositeFrame -> TGFrame
Sincerely,
Sergei.[/quote]

Dear Sergej. It is no as easy as one can image.
TViewerX3D is a ROOT wrapper around the “plain” X11 window" that is managed by the dedicated “C” (not C++) code and the memebr function of TGFrame is not “aware” about the plain X11 widget it is wrapped around.

No, you can not (with this implementation at least)

[quote=“vaurynovich”]Dear Valeri,

The web-page suggests to replace the line

Plugin.TViewerX3D: * TViewerX3D X3d “TViewerX3D(TVirtualPad*,Option_t*,const char*,UInt_t,UInt_t)”

with line

Plugin.TViewerX3D: qt TQtViewerX3D QtX3d “TQtViewerX3D(TVirtualPad*,Option_t*,const char*,UInt_t,UInt_t)”

However I have the following in my system.rootrc file:

Plugin.TViewerX3D: x11 TViewerX3D X3d “TViewerX3D(TVirtualPad*,Option_t*,const char*,UInt_t,UInt_t)”

+Plugin.TViewerX3D: qt TQtViewerX3D QtX3d “TQtViewerX3D(TVirtualPad*,Option_t*,const char*,UInt_t,UInt_t)”

And If I delete “+” in the beginning of the second line TViewerX3D window
stops appearing at all :confused:

How should I fix it?

Sincerely,
Sergei.[/quote]

It is a problem with the current ROOT plugin handler.

To workaround you can either

comment out the
Plugin.TViewerX3D: x11

and leave
Plugin.TViewerX3D: qt

alone (no “+”)

or provide the later within your local “.rootrc” file.
This way one may not touch the global “system.rootrc” at all.

Hope this helps

Dear Valeri,

This is exactly what I did :slight_smile: I tried to add the line without “+” to my .rootrc
file and the TViewerX3D windows stops appearing :confused:

Sincerely,
Sergei.

[quote=“vaurynovich”]
This is exactly what I did :slight_smile: I tried to add the line without “+” to my .rootrc
file and the TViewerX3D windows stops appearing :confused:

Sincerely,
Sergei.[/quote]

Did you install ROOT with “Qt layer” and “Qt extension”?

[quote=“fine”]
Did you install ROOT with “Qt layer” and “Qt extension”?[/quote]

I do not know :blush: I use the standard ROOT version ( 4.00/08 )
for our experiment (PHOBOS).

Valeri, how could I check it?

Sincerely,
Sergei.

[quote=“vaurynovich”][quote=“fine”]
Did you install ROOT with “Qt layer” and “Qt extension”?[/quote]

I do not know :blush: I use the standard ROOT version ( 4.00/08 )
for our experiment (PHOBOS).

Valeri, how could I check it?

Sincerely,
Sergei.[/quote]

You can use
ls $ROOTSYS/lib/Qt
to see the list of your libraries.

For example for STAR env one would get

[rcas6002] ~/> echo $ROOTSYS/lib
/afs/rhic.bnl.gov/star/ROOT/4.01.00/.sl302_gcc323/rootdeb/lib
[rcas6002] ~/> ls $ROOTSYS/lib/Qt
/afs/rhic.bnl.gov/star/ROOT/4.01.00/.sl302_gcc323/rootdeb/lib/libGQt.so
/afs/rhic.bnl.gov/star/ROOT/4.01.00/.sl302_gcc323/rootdeb/lib/libQtGed.so
/afs/rhic.bnl.gov/star/ROOT/4.01.00/.sl302_gcc323/rootdeb/lib/libQtGui.so
/afs/rhic.bnl.gov/star/ROOT/4.01.00/.sl302_gcc323/rootdeb/lib/libQtImage.so
/afs/rhic.bnl.gov/star/ROOT/4.01.00/.sl302_gcc323/rootdeb/lib/libQtRoot.so
/afs/rhic.bnl.gov/star/ROOT/4.01.00/.sl302_gcc323/rootdeb/lib/libQtX3d.so

No, I do not have any Qt libraries :cry:

That answers the question!!!

Thanks a lot, Valeri !!!

[quote=“vaurynovich”]No, I do not have any Qt libraries :cry:

That answers the question!!!

Thanks a lot, Valeri !!![/quote]

Ask Phobos to add them to your version.
If they any assistance I am willing to help. It should take about 10 min per platform.