102 infoFrame->
AddFrame(fInfoMenu, expandX);
120 options->
AddFrame(scaleByGroup, expandX);
123 options->
AddFrame(defaultColorFrame, expandX);
124 TGLabel* defColorlabel =
new TGLabel(defaultColorFrame,
"Default color");
125 defaultColorFrame->
AddFrame(defColorlabel, expandX);
127 defColorSelect->
Connect(
"ColorSelected(Pixel_t)",
"TStructViewerGUI",
this,
"ColorSelectedSlot(Pixel_t)");
128 defaultColorFrame->
AddFrame(defColorSelect);
131 options->
AddFrame(boxHeightFrame, expandX);
132 TGLabel* boxHeightLabel =
new TGLabel(boxHeightFrame,
"Box height:");
133 boxHeightFrame->
AddFrame(boxHeightLabel, expandX);
140 options->
AddFrame(levelDistanceFrame, expandX);
141 TGLabel* lvlDistLabel =
new TGLabel(levelDistanceFrame,
"Distance between levels");
142 levelDistanceFrame->
AddFrame(lvlDistLabel, expandX);
150 fAutoRefesh->
Connect(
"Toggled(Bool_t)",
"TStructViewerGUI",
this,
"AutoRefreshButtonSlot(Bool_t)");
154 options->
AddFrame(pointerLabel, expandX);
157 TGLabel* fPointerTypeLabel =
new TGLabel(options,
"Pointer Type:");
158 options->
AddFrame(fPointerTypeLabel, expandX);
162 setPointerButton->
Connect(
"Clicked()",
"TStructViewerGUI",
this,
"SetPointerButtonSlot()");
163 options->
AddFrame(setPointerButton, expandX);
170 fEditor->
Connect(
"Update(Bool_t)",
"TStructViewerGUI",
this,
"Update(Bool_t)");
176 splitter->SetFrame(leftFrame,
true);
193 leftFrame->
AddFrame(resetCameraButton, expandX);
194 resetCameraButton->
Connect(
"Clicked()",
"TStructViewerGUI",
this,
"ResetButtonSlot()");
197 updateButton->
Connect(
"Clicked()",
"TStructViewerGUI",
this,
"UpdateButtonSlot()");
198 leftFrame->
AddFrame(updateButton, expandX);
201 leftFrame->
AddFrame(quitButton, expandX);
213 fGLViewer->
Connect(
"MouseOver(TGLPhysicalShape*)",
"TStructViewerGUI",
this,
"MouseOverSlot(TGLPhysicalShape*)");
215 fGLViewer->
Connect(
"DoubleClicked()",
"TStructViewerGUI",
this,
"DoubleClickedSlot()");
369 if(sum1 >=
sum/2.0) {
391 }
else if (list->
GetSize() == 1) {
509 for (
Float_t i = -(slices-1)/2; i < slices/2; i++) {
565 if (cl->InheritsFrom(propName.
Data())) {
593 return prop->GetColor().GetNumber();
632 switch (
event->fType) {
739 parent->
SetWidth(sqrt * sqrt / min);
850 name =
"All members: ";
859 name =
"Total size: ";
ULong_t Pixel_t
Pixel value.
R__EXTERN TApplication * gApplication
winID h TVirtualViewer3D TVirtualGLPainter p
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
static void GetPixel(int y, int width, Byte_t *scline)
Get pixels in line y and put in array scline.
R__EXTERN TGeoManager * gGeoManager
const Bool_t kSortDescending
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
TClass instances represent classes, structs and namespaces in the ROOT type system.
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
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.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
void Add(ULong64_t hash, Long64_t key, Long64_t value)
Add an (key,value) pair to the table. The key should be unique.
Long64_t GetValue(ULong64_t hash, Long64_t key)
Return the value belonging to specified key and hash value.
Like a checkbutton but instead of the check mark there is color area with a little down arrow.
The base class for composite widgets (menu bars, list boxes, etc.).
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.
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.
TGCompositeFrame * GetFrame() const
Concrete physical shape - a GL drawable.
const TGLLogicalShape * GetLogical() const
virtual void PadPaint(TVirtualPad *pad)
Entry point for updating viewer contents via VirtualViewer3D interface.
void SetCurrentCamera(ECameraType camera)
Set current active camera - 'cameraType' one of: kCameraPerspX, kCameraPerspY, kCameraPerspZ,...
void UpdateScene(Bool_t redraw=kTRUE)
Force update of pad-scenes.
void SetResetCamerasOnUpdate(Bool_t v)
void ResetCurrentCamera()
Resets position/rotation of current camera to default values.
TGLWidget * GetGLWidget()
This class handles GUI labels.
virtual void SetText(TGString *newText)
Set new text in label.
This class describes layout hints used by the layout classes.
Defines top level windows that interact with the system Window Manager.
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.
virtual void SetLimits(ELimit limits=TGNumberFormat::kNELNoLimits, Double_t min=0, Double_t max=1)
virtual Double_t GetNumber() const
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.
const char * GetText() const
A composite frame that layout their children in vertical way.
ROOT GUI Window base class.
The manager class for any TGeo geometry.
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.
void SetTopVolume(TGeoVolume *vol)
Set the top volume and corresponding node as starting point of the geometry.
void SetNsegments(Int_t nseg)
Set number of segments for approximating circles in drawing.
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.
virtual TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
Add a TGeoNode to the list of nodes.
virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
Add a TGeoNode to the list of nodes.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
void Clear(Option_t *option="") override
Remove all objects from the list.
void Add(TObject *obj) override
TObject * Last() const override
Return the last object in the list. Returns 0 when list is empty.
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
void RemoveLast() override
Remove the last object of the list.
virtual void Sort(Bool_t order=kSortAscending)
Sort linked list.
virtual void Clear(Option_t *="")
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
TList * GetListOfPrimitives() const override
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)
void SetModel(TObject *obj)
Pick up the used node attributes.
UInt_t GetMaxLevel() const
Returns maximum number of leves displayed when the node is top node on scene.
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".
virtual TClass * IsA() const
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.
const char * GetName() const
Returns name of object.
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 GetMaxObjects() const
Returns maximum number of objects displayed when the node is top node on scene.
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.
~TStructViewerGUI()
Destructor.
TGTextEntry * fPointerTextEntry
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 Draw(Option_t *option="")
Check limits and draws nodes and links.
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 UndoButtonSlot()
UndoButton Slot. Activated when user press Undo button. Restore last top node pointer.
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 CloseWindow()
Delete window.
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.
void SetPointer(void *ptr, const char *clname=nullptr)
Set main pointer of class "clname".
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.
static uint64_t sum(uint64_t i)