Presentation is loading. Please wait.

Presentation is loading. Please wait.

CHEP06, Mumbai, India 13-17 February 2006 General Status of ROOT GUI Ilka Antcheva, Bertrand Bellenot, René Brun, Valeriy Onuchin *, Fons Rademakers CERN,

Similar presentations


Presentation on theme: "CHEP06, Mumbai, India 13-17 February 2006 General Status of ROOT GUI Ilka Antcheva, Bertrand Bellenot, René Brun, Valeriy Onuchin *, Fons Rademakers CERN,"— Presentation transcript:

1 CHEP06, Mumbai, India 13-17 February 2006 General Status of ROOT GUI Ilka Antcheva, Bertrand Bellenot, René Brun, Valeriy Onuchin *, Fons Rademakers CERN, Geneva, Switzerland * IHEP, Protvino, Russia

2 ROOT GUI CHEP06, Mumbai, India 13-17 February 2006 2 Overview Basic Features Canvas Interface New and Improved Widgets Graphics Editor Style Manager GUI Builder ROOT and Qt Conclusions

3 ROOT GUI CHEP06, Mumbai, India 13-17 February 2006 3 Basic Features (1) ROOT as a high-energy physics (HEP) analysis framework provides a large selection of HEP specific objects and utilities. Graphical capabilities of ROOT range from 2 D primitives to various plots, histograms, and 3 D graphical objects. The GUI class library contains a rich and complete set of widgets and makes it easy to write visually attractive applications that are ready to run on different environments. The object-oriented framework offers considerable benefits for developing object-oriented user interfaces. The user interface developments respond dynamically to the user needs, increasing their productivity and confidence in the system.

4 ROOT GUI CHEP06, Mumbai, India 13-17 February 2006 4 fText = new TGTextEntry(fMain, new TGTextBuffer(100)); fText->SetToolTipText("Enter the label and hit Enter key"); fText->Connect("ReturnPressed()", "MyDialog", this, "DoSetlabel()"); fMain->AddFrame(fText, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5)); fGframe = new TGGroupFrame(fMain, "Last File"); fLabel = new TGLabel(fGframe, "No Intut "); fGframe->AddFrame(fLabel, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5)); fMain->AddFrame(fGframe, new TGLayoutHints(kLHintsExpandX, 2, 2, 1, 1)); … // fText = new TGTextEntry(fMain, new TGTextBuffer(100)); // fText->SetToolTipText("Enter the label and hit Enter key"); // fText->Connect("ReturnPressed()", "MyDialog", this, "DoSetlabel()"); // fMain->AddFrame(fText, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5)); fGframe = new TGGroupFrame(fMain, "Last File"); fLabel = new TGLabel(fGframe, "No Intut "); fGframe->AddFrame(fLabel, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5)); fText = new TGTextEntry(fGframe, new TGTextBuffer(100)); fText->SetToolTipText("Enter the label and hit Enter key"); fText->Connect("ReturnPressed()", "MyDialog", this, "DoSetlabel()"); fText->Resize(150, fText->GetDefaultHeight()); fGframe->AddFrame(fText, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5)); fMain->AddFrame(fGframe, new TGLayoutHints(kLHintsExpandX, 2, 2, 1, 1)); root [0].x myDialog.C root [1] root [0].x myDialog.C root [1].x myDialog.C Basic Features (2) Cross-platform GUIs – consistent look; no need to implement specific code for each platform. Fast GUI prototyping thanks to CINT – a command and script interpreter supporting pure C++ code: From simple sequence of statements to complex class and method definitions No need for special preprocessors or compilation

5 ROOT GUI CHEP06, Mumbai, India 13-17 February 2006 5 Basic Features (3) Signals/Slots communication mechanism is integrated into ROOT core by TQObject, TQConnection, TQClass Uses dictionary information and the CINT interpreter to connect signal methods to slot methods Facilitates programming since it allows a total independence of the interacting classes Different components snap together like Lego blocks, leaving possibilities for adding new pieces in the future (by just connecting to the signals)

6 ROOT GUI CHEP06, Mumbai, India 13-17 February 2006 6 On interactions, widgets send out various signals (event senders) Public object methods can be used as slots (event receivers) Signals and slots can be connected together fHslider1 = new TGTripleHSlider(fHframe1, 190, kDoubleScaleBoth, HSId1,…); fHslider1->Connect("PositionChanged()", "TTripleSliderDemo", this, "DoSlider()"); virtual void PointerPositionChanged() { Emit("PointerPositionChanged()"); } //*SIGNAL* void TTripleSliderDemo::DoSlider() { // Slot method. Redraw the function in the canvas window according to the // parameters and range set by slider after user interactions. … } Basic Features (4)

7 ROOT GUI CHEP06, Mumbai, India 13-17 February 2006 7 Basic Features (5) Using Ctrl+S any GUI can be saved as a C++ macro via the widget SavePrimitive() methods. This macro can be edited and then executed via the CINT interpreter. Executing the macro restores the complete original GUI. However, currently, the signal/slot connections are not yet restored. This will be coming though. // transient frame TGTransientFrame *frame2 = new TGTransientFrame(gClient->GetRoot(),760,590); // group frame TGGroupFrame *frame3 = new TGGroupFrame(frame2,"curve"); TGRadioButton *frame4 = new TGRadioButton(frame3,"gaus",10); frame3->AddFrame(frame4); root [0].x example.C

8 ROOT GUI CHEP06, Mumbai, India 13-17 February 2006 8 Basic Features ( 6 )

9 ROOT GUI CHEP06, Mumbai, India 13-17 February 2006 9 The dockable tool bar provides shortcuts for menu’s and buttons for primitive drawing The Editor pane provides a GUI for editing attributes of the objects drawn in the canvas window The Style Manager handles general graphics settings and style editing The Fit Panel provides the GUI for histograms and graphs fitting Editor Pane Style Manager Toolbar Canvas Interface

10 ROOT GUI CHEP06, Mumbai, India 13-17 February 2006 10 New and Improved Widgets (1) TGDockableFrame widget - allows the undocking/docking of menus, tool or status bars, or the collapsing of these bars. MDI (Multiple Document Interface) widgets

11 ROOT GUI CHEP06, Mumbai, India 13-17 February 2006 11 New and Improved Widgets (2)  Triple slider widget ‘Pseudo-windows' concept allows to draw & scroll more than 25 000 items TGListView TGListBox TGListTree TGComboBox

12 ROOT GUI CHEP06, Mumbai, India 13-17 February 2006 12 New and Improved Widgets (3) TGListTree Checkboxes on the tree nodes turn on/off pieces of the tree hierarchy

13 ROOT GUI CHEP06, Mumbai, India 13-17 February 2006 13 Graphics Editor (1) Object orientation of editor design: Allows the editing of object attributes in the canvas Presents the right editor at the right moment according to the selected object in the canvas Easy-to-use Freedom to expand by using editor plug-ins

14 ROOT GUI CHEP06, Mumbai, India 13-17 February 2006 14 Modular – loads corresponding editor Editor according to the of the selected object, e.g. TArrow  TArrowEditor Algorithm: Searches for a class name Editor (correct naming is important). Checks that this class derives from TGedFrame (the editor base class). Makes an instance of the class editor using the TROOT::ProcessLine method. Scans all base classes for corresponding object editors. Can be extended easily by any user-defined object editor - this makes GUI design easier and adaptive to the users expertise. Graphics Editor (2) TArrow TAttMarker TCurlyArc TH1 TPad TAttFill TAttText TCurlyLine TH2 TPaveStats TAttLine TAxis TFrame TGraph...

15 ROOT GUI CHEP06, Mumbai, India 13-17 February 2006 15 Manages a collection of TStyle objects that handle graphics attributes. Applies selected style on all canvases or just on the selected object Allows editing of the selected TStyle object Protects users from errors – they can go back to a previous saved state easily Provides dynamic feedback in a preview window The style manager elements are grouped by the functionality they set Style Manager

16 ROOT GUI CHEP06, Mumbai, India 13-17 February 2006 16 GUI Builder Allows to create interactively GUIs based on the ROOT widget classes Uses Ctrl+S or the SaveAs dialog; users can generate C++ code in a macro that can be edited and executed via the CINT interpreter: root [0].x example.C // transient frame TGTransientFrame *frame2 = new TGTransientFrame(gClient->GetRoot(),760,590); // group frame TGGroupFrame *frame3 = new TGGroupFrame(frame2,"curve"); TGRadioButton *frame4 = new TGRadioButton(frame3,"gaus",10); frame3->AddFrame(frame4); frame2->SetWindowName(“Fit Panel"); frame2->MapSubwindows(); frame2->Resize(frame2->GetDefaultSize()); frame2->MapWindow(); }

17 ROOT GUI CHEP06, Mumbai, India 13-17 February 2006 17 ROOT and Qt (1) Qt BNL (in ROOT CVS since 2004) Uses Qt as a render engine for all ROOT graphics (GUI and Canvas) via TGQt ROOT Canvases can be embedded in Qt widgets See talk 158 by Valeri Fine Qt GSI (works since many years on Linux, Windows port currently under development) Lightweight interface that uses the Qt event loop to drive Qt widgets and the ROOT event loop to handle all ROOT events: GUI, timers, signals, etc. Qt widgets are rendered via Qt, ROOT widgets are rendered either via TGX11 or TGWin32GDK ROOT Canvases can be embedded in Qt widgets

18 ROOT GUI CHEP06, Mumbai, India 13-17 February 2006 18 ROOT and Qt (2) Qt BNL Qt GSI

19 ROOT GUI CHEP06, Mumbai, India 13-17 February 2006 19 Conclusions The ROOT GUI is a rich and powerful scriptable cross-platform GUI library It provides a solid basis for the development of many additional widgets and GUI components, like a Fit Panel, Help browser, object editors and event displays The GUI builder will make the task of designing complicated GUI’s much easier The different ROOT/Qt integration interfaces give Qt users easy access to the ROOT graphics in their Qt-based GUI’s


Download ppt "CHEP06, Mumbai, India 13-17 February 2006 General Status of ROOT GUI Ilka Antcheva, Bertrand Bellenot, René Brun, Valeriy Onuchin *, Fons Rademakers CERN,"

Similar presentations


Ads by Google