Logo ROOT  
Reference Guide
TStructViewerGUI.cxx
Go to the documentation of this file.
1 // @(#)root/gviz3d:$Id$
2 // Author: Tomasz Sosnicki 18/09/09
3 
4 /************************************************************************
5 * Copyright (C) 1995-2009, 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 #include "TStructViewerGUI.h"
13 #include "TStructViewer.h"
14 #include "TStructNodeEditor.h"
15 #include "TStructNodeProperty.h"
16 #include "TStructNode.h"
17 #include <TCanvas.h>
18 #include <RQ_OBJECT.h>
19 #include <TGLLogicalShape.h>
20 #include <TGLPhysicalShape.h>
21 #include <TGLWidget.h>
22 #include <TGButtonGroup.h>
23 #include <TGSplitter.h>
24 #include <TList.h>
25 #include <TClass.h>
26 #include <TDataMember.h>
27 #include <TExMap.h>
28 #include <TPolyLine3D.h>
29 #include <TGTab.h>
30 #include <TGeoManager.h>
31 #include <TGeoMatrix.h>
32 #include <TMath.h>
33 #include <TROOT.h>
34 #include <TApplication.h>
35 
37 
38 //________________________________________________________________________
39 //////////////////////////////////////////////////////////////////////////
40 //
41 // TStructViewerGUI is main window of TStructViewer. It provides graphical
42 // interface. In the window we can find panel with tabs and frame with
43 // GLViewer. Tab "Info" serves information about node and is used to naviagate
44 // backward and forward. Second tab "Options" is used to set few options
45 // such as links visibility, scaling method or setting a pointer.
46 // Last tab "Editor" is tab when the TStructNodeEditor is placed.
47 //
48 //////////////////////////////////////////////////////////////////////////
49 
52 
53 ////////////////////////////////////////////////////////////////////////////////
54 /// Constructs window with "w" as width, "h" as height and given parent "p". Argument "parent" is a pointer to TStructViewer which contains this GUI.
55 /// This constructor build window with all controls, build map with colors, init OpenGL Viewer and create TGeoVolumes.
56 
59 {
60  fParent = parent;
61  fNodePtr = nodePtr;
62 
63  fMaxSlices = 10;
64  fMouseX = 0;
65  fMouseY = 0;
66  fSelectedObject = NULL;
67  fMaxRatio = 0;
68  fColors = colors;
69 
70  if (!gGeoManager) new TGeoManager("tmp","tmp");
71  if (!fgMedium) {
72  fgMedium = new TGeoMedium("MED",1,new TGeoMaterial("Mat", 26.98,13,2.7));
73  }
74 
76  //////////////////////////////////////////////////////////////////////////
77  // layout
78  //////////////////////////////////////////////////////////////////////////
79  TGVerticalFrame* leftFrame = new TGVerticalFrame(this, 200, 200, kFixedWidth);
80  this->AddFrame(leftFrame, new TGLayoutHints(kFixedWidth, 1, 1, 1, 1));
81  TGTab* tabs = new TGTab(leftFrame);
82  TGLayoutHints* expandX = new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 5,5,5,5);
83  //////////////////////////////////////////////////////////////////////////
84  // INFO
85  //////////////////////////////////////////////////////////////////////////
86  TGCompositeFrame* infoFrame = tabs->AddTab("Info");
87  TGGroupFrame* fInfoMenu = new TGGroupFrame(infoFrame, "Info");
88  fNodeNameLabel = new TGLabel(fInfoMenu, "Name:");
89  fInfoMenu->AddFrame(fNodeNameLabel, expandX);
90  fNodeTypelabel = new TGLabel(fInfoMenu, "Type:");
91  fInfoMenu->AddFrame(fNodeTypelabel, expandX);
92  fMembersCountLabel = new TGLabel(fInfoMenu, "Members:");
93  fInfoMenu->AddFrame(fMembersCountLabel, expandX);
94  fAllMembersCountLabel = new TGLabel(fInfoMenu, "All members:");
95  fInfoMenu->AddFrame(fAllMembersCountLabel, expandX);
96  fLevelLabel = new TGLabel(fInfoMenu, "Level:");
97  fInfoMenu->AddFrame(fLevelLabel, expandX);
98  fSizeLabel = new TGLabel(fInfoMenu, "Size:");
99  fInfoMenu->AddFrame(fSizeLabel, expandX);
100  fTotalSizeLabel = new TGLabel(fInfoMenu, "Total size:");
101  fInfoMenu->AddFrame(fTotalSizeLabel, expandX);
102  infoFrame->AddFrame(fInfoMenu, expandX);
103 
104  //////////////////////////////////////////////////////////////////////////
105  // OPTIONS
106  //////////////////////////////////////////////////////////////////////////
107  TGCompositeFrame* options = tabs->AddTab("Options");
108 
109  fShowLinksCheckButton = new TGCheckButton(options, "Show links");
110  fShowLinksCheckButton->Connect("Toggled(Bool_t)", "TStructViewerGUI", this, "ShowLinksToggled(Bool_t)");
113 
114  TGVButtonGroup* scaleByGroup = new TGVButtonGroup(options, "Scale by");
115  fScaleBySizeButton = new TGRadioButton(scaleByGroup, "Size");
116  fScaleBySizeButton->Connect("Clicked()", "TStructViewerGUI", this, "ScaleByChangedSlot()");
118  fScaleByMembersButton = new TGRadioButton(scaleByGroup, "Members count");
119  fScaleByMembersButton->Connect("Clicked()", "TStructViewerGUI", this, "ScaleByChangedSlot()");
120  options->AddFrame(scaleByGroup, expandX);
121 
122  TGHorizontalFrame* defaultColorFrame = new TGHorizontalFrame(options);
123  options->AddFrame(defaultColorFrame, expandX);
124  TGLabel* defColorlabel = new TGLabel(defaultColorFrame, "Default color");
125  defaultColorFrame->AddFrame(defColorlabel, expandX);
126  TGColorSelect* defColorSelect = new TGColorSelect(defaultColorFrame, GetDefaultColor()->GetPixel());
127  defColorSelect->Connect("ColorSelected(Pixel_t)", "TStructViewerGUI", this, "ColorSelectedSlot(Pixel_t)");
128  defaultColorFrame->AddFrame(defColorSelect);
129 
130  TGHorizontalFrame* boxHeightFrame = new TGHorizontalFrame(options);
131  options->AddFrame(boxHeightFrame, expandX);
132  TGLabel* boxHeightLabel = new TGLabel(boxHeightFrame, "Box height:");
133  boxHeightFrame->AddFrame(boxHeightLabel, expandX);
134  fBoxHeightEntry = new TGNumberEntry(boxHeightFrame, 0.1);
136  fBoxHeightEntry->Connect("ValueSet(Long_t)", "TStructViewerGUI", this, "BoxHeightValueSetSlot(Long_t)");
137  boxHeightFrame->AddFrame(fBoxHeightEntry);
138 
139  TGHorizontalFrame* levelDistanceFrame = new TGHorizontalFrame(options);
140  options->AddFrame(levelDistanceFrame, expandX);
141  TGLabel* lvlDistLabel = new TGLabel(levelDistanceFrame, "Distance between levels");
142  levelDistanceFrame->AddFrame(lvlDistLabel, expandX);
143  fLevelDistanceEntry = new TGNumberEntry(levelDistanceFrame, 1.1);
145  fLevelDistanceEntry->Connect("ValueSet(Long_t)", "TStructViewerGUI", this, "LevelDistValueSetSlot(Long_t)");
146  levelDistanceFrame->AddFrame(fLevelDistanceEntry);
147 
148  fAutoRefesh = new TGCheckButton(options, "Auto refresh");
149  fAutoRefesh->SetOn();
150  fAutoRefesh->Connect("Toggled(Bool_t)", "TStructViewerGUI", this, "AutoRefreshButtonSlot(Bool_t)");
151  options->AddFrame(fAutoRefesh, expandX);
152 
153  TGLabel* pointerLabel = new TGLabel(options, "Pointer:");
154  options->AddFrame(pointerLabel, expandX);
155  fPointerTextEntry = new TGTextEntry(options, "0x0000000");
156  options->AddFrame(fPointerTextEntry, expandX);
157  TGLabel* fPointerTypeLabel = new TGLabel(options, "Pointer Type:");
158  options->AddFrame(fPointerTypeLabel, expandX);
159  fPointerTypeTextEntry = new TGTextEntry(options, "TObject");
160  options->AddFrame(fPointerTypeTextEntry, expandX);
161  TGTextButton* setPointerButton = new TGTextButton(options, "Set pointer");
162  setPointerButton->Connect("Clicked()", "TStructViewerGUI", this, "SetPointerButtonSlot()");
163  options->AddFrame(setPointerButton, expandX);
164 
165  //////////////////////////////////////////////////////////////////////////
166  // EDITOR
167  //////////////////////////////////////////////////////////////////////////
168  TGCompositeFrame* editTab = tabs->AddTab("Editor");
169  fEditor = new TStructNodeEditor(fColors, editTab);
170  fEditor->Connect("Update(Bool_t)", "TStructViewerGUI", this, "Update(Bool_t)");
171  editTab->AddFrame(fEditor, expandX);
172 
173  leftFrame->AddFrame(tabs, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 1,1,1,1));
174 
175  TGVSplitter* splitter = new TGVSplitter(this);
176  splitter->SetFrame(leftFrame, true);
177  this->AddFrame(splitter, new TGLayoutHints(kLHintsLeft | kLHintsExpandY));
178 
179  //////////////////////////////////////////////////////////////////////////
180  // NAVIGATE
181  //////////////////////////////////////////////////////////////////////////
182  fUndoButton = new TGTextButton(leftFrame, "Undo");
183  fUndoButton->Connect("Clicked()", "TStructViewerGUI", this, "UndoButtonSlot()");
184  fUndoButton->SetEnabled(false);
185  leftFrame->AddFrame(fUndoButton, expandX);
186 
187  fRedoButton = new TGTextButton(leftFrame, "Redo");
188  fRedoButton->Connect("Clicked()", "TStructViewerGUI", this, "RedoButtonSlot()");
189  fRedoButton->SetEnabled(false);
190  leftFrame->AddFrame(fRedoButton, expandX);
191 
192  TGTextButton* resetCameraButton = new TGTextButton(leftFrame, "Reset camera");
193  leftFrame->AddFrame(resetCameraButton, expandX);
194  resetCameraButton->Connect("Clicked()", "TStructViewerGUI", this, "ResetButtonSlot()");
195 
196  TGTextButton* updateButton = new TGTextButton(leftFrame, "Update");
197  updateButton->Connect("Clicked()", "TStructViewerGUI", this, "UpdateButtonSlot()");
198  leftFrame->AddFrame(updateButton, expandX);
199 
200  TGTextButton* quitButton = new TGTextButton(leftFrame, "Quit");
201  leftFrame->AddFrame(quitButton, expandX);
202  quitButton->Connect("Clicked()", "TApplication", gApplication, "Terminate()");
203 
204  fTopVolume = gGeoManager->MakeBox("TOPVolume", fgMedium,100, 100, 100);
207 
208  fCanvas = new TCanvas("c", "c", 0, 0);
209  // drawing after creating canvas to avoid drawing in default canvas
210  fGLViewer = new TGLEmbeddedViewer(this, fCanvas);
213  fGLViewer->Connect("MouseOver(TGLPhysicalShape*)", "TStructViewerGUI", this, "MouseOverSlot(TGLPhysicalShape*)");
214  fGLViewer->GetGLWidget()->Connect("ProcessedEvent(Event_t*)", "TStructViewerGUI", this, "GLWidgetProcessedEventSlot(Event_t*))");
215  fGLViewer->Connect("DoubleClicked()", "TStructViewerGUI", this, "DoubleClickedSlot()");
217  Update();
219 
220  SetWindowName("Struct Viewer");
221  MapSubwindows();
222  this->SetWMSizeHints(w, h, 2000, 2000, 0, 0);
224  MapWindow();
225 
226  fToolTip = new TGToolTip(0, 0, "ToolTip", 500);
227 }
228 
229 ////////////////////////////////////////////////////////////////////////////////
230 /// Destructor
231 
233 {
234  delete fCanvas;
235 }
236 
237 ////////////////////////////////////////////////////////////////////////////////
238 /// Activated when user chage condition
239 
241 {
242  if (on) {
243  Update();
244  }
245 }
246 
247 ////////////////////////////////////////////////////////////////////////////////
248 /// Emmited when user changes height of boxes
249 
251 {
252  if(fAutoRefesh->IsOn()) {
253  Update();
254  }
255 }
256 
257 ////////////////////////////////////////////////////////////////////////////////
258 /// Recursive method to calculating nodes posistion in 3D space
259 
261 {
262  // choose scaling method
265  } else if (fScaleByMembersButton->GetState() == kButtonDown) {
267  }
268  Float_t ratio = (Float_t)((parent->GetLevel()+1.0) / parent->GetLevel());
269 
270  // changing the angle between parent object and daughters
271  // if center of parent is 0 that is real piramid
272  parent->SetWidth(1);
273  parent->SetHeight(1);
274  parent->SetX(-parent->GetWidth()/2);
275  parent->SetY(-parent->GetHeight()/2);
276 
277  fMaxRatio = parent->GetVolumeRatio();
278 
279  // sorting list of members by size or number of members
280  parent->GetMembers()->Sort(kSortDescending);
281  Divide(parent->GetMembers(), (parent->GetX()) *ratio, (parent->GetX() + parent->GetWidth())* ratio, (parent->GetY())* ratio, (parent->GetY() + parent->GetHeight())*ratio);
282 
283  // sclale all the objects
284  Scale(parent);
285 }
286 
287 ////////////////////////////////////////////////////////////////////////////////
288 /// Check if all of nodes can be displayed on scene. Hides redendant nodes.
289 
291 {
292  UInt_t object = 0;
293 
294  TList queue;
295  queue.Add(parent);
296  TStructNode* node;
297 
298  while ((node = (TStructNode*) queue.First() )) {
299  object++;
300 
301  if (object > fNodePtr->GetMaxObjects() || node->GetLevel() - fNodePtr->GetLevel() >= fNodePtr->GetMaxLevel()) {
302  break;
303  }
304 
305  node->SetVisible(true);
306 
307  queue.AddAll(node->GetMembers());
308  queue.RemoveFirst();
309 
310  fVisibleObjects.Add(node);
311  }
312 
313  TIter it(&fVisibleObjects);
314  TStructNode* member;
315  while ((node = (TStructNode*) it() )) {
316  if(node->GetLevel() - fNodePtr->GetLevel() == fNodePtr->GetMaxLevel()-1 && node->GetMembersCount() > 0) {
317  node->SetCollapsed(true);
318  continue;
319  }
320 
321  TIter memIt(node->GetMembers());
322  while ((member = (TStructNode*) memIt() )) {
323  if(member->IsVisible() == false) {
324  node->SetCollapsed(true);
325  break;
326  }
327  }
328  }
329 }
330 
331 ////////////////////////////////////////////////////////////////////////////////
332 /// Delete window
333 
335 {
336  DeleteWindow();
337 }
338 
339 ////////////////////////////////////////////////////////////////////////////////
340 /// Slot for default color selsect.
341 /// Sets default colot to "pixel"
342 
344 {
346  if(prop) {
347  prop->SetColor(pixel);
348  Update();
349  }
350 }
351 
352 ////////////////////////////////////////////////////////////////////////////////
353 /// Divides rectangle where the outlining box is placed.
354 
356 {
357  if (list->GetSize() > 1) { // spliting node into two lists
358  ULong_t sum1 = 0, sum = 0;
359 
360  TStructNode* node;
361  TList list1, list2;
362  TIter it(list);
363 
364  while((node = (TStructNode*) it() )) {
365  sum += node->GetVolume();
366  }
367  it.Reset();
368  while((node = (TStructNode*) it() )) {
369  if(sum1 >= sum/2.0) {
370  list2.Add(node);
371  } else {
372  sum1 += node->GetVolume();
373  list1.Add(node);
374  }
375  }
376 
377  if (!sum) return;
378  Float_t ratio = (float)sum1/sum;
379 
380  Float_t width = x2 - x1;
381  Float_t height = y2 - y1;
382  if (width < height) { // vertical split
383  Float_t split = y1 + ratio * height;
384  Divide(&list1, x1, x2, y1, split);
385  Divide(&list2, x1, x2, split, y2);
386  } else { // horizontal
387  Float_t split = x1 + ratio * width;
388  Divide(&list1, x1, split, y1, y2);
389  Divide(&list2, split, x2, y1, y2);
390  }
391  } else if (list->GetSize() == 1) { // divide place to node
392  TStructNode* node = (TStructNode*)(list->First());
393 
394  node->SetWidth(x2 - x1);
395  node->SetHeight(y2 - y1);
396  node->SetX(x1);
397  node->SetY(y1);
398 
399  if (node->GetVolumeRatio() > fMaxRatio) {
400  fMaxRatio = node->GetVolumeRatio();
401  }
402 
403  Float_t ratio = (Float_t)((node->GetLevel()+1.0)/node->GetLevel());
404  node->GetMembers()->Sort(kSortDescending);
405  Divide(node->GetMembers(), x1*ratio, x2*ratio, y1*ratio, y2*ratio);
406  }
407 }
408 
409 ////////////////////////////////////////////////////////////////////////////////
410 /// Activated when user double click on objects on 3D scene. Sets clicked node to top node
411 /// and updates scene with camers reset.
412 
414 {
415  if (fSelectedObject) {
416  if(fSelectedObject == fNodePtr) {
417  return;
418  }
419 
422  fUndoButton->SetEnabled(true);
423 
424  Update(kTRUE);
425  }
426 }
427 ////////////////////////////////////////////////////////////////////////////////
428 /// Check limits and draws nodes and links
429 
431 {
432  fVolumes.Clear();
434 
437 
440  }
441 
443 }
444 
445 ////////////////////////////////////////////////////////////////////////////////
446 /// Recursive method to draw links
447 
449 {
450  if(parent->GetLevel() - fNodePtr->GetLevel() >= fNodePtr->GetMaxLevel()) {
451  return;
452  }
453 
454  if(parent->IsCollapsed()) {
455  return;
456  }
457 
458  TIter it(parent->GetMembers());
459  TStructNode* node;
460  while((node = (TStructNode*) it())) {
461  TPolyLine3D *l = new TPolyLine3D(2);
462  l->SetPoint(0 ,node->GetCenter(), node->GetMiddle(), -(node->GetLevel() * fLevelDistanceEntry->GetNumber()));
463  l->SetPoint(1 ,parent->GetCenter(), parent->GetMiddle(), -(parent->GetLevel() * fLevelDistanceEntry->GetNumber()));
464 
465  l->SetLineColor(GetColor(node));
466  l->SetLineWidth(1);
467  l->Draw();
468 
469  if(!node->IsCollapsed()) {
470  DrawLink(node);
471  }
472  }
473 }
474 
475 ////////////////////////////////////////////////////////////////////////////////
476 /// Creates and draws TGeoVolume from given "node"
477 
479 {
480  TGeoVolume* vol;
481 
482  /*if(node->IsCollapsed())
483  {
484  //float r = (node->GetWidth() < node->GetHeight() ? 0.5 * node->GetWidth() : 0.5 * node->GetHeight());
485  //vol = gGeoManager->MakeTorus(node->GetName(),TStructNode::GetMedium(), 0.75*r, 0, r/4);
486 
487  vol = gGeoManager->MakeBox(TString(node->GetName()) + "up",TStructNode::GetMedium(), 0.45*node->GetWidth(), 0.45*node->GetHeight(), (node->GetWidth() < node->GetHeight() ? 0.45 * node->GetWidth() : 0.45 * node->GetHeight()));
488  Double_t max = TMath::Max(0.22 * node->GetWidth(), 0.22 * node->GetHeight());
489  TGeoVolume* subvol = gGeoManager->MakeTrd2(node->GetName(), TStructNode::GetMedium(), 0, 0.45 * node->GetWidth(), 0, 0.45 * node->GetHeight(), max);
490  subvol->SetLineColor(GetColor(node));
491  subvol->SetNumber((Int_t)node);
492  TGeoTranslation* subtrans = new TGeoTranslation("subtranslation", 0, 0, -max);
493  vol->AddNodeOverlap(subvol, 1, subtrans);
494 
495  subvol = gGeoManager->MakeTrd2(TString(node->GetName()) + "down", TStructNode::GetMedium(), 0.45 * node->GetWidth(), 0, 0.45 * node->GetHeight(), 0, max);
496  subvol->SetLineColor(GetColor(node));
497  subvol->SetNumber((Int_t)node);
498  subtrans = new TGeoTranslation("subtranslation", 0, 0, max);
499  vol->AddNodeOverlap(subvol, 1, subtrans);
500  }
501  else*/ if(node->GetNodeType() == kCollection) {
502  vol = gGeoManager->MakeBox(Form("%s_%d", node->GetName(), fgCounter++), fgMedium, 0.45*node->GetWidth(), 0.45*node->GetHeight(), fBoxHeightEntry->GetNumber());
503  // subboxes
504  Float_t slices = (Float_t)(node->GetMembersCount());
505  if (slices > fMaxSlices) {
506  slices = (Float_t)fMaxSlices;
507  }
508 
509  for (Float_t i = -(slices-1)/2; i < slices/2; i++) {
510  TGeoVolume* sub = gGeoManager->MakeBox(Form("%s_%d", node->GetName(), fgCounter++), fgMedium,0.45*node->GetWidth() * 0.7 / slices, 0.45*node->GetHeight(), fBoxHeightEntry->GetNumber());
511  sub->SetLineColor(GetColor(node));
512  fVolumes.Add((Longptr_t)sub, (Longptr_t)node);
513  TGeoTranslation* subtrans = new TGeoTranslation("subtranslation", i * node->GetWidth() / slices, 0, 0);
514  vol->AddNodeOverlap(sub, 1, subtrans);
515  }
516  } else {
517  vol = gGeoManager->MakeBox(Form("%s_%d", node->GetName(), fgCounter++), fgMedium, 0.45*node->GetWidth(), 0.45*node->GetHeight(), fBoxHeightEntry->GetNumber());
518  }
519 
520  vol->SetLineColor(GetColor(node));
521  vol->SetLineWidth(1);
522 
523  TGeoTranslation* trans = new TGeoTranslation("translation", node->GetCenter(), node->GetMiddle(), -(node->GetLevel() * fLevelDistanceEntry->GetNumber()));
524  fVolumes.Add((Longptr_t)vol, (Longptr_t)node);
525 
526  fTopVolume->AddNode(vol,1, trans);
527 }
528 
529 ////////////////////////////////////////////////////////////////////////////////
530 /// Recursive method to draw GeoVolumes
531 
533 {
534  if(parent->GetLevel() - fNodePtr->GetLevel() >= fNodePtr->GetMaxLevel()) {
535  return;
536  }
537 
538  DrawNode(parent);
539 
540  if(parent->IsCollapsed()) {
541  return;
542  }
543 
544  TIter nextVis(parent->GetMembers());
545  TStructNode* node;
546  while((node = (TStructNode*)nextVis())) {
547  DrawVolumes(node);
548  }
549 }
550 
551 ////////////////////////////////////////////////////////////////////////////////
552 /// Returns pointer to property associated with node "node". If property is not found
553 /// then it returns default property
554 
556 {
557  TIter it(fColors);
558  TStructNodeProperty* prop;
559  while ((prop = (TStructNodeProperty*) it() )) {
560  TString propName(prop->GetName());
561  if (propName.EndsWith("+")) {
562 
563  if (TClass* cl = TClass::GetClass(node->GetTypeName())) {
564  propName.Remove(propName.Length()-1, 1);
565  if (cl->InheritsFrom(propName.Data())) {
566  return prop;
567  }
568  }
569  } else {
570  if (propName == TString(node->GetTypeName())) {
571  return prop;
572  }
573  }
574  }
575 
576  return (TStructNodeProperty*)fColors->Last();
577 }
578 
579 //________________________________________________________________________`
581 {
582  // Returns canvas used to keep TGeoVolumes
583 
584  return fCanvas;
585 }
586 ////////////////////////////////////////////////////////////////////////////////
587 /// Returns color form fColors for given "node"
588 
590 {
592  if (prop) {
593  return prop->GetColor().GetNumber();
594  }
595 
596  return 2;
597 }
598 
599 ////////////////////////////////////////////////////////////////////////////////
600 /// Return default color for nodes
601 
603 {
604  return ((TStructNodeProperty*)(fColors->Last()));
605 }
606 
607 ////////////////////////////////////////////////////////////////////////////////
608 /// Returns true if links are visible, otherwise return false.
609 
611 {
613  return true;
614  } else {
615  return false;
616  }
617 }
618 
619 ////////////////////////////////////////////////////////////////////////////////
620 /// Returns top node pointer
621 
623 {
624  return fNodePtr;
625 }
626 
627 ////////////////////////////////////////////////////////////////////////////////
628 /// Handle events. Sets fMouseX and fMouseY when user move a mouse over viewer and hides ToolTip
629 
631 {
632  switch (event->fType) {
633  case kMotionNotify:
634  fMouseX = event->fXRoot + 15;
635  fMouseY = event->fYRoot + 15;
636  break;
637 
638  case kButtonPress:
639  fToolTip->Hide();
640  if (fSelectedObject) {
643  }
644  break;
645 
646  default:
647  break;
648  }
649 }
650 
651 ////////////////////////////////////////////////////////////////////////////////
652 /// Emmited when user changes distance between levels
653 
655 {
656  if(fAutoRefesh->IsOn()) {
657  Update(kTRUE);
658  }
659 }
660 
661 ////////////////////////////////////////////////////////////////////////////////
662 /// MouseOver slot. Activated when user out mouse over object on scene.
663 /// Sets ToolTip and updates labels
664 
666 {
667  fToolTip->Hide();
668  fSelectedObject = NULL;
669  if (shape && shape->GetLogical()) {
670  fSelectedObject = (TStructNode*)(shape->GetLogical()->ID());
671  if (fSelectedObject) {
673  fSelectedObject = NULL;
674  return;
675  }
676  Longptr_t shapeID = (Longptr_t)(shape->GetLogical()->ID());
677  Longptr_t volValue = (Longptr_t)fVolumes.GetValue(shapeID);
678  fSelectedObject = (TStructNode*)volValue;
679 
682  fToolTip->Reset();
684  }
685  }
686 }
687 
688 ////////////////////////////////////////////////////////////////////////////////
689 /// Activated when user click Redo button. Repeat last Undo action.
690 
692 {
694  fUndoButton->SetEnabled(true);
697  if (!fRedoList.First()) {
698  fRedoButton->SetEnabled(false);
699  }
700  Update(kTRUE);
702 }
703 
704 ////////////////////////////////////////////////////////////////////////////////
705 /// Resets camera
706 
708 {
711 }
712 
713 ////////////////////////////////////////////////////////////////////////////////
714 /// Recursive method to scaling all modes on scene. We have to scale nodes to get real ratio between nodes.
715 /// Uses fMaxRatio.
716 
718 {
719  // newRatio = sqrt(ratio/maxratio)
721  // set left top conner in the center
722  parent->SetX(parent->GetX() + parent->GetWidth()/2);
723  parent->SetY(parent->GetY() + parent->GetHeight()/2);
724  // set new size
725  Float_t min = (Float_t)TMath::Min(parent->GetWidth(), parent->GetHeight());
726  parent->SetWidth(parent->GetWidth() * newRatio);
727  parent->SetHeight(parent->GetHeight() * newRatio);
728  // fit the ratio -> height to width
729  Float_t sqrt = (Float_t)(TMath::Sqrt(parent->GetWidth() * parent->GetHeight()));
730  // it's a square
731  if (min > sqrt) {
732  parent->SetWidth(sqrt);
733  parent->SetHeight(sqrt);
734  } else { // it's rectangle
735  if (parent->GetHeight() > parent->GetWidth()) {
736  parent->SetWidth(min);
737  parent->SetHeight(sqrt * sqrt / min);
738  } else {
739  parent->SetWidth(sqrt * sqrt / min);
740  parent->SetHeight(min);
741  }
742  }
743  // move left top corner
744  parent->SetX(parent->GetX() - parent->GetWidth()/2);
745  parent->SetY(parent->GetY() - parent->GetHeight()/2);
746 
747  // scale others nodes
748  TStructNode* node;
749  TIter it(parent->GetMembers());
750  while ((node = (TStructNode*) it() )) {
751  Scale(node);
752  }
753 }
754 
755 ////////////////////////////////////////////////////////////////////////////////
756 /// Sets top node pointer and updates view
757 
759 {
760  fNodePtr = val;
761  Update(kTRUE);
762 }
763 
764 ////////////////////////////////////////////////////////////////////////////////
765 /// Sets links visibility to "visible"
766 
768 {
769  if (visible) {
771  } else {
773  }
774 }
775 
776 ////////////////////////////////////////////////////////////////////////////////
777 /// Sets pointer given in fPointerTestEntry to the main pointer
778 
780 {
781  void* obj = (void*)gROOT->ProcessLine(fPointerTextEntry->GetText());
783 }
784 
785 ////////////////////////////////////////////////////////////////////////////////
786 /// Changes links visibility and refresh view.
787 
789 {
790  if (fAutoRefesh->IsOn()) {
791  Update();
792  }
793 }
794 
795 ////////////////////////////////////////////////////////////////////////////////
796 /// Shows hidden nodes
797 
799 {
800  TStructNode* node;
801  TIter it(&fVisibleObjects);
802 
803  while ((node = (TStructNode*) it() )) {
804  node->SetCollapsed(false);
805  node->SetVisible(false);
806  }
807 
809 }
810 
811 ////////////////////////////////////////////////////////////////////////////////
812 /// Updates view. Clear all the nodes, call draw function and update scene. Doesn't reset camera.
813 
815 {
816  if (!fNodePtr) {
817  return;
818  }
819 
822  Draw();
825 
826  if(resetCamera) {
828  }
829 }
830 
831 ////////////////////////////////////////////////////////////////////////////////
832 /// Update button slot. Updates scene
833 
835 {
836  Update();
837 }
838 
839 ////////////////////////////////////////////////////////////////////////////////
840 /// Refresh information in labels when user put mouse over object
841 
843 {
844  fNodeNameLabel->SetText(node->GetName());
846 
847  TString name = "Members: ";
848  name += node->GetMembersCount();
850  name = "All members: ";
851  name += node->GetAllMembersCount();
853  name = "Level: ";
854  name += node->GetLevel();
856  name = "Size: ";
857  name += node->GetSize();
859  name = "Total size: ";
860  name += node->GetTotalSize();
862 }
863 
864 ////////////////////////////////////////////////////////////////////////////////
865 /// UndoButton Slot. Activated when user press Undo button. Restore last top node pointer.
866 
868 {
870  fRedoButton->SetEnabled(true);
873  if (!fUndoList.First()) {
874  fUndoButton->SetEnabled(false);
875  }
876  Update(kTRUE);
878 }
879 
880 ////////////////////////////////////////////////////////////////////////////////
881 /// Activated when user press radio button
882 
884 {
885  if (fAutoRefesh->IsOn()) {
886  Update();
887  }
888 }
TGCompositeFrame::GetDefaultSize
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGFrame.h:316
TStructNodeProperty::SetColor
void SetColor(const TColor &color)
Sets the color to "color".
Definition: TStructNodeProperty.cxx:136
l
auto * l
Definition: textangle.C:4
TStructViewerGUI::fSelectedObject
TStructNode * fSelectedObject
Definition: TStructViewerGUI.h:46
TStructViewerGUI::fTopVolume
TGeoVolume * fTopVolume
Definition: TStructViewerGUI.h:41
TStructViewer
Definition: TStructViewer.h:26
TGButton::SetEnabled
virtual void SetEnabled(Bool_t e=kTRUE)
Set enabled or disabled state of button.
Definition: TGButton.cxx:459
TStructViewerGUI::DrawVolumes
void DrawVolumes(TStructNode *visObj)
Recursive method to draw GeoVolumes.
Definition: TStructViewerGUI.cxx:532
kSortDescending
const Bool_t kSortDescending
Definition: TList.h:38
TStructViewerGUI::fLevelDistanceEntry
TGNumberEntry * fLevelDistanceEntry
Definition: TStructViewerGUI.h:77
TGLViewer::ResetCurrentCamera
void ResetCurrentCamera()
Resets position/rotation of current camera to default values.
Definition: TGLViewer.cxx:357
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
TGCheckButton::SetState
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
Definition: TGButton.cxx:1250
TStructViewerGUI::fAllMembersCountLabel
TGLabel * fAllMembersCountLabel
Definition: TStructViewerGUI.h:64
TList::RemoveLast
virtual void RemoveLast()
Remove the last object of the list.
Definition: TList.cxx:909
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
TStructViewerGUI::fEditor
TStructNodeEditor * fEditor
Definition: TStructViewerGUI.h:74
kFixedWidth
@ kFixedWidth
Definition: GuiTypes.h:387
TStructViewerGUI::fUndoList
TList fUndoList
Definition: TStructViewerGUI.h:47
TGMainFrame
Defines top level windows that interact with the system Window Manager.
Definition: TGFrame.h:398
TStructNode::GetSize
ULong_t GetSize() const
Returns size of node.
Definition: TStructNode.cxx:256
TStructNode::SetY
void SetY(Float_t y)
Sets Y coordinate to "y".
Definition: TStructNode.cxx:472
TStructNode::GetVolume
ULong_t GetVolume() const
Returns size or number of members.
Definition: TStructNode.cxx:281
TStructNodeEditor::SetModel
void SetModel(TObject *obj)
Pick up the used node attributes.
Definition: TStructNodeEditor.cxx:259
TStructViewerGUI::RedoButtonSlot
void RedoButtonSlot()
Activated when user click Redo button. Repeat last Undo action.
Definition: TStructViewerGUI.cxx:691
TStructNode::GetWidth
Float_t GetWidth() const
Returns width of outlining box.
Definition: TStructNode.cxx:304
Option_t
const char Option_t
Definition: RtypesCore.h:66
TGeoManager::MakeBox
TGeoVolume * MakeBox(const char *name, TGeoMedium *medium, Double_t dx, Double_t dy, Double_t dz)
Make in one step a volume pointing to a box shape with given medium.
Definition: TGeoManager.cxx:2920
TStructViewerGUI::fVolumes
TExMap fVolumes
Definition: TStructViewerGUI.h:53
kMembers
@ kMembers
Definition: TStructNode.h:27
TGLPhysicalShape.h
TGLViewer::GetGLWidget
TGLWidget * GetGLWidget()
Definition: TGLViewer.h:223
TGToolTip::SetPosition
void SetPosition(Int_t x, Int_t y)
Set popup position within specified frame (as specified in the ctor).
Definition: TGToolTip.cxx:409
gGeoManager
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:602
kButtonDown
@ kButtonDown
Definition: TGButton.h:54
TStructViewerGUI::fMaxRatio
Float_t fMaxRatio
Definition: TStructViewerGUI.h:50
TString::Data
const char * Data() const
Definition: TString.h:369
TStructViewerGUI::UndoButtonSlot
void UndoButtonSlot()
UndoButton Slot. Activated when user press Undo button. Restore last top node pointer.
Definition: TStructViewerGUI.cxx:867
Pixel_t
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
Form
char * Form(const char *fmt,...)
TStructNode::GetX
Float_t GetX() const
Returns X coordinate.
Definition: TStructNode.cxx:312
TStructViewerGUI::GetNodePtr
TStructNode * GetNodePtr() const
Returns top node pointer.
Definition: TStructViewerGUI.cxx:622
TGCheckButton::IsOn
virtual Bool_t IsOn() const
Definition: TGButton.h:311
TStructNodeProperty.h
TGLEmbeddedViewer::GetFrame
TGCompositeFrame * GetFrame() const
Definition: TGLEmbeddedViewer.h:46
TStructNode::GetRelativeVolumeRatio
Float_t GetRelativeVolumeRatio()
Returns ratio - relative volume to area taken by utlining box.
Definition: TStructNode.cxx:248
sum
static uint64_t sum(uint64_t i)
Definition: Factory.cxx:2345
kLHintsLeft
@ kLHintsLeft
Definition: TGLayout.h:24
TGLEmbeddedViewer
Minimal GL-viewer that can be embedded in a standard ROOT frames.
Definition: TGLEmbeddedViewer.h:24
colors
Color * colors
Definition: X3DBuffer.c:21
TGLabel
This class handles GUI labels.
Definition: TGLabel.h:24
TMath::Sqrt
Double_t Sqrt(Double_t x)
Definition: TMath.h:691
kButtonUp
@ kButtonUp
Definition: TGButton.h:53
TGMainFrame::SetWMSizeHints
void SetWMSizeHints(UInt_t wmin, UInt_t hmin, UInt_t wmax, UInt_t hmax, UInt_t winc, UInt_t hinc)
Give the window manager minimum and maximum size hints.
Definition: TGFrame.cxx:1880
TStructViewerGUI::fLevelLabel
TGLabel * fLevelLabel
Definition: TStructViewerGUI.h:67
TDataMember.h
Float_t
float Float_t
Definition: RtypesCore.h:57
width
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
TGTextButton
Yield an action as soon as it is clicked.
Definition: TGButton.h:142
TStructViewerGUI::fNodeNameLabel
TGLabel * fNodeNameLabel
Definition: TStructViewerGUI.h:61
TStructViewerGUI::fColors
TList * fColors
Definition: TStructViewerGUI.h:51
TGLLogicalShape::ID
TObject * ID() const
Definition: TGLLogicalShape.h:82
TStructNode::GetMembers
TList * GetMembers() const
Returns list with pointers to daughter nodes.
Definition: TStructNode.cxx:159
TGeoVolume::SetLineWidth
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition: TGeoVolume.cxx:2052
TGeoVolume::AddNode
virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a TGeoNode to the list of nodes.
Definition: TGeoVolume.cxx:932
TString::EndsWith
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Definition: TString.cxx:2202
TStructViewerGUI::fSizeLabel
TGLabel * fSizeLabel
Definition: TStructViewerGUI.h:65
TStructViewerGUI::AutoRefreshButtonSlot
void AutoRefreshButtonSlot(Bool_t on)
Activated when user chage condition.
Definition: TStructViewerGUI.cxx:240
event
Definition: triangle.c:553
TGToolTip::SetText
void SetText(const char *new_text)
Set new tool tip text.
Definition: TGToolTip.cxx:390
TString::Length
Ssiz_t Length() const
Definition: TString.h:410
TClass.h
TGToolTip
Definition: TGToolTip.h:24
TList.h
TList::Last
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
Definition: TList.cxx:693
TStructNode::GetMaxObjects
UInt_t GetMaxObjects() const
Returns maximum number of objects displayed when the node is top node on scene.
Definition: TStructNode.cxx:151
TGMainFrame::SetWindowName
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1764
TIter::Reset
void Reset()
Definition: TCollection.h:252
TStructViewerGUI::DrawNode
void DrawNode(TStructNode *node)
Creates and draws TGeoVolume from given "node".
Definition: TStructViewerGUI.cxx:478
TStructViewerGUI::UnCheckMaxObjects
void UnCheckMaxObjects()
Shows hidden nodes.
Definition: TStructViewerGUI.cxx:798
TStructViewerGUI::fGLViewer
TGLEmbeddedViewer * fGLViewer
Definition: TStructViewerGUI.h:58
TGHorizontalFrame
A composite frame that layout their children in horizontal way.
Definition: TGFrame.h:386
TStructNode::GetMaxLevel
UInt_t GetMaxLevel() const
Returns maximum number of leves displayed when the node is top node on scene.
Definition: TStructNode.cxx:143
TStructViewerGUI::SetNodePtr
void SetNodePtr(TStructNode *val)
Sets top node pointer and updates view.
Definition: TStructViewerGUI.cxx:758
TCanvas.h
TStructViewerGUI::fgCounter
static UInt_t fgCounter
Definition: TStructViewerGUI.h:54
TStructViewerGUI::fNodePtr
TStructNode * fNodePtr
Definition: TStructViewerGUI.h:42
TStructViewerGUI.h
TExMap::GetValue
Long64_t GetValue(ULong64_t hash, Long64_t key)
Return the value belonging to specified key and hash value.
Definition: TExMap.cxx:173
TString
Basic string class.
Definition: TString.h:136
TCollection::AddAll
virtual void AddAll(const TCollection *col)
Add all objects from collection col to this collection.
Definition: TCollection.cxx:195
TGeoTranslation
Class describing translations.
Definition: TGeoMatrix.h:122
TObject::InheritsFrom
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:445
TStructViewerGUI::fRedoList
TList fRedoList
Definition: TStructViewerGUI.h:48
TGLabel::SetText
virtual void SetText(TGString *newText)
Set new text in label.
Definition: TGLabel.cxx:180
TGeoMaterial
Base class describing materials.
Definition: TGeoMaterial.h:36
TGFrame::MapWindow
virtual void MapWindow()
map window
Definition: TGFrame.h:204
bool
TStructViewerGUI::GetDefaultColor
TStructNodeProperty * GetDefaultColor()
Return default color for nodes.
Definition: TStructViewerGUI.cxx:602
TGeoManager::SetNsegments
void SetNsegments(Int_t nseg)
Set number of segments for approximating circles in drawing.
Definition: TGeoManager.cxx:3341
TStructNode::SetWidth
void SetWidth(Float_t w)
Sets width of outlining box to "w".
Definition: TStructNode.cxx:456
x1
static const double x1[5]
Definition: RooGaussKronrodIntegrator1D.cxx:346
TList::Sort
virtual void Sort(Bool_t order=kSortAscending)
Sort linked list.
Definition: TList.cxx:937
TROOT.h
TStructNode::GetNodeType
ENodeType GetNodeType() const
Returns type of node.
Definition: TStructNode.cxx:135
TStructViewerGUI::GetColor
Int_t GetColor(TStructNode *node)
Returns color form fColors for given "node".
Definition: TStructViewerGUI.cxx:589
TGLViewer::SetResetCamerasOnUpdate
void SetResetCamerasOnUpdate(Bool_t v)
Definition: TGLViewer.h:358
TStructViewerGUI::fCanvas
TCanvas * fCanvas
Definition: TStructViewerGUI.h:57
TApplication.h
TList::First
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:659
TGCheckButton
Selects different options.
Definition: TGButton.h:264
TGVButtonGroup
Organizes TGButton widgets in a group with one vertical column.
Definition: TGButtonGroup.h:94
TStructViewerGUI::fToolTip
TGToolTip * fToolTip
Definition: TStructViewerGUI.h:59
TGFrame::DeleteWindow
virtual void DeleteWindow()
Delete window.
Definition: TGFrame.cxx:276
TGToolTip::Reset
void Reset()
Reset tool tip popup delay timer.
Definition: TGToolTip.cxx:263
TGLViewer::SetCurrentCamera
void SetCurrentCamera(ECameraType camera)
Set current active camera - 'cameraType' one of: kCameraPerspX, kCameraPerspY, kCameraPerspZ,...
Definition: TGLViewer.cxx:1791
TStructViewerGUI::fMaxSlices
UInt_t fMaxSlices
Definition: TStructViewerGUI.h:43
TGeoManager::SetTopVolume
void SetTopVolume(TGeoVolume *vol)
Set the top volume and corresponding node as starting point of the geometry.
Definition: TGeoManager.cxx:3399
TStructViewerGUI::ColorSelectedSlot
void ColorSelectedSlot(Pixel_t pixel)
Slot for default color selsect.
Definition: TStructViewerGUI.cxx:343
TStructViewerGUI::DoubleClickedSlot
void DoubleClickedSlot()
Activated when user double click on objects on 3D scene.
Definition: TStructViewerGUI.cxx:413
TStructViewerGUI::SetPointerButtonSlot
void SetPointerButtonSlot()
Sets pointer given in fPointerTestEntry to the main pointer.
Definition: TStructViewerGUI.cxx:779
TStructViewerGUI
Definition: TStructViewerGUI.h:37
TStructNode::SetCollapsed
void SetCollapsed(Bool_t collapsed)
Sets collapsing of node to "collapse".
Definition: TStructNode.cxx:360
TStructNode::GetMiddle
Float_t GetMiddle() const
Returns center of outlining box on y-axis.
Definition: TStructNode.cxx:175
TGRadioButton
Selects different options.
Definition: TGButton.h:322
TStructViewerGUI::Update
void Update(Bool_t resetCamera=false)
Updates view. Clear all the nodes, call draw function and update scene. Doesn't reset camera.
Definition: TStructViewerGUI.cxx:814
h
#define h(i)
Definition: RSha256.hxx:106
TStructViewer.h
TPolyLine3D
A 3-dimensional polyline.
Definition: TPolyLine3D.h:33
TGCompositeFrame::MapSubwindows
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1164
TGVerticalFrame
A composite frame that layout their children in vertical way.
Definition: TGFrame.h:375
TGTab::AddTab
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
Definition: TGTab.cxx:376
TStructViewerGUI::fScaleBySizeButton
TGRadioButton * fScaleBySizeButton
Definition: TStructViewerGUI.h:70
TStructNode::SetVisible
void SetVisible(bool visible)
Sets visibility of node to "visible".
Definition: TStructNode.cxx:448
TPad::GetListOfPrimitives
TList * GetListOfPrimitives() const override
Definition: TPad.h:239
TGFrame::Resize
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:605
TGTextEntry
A TGTextEntry is a one line text input widget.
Definition: TGTextEntry.h:24
TStructViewerGUI::Divide
void Divide(TList *list, Float_t x1, Float_t x2, Float_t y1, Float_t y2)
Divides rectangle where the outlining box is placed.
Definition: TStructViewerGUI.cxx:355
TString::Remove
TString & Remove(Ssiz_t pos)
Definition: TString.h:673
TSeqCollection::RemoveFirst
virtual void RemoveFirst()
Definition: TSeqCollection.h:44
TStructNode::GetLevel
UInt_t GetLevel() const
Returns actual level of node.
Definition: TStructNode.cxx:119
GetPixel
static void GetPixel(int y, int width, Byte_t *scline)
Get pixels in line y and put in array scline.
Definition: TGWin32.cxx:4290
TStructViewer::SetPointer
void SetPointer(void *ptr, const char *clname=NULL)
Set main pointer of class "clname".
Definition: TStructViewer.cxx:480
TStructNode::SetScaleBy
static void SetScaleBy(EScalingType type)
Sets scaling by to "type".
Definition: TStructNode.cxx:424
TStructViewerGUI::GetLinksVisibility
Bool_t GetLinksVisibility() const
Returns true if links are visible, otherwise return false.
Definition: TStructViewerGUI.cxx:610
TStructNode::GetTypeName
TString GetTypeName() const
Returns name of class.
Definition: TStructNode.cxx:272
TStructViewerGUI::fShowLinksCheckButton
TGCheckButton * fShowLinksCheckButton
Definition: TStructViewerGUI.h:60
kButtonPress
@ kButtonPress
Definition: GuiTypes.h:60
TStructNode::GetName
const char * GetName() const
Returns name of object.
Definition: TStructNode.cxx:127
TGLViewer::PadPaint
virtual void PadPaint(TVirtualPad *pad)
Entry point for updating viewer contents via VirtualViewer3D interface.
Definition: TGLViewer.cxx:303
Long_t
long Long_t
Definition: RtypesCore.h:54
TStructViewerGUI::BoxHeightValueSetSlot
void BoxHeightValueSetSlot(Long_t h)
Emmited when user changes height of boxes.
Definition: TStructViewerGUI.cxx:250
TStructNodeProperty::GetColor
TColor GetColor() const
Returns color of class.
Definition: TStructNodeProperty.cxx:112
TStructViewerGUI::FindNodeProperty
TStructNodeProperty * FindNodeProperty(TStructNode *node)
Returns pointer to property associated with node "node".
Definition: TStructViewerGUI.cxx:555
TGLayoutHints
This class describes layout hints used by the layout classes.
Definition: TGLayout.h:50
TPolyLine3D.h
TStructViewerGUI::UpdateButtonSlot
void UpdateButtonSlot()
Update button slot. Updates scene.
Definition: TStructViewerGUI.cxx:834
TGGroupFrame
A composite frame with a border and a title.
Definition: TGFrame.h:522
RQ_OBJECT.h
gApplication
R__EXTERN TApplication * gApplication
Definition: TApplication.h:165
TStructViewerGUI::UpdateLabels
void UpdateLabels(TStructNode *node)
Refresh information in labels when user put mouse over object.
Definition: TStructViewerGUI.cxx:842
TStructViewerGUI::LevelDistValueSetSlot
void LevelDistValueSetSlot(Long_t dist)
Emmited when user changes distance between levels.
Definition: TStructViewerGUI.cxx:654
TGTab
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
TStructViewerGUI::fVisibleObjects
TList fVisibleObjects
Definition: TStructViewerGUI.h:49
TStructViewerGUI::fNodeTypelabel
TGLabel * fNodeTypelabel
Definition: TStructViewerGUI.h:62
TGButtonGroup.h
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
kMotionNotify
@ kMotionNotify
Definition: GuiTypes.h:61
TGTab.h
TClass::GetClass
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:2955
TStructViewerGUI::fPointerTextEntry
TGTextEntry * fPointerTextEntry
Definition: TStructViewerGUI.h:72
sqrt
double sqrt(double)
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
kLHintsExpandY
@ kLHintsExpandY
Definition: TGLayout.h:31
TGLPhysicalShape::GetLogical
const TGLLogicalShape * GetLogical() const
Definition: TGLPhysicalShape.h:96
TStructNode::IsVisible
bool IsVisible() const
Returns true if node is visible.
Definition: TStructNode.cxx:344
TStructNode::GetY
Float_t GetY() const
Returns Y coordinate.
Definition: TStructNode.cxx:320
TStructViewerGUI::fScaleByMembersButton
TGRadioButton * fScaleByMembersButton
Definition: TStructViewerGUI.h:71
TStructViewerGUI::fMembersCountLabel
TGLabel * fMembersCountLabel
Definition: TStructViewerGUI.h:63
TStructViewerGUI::CheckMaxObjects
void CheckMaxObjects(TStructNode *parent)
Check if all of nodes can be displayed on scene. Hides redendant nodes.
Definition: TStructViewerGUI.cxx:290
TMath::Min
Short_t Min(Short_t a, Short_t b)
Definition: TMathBase.h:180
TGLWidget.h
unsigned int
TGeoMatrix.h
TStructNodeEditor.h
TGeoVolume::ClearNodes
void ClearNodes()
Definition: TGeoVolume.h:100
kSize
@ kSize
Definition: TStructNode.h:26
kHorizontalFrame
@ kHorizontalFrame
Definition: GuiTypes.h:382
TStructNodeProperty
Definition: TStructNodeProperty.h:19
TStructViewerGUI::fPointerTypeTextEntry
TGTextEntry * fPointerTypeTextEntry
Definition: TStructViewerGUI.h:73
TStructViewerGUI::fMouseY
UInt_t fMouseY
Definition: TStructViewerGUI.h:45
TGeoManager.h
TStructViewerGUI::fgMedium
static TGeoMedium * fgMedium
Definition: TStructViewerGUI.h:52
TStructViewerGUI::fMouseX
UInt_t fMouseX
Definition: TStructViewerGUI.h:44
TStructNode
Definition: TStructNode.h:34
TStructViewerGUI::ResetButtonSlot
void ResetButtonSlot()
Resets camera.
Definition: TStructViewerGUI.cxx:707
Longptr_t
long Longptr_t
Definition: RtypesCore.h:82
TGeoVolume::AddNodeOverlap
virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a TGeoNode to the list of nodes.
Definition: TGeoVolume.cxx:996
TStructViewerGUI::GetCanvas
TCanvas * GetCanvas()
Definition: TStructViewerGUI.cxx:580
TStructViewerGUI::TStructViewerGUI
TStructViewerGUI(TStructViewer *parent, TStructNode *nodePtr, TList *colors, const TGWindow *p=NULL, UInt_t w=800, UInt_t h=600)
Constructs window with "w" as width, "h" as height and given parent "p".
Definition: TStructViewerGUI.cxx:57
TGNumberEntry::SetLimits
virtual void SetLimits(ELimit limits=TGNumberFormat::kNELNoLimits, Double_t min=0, Double_t max=1)
Definition: TGNumberEntry.h:219
TStructViewerGUI::DrawLink
void DrawLink(TStructNode *parent)
Recursive method to draw links.
Definition: TStructViewerGUI.cxx:448
TStructNode::GetVolumeRatio
Float_t GetVolumeRatio()
Returns ratio - volme of node to area taken by outlining box.
Definition: TStructNode.cxx:296
TQObject::Connect
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:869
TStructViewerGUI::fTotalSizeLabel
TGLabel * fTotalSizeLabel
Definition: TStructViewerGUI.h:66
TStructNode::SetHeight
void SetHeight(Float_t h)
Sets width of outlining box to "w".
Definition: TStructNode.cxx:368
TCanvas
The Canvas class.
Definition: TCanvas.h:23
TStructNode::GetTotalSize
ULong_t GetTotalSize() const
Returns total size of allocated memory in bytes.
Definition: TStructNode.cxx:264
TCollection::GetSize
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:182
TStructViewerGUI::Scale
void Scale(TStructNode *parent)
Recursive method to scaling all modes on scene.
Definition: TStructViewerGUI.cxx:717
TClass
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
TStructViewerGUI::fRedoButton
TGTextButton * fRedoButton
Definition: TStructViewerGUI.h:69
TStructViewerGUI::fUndoButton
TGTextButton * fUndoButton
Definition: TStructViewerGUI.h:68
TGLLogicalShape.h
TGLViewer::UpdateScene
void UpdateScene(Bool_t redraw=kTRUE)
Force update of pad-scenes.
Definition: TGLViewer.cxx:335
TList::Add
virtual void Add(TObject *obj)
Definition: TList.h:87
TGButton::GetState
virtual EButtonState GetState() const
Definition: TGButton.h:112
TGSplitter.h
TStructViewerGUI::MouseOverSlot
void MouseOverSlot(TGLPhysicalShape *shape)
MouseOver slot.
Definition: TStructViewerGUI.cxx:665
Event_t
Event structure.
Definition: GuiTypes.h:174
TList::Clear
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Definition: TList.cxx:402
TStructViewerGUI::ShowLinksToggled
void ShowLinksToggled(Bool_t on)
Changes links visibility and refresh view.
Definition: TStructViewerGUI.cxx:788
name
char name[80]
Definition: TGX11.cxx:110
TStructNode::GetHeight
Float_t GetHeight() const
Returns height of outlining box.
Definition: TStructNode.cxx:111
TGLPhysicalShape
Concrete physical shape - a GL drawable.
Definition: TGLPhysicalShape.h:32
kDeepCleanup
@ kDeepCleanup
Definition: TGFrame.h:42
TGTextEntry::GetText
const char * GetText() const
Definition: TGTextEntry.h:119
TGNumberFormat::kNELLimitMin
@ kNELLimitMin
Lower limit only.
Definition: TGNumberEntry.h:48
x2
static const double x2[5]
Definition: RooGaussKronrodIntegrator1D.cxx:364
TIter
Definition: TCollection.h:233
TGButton::SetOn
virtual void SetOn(Bool_t on=kTRUE, Bool_t emit=kFALSE)
Definition: TGButton.h:120
TStructViewerGUI::Draw
void Draw(Option_t *option="")
Check limits and draws nodes and links.
Definition: TStructViewerGUI.cxx:430
TGColorSelect
Like a checkbutton but instead of the check mark there is color area with a little down arrow.
Definition: TGColorSelect.h:104
TStructViewerGUI::CloseWindow
void CloseWindow()
Delete window.
Definition: TStructViewerGUI.cxx:334
TGNumberEntry::GetNumber
virtual Double_t GetNumber() const
Definition: TGNumberEntry.h:197
kLHintsExpandX
@ kLHintsExpandX
Definition: TGLayout.h:30
TGCompositeFrame::SetCleanup
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1072
TStructViewerGUI::CalculatePosistion
void CalculatePosistion(TStructNode *parent)
Recursive method to calculating nodes posistion in 3D space.
Definition: TStructViewerGUI.cxx:260
TExMap::Add
void Add(ULong64_t hash, Long64_t key, Long64_t value)
Add an (key,value) pair to the table. The key should be unique.
Definition: TExMap.cxx:87
TStructNode::IsCollapsed
Bool_t IsCollapsed() const
Returns true if node is colllapsed.
Definition: TStructNode.cxx:328
TGNumberEntry
TGNumberEntry is a number entry input widget with up/down buttons.
Definition: TGNumberEntry.h:148
TStructNode::SetX
void SetX(Float_t x)
Sets X coordinate to "x".
Definition: TStructNode.cxx:464
TGeoMedium
Media are used to store properties related to tracking and which are useful only when using geometry ...
Definition: TGeoMedium.h:24
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
TStructViewerGUI::SetLinksVisibility
void SetLinksVisibility(Bool_t val)
Sets links visibility to "visible".
Definition: TStructViewerGUI.cxx:767
TGVSplitter
Definition: TGSplitter.h:53
TStructNode::GetAllMembersCount
ULong_t GetAllMembersCount() const
Returns number of all members in node.
Definition: TStructNode.cxx:95
Class
void Class()
Definition: Class.C:29
TGeoVolume::SetLineColor
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition: TGeoVolume.cxx:2036
TStructNode::GetMembersCount
ULong_t GetMembersCount() const
Returns numbers of members of node.
Definition: TStructNode.cxx:167
TGCompositeFrame
The base class for composite widgets (menu bars, list boxes, etc.).
Definition: TGFrame.h:287
TGToolTip::Hide
void Hide()
Hide tool tip window.
Definition: TGToolTip.cxx:250
TStructViewerGUI::ScaleByChangedSlot
void ScaleByChangedSlot()
Activated when user press radio button.
Definition: TStructViewerGUI.cxx:883
TGeoManager
The manager class for any TGeo geometry.
Definition: TGeoManager.h:45
splitter
REAL splitter
Definition: triangle.c:617
TGCompositeFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1117
TGLViewer::kCameraPerspXOY
@ kCameraPerspXOY
Definition: TGLViewer.h:61
kCollection
@ kCollection
Definition: TStructNode.h:21
TStructViewerGUI::~TStructViewerGUI
~TStructViewerGUI()
Destructor.
Definition: TStructViewerGUI.cxx:232
TStructViewerGUI::fAutoRefesh
TGCheckButton * fAutoRefesh
Definition: TStructViewerGUI.h:76
TStructViewerGUI::fParent
TStructViewer * fParent
Definition: TStructViewerGUI.h:40
TGeoVolume
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition: TGeoVolume.h:49
TStructNode::GetCenter
Float_t GetCenter() const
Returns center of outlining box on x-axis.
Definition: TStructNode.cxx:103
TObject::Clear
virtual void Clear(Option_t *="")
Definition: TObject.h:115
TStructViewerGUI::GLWidgetProcessedEventSlot
void GLWidgetProcessedEventSlot(Event_t *event)
Handle events. Sets fMouseX and fMouseY when user move a mouse over viewer and hides ToolTip.
Definition: TStructViewerGUI.cxx:630
TList
A doubly linked list.
Definition: TList.h:44
TMath.h
TStructNode.h
gROOT
#define gROOT
Definition: TROOT.h:404
TExMap.h
int
TStructNodeEditor
Definition: TStructNodeEditor.h:26
TStructViewerGUI::fBoxHeightEntry
TGNumberEntry * fBoxHeightEntry
Definition: TStructViewerGUI.h:75
TColor::GetNumber
Int_t GetNumber() const
Definition: TColor.h:55