STAR |
TG...
classes ?
libGQt.DLL is the Qt-based implementation of the TVirtualX ROOT abstract interface with the low level local graphics subsystem (X11 or Win32 for example).
The "Qt ROOT extensions" shared libraries (DLLs) contain the implementations of other abstract interfaces those the TGuiFactory and TThreadFactory ROOT classes are supposed to provide:
In addition for X11 platform and "old
ROOT versions TQtViewerX3D
is provided also. This viewer is no use for Windows because
the x3d
package is a "pure" X11 application.
The main goal of these exercises is to build the ROOT code free of the platform (X11 / WIN32) dependencies.
To turn it ON/OFF you should apply the ROOT-provided plugin mechanizm by customizing the default ROOT resource file.
That is the "system.rootrc"
and it can be found under you $ROOTSYS/etc/
directory.
As an alternative you can turn ON the Qt layers by providing your own version of the user ".rootrc"
resource file.
There are two resource files to tune ON the "Qt layer" and "Qt extensions" all together one for UNIX and other one for Windows system. You are free to add this file either to your home directory or to your current working directory.
To turn ON all Qt layers pick the appropriated version of this resource file and copy (link) it into your ".rootrc"
then start (re-start) ROOT as usually
You may opt to turn ON the "Qt layer" (with no "Qt extension") only by selecting another version of the resource file. (For the time being this is available for UNIX platform only)
To turn Qt layes OFF just remove the said resource file or restore the original default value of the "system.rootrc"
file
then re-start ROOT.
Note: The "Qt extensions" are not the part of the official ROOT distribution.
On UNIX one may want to turn X3D viewer on also.
No change and re-compilation are required.
benhmarks.C
macros
from $ROOTSYS/tutorials
subdirectory.
The table above was done for the optimized version of Qt and ROOT libraries.
On Unix platform the number I got running one and the same binaries by switching the Gui.Backend root resource file parameter. In other word one and the same shared libraries and main root.exe executable were loaded, the same CPU, compiler ,compilation option were applied. It was measured with the remote X-server (it was eXceed)
The number varies greatly depends of whether you work remotely
or locally and whether you use any intermediate security protocol / tunnel (ssh, for example).
Anyway the ROOT benchmark above is what the STAR collaboration at BNL can gain with the existent BNL cluster connection policy.
Please, send me you number to create the whole picture.
The source code of "Qt layer" is available via ROOT CVS repository. "Qt layer" is a part of "ROOT Qt extensions" and that is available from the BNL CVS repostitory as well as a tar-ball. It contains the very latest the developers are working on. If you need a specific fix only available in the development version or you want to upgrade the "Qt layer" of your existent ROOT installation (for example ROOT 3.10.02 / 4.00.04 / 4.00.08 / 4.00.08a) and you do not want to change the ROOT version itself, then this is the way to get it.
What is CVS? CVS is the Concurrent Versions System. Start at CVShome's pages to learn more and read the tutorial.
Anyone can check out the sources via CVS, but only certain people have the ability to check in.
To check out the sources, you need to be running CVS 1.10 or later (check by doing cvs -v), and have your $CVSROOT set to
:pserver:cvsuser@cvs.bnl.gov:/data01/CVS
The password for user cvsuser is cvsuser.
Two cvs
commands will do the job:
cvs -d :pserver:cvsuser@cvs.bnl.gov:/data01/CVS login
cvs -d :pserver:cvsuser@cvs.bnl.gov:/data01/CVS co -d qtRoot root
The supporting documentation is kept separately and it can be retrieved from the CVS repository also.
The CVS command:
cvs -d :pserver:cvsuser@cvs.bnl.gov:/data01/CVS co qtrootdoc
will do the job.
ROOT CVS Web page contains some useful details as well.
In addition there is a "low level"
Qt padPainted(QPixmap*)
signal. It is emitted when a pixmap of TPad class
object has been painted onto the parent TPad pixmap. QPixmap*
is a pixmap corresponding
to the particular TPad or TCanvas.
Since TGQt class is not derived from Q_OBJECT
a special TQtEmitter class to emit the signal
on behalf of TGQt object is introduced.
To connect the TGQt padPainted(QPixmap*)
signal with the user class slot one needs
to establish a connection as follows:
connect(((TGQt *)gVirtualX)->Emitter(),SIGNAL(padPainted(QPixmap*)), SLOT(updatePad(QPixmap*)));
See: $ROOTSYS/test/qt/xform.cpp code for example.
TQtWidget
designed to provide the so-called
embedded TCanvas.
TQtWidget
is derived from Qt
QWidget class.
This class constructor looks as follows:
TQtWidget::TQtWidget( QWidget* parent=0, const char* name=0, WFlags f=Qt::WStyle_NoBorder, bool embedded=FALSE)
:QWidget(parent,name,f)
{
. . .
setWFlags(getWFlags () | Qt::WRepaintNoErase);
if (embedded) fCanvas = new TCanvas(name, 4, 4, TQt::iwid(this));
. . .
}
See the ROOT User's Guide v5.14 the chapter ROOT / Qt Integration Interfaces, section "TQtWidget Qt Signals", p.421
See: $ROOTSYS/test/qt/xform.cpp code for example.
Another good example is the Qt-edition of the RootShower package (look up your $ROOTSYS/test/qtRootShower
directory.
"xform.CC"
macro provided. This macro uses the slightly modified
TrollTech example and the regular
ROOT "demos.C" macro. The source of the modified xform.cpp code
can be found under $ROOTSYS/test/qt
directory.
There are the "diff"
file and the original code also to compare.
To build the example from the scratch xform.pro
qmake profile is provided.
The profile is to build a Qt-based ROOT loadable DLL
(the original TrollTech profile creates a Qt-based stand-alone application).
See the ROOT User's Guide v5.14 the chapter ROOT / Qt Integration Interfaces, also.
See the ROOT User's Guide v5.14 the chapter ROOT / Qt Integration Interfaces, , section "Using Qt "Designer" to Create Qt GUI with Embedded ROOT Objects", p.419 also.
The BNL CVS repository contains several Qt projects created with Qt 3.3 to demonstrate how QT designer can be used to create the Qt applications with the ROOT-based embedded elements.
To do that you should download
the custom widget definition
for TQtWidget class. One can pick it from his/her ROOT source tree also.
Look for the file $ROOTSYS/qt/inc/TQtWidget.cw
.
There are three examples, the simple (number #1, 60 lines of the "handwritten" C++ code), advanced (number #3, 400 lines of the "handwritten" C++ code) one, and the trivial (number #2, it contains no "handwritten" C++ code at all) one.
You can download the working simple Qt "ROOT histogram browser" project, read README file and try it yourself. This example need the "QT layer" to be installed only.
To build and run this example you have to install the "ROOT Qt Extensions" as well.
Note: The "custom widget descriptor" and the Qt project rely on the version of the "Qt layer" from ROOT 4.01.01.
If you want to try it with other ROOT versions your should have your "Qt layer version"upgraded .
rootcint.pri
qmake include
file in the regular ROOT include directory - $ROOTSYS/include/rootcint.pri
The file defines the special "qmake" rule" to generate RootCint dictionary for the current QMAKE_TARGET.
RootShower.pro
to build the Qt version of RootShower test.
See the ROOT User's Guide v5.14 the chapter ROOT / Qt Integration Interfaces, , section "Qt Project for Creation of ROOT Shared Libraries with Qt Components and ROOT Dictionaries", p.417 also.
TG...
classes ?
libGQt.DLL
and libQtGui.DLL
INSTEAD of libWin32gdk.DLL
.
The distribution contains both kind of libraries in question.
1,598,500 libCint.dll
3,587,828 libCore.dll
403,500 libEG.dll
887,420 libGpad.dll
1,241,324 libGraf.dll
800,860 libGraf3d.dll
2,333,944 libGui.dll
1,388,764 libHist.dll
297,572 libHistPainter.dll
182,752 libHtml.dll
353,732 libMatrix.dll
410,784 libMinuit.dll
44,920 libNew.dll
244,096 libPhysics.dll
272,392 libPostscript.dll
331,296 libProof.dll
1,598,748 libGQt.dll
2,933,044 libQtGui.dll
738,016 libRGL.dll
282,852 libRint.dll
893,460 libStar.dll
817,988 libTree.dll
408,380 libTreePlayer.dll
571,180 libTreeViewer.dll
690,504 libWin32gdk.dll
There is a simple way to switch from one interface to another one with no change of the user code or any re-compilation
of your code.
Since the new source doesn't contain any call to WIN32 API
this suggests it can be ported more /less easy to
the platforms Qt supports
Please find there the lines:
http://www.trolltech.com/developer/platforms
http://www.trolltech.com/products/qt/windows.html
There is a free version of
Q... On Windows .
That I did not test myself yet.
If your lack of
money (Amazon.com sells it for $31.49) but have plenty of spare time (:-) then you may have installed Cygwin, and X11-free Qt edition, and
install Root with Qt layer, using Cygwin environment.
Be aware you need to install the special "cygwin version" of Qt.
The recenly introduced Academic and Education licenses may help you also.
The last good news. TrolltTech had announced the coming new version of Qt -
Qt4 will be "Open Source" for Windows platform also
(in other word one can use it for free for non-commercial applications).
But you have to use gcc compiler only:-(
Here you are:
An AFS version for Red Hat Linux 7.1 gcc 2.96-98 can be found and try also:
You
can select gcc 2.95 or Sun CC5 version as well by replacing the environment QTSYS variable as follows
setenv QTSYS i386_linux24
setenv ROOTSYS /afs/rhic/star/ROOT/3.05.04.qt/.$QTSYS/rootdeb
setenv QTDIR /afs/rhic/$QTSYS/opt/star/qt
setenv LD_LIBRARY_PATH $ROOTSYS/lib:$QTDIR/lib:$LD_LIBRARY_PATH
setenv PATH $ROOTSYS/bin:$QTDIR/bin:$PATH
setenv QTSYS i386_linux22
or
setenv QTSYS sun4x_58
Very likely you forgot to adjust your ROOT system system.rootrc
resource file.
This file can be found under $ROOTSYS/etc/system.rootrc
Plugin.TViewerX3D: * TViewerX3D X3d "TViewerX3D(TVirtualPad*,Option_t*,const char*,UInt_t,UInt_t)"
and replace it as follows:
# Plugin.TViewerX3D: * 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)"
Check whether you turn the ROOT QT GUI backend on properly.
"$ROOTSYS/TQtUtil.h"
provides several functions
to get an access to the platform specific and Qt specific information to allow the
platform specific optimization.
//_______________________________________
QPixmap *padPixmap(TPad *pad)
{return (QPixmap *)TQt::iwid(pad->GetPixmapID());}
//_______________________________________
QWidget *canvasWidget(TCanvas *c)
{ return (QWidget *)TQt::iwid(c->GetCanvasID());}
//_______________________________________
QWidget *canvasWidget(TCanvasImp *c)
{ return (QWidget *) TQt::iwid(((TQtCanvasImp *)c)->GetCanvasImpID());}
//_______________________________________
QWidget *mainWidget(TCanvas *c)
{ return canvasWidget(c->GetCanvasImp()); }
//_______________________________________
HDC hdcWin32(TPad *pad)
{ return padPixmap(pad)->handle(); }
//_______________________________________
HDC hdcWin32(TCanvas *c)
{ return canvasWidget(c)->handle(); }
//_______________________________________
HDC hdcWin32(TCanvasImp *c)
{ return canvasWidget(c)->handle(); }
//_______________________________________
HWND hwndWin32(TCanvas *c)
{ return canvasWidget(c)->winId(); }
//_______________________________________
HWND hwndWin32(TCanvasImp *c)
{ return canvasWidget(c)->winId(); }
"... Qt/Windows is source compatible with Qt/X11 and Qt/Mac.
Code written for one compiles and runs on the others. ... "
The official Qt Book "C++ GUI Programming with Qt 3" includes a CD with a special non-commercial (NC) "book-version" of Qt/Windows 3.2.
The NC version is fully functional and not limited by anything but its non-commercial license.
See: Axel Naumann's ROOT page.
See for example:
(Please, take in account I am not the professor of law, this is just what I think myself :=)
Write the pixmap wid in the bitmap file pxname. wid : Pixmap address w,h : Width and height of the pixmap. pxFileName : pixmap file name The format is defined by the file name extension like "png","jpg","bmp" . . . If no or some unknown extension is provided then the "png" format is used "by default"
For example to create a JPEG file of the current TPad object one can use the following statement:
It creates a pixmap object 240 pixel x 120 pixel and
writes it into the "pad.jpg" file in JPEG format. If the size of the original
TPad does not match the requirement it will be scaled properly.
gVirtualX->WritePixmap(gPad->GetPixmapID(),240,120,"pad.jpg")
The full list of the available pixmap formats is defined by your local Qt installation
TVirtualX::WriteGIF(char *fileName)
Writes the current window into pixmap file.
Returns:
1 in case of success,
0 otherwise
This is a member function, provided for convenience and for the sake of the backward compatibility.
It behaves essentially like the above function. However it preserves the original pixmap size.
Be aware calling this method from the ROOT prompt may produce
the confusing result. The current window will be that "ROOT prompt widget"
(telnet or MS DOS) rather the last selected ROOT TCanvas.
- void TImage::WriteImage(const char* file, TImage::EImageFileTypes type = kUnknown)
One can use a Qt implementation of TImage ROOT class.
The ROOT macro rose_image.C
and pad2png.C show simple examples.
To get it works with Qt-layer one should not forget to add to his/her ROOT resource file
".rootrc" the TImage plug-in implementation (based on
QImage class).
If the only thing you need is a pixmap copy of your Canvas/Pad the
WritePixmap(int wid, UInt_t w, UInt_t h, char *pxFileName) is recommended.
> Xvfb :1 &
> setenv DISPLAY :1
> root.exe -q '[your favorite ROOT macro here.C ]'
If your "frame buffer" supports GLX protocol then you can create 3D OpenGL images in batch
(for example, with the Web server) as well.
For example Exceed says:
You need to install Exceed 3D on your PC and enable the GLX
extension
(Xconfig/Protocol).
XWin32 Windows based X_Server does support GLX prtocol also.
http://www.geocities.com/SiliconValley/Vista/7184/guitool.html"