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;
394 }
else if (list->
GetSize() == 1) {
512 for (
Float_t i = -(slices-1)/2; i < slices/2; i++) {
568 if (cl->InheritsFrom(propName.
Data())) {
635 switch (event->
fType) {
853 name =
"All members: ";
862 name =
"Total size: ";
static const double x2[5]
static const double x1[5]
R__EXTERN TApplication * gApplication
include TDocParser_001 C image html pict1_TDocParser_001 png width
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,...)
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.
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.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
virtual void DeleteWindow()
Delete window.
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
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()
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 SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
virtual void SetLimits(ELimit limits=TGNumberFormat::kNELNoLimits, Double_t min=0, Double_t max=1)
virtual Double_t GetNumber() const
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
const char * GetText() const
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 void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, 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.
virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a TGeoNode to the list of nodes.
virtual void Add(TObject *obj)
virtual void RemoveLast()
Remove the last object of the list.
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
virtual void Clear(Option_t *option="")
Remove all objects from the list.
virtual void Sort(Bool_t order=kSortAscending)
Sort linked list.
virtual const char * GetName() const
Returns name of object.
virtual void Clear(Option_t *="")
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
TList * GetListOfPrimitives() const
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.
TColor GetColor() const
Returns color of class.
void SetColor(const TColor &color)
Sets the color to "color".
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".
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.
TGTextEntry * fPointerTypeTextEntry
void UndoButtonSlot()
UndoButton Slot. Activated when user press Undo button. Restore last top node pointer.
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".
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=NULL)
Set main pointer of class "clname".
Double_t Sqrt(Double_t x)
Short_t Min(Short_t a, Short_t b)
static long int sum(long int i)