Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGeoTabManager.cxx
Go to the documentation of this file.
1// @(#):$Id$
2// Author: M.Gheata
3
4/*************************************************************************
5 * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12/** \class TGeoTabManager
13\ingroup Geometry_builder
14
15Manager for all editor tabs.
16
17TGeoTreeDialog - Base class for dialog frames for selecting objects
18with a tree hierarchy. Specific implementations are:
19
20 - TGeoVolumeDialog - Special tree dialog class for selecting volumes.
21 - TGeoShapeDialog - Special tree dialog class for selecting shapes.
22 - TGeoMediumDialog - Special tree dialog class for selecting media.
23 - TGeoMaterialDialog - Special tree dialog class for selecting materials.
24 - TGeoMatrixDialog - Special tree dialog class for selecting matrices.
25 - TGeoTransientPanel - Special transient tab holding TGeo editors.
26*/
27
28#include "TROOT.h"
29#include "TClass.h"
30#include "TVirtualPad.h"
31#include "TGeoGedFrame.h"
32#include "TGTab.h"
33#include "TGLabel.h"
34#include "TGComboBox.h"
35#include "TGListTree.h"
36#include "TGTextEntry.h"
37#include "TGCanvas.h"
38#include "TGMimeTypes.h"
39
40#include "TGeoManager.h"
41#include "TGeoShape.h"
42#include "TGeoVolume.h"
43#include "TGeoMedium.h"
44#include "TGeoMaterial.h"
45#include "TGeoMatrix.h"
46
47#include "TGedEditor.h"
48#include "TGeoTabManager.h"
49#include "TVirtualX.h"
50
52
53
54////////////////////////////////////////////////////////////////////////////////
55/// Ctor.
56
58{
59 fGedEditor = ged;
60 fPad = ged->GetPad();
61 fTab = ged->GetTab();
62 fVolume = nullptr;
63 fShapePanel = nullptr;
64 fMediumPanel = nullptr;
65 fMaterialPanel = nullptr;
66 fMatrixPanel = nullptr;
67 fVolumeTab = nullptr;
68 fgEditorToMgrMap.Add(ged, this);
69}
70
71////////////////////////////////////////////////////////////////////////////////
72/// Dtor.
73
75{
77 if (fShapePanel)
78 delete fShapePanel;
80 delete fMaterialPanel;
81 if (fMatrixPanel)
82 delete fMatrixPanel;
83 if (fMediumPanel)
84 delete fMediumPanel;
85}
86
87////////////////////////////////////////////////////////////////////////////////
88/// Static method to cleanup hierarchically all daughters of a composite frame.
89/// Does not remove the frame itself.
90
92{
94 TList *list = frame->GetList();
95 Int_t nframes = list->GetSize();
96 TClass *cl;
97 for (Int_t i = 0; i < nframes; i++) {
98 el = (TGFrameElement *)list->At(i);
99 cl = el->fFrame->IsA();
101 Cleanup((TGCompositeFrame *)el->fFrame);
102 }
103 frame->Cleanup();
104}
105
106////////////////////////////////////////////////////////////////////////////////
107/// Get editor for a shape.
108
110{
111 if (!shape)
112 return;
113 if (!fShapePanel)
114 fShapePanel = new TGeoTransientPanel(fGedEditor, "Shape", shape);
115 else {
116 fShapePanel->SetModel(shape);
117 fShapePanel->Show();
118 }
119}
120
121////////////////////////////////////////////////////////////////////////////////
122/// Get editor for a volume.
123
125{
126 if (!volume || !fVolumeTab)
127 return;
132 SetModel(volume);
133}
134
135////////////////////////////////////////////////////////////////////////////////
136/// Get editor for a matrix.
137
139{
140 if (!matrix)
141 return;
142 if (!fMatrixPanel)
144 else {
147 }
148}
149
150////////////////////////////////////////////////////////////////////////////////
151/// Get editor for a medium.
152
154{
155 if (!medium)
156 return;
157 if (!fMediumPanel)
159 else {
163 }
164}
165
166////////////////////////////////////////////////////////////////////////////////
167/// Get editor for a material.
168
170{
171 if (!material)
172 return;
173 TString name = "Material";
174 if (material->IsMixture())
175 name = "Mixture";
176 if (!fMaterialPanel)
177 fMaterialPanel = new TGeoTransientPanel(fGedEditor, name.Data(), material);
178 else {
179 fMaterialPanel->SetModel(material);
182 }
183}
184
185////////////////////////////////////////////////////////////////////////////////
186/// Get editor for a class.
187/// Look in fVolumeTab for any object deriving from TGedFrame,
188
190{
192 if (class2 && class2->InheritsFrom(TGedFrame::Class())) {
193 TGFrameElement *fr;
194 TIter next(fVolumeTab->GetList());
195 while ((fr = (TGFrameElement *)next()))
196 if (fr->fFrame->IsA() == class2)
197 return;
198 TGClient *client = fGedEditor->GetClient();
199 TGWindow *exroot = (TGWindow *)client->GetRoot();
200 client->SetRoot(fVolumeTab);
202 TGedFrame *gfr = reinterpret_cast<TGedFrame *>(class2->New());
203 gfr->SetModelClass(cl);
205 client->SetRoot(exroot);
207 gfr->MapSubwindows();
208 }
209}
210
211////////////////////////////////////////////////////////////////////////////////
212/// Static method to return the tab manager currently appended to the pad or create one
213/// if not existing.
214
216{
217 if (!ged)
218 return nullptr;
219 TPair *pair = (TPair *)fgEditorToMgrMap.FindObject(ged);
220 if (pair) {
221 return (TGeoTabManager *)pair->Value();
222 } else {
223 TGeoTabManager *tabmgr = new TGeoTabManager(ged); // added to fgEditorToMgrMap in ctor
224 return tabmgr;
225 }
226}
227
228////////////////////////////////////////////////////////////////////////////////
229/// Get index for a given tab element.
230
232{
234 TString tabname = "Volume";
235
237 for (Int_t i = 0; i < ntabs; i++) {
238 tel = fTab->GetTabTab(i);
239 if (tel && !strcmp(tel->GetString(), tabname.Data()))
240 return i;
241 }
242 return 0;
243}
244
245////////////////////////////////////////////////////////////////////////////////
246/// Move frame fr at the end of the list of parent p.
247
249{
250 TList *list = p->GetList();
251 TIter next(list);
252 TGFrameElement *el = nullptr;
253 while ((el = (TGFrameElement *)next())) {
254 if (el->fFrame == fr)
255 break;
256 }
257 if (el) {
258 list->Remove(el);
259 list->Add(el);
260 }
261}
262
263////////////////////////////////////////////////////////////////////////////////
264/// Enable/disable tabs
265
270
271////////////////////////////////////////////////////////////////////////////////
272/// Send the SetModel signal to all editors in the tab TYPE.
273
275{
277 fVolume = (TGeoVolume *)model;
279 TIter next(tab->GetList());
280 while ((el = (TGFrameElement *)next())) {
281 if ((el->fFrame)->InheritsFrom(TGedFrame::Class())) {
282 ((TGedFrame *)(el->fFrame))->SetModel(model);
283 }
284 }
285}
286
287////////////////////////////////////////////////////////////////////////////////
288/// Set a given tab element as active one.
289
294
295
297
298////////////////////////////////////////////////////////////////////////////////
299/// static; return selected object
300
305
306////////////////////////////////////////////////////////////////////////////////
307/// Constructor
308
311{
312 fgSelectedObj = nullptr;
313 fCanvas = new TGCanvas(this, 100, 200, kSunkenFrame | kDoubleBorder);
314 fLT = new TGListTree(fCanvas->GetViewPort(), 100, 200);
315 fLT->Associate(this);
318 f1 = new TGCompositeFrame(this, 100, 10, kHorizontalFrame | kFitWidth);
319 fObjLabel = new TGLabel(f1, "Selected: -none-");
320 Pixel_t color;
321 gClient->GetColorByName("#0000ff", color);
322 fObjLabel->SetTextColor(color);
325 fClose = new TGTextButton(f1, "&Close");
326 fClose->Associate(this);
327 f1->AddFrame(fClose, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
329
330 Int_t ww = caller->GetWidth();
332 Int_t ax, ay;
333 gVirtualX->TranslateCoordinates(caller->GetId(), main->GetId(), 0, 0, ax, ay, wdum);
334 Move(ax + ww, ay);
336}
337
338////////////////////////////////////////////////////////////////////////////////
339/// Destructor
340
342{
343 delete fClose;
344 delete fObjLabel;
345 delete f1;
346 delete fLT;
347 delete fCanvas;
348}
349
350////////////////////////////////////////////////////////////////////////////////
351/// Update dialog to reflect current clicked object.
352
354{
355 static TString name;
356 if (!item || !item->GetUserData()) {
357 fgSelectedObj = nullptr;
358 name = "Selected: -none-";
360 return;
361 }
362 fgSelectedObj = (TObject *)item->GetUserData();
363 if (fgSelectedObj) {
364 name = TString::Format("Selected %s", fgSelectedObj->GetName());
366 }
367}
368
369
370////////////////////////////////////////////////////////////////////////////////
371/// Ctor.
372
375{
379 Layout();
380 SetWindowName("Volume dialog");
381 MapWindow();
382 gClient->WaitForUnmap(this);
383}
384
385////////////////////////////////////////////////////////////////////////////////
386/// Build volume specific list tree.
387
389{
390 const TGPicture *pic_fld = gClient->GetPicture("folder_t.xpm");
391 const TGPicture *pic_fldo = gClient->GetPicture("ofolder_t.xpm");
392 const TGPicture *pic_file = gClient->GetPicture("mdi_default.xpm");
393 const TGPicture *pic_fileo = gClient->GetPicture("fileopen.xpm");
394 TGListTreeItem *parent_item = nullptr;
396 TGeoVolume *vol;
397 // Existing volume hierarchy
398 parent_item = fLT->AddItem(parent_item, "Volume hierarchy", pic_fldo, pic_fld);
399 parent_item->SetTipText("Select a volume from the existing hierarchy");
401 if (parent_vol) {
402 if (!parent_vol->GetNdaughters()) {
404 parent_item->SetTipText("Master volume");
406 } else {
408 parent_item->SetTipText("Master volume");
410 }
411 }
412 parent_item = fLT->AddItem(nullptr, "Other volumes", pic_fldo, pic_fld);
413 parent_item->SetTipText("Select a volume from the list of unconnected volumes");
415 Bool_t found = kFALSE;
416 while ((vol = (TGeoVolume *)next1())) {
417 if (vol->IsAdded())
418 continue;
420 found = kTRUE;
421 }
422 if (found) {
423 // fLT->OpenItem(parent_item);
424 if (!parent_vol)
425 fLT->SetSelected(parent_item->GetFirstChild());
426 }
427}
428
429////////////////////////////////////////////////////////////////////////////////
430/// Handle close button.
431
436
437////////////////////////////////////////////////////////////////////////////////
438/// Handle item click.
439/// Iterate daughters
440
442{
443 if (btn != kButton1)
444 return;
445 DoSelect(item);
446 if (!item || !item->GetUserData())
447 return;
448 const TGPicture *pic_fld = gClient->GetPicture("folder_t.xpm");
449 const TGPicture *pic_fldo = gClient->GetPicture("ofolder_t.xpm");
450 const TGPicture *pic_file = gClient->GetPicture("mdi_default.xpm");
451 const TGPicture *pic_fileo = gClient->GetPicture("fileopen.xpm");
452 TGeoVolume *parent_vol = (TGeoVolume *)item->GetUserData();
453 TGeoVolume *vol;
456 Int_t i, j, ind, icopy;
457 Int_t nd = parent_vol->GetNdaughters();
458 for (i = 0; i < nd; i++) {
459 icopy = 0;
460 crtnode = parent_vol->GetNode(i);
461 vol = crtnode->GetVolume();
462 // check if the volume is replicated in the parent
463 ind = parent_vol->GetIndex(crtnode);
464 for (j = 0; j < ind; j++)
465 if (parent_vol->GetNode(j)->GetVolume() == vol)
466 break;
467 if (i < ind)
468 continue;
469 icopy++;
470 for (j = ind + 1; j < nd; j++)
471 if (parent_vol->GetNode(j)->GetVolume() == vol)
472 icopy++;
474 item, ((icopy > 1) ? (TString::Format("%s (%i)", vol->GetName(), icopy)).Data() : vol->GetName()), vol,
475 ((vol->GetNdaughters()) ? pic_fldo : pic_fileo), ((vol->GetNdaughters()) ? pic_fld : pic_file));
476 if (strlen(vol->GetTitle()))
477 daughter_item->SetTipText(vol->GetTitle());
478 }
479 if (nd)
480 gClient->NeedRedraw(fLT);
481}
482
483////////////////////////////////////////////////////////////////////////////////
484/// Connect signals to slots.
485
487{
488 fClose->Connect("Clicked()", "TGeoVolumeDialog", this, "DoClose()");
489 fLT->Connect("Clicked(TGListTreeItem *, Int_t)", "TGeoVolumeDialog", this, "DoItemClick(TGListTreeItem *, Int_t)");
490}
491
492
493////////////////////////////////////////////////////////////////////////////////
494/// Ctor.
495
498{
502 Layout();
503 SetWindowName("Shape dialog");
504 MapWindow();
505 gClient->WaitForUnmap(this);
506}
507
508////////////////////////////////////////////////////////////////////////////////
509/// Build shape specific list tree.
510
512{
513 const TGPicture *pic_fld = gClient->GetPicture("folder_t.xpm");
514 const TGPicture *pic_fldo = gClient->GetPicture("ofolder_t.xpm");
515 const TGPicture *pic_shape;
516 TGListTreeItem *parent_item = nullptr;
517 TGeoShape *shape;
518 const char *shapename;
521 if (!nshapes)
522 return;
523 // Existing shapes
524 for (Int_t i = 0; i < nshapes; i++) {
525 shape = (TGeoShape *)gGeoManager->GetListOfShapes()->At(i);
526 if (!shape)
527 continue;
528 shapename = shape->IsA()->GetName();
530 fld_name = shapename; // e.g. "TGeoBBox"
531 fld_name.Remove(0, 4); // remove "TGeo" part -> "BBox"
532 fld_name += " Shapes";
533 parent_item = fLT->FindChildByName(nullptr, fld_name.Data());
534 if (!parent_item) {
535 parent_item = fLT->AddItem(nullptr, fld_name.Data(), pic_fldo, pic_fld);
536 parent_item->SetTipText(TString::Format("List of %s shapes", fld_name.Data()));
537 }
538 fLT->AddItem(parent_item, shape->GetName(), shape, pic_shape, pic_shape);
539 }
540}
541
542////////////////////////////////////////////////////////////////////////////////
543/// Handle close button.
544
549
550////////////////////////////////////////////////////////////////////////////////
551/// Handle item click.
552/// Iterate daughters
553
555{
556 if (btn != kButton1)
557 return;
558 DoSelect(item);
559 if (!item || !item->GetUserData())
560 return;
561}
562
563////////////////////////////////////////////////////////////////////////////////
564/// Connect signals to slots.
565
567{
568 fClose->Connect("Clicked()", "TGeoShapeDialog", this, "DoClose()");
569 fLT->Connect("Clicked(TGListTreeItem *, Int_t)", "TGeoShapeDialog", this, "DoItemClick(TGListTreeItem *, Int_t)");
570}
571
572
573////////////////////////////////////////////////////////////////////////////////
574/// Ctor.
575
578{
582 Layout();
583 SetWindowName("Medium dialog");
584 MapWindow();
585 gClient->WaitForUnmap(this);
586}
587
588////////////////////////////////////////////////////////////////////////////////
589/// Build volume specific list tree.
590
592{
593 const TGPicture *pic_med = gClient->GetPicture("geomedium_t.xpm");
594 ;
597 if (!nmed)
598 return;
599 // Existing media
600 for (Int_t i = 0; i < nmed; i++) {
602 fLT->AddItem(nullptr, med->GetName(), med, pic_med, pic_med);
603 }
604}
605
606////////////////////////////////////////////////////////////////////////////////
607/// Handle close button.
608
613
614////////////////////////////////////////////////////////////////////////////////
615/// Handle item click.
616/// Iterate daughters
617
619{
620 if (btn != kButton1)
621 return;
622 DoSelect(item);
623 if (!item || !item->GetUserData())
624 return;
625 // gClient->NeedRedraw(fLT);
626}
627
628////////////////////////////////////////////////////////////////////////////////
629/// Connect signals to slots.
630
632{
633 fClose->Connect("Clicked()", "TGeoMediumDialog", this, "DoClose()");
634 fLT->Connect("Clicked(TGListTreeItem *, Int_t)", "TGeoMediumDialog", this, "DoItemClick(TGListTreeItem *, Int_t)");
635}
636
637
638////////////////////////////////////////////////////////////////////////////////
639/// Ctor.
640
643{
647 Layout();
648 SetWindowName("Material dialog");
649 MapWindow();
650 gClient->WaitForUnmap(this);
651}
652
653////////////////////////////////////////////////////////////////////////////////
654/// Build volume specific list tree.
655
657{
658 const TGPicture *pic_mat = gClient->GetPicture("geomaterial_t.xpm");
659 ;
662 if (!nmat)
663 return;
664 // Existing materials
665 for (Int_t i = 0; i < nmat; i++) {
667 fLT->AddItem(nullptr, mat->GetName(), mat, pic_mat, pic_mat);
668 }
669}
670
671////////////////////////////////////////////////////////////////////////////////
672/// Handle close button.
673
678
679////////////////////////////////////////////////////////////////////////////////
680/// Handle item click.
681/// Iterate daughters
682
684{
685 if (btn != kButton1)
686 return;
687 DoSelect(item);
688 if (!item || !item->GetUserData())
689 return;
690 // gClient->NeedRedraw(fLT);
691}
692
693////////////////////////////////////////////////////////////////////////////////
694/// Connect signals to slots.
695
697{
698 fClose->Connect("Clicked()", "TGeoMaterialDialog", this, "DoClose()");
699 fLT->Connect("Clicked(TGListTreeItem *, Int_t)", "TGeoMaterialDialog", this, "DoItemClick(TGListTreeItem *, Int_t)");
700}
701
702
703////////////////////////////////////////////////////////////////////////////////
704/// Ctor.
705
708{
712 Layout();
713 SetWindowName("Matrix dialog");
714 MapWindow();
715 gClient->WaitForUnmap(this);
716}
717
718////////////////////////////////////////////////////////////////////////////////
719/// Build matrix specific list tree.
720
722{
723 const TGPicture *pic_tr = gClient->GetPicture("geotranslation_t.xpm");
724 const TGPicture *pic_rot = gClient->GetPicture("georotation_t.xpm");
725 const TGPicture *pic_combi = gClient->GetPicture("geocombi_t.xpm");
726 const TGPicture *pic;
727 TGListTreeItem *parent_item = nullptr;
730 if (!nmat)
731 return;
732 // Existing matrices
733 for (Int_t i = 0; i < nmat; i++) {
735 if (matrix->IsIdentity())
736 continue;
737 if (!strcmp(matrix->IsA()->GetName(), "TGeoTranslation")) {
738 pic = pic_tr;
739 parent_item = fLT->FindChildByName(nullptr, "Translations");
740 if (!parent_item) {
741 parent_item = fLT->AddItem(nullptr, "Translations", pic, pic);
742 parent_item->SetTipText("List of translations");
743 }
744 } else if (!strcmp(matrix->IsA()->GetName(), "TGeoRotation")) {
745 pic = pic_rot;
746 parent_item = fLT->FindChildByName(nullptr, "Rotations");
747 if (!parent_item) {
748 parent_item = fLT->AddItem(nullptr, "Rotations", pic, pic);
749 parent_item->SetTipText("List of rotations");
750 }
751 } else if (!strcmp(matrix->IsA()->GetName(), "TGeoCombiTrans") ||
752 !strcmp(matrix->IsA()->GetName(), "TGeoHMatrix")) {
753 pic = pic_combi;
754 parent_item = fLT->FindChildByName(nullptr, "Combined");
755 if (!parent_item) {
756 parent_item = fLT->AddItem(nullptr, "Combined", pic, pic);
757 parent_item->SetTipText("List of combined transformations");
758 }
759 } else
760 continue;
761 fLT->AddItem(parent_item, matrix->GetName(), matrix, pic, pic);
762 }
763}
764
765////////////////////////////////////////////////////////////////////////////////
766/// Handle close button.
767
772
773////////////////////////////////////////////////////////////////////////////////
774/// Handle item click.
775/// Iterate daughters
776
778{
779 if (btn != kButton1)
780 return;
781 DoSelect(item);
782 if (!item || !item->GetUserData())
783 return;
784 // gClient->NeedRedraw(fLT);
785}
786
787////////////////////////////////////////////////////////////////////////////////
788/// Connect signals to slots.
789
791{
792 fClose->Connect("Clicked()", "TGeoMatrixDialog", this, "DoClose()");
793 fLT->Connect("Clicked(TGListTreeItem *, Int_t)", "TGeoMatrixDialog", this, "DoItemClick(TGListTreeItem *, Int_t)");
794}
795
796
797////////////////////////////////////////////////////////////////////////////////
798/// Transient panel ctor.
799
801 : TGMainFrame(gClient->GetRoot(), 175, 20)
802{
803 fGedEditor = ged;
804 fModel = obj;
805 fCan = new TGCanvas(this, 170, 100);
806 fTab = new TGTab(fCan->GetViewPort(), 10, 10);
814 wname += " Editor";
815 SetWindowName(wname.Data());
817 fClose = new TGTextButton(this, "Close");
820 Layout();
822 MapWindow();
823 gROOT->GetListOfCleanups()->Add(this);
824 fClose->Connect("Clicked()", "TGeoTransientPanel", this, "Hide()");
825}
826
827////////////////////////////////////////////////////////////////////////////////
828/// Destructor.
829
831{
833 delete fTab;
834 delete fCan;
835 gROOT->GetListOfCleanups()->Remove(this);
836}
837
838////////////////////////////////////////////////////////////////////////////////
839/// When closed via WM close button, just unmap (i.e. hide) editor
840/// for later use.
841
843{
844 UnmapWindow();
845 gROOT->GetListOfCleanups()->Remove(this);
846}
847
848////////////////////////////////////////////////////////////////////////////////
849/// Get editor for a class.
850/// Look in fStyle for any object deriving from TGedFrame,
851
853{
855 if (class2 && class2->InheritsFrom(TGedFrame::Class())) {
856 TGFrameElement *fr;
857 TIter next(fStyle->GetList());
858 while ((fr = (TGFrameElement *)next()))
859 if (fr->fFrame->IsA() == class2)
860 return;
861 TGClient *client = fGedEditor->GetClient();
862 TGWindow *exroot = (TGWindow *)client->GetRoot();
863 client->SetRoot(fStyle);
865 TGedFrame *gfr = reinterpret_cast<TGedFrame *>(class2->New());
866 gfr->SetModelClass(cl);
868 client->SetRoot(exroot);
870 gfr->MapSubwindows();
871 }
872}
873
874////////////////////////////////////////////////////////////////////////////////
875/// Update the editors in the main tab to reflect the selected object.
876
878{
879 if (!model)
880 return;
881 fModel = model;
882 GetEditors(model->IsA());
884 TIter next(fStyle->GetList());
885 while ((el = (TGFrameElement *)next())) {
886 if ((el->fFrame)->InheritsFrom(TGedFrame::Class())) {
887 ((TGedFrame *)(el->fFrame))->SetModel(model);
888 }
889 }
891}
892
893////////////////////////////////////////////////////////////////////////////////
894/// Hide the transient frame
895
897{
898 UnmapWindow();
899}
900
901////////////////////////////////////////////////////////////////////////////////
902/// Hide the transient frame
903
905{
906 MapWindow();
907}
908
909////////////////////////////////////////////////////////////////////////////////
910/// Delete editors.
911
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
@ kSunkenFrame
Definition GuiTypes.h:383
@ kVerticalFrame
Definition GuiTypes.h:381
@ kDoubleBorder
Definition GuiTypes.h:385
@ kFitWidth
Definition GuiTypes.h:386
@ kHorizontalFrame
Definition GuiTypes.h:382
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
@ kButton1
Definition GuiTypes.h:214
int main()
Definition Prototype.cxx:12
#define h(i)
Definition RSha256.hxx:106
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define gClient
Definition TGClient.h:157
@ kLHintsRight
Definition TGLayout.h:26
@ kLHintsExpandY
Definition TGLayout.h:31
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsBottom
Definition TGLayout.h:29
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void SetWMPosition
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize MapSubwindows
char name[80]
Definition TGX11.cxx:110
R__EXTERN TGeoManager * gGeoManager
#define gROOT
Definition TROOT.h:411
#define gVirtualX
Definition TVirtualX.h:337
static TClass * Class()
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:84
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Definition TClass.cxx:2973
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
A frame containing two scrollbars (a horizontal and a vertical) and a viewport.
Definition TGCanvas.h:192
virtual void SetContainer(TGFrame *f)
Definition TGCanvas.h:222
TGViewPort * GetViewPort() const
Definition TGCanvas.h:217
Window client.
Definition TGClient.h:37
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition TGClient.cxx:223
TGMimeTypes * GetMimeTypeList() const
Definition TGClient.h:147
void SetRoot(TGWindow *root=nullptr)
Sets the current root (i.e.
Definition TGClient.cxx:243
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:289
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
virtual TList * GetList() const
Definition TGFrame.h:312
UInt_t GetDefaultWidth() const override
Definition TGFrame.h:314
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:959
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1156
UInt_t GetDefaultHeight() const override
Definition TGFrame.h:316
TGCompositeFrame(const TGCompositeFrame &)=delete
void Layout() override
Layout the elements of the composite frame.
Definition TGFrame.cxx:1249
static TClass * Class()
virtual void Associate(const TGWindow *w)
Definition TGCanvas.h:89
TGFrame * fFrame
Definition TGLayout.h:112
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition TGFrame.h:80
virtual void ChangeOptions(UInt_t options)
Change frame options. Options is an OR of the EFrameTypes.
Definition TGFrame.cxx:313
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:597
void MapWindow() override
map window
Definition TGFrame.h:206
void Move(Int_t x, Int_t y) override
Move frame.
Definition TGFrame.cxx:585
TClass * IsA() const override
Definition TGFrame.h:285
virtual void DeleteWindow()
Delete window.
Definition TGFrame.cxx:268
void UnmapWindow() override
unmap window
Definition TGFrame.h:208
static TClass * Class()
This class handles GUI labels.
Definition TGLabel.h:24
virtual void SetTextColor(Pixel_t color, Bool_t global=kFALSE)
Changes text color.
Definition TGLabel.cxx:361
virtual void SetText(TGString *newText)
Set new text in label.
Definition TGLabel.cxx:179
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
A list tree is a widget that can contain a number of items arranged in a tree structure.
Definition TGListTree.h:197
void AddItem(TGListTreeItem *parent, TGListTreeItem *item)
Add given item to list tree.
void OpenItem(TGListTreeItem *item)
Open item in list tree (i.e. show child items).
void SetSelected(TGListTreeItem *item)
Definition TGListTree.h:355
TGListTreeItem * FindChildByName(TGListTreeItem *item, const char *name)
Find child of item by name.
Defines top level windows that interact with the system Window Manager.
Definition TGFrame.h:399
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1780
const TGPicture * GetIcon(const char *filename, Bool_t small_icon)
Return icon belonging to mime type of filename.
TGClient * fClient
Connection to display server.
Definition TGObject.h:25
TGClient * GetClient() const
Definition TGObject.h:42
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition TGPicture.h:25
Service classes of the tab widget.
Definition TGTab.h:117
A tab widget contains a set of composite frames each with a little tab with a name (like a set of fol...
Definition TGTab.h:46
virtual void SetEnabled(Int_t tabIndex, Bool_t on=kTRUE)
Enable or disable tab.
Definition TGTab.cxx:467
TGTabElement * GetTabTab(Int_t tabIndex) const
Return the tab element of tab with index tabIndex.
Definition TGTab.cxx:660
Int_t GetNumberOfTabs() const
Return number of tabs.
Definition TGTab.cxx:706
virtual Bool_t SetTab(Int_t tabIndex, Bool_t emit=kTRUE)
Brings the composite frame with the index tabIndex to the front and generate the following event if t...
Definition TGTab.cxx:555
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
Definition TGTab.cxx:373
Yield an action as soon as it is clicked.
Definition TGButton.h:142
Defines transient windows that typically are used for dialogs windows.
Definition TGFrame.h:500
static TClass * Class()
virtual void Associate(const TGWindow *w)
Definition TGWidget.h:72
ROOT GUI Window base class.
Definition TGWindow.h:23
virtual void RaiseWindow()
raise window
Definition TGWindow.cxx:206
TGTab * GetTab() const
Definition TGedEditor.h:73
virtual TVirtualPad * GetPad() const
Definition TGedEditor.h:78
static void SetFrameCreator(TGedEditor *e)
Set the TGedEditor that currently creates TGedFrames.
Base frame for implementing GUI - a service class.
Definition TGedFrame.h:27
TList * GetListOfMedia() const
TObjArray * GetListOfVolumes() const
TObjArray * GetListOfMatrices() const
TGeoVolume * GetMasterVolume() const
TList * GetListOfMaterials() const
TObjArray * GetListOfShapes() const
void ConnectSignalsToSlots() override
Connect signals to slots.
TGeoMaterialDialog(TGFrame *caller, const TGWindow *main, UInt_t w=1, UInt_t h=1)
Ctor.
void DoItemClick(TGListTreeItem *item, Int_t btn) override
Handle item click.
void DoClose() override
Handle close button.
void BuildListTree() override
Build volume specific list tree.
Base class describing materials.
virtual Bool_t IsMixture() const
void DoItemClick(TGListTreeItem *item, Int_t btn) override
Handle item click.
void DoClose() override
Handle close button.
void ConnectSignalsToSlots() override
Connect signals to slots.
TGeoMatrixDialog(TGFrame *caller, const TGWindow *main, UInt_t w=1, UInt_t h=1)
Ctor.
void BuildListTree() override
Build matrix specific list tree.
Geometrical transformation package.
Definition TGeoMatrix.h:38
void ConnectSignalsToSlots() override
Connect signals to slots.
void DoClose() override
Handle close button.
void BuildListTree() override
Build volume specific list tree.
void DoItemClick(TGListTreeItem *item, Int_t btn) override
Handle item click.
TGeoMediumDialog(TGFrame *caller, const TGWindow *main, UInt_t w=1, UInt_t h=1)
Ctor.
Media are used to store properties related to tracking and which are useful only when using geometry ...
Definition TGeoMedium.h:23
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
Definition TGeoNode.h:39
void BuildListTree() override
Build shape specific list tree.
TGeoShapeDialog(TGFrame *caller, const TGWindow *main, UInt_t w=1, UInt_t h=1)
Ctor.
void ConnectSignalsToSlots() override
Connect signals to slots.
void DoClose() override
Handle close button.
void DoItemClick(TGListTreeItem *item, Int_t btn) override
Handle item click.
Base abstract class for all shapes.
Definition TGeoShape.h:25
const char * GetName() const override
Get the shape name.
TClass * IsA() const override
Definition TGeoShape.h:179
Manager for all editor tabs.
TVirtualPad * fPad
void GetVolumeEditor(TGeoVolume *vol)
Get editor for a volume.
TGedEditor * fGedEditor
TGeoTransientPanel * fMaterialPanel
TGeoVolume * fVolume
TGCompositeFrame * fVolumeTab
static void MoveFrame(TGCompositeFrame *fr, TGCompositeFrame *p)
Move frame fr at the end of the list of parent p.
static TMap fgEditorToMgrMap
void GetMaterialEditor(TGeoMaterial *material)
Get editor for a material.
void GetEditors(TClass *cl)
Get editor for a class.
static TGeoTabManager * GetMakeTabManager(TGedEditor *ged)
Static method to return the tab manager currently appended to the pad or create one if not existing.
void SetModel(TObject *model)
Send the SetModel signal to all editors in the tab TYPE.
Int_t GetTabIndex() const
Get index for a given tab element.
TGeoTransientPanel * fShapePanel
void GetMediumEditor(TGeoMedium *medium)
Get editor for a medium.
static void Cleanup(TGCompositeFrame *frame)
Static method to cleanup hierarchically all daughters of a composite frame.
void GetShapeEditor(TGeoShape *shape)
Get editor for a shape.
TGeoTransientPanel * fMediumPanel
TGeoTabManager(TGedEditor *ged)
Ctor.
void SetTab()
Set a given tab element as active one.
~TGeoTabManager() override
Dtor.
void SetVolTabEnabled(Bool_t flag=kTRUE)
Enable/disable tabs.
void GetMatrixEditor(TGeoMatrix *matrix)
Get editor for a matrix.
TGeoTransientPanel * fMatrixPanel
TGedEditor * fGedEditor
virtual void Hide()
Hide the transient frame.
TGTextButton * fClose
void CloseWindow() override
When closed via WM close button, just unmap (i.e.
TGeoTransientPanel(TGedEditor *ged, const char *name, TObject *obj)
Transient panel ctor.
void GetEditors(TClass *cl)
Get editor for a class.
virtual void Show()
Hide the transient frame.
virtual void DeleteEditors()
Delete editors.
TGCompositeFrame * fTabContainer
TGCompositeFrame * fStyle
void SetModel(TObject *model)
Update the editors in the main tab to reflect the selected object.
~TGeoTransientPanel() override
Destructor.
static TObject * fgSelectedObj
~TGeoTreeDialog() override
Destructor.
TGLabel * fObjLabel
static TObject * GetSelected()
static; return selected object
TGCompositeFrame * f1
TGTextButton * fClose
void DoSelect(TGListTreeItem *item)
Update dialog to reflect current clicked object.
TGListTree * fLT
TGeoTreeDialog(TGFrame *caller, const TGWindow *main, UInt_t w=1, UInt_t h=1)
Constructor.
TGCanvas * fCanvas
void DoItemClick(TGListTreeItem *item, Int_t btn) override
Handle item click.
TGeoVolumeDialog(TGFrame *caller, const TGWindow *main, UInt_t w=1, UInt_t h=1)
Ctor.
void DoClose() override
Handle close button.
void BuildListTree() override
Build volume specific list tree.
void ConnectSignalsToSlots() override
Connect signals to slots.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:43
Int_t GetNdaughters() const
Definition TGeoVolume.h:362
static TClass * Class()
Bool_t IsAdded() const
Definition TGeoVolume.h:147
A doubly linked list.
Definition TList.h:38
TObject * At(Int_t idx) const override
Returns the object at position idx. Returns 0 if idx is out of range.
Definition TList.cxx:354
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
Definition TMap.h:40
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:50
Int_t GetEntriesFast() const
Definition TObjArray.h:58
TObject * At(Int_t idx) const override
Definition TObjArray.h:164
Mother of all ROOT objects.
Definition TObject.h:41
static TClass * Class()
virtual TClass * IsA() const
Definition TObject.h:246
Class used by TMap to store (key,value) pairs.
Definition TMap.h:102
TObject * Value() const
Definition TMap.h:121
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition TQObject.cxx:865
Basic string class.
Definition TString.h:138
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2384