101 infoFrame->
AddFrame(fInfoMenu, expandX);
109 fShowLinksCheckButton->Connect(
"Toggled(Bool_t)",
"TStructViewerGUI",
this,
"ShowLinksToggled(Bool_t)");
115 fScaleBySizeButton->Connect(
"Clicked()",
"TStructViewerGUI",
this,
"ScaleByChangedSlot()");
119 options->
AddFrame(scaleByGroup, expandX);
122 options->
AddFrame(defaultColorFrame, expandX);
123 TGLabel* defColorlabel =
new TGLabel(defaultColorFrame,
"Default color");
124 defaultColorFrame->
AddFrame(defColorlabel, expandX);
126 defColorSelect->
Connect(
"ColorSelected(Pixel_t)",
"TStructViewerGUI",
this,
"ColorSelectedSlot(Pixel_t)");
127 defaultColorFrame->
AddFrame(defColorSelect);
130 options->
AddFrame(boxHeightFrame, expandX);
131 TGLabel* boxHeightLabel =
new TGLabel(boxHeightFrame,
"Box height:");
132 boxHeightFrame->
AddFrame(boxHeightLabel, expandX);
135 fBoxHeightEntry->Connect(
"ValueSet(Long_t)",
"TStructViewerGUI",
this,
"BoxHeightValueSetSlot(Long_t)");
139 options->
AddFrame(levelDistanceFrame, expandX);
140 TGLabel* lvlDistLabel =
new TGLabel(levelDistanceFrame,
"Distance between levels");
141 levelDistanceFrame->
AddFrame(lvlDistLabel, expandX);
144 fLevelDistanceEntry->Connect(
"ValueSet(Long_t)",
"TStructViewerGUI",
this,
"LevelDistValueSetSlot(Long_t)");
149 fAutoRefesh->Connect(
"Toggled(Bool_t)",
"TStructViewerGUI",
this,
"AutoRefreshButtonSlot(Bool_t)");
153 options->
AddFrame(pointerLabel, expandX);
156 TGLabel* fPointerTypeLabel =
new TGLabel(options,
"Pointer Type:");
157 options->
AddFrame(fPointerTypeLabel, expandX);
161 setPointerButton->
Connect(
"Clicked()",
"TStructViewerGUI",
this,
"SetPointerButtonSlot()");
162 options->
AddFrame(setPointerButton, expandX);
169 fEditor->Connect(
"Update(Bool_t)",
"TStructViewerGUI",
this,
"Update(Bool_t)");
175 splitter->
SetFrame(leftFrame,
true);
182 fUndoButton->Connect(
"Clicked()",
"TStructViewerGUI",
this,
"UndoButtonSlot()");
187 fRedoButton->Connect(
"Clicked()",
"TStructViewerGUI",
this,
"RedoButtonSlot()");
192 leftFrame->
AddFrame(resetCameraButton, expandX);
193 resetCameraButton->
Connect(
"Clicked()",
"TStructViewerGUI",
this,
"ResetButtonSlot()");
196 updateButton->
Connect(
"Clicked()",
"TStructViewerGUI",
this,
"UpdateButtonSlot()");
197 leftFrame->
AddFrame(updateButton, expandX);
200 leftFrame->
AddFrame(quitButton, expandX);
212 fGLViewer->Connect(
"MouseOver(TGLPhysicalShape*)",
"TStructViewerGUI",
this,
"MouseOverSlot(TGLPhysicalShape*)");
213 fGLViewer->GetGLWidget()->Connect(
"ProcessedEvent(Event_t*)",
"TStructViewerGUI",
this,
"GLWidgetProcessedEventSlot(Event_t*))");
214 fGLViewer->Connect(
"DoubleClicked()",
"TStructViewerGUI",
this,
"DoubleClickedSlot()");
217 fGLViewer->SetResetCamerasOnUpdate(
false);
356 if (list->GetSize() > 1) {
368 if(sum1 >=
sum/2.0) {
381 if (width < height) {
382 Float_t split = y1 + ratio * height;
383 Divide(&list1, x1, x2, y1, split);
384 Divide(&list2, x1, x2, split, y2);
386 Float_t split = x1 + ratio * width;
387 Divide(&list1, x1, split, y1, y2);
388 Divide(&list2, split, x2, y1, y2);
390 }
else if (list->GetSize() == 1) {
508 for (
Float_t i = -(slices-1)/2; i < slices/2; i++) {
564 if (cl->InheritsFrom(propName.
Data())) {
631 switch (event->
fType) {
738 parent->
SetWidth(sqrt * sqrt / min);
819 fCanvas->GetListOfPrimitives()->Clear();
855 name =
"All members: ";
864 name =
"Total size: ";
ULong_t Pixel_t
Pixel value.
int Int_t
Signed integer 4 bytes (int).
long Longptr_t
Integer large enough to hold a pointer (platform-dependent).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
bool Bool_t
Boolean (0=false, 1=true) (bool).
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
externTApplication * gApplication
externTGeoManager * gGeoManager
const Bool_t kSortDescending
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
TClass instances represent classes, structs and namespaces in the ROOT type system.
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.
virtual void AddAll(const TCollection *col)
Add all objects from collection col to this collection.
Like a checkbutton but instead of the check mark there is color area with a little down arrow.
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
TGCompositeFrame(const TGCompositeFrame &)=delete
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
void MapWindow() override
map window
virtual void DeleteWindow()
Delete window.
A composite frame with a border and a title.
A composite frame that layout their children in horizontal way.
Minimal GL-viewer that can be embedded in a standard ROOT frames.
Concrete physical shape - a GL drawable.
const TGLLogicalShape * GetLogical() const
This class handles GUI labels.
This class describes layout hints used by the layout classes.
TGMainFrame(const TGMainFrame &)=delete
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
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.
TGNumberEntry is a number entry input widget with up/down buttons.
A tab widget contains a set of composite frames each with a little tab with a name (like a set of fol...
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
Yield an action as soon as it is clicked.
A TGTextEntry is a one line text input widget.
void SetFrame(TGFrame *frame, Bool_t left) override
Set frame to be resized.
A composite frame that layout their children in vertical way.
ROOT GUI Window base class.
The manager class for any TGeo geometry.
Base class describing materials.
Media are used to store properties related to tracking and which are useful only when using geometry ...
Class describing translations.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
void SetLineWidth(Width_t lwidth) override
Set the line width.
virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
Add a TGeoNode to the list of nodes.
void SetLineColor(Color_t lcolor) override
Set the line color.
void Add(TObject *obj) override
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
virtual void Sort(Bool_t order=kSortAscending)
Sort linked list.
const char * GetName() const override
Returns name of object.
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.
virtual void RemoveFirst()
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
const char * Data() const
TString & Remove(Ssiz_t pos)
TColor GetColor() const
Returns color of class.
void SetColor(const TColor &color)
Sets the color to "color".
const char * GetName() const override
Returns name of object.
ULong_t GetAllMembersCount() const
Returns number of all members in node.
void SetY(Float_t y)
Sets Y coordinate to "y".
ULong_t GetSize() const
Returns size of node.
TString GetTypeName() const
Returns name of class.
void SetX(Float_t x)
Sets X coordinate to "x".
void SetWidth(Float_t w)
Sets width of outlining box to "w".
void SetCollapsed(Bool_t collapsed)
Sets collapsing of node to "collapse".
ULong_t GetMembersCount() const
Returns numbers of members of node.
bool IsVisible() const
Returns true if node is visible.
Float_t GetCenter() const
Returns center of outlining box on x-axis.
ULong_t GetVolume() const
Returns size or number of members.
Float_t GetY() const
Returns Y coordinate.
void SetVisible(bool visible)
Sets visibility of node to "visible".
TList * GetMembers() const
Returns list with pointers to daughter nodes.
Float_t GetWidth() const
Returns width of outlining box.
Float_t GetVolumeRatio()
Returns ratio - volme of node to area taken by outlining box.
static void SetScaleBy(EScalingType type)
Sets scaling by to "type".
Float_t GetX() const
Returns X coordinate.
Float_t GetRelativeVolumeRatio()
Returns ratio - relative volume to area taken by utlining box.
Float_t GetMiddle() const
Returns center of outlining box on y-axis.
ENodeType GetNodeType() const
Returns type of node.
void SetHeight(Float_t h)
Sets width of outlining box to "w".
Float_t GetHeight() const
Returns height of outlining box.
UInt_t GetLevel() const
Returns actual level of node.
ULong_t GetTotalSize() const
Returns total size of allocated memory in bytes.
Bool_t IsCollapsed() const
Returns true if node is colllapsed.
TGLabel * fTotalSizeLabel
void SetNodePtr(TStructNode *val)
Sets top node pointer and updates view.
TGLabel * fAllMembersCountLabel
void ResetButtonSlot()
Resets camera.
TGTextEntry * fPointerTextEntry
~TStructViewerGUI() override
Destructor.
void DrawNode(TStructNode *node)
Creates and draws TGeoVolume from given "node".
void Scale(TStructNode *parent)
Recursive method to scaling all modes on scene.
void RedoButtonSlot()
Activated when user click Redo button. Repeat last Undo action.
TStructNodeProperty * FindNodeProperty(TStructNode *node)
Returns pointer to property associated with node "node".
void ColorSelectedSlot(Pixel_t pixel)
Slot for default color selsect.
TGTextButton * fRedoButton
void BoxHeightValueSetSlot(Long_t h)
Emmited when user changes height of boxes.
TGNumberEntry * fBoxHeightEntry
TStructNode * fSelectedObject
TGRadioButton * fScaleByMembersButton
TStructNode * GetNodePtr() const
Returns top node pointer.
void CheckMaxObjects(TStructNode *parent)
Check if all of nodes can be displayed on scene. Hides redendant nodes.
TGLabel * fMembersCountLabel
void UpdateLabels(TStructNode *node)
Refresh information in labels when user put mouse over object.
void UpdateButtonSlot()
Update button slot. Updates scene.
void MouseOverSlot(TGLPhysicalShape *shape)
MouseOver slot.
Bool_t GetLinksVisibility() const
Returns true if links are visible, otherwise return false.
void DrawLink(TStructNode *parent)
Recursive method to draw links.
void SetLinksVisibility(Bool_t val)
Sets links visibility to "visible".
TGNumberEntry * fLevelDistanceEntry
void AutoRefreshButtonSlot(Bool_t on)
Activated when user chage condition.
TGCheckButton * fAutoRefesh
void DoubleClickedSlot()
Activated when user double click on objects on 3D scene.
void UnCheckMaxObjects()
Shows hidden nodes.
TGTextButton * fUndoButton
TStructNodeProperty * GetDefaultColor()
Return default color for nodes.
void DrawVolumes(TStructNode *visObj)
Recursive method to draw GeoVolumes.
void LevelDistValueSetSlot(Long_t dist)
Emmited when user changes distance between levels.
TGRadioButton * fScaleBySizeButton
Int_t GetColor(TStructNode *node)
Returns color form fColors for given "node".
TGLEmbeddedViewer * fGLViewer
TStructNodeEditor * fEditor
static TGeoMedium * fgMedium
void ScaleByChangedSlot()
Activated when user press radio button.
TStructViewerGUI(TStructViewer *parent, TStructNode *nodePtr, TList *colors, const TGWindow *p=nullptr, UInt_t w=800, UInt_t h=600)
Constructs window with "w" as width, "h" as height and given parent "p".
TGTextEntry * fPointerTypeTextEntry
void CloseWindow() override
Delete window.
void UndoButtonSlot()
UndoButton Slot. Activated when user press Undo button. Restore last top node pointer.
void Draw(Option_t *option="") override
Check limits and draws nodes and links.
void GLWidgetProcessedEventSlot(Event_t *event)
Handle events. Sets fMouseX and fMouseY when user move a mouse over viewer and hides ToolTip.
void ShowLinksToggled(Bool_t on)
Changes links visibility and refresh view.
void SetPointerButtonSlot()
Sets pointer given in fPointerTestEntry to the main pointer.
void Divide(TList *list, Float_t x1, Float_t x2, Float_t y1, Float_t y2)
Divides rectangle where the outlining box is placed.
TGCheckButton * fShowLinksCheckButton
void CalculatePosistion(TStructNode *parent)
Recursive method to calculating nodes posistion in 3D space.
void Update(Bool_t resetCamera=false)
Updates view. Clear all the nodes, call draw function and update scene. Doesn't reset camera.
Double_t Sqrt(Double_t x)
Returns the square root of x.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
EGEventType fType
of event (see EGEventType)
static uint64_t sum(uint64_t i)