105 infoFrame->
AddFrame(fInfoMenu, expandX);
123 options->
AddFrame(scaleByGroup, expandX);
126 options->
AddFrame(defaultColorFrame, expandX);
127 TGLabel* defColorlabel =
new TGLabel(defaultColorFrame,
"Default color");
128 defaultColorFrame->
AddFrame(defColorlabel, expandX);
130 defColorSelect->
Connect(
"ColorSelected(Pixel_t)",
"TStructViewerGUI",
this,
"ColorSelectedSlot(Pixel_t)");
131 defaultColorFrame->
AddFrame(defColorSelect);
134 options->
AddFrame(boxHeightFrame, expandX);
135 TGLabel* boxHeightLabel =
new TGLabel(boxHeightFrame,
"Box height:");
136 boxHeightFrame->
AddFrame(boxHeightLabel, expandX);
143 options->
AddFrame(levelDistanceFrame, expandX);
144 TGLabel* lvlDistLabel =
new TGLabel(levelDistanceFrame,
"Distance between levels");
145 levelDistanceFrame->
AddFrame(lvlDistLabel, expandX);
153 fAutoRefesh->
Connect(
"Toggled(Bool_t)",
"TStructViewerGUI",
this,
"AutoRefreshButtonSlot(Bool_t)");
157 options->
AddFrame(pointerLabel, expandX);
160 TGLabel* fPointerTypeLabel =
new TGLabel(options,
"Pointer Type:");
161 options->
AddFrame(fPointerTypeLabel, expandX);
165 setPointerButton->
Connect(
"Clicked()",
"TStructViewerGUI",
this,
"SetPointerButtonSlot()");
166 options->
AddFrame(setPointerButton, expandX);
173 fEditor->
Connect(
"Update(Bool_t)",
"TStructViewerGUI",
this,
"Update(Bool_t)");
179 splitter->
SetFrame(leftFrame,
true);
196 leftFrame->
AddFrame(resetCameraButton, expandX);
197 resetCameraButton->
Connect(
"Clicked()",
"TStructViewerGUI",
this,
"ResetButtonSlot()");
200 updateButton->
Connect(
"Clicked()",
"TStructViewerGUI",
this,
"UpdateButtonSlot()");
201 leftFrame->
AddFrame(updateButton, expandX);
204 leftFrame->
AddFrame(quitButton, expandX);
216 fGLViewer->
Connect(
"MouseOver(TGLPhysicalShape*)",
"TStructViewerGUI",
this,
"MouseOverSlot(TGLPhysicalShape*)");
218 fGLViewer->
Connect(
"DoubleClicked()",
"TStructViewerGUI",
this,
"DoubleClickedSlot()");
372 if(sum1 >=
sum/2.0) {
385 if (width < height) {
386 Float_t split = y1 + ratio * height;
387 Divide(&list1, x1, x2, y1, split);
388 Divide(&list2, x1, x2, split, y2);
391 Divide(&list1, x1, split, y1, y2);
392 Divide(&list2, split, x2, y1, y2);
394 }
else if (list->
GetSize() == 1) {
472 if(!node->IsCollapsed()) {
512 for (
Float_t i = -(slices-1)/2; i < slices/2; i++) {
564 if (propName.EndsWith(
"+")) {
567 propName.
Remove(propName.Length()-1, 1);
568 if (cl->InheritsFrom(propName.Data())) {
635 switch (event->
fType) {
742 parent->
SetWidth(sqrt * sqrt / min);
853 name =
"All members: ";
862 name =
"Total size: ";
virtual void Clear(Option_t *="")
virtual const char * GetName() const
Returns name of object.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
TGCompositeFrame * GetFrame() const
void Add(ULong64_t hash, Long64_t key, Long64_t value)
Add an (key,value) pair to the table. The key should be unique.
void SetNodePtr(TStructNode *val)
Sets top node pointer and updates view.
static long int sum(long int i)
TGTextEntry * fPointerTypeTextEntry
Float_t GetWidth() const
Returns width of outlining box.
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...
virtual void PadPaint(TVirtualPad *pad)
Entry point for updating viewer contents via VirtualViewer3D interface.
The manager class for any TGeo geometry.
void SetLinksVisibility(Bool_t val)
Sets links visibility to "visible".
TList * GetListOfPrimitives() const
void ScaleByChangedSlot()
Activated when user press radio button.
Float_t GetCenter() const
Returns center of outlining box on x-axis.
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
ULong_t GetVolume() const
Returns size or number of members.
void SetY(Float_t y)
Sets Y coordinate to "y".
image html pict1_TGaxis_012 png width
Define new text attributes for the label number "labNum".
Float_t GetRelativeVolumeRatio()
Returns ratio - relative volume to area taken by utlining box.
virtual void RemoveLast()
Remove the last object of the list.
UInt_t GetMaxLevel() const
Returns maximum number of leves displayed when the node is top node on scene.
TGNumberEntry * fBoxHeightEntry
TColor GetColor() const
Returns color of class.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
void ResetCurrentCamera()
Resets position/rotation of current camera to default values.
virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a TGeoNode to the list of nodes.
virtual void SetFrame(TGFrame *frame, Bool_t left)
Set frame to be resized.
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
virtual void AddAll(const TCollection *col)
Add all objects from collection col to this collection.
Class describing translations.
void SetTopVolume(TGeoVolume *vol)
Set the top volume and corresponding node as starting point of the geometry.
TStructNodeProperty * FindNodeProperty(TStructNode *node)
Returns pointer to property associated with node "node".
Base class describing materials.
void ColorSelectedSlot(Pixel_t pixel)
Slot for default color selsect.
TGRadioButton * fScaleByMembersButton
Short_t Min(Short_t a, Short_t b)
A 3-dimensional polyline.
ULong_t GetSize() const
Returns size of node.
virtual void SetLimits(ELimit limits=TGNumberFormat::kNELNoLimits, Double_t min=0, Double_t max=1)
UInt_t GetMaxObjects() const
Returns maximum number of objects displayed when the node is top node on scene.
R__EXTERN TApplication * gApplication
void ShowLinksToggled(Bool_t on)
Changes links visibility and refresh view.
Minimal GL-viewer that can be embedded in a standard ROOT frames.
Concrete physical shape - a GL drawable.
Bool_t GetLinksVisibility() const
Returns true if links are visible, otherwise return false.
TList * GetMembers() const
Returns list with pointers to daughter nodes.
~TStructViewerGUI()
Destructor.
TGLabel * fMembersCountLabel
virtual void Sort(Bool_t order=kSortAscending)
Sort linked list.
Float_t GetX() const
Returns X coordinate.
void UpdateLabels(TStructNode *node)
Refresh information in labels when user put mouse over object.
static const double x2[5]
TGTextButton * fUndoButton
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.
virtual void SetText(TGString *newText)
Set new text in label.
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.
void Divide(TList *list, Float_t x1, Float_t x2, Float_t y1, Float_t y2)
Divides rectangle where the outlining box is placed.
void CloseWindow()
Delete window.
TStructNodeEditor * fEditor
void Scale(TStructNode *parent)
Recursive method to scaling all modes on scene.
void UpdateButtonSlot()
Update button slot. Updates scene.
void SetWidth(Float_t w)
Sets width of outlining box to "w".
static TGeoMedium * fgMedium
const Bool_t kSortDescending
Float_t GetMiddle() const
Returns center of outlining box on y-axis.
void DrawLink(TStructNode *parent)
Recursive method to draw links.
virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a TGeoNode to the list of nodes.
void UpdateScene(Bool_t redraw=kTRUE)
Force update of pad-scenes.
bool IsVisible() const
Returns true if node is visible.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
TGCheckButton * fAutoRefesh
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...
TString GetTypeName() const
Returns name of class.
const char * GetName() const
Returns name of object.
void GLWidgetProcessedEventSlot(Event_t *event)
Handle events. Sets fMouseX and fMouseY when user move a mouse over viewer and hides ToolTip...
Long64_t GetValue(ULong64_t hash, Long64_t key)
Return the value belonging to specified key and hash value.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
TStructNodeProperty * GetDefaultColor()
Return default color for nodes.
void SetCollapsed(Bool_t collapsed)
Sets collapsing of node to "collapse".
void DrawNode(TStructNode *node)
Creates and draws TGeoVolume from given "node".
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
void UnCheckMaxObjects()
Shows hidden nodes.
ENodeType GetNodeType() const
Returns type of node.
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
void SetVisible(bool visible)
Sets visibility of node to "visible".
Float_t GetY() const
Returns Y coordinate.
char * Form(const char *fmt,...)
void SetHeight(Float_t h)
Sets width of outlining box to "w".
UInt_t GetLevel() const
Returns actual level of node.
ULong_t GetTotalSize() const
Returns total size of allocated memory in bytes.
TGTextButton * fRedoButton
The ROOT global object gROOT contains a list of all defined classes.
TGLabel * fAllMembersCountLabel
TGLEmbeddedViewer * fGLViewer
Float_t GetHeight() const
Returns height of outlining box.
virtual void Draw(Option_t *option="")
Draw this 3-D polyline with its current attributes.
const char * GetText() const
TString & Remove(Ssiz_t pos)
TGRadioButton * fScaleBySizeButton
void Draw(Option_t *option="")
Check limits and draws nodes and links.
virtual void SetPoint(Int_t point, Double_t x, Double_t y, Double_t z)
Set point n to x, y, z.
static const double x1[5]
static void SetScaleBy(EScalingType type)
Sets scaling by to "type".
R__EXTERN TGeoManager * gGeoManager
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
TStructNode * GetNodePtr() const
Returns top node pointer.
void SetResetCamerasOnUpdate(Bool_t v)
virtual Double_t GetNumber() const
void RedoButtonSlot()
Activated when user click Redo button. Repeat last Undo action.
void SetCurrentCamera(ECameraType camera)
Set current active camera - 'cameraType' one of: kCameraPerspX, kCameraPerspY, kCameraPerspZ, kCameraOrthoXOY, kCameraOrthoXOZ, kCameraOrthoZOY, kCameraOrthoXnOY, kCameraOrthoXnOZ, kCameraOrthoZnOY.
static void GetPixel(int y, int width, Byte_t *scline)
Get pixels in line y and put in array scline.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
void DrawVolumes(TStructNode *visObj)
Recursive method to draw GeoVolumes.
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 Clear(Option_t *option="")
Remove all objects from the list.
TGNumberEntry * fLevelDistanceEntry
Media are used to store properties related to tracking and which are useful only when using geometry ...
void SetColor(const TColor &color)
Sets the color to "color".
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
TGTextEntry * fPointerTextEntry
void SetNsegments(Int_t nseg)
Set number of segments for approximating circles in drawing.
void AutoRefreshButtonSlot(Bool_t on)
Activated when user chage condition.
void BoxHeightValueSetSlot(Long_t h)
Emmited when user changes height of boxes.
void CheckMaxObjects(TStructNode *parent)
Check if all of nodes can be displayed on scene. Hides redendant nodes.
virtual void Add(TObject *obj)
ULong_t GetAllMembersCount() const
Returns number of all members in node.
void SetPointer(void *ptr, const char *clname=NULL)
Set main pointer of class "clname".
TStructNode * fSelectedObject
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".
Int_t GetColor(TStructNode *node)
Returns color form fColors for given "node".
void ResetButtonSlot()
Resets camera.
Float_t GetVolumeRatio()
Returns ratio - volme of node to area taken by outlining box.
Double_t Sqrt(Double_t x)
TGLabel * fTotalSizeLabel
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
TGCheckButton * fShowLinksCheckButton
void SetPointerButtonSlot()
Sets pointer given in fPointerTestEntry to the main pointer.
virtual void DeleteWindow()
Delete window.
void SetX(Float_t x)
Sets X coordinate to "x".
Bool_t IsCollapsed() const
Returns true if node is colllapsed.
void DoubleClickedSlot()
Activated when user double click on objects on 3D scene.
void LevelDistValueSetSlot(Long_t dist)
Emmited when user changes distance between levels.
void SetModel(TObject *obj)
Pick up the used node attributes.
void MouseOverSlot(TGLPhysicalShape *shape)
MouseOver slot.
ULong_t GetMembersCount() const
Returns numbers of members of node.
void UndoButtonSlot()
UndoButton Slot. Activated when user press Undo button. Restore last top node pointer.
const TGLLogicalShape * GetLogical() const
virtual void RemoveFirst()
TGLWidget * GetGLWidget()