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) {
390 }
else if (list->GetSize() == 1) {
508 for (
Float_t i = -(slices-1)/2; i < slices/2; i++) {
564 if (cl->InheritsFrom(propName.
Data())) {
592 return prop->GetColor().GetNumber();
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.
bool Bool_t
Boolean (0=false, 1=true) (bool).
int Int_t
Signed integer 4 bytes (int).
long Longptr_t
Integer large enough to hold a pointer (platform-dependent).
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.
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
externTApplication * gApplication
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void w
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void pixel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h prop
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t SetWMSizeHints
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Option_t Option_t TPoint TPoint const char y1
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.
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.
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.
A 3-dimensional polyline.
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)
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)