#ifndef ROOT_TStructViewerGUI
#define ROOT_TStructViewerGUI
#include <TGFrame.h>
#include <TGLEmbeddedViewer.h>
#include <TGToolTip.h>
#include <TGLabel.h>
#include <TGNumberEntry.h>
#include <TGeoVolume.h>
#include <TExMap.h>
class TGeoMedium;
class TStructViewer;
class TGeoVolume;
class TStructNode;
class TCanvas;
class TGCheckButton;
class TGTextButton;
class TGRadioButton;
class TStructNodeEditor;
class TStructNodeProperty;
class TGLPhysicalShape;
class TString;
class TGTextEntry;
class TStructViewerGUI : public TGMainFrame {
private:
TStructViewer *fParent;
TGeoVolume *fTopVolume;
TStructNode *fNodePtr;
UInt_t fMaxSlices;
UInt_t fMouseX;
UInt_t fMouseY;
TStructNode *fSelectedObject;
TList fUndoList;
TList fRedoList;
TList fVisibleObjects;
Float_t fMaxRatio;
TList *fColors;
static TGeoMedium *fgMedium;
TExMap fVolumes;
static UInt_t fgCounter;
TCanvas *fCanvas;
TGLEmbeddedViewer *fGLViewer;
TGToolTip *fToolTip;
TGCheckButton *fShowLinksCheckButton;
TGLabel *fNodeNameLabel;
TGLabel *fNodeTypelabel;
TGLabel *fMembersCountLabel;
TGLabel *fAllMembersCountLabel;
TGLabel *fSizeLabel;
TGLabel *fTotalSizeLabel;
TGLabel *fLevelLabel;
TGTextButton *fUndoButton;
TGTextButton *fRedoButton;
TGRadioButton *fScaleBySizeButton;
TGRadioButton *fScaleByMembersButton;
TGTextEntry *fPointerTextEntry;
TGTextEntry *fPointerTypeTextEntry;
TStructNodeEditor *fEditor;
TGNumberEntry *fBoxHeightEntry;
TGCheckButton *fAutoRefesh;
TGNumberEntry *fLevelDistanceEntry;
private:
void CalculatePosistion(TStructNode* parent);
void CheckMaxObjects(TStructNode* parent);
void Divide(TList* list, Float_t x1, Float_t x2, Float_t y1, Float_t y2);
void DrawNode(TStructNode* node);
void DrawLink(TStructNode* parent);
void DrawVolumes(TStructNode* visObj);
TStructNodeProperty* FindNodeProperty(TStructNode* node);
void Scale(TStructNode* parent);
void UnCheckMaxObjects();
void UpdateLabels( TStructNode* node );
public:
TStructViewerGUI(TStructViewer* parent, TStructNode* nodePtr, TList* colors, const TGWindow *p = NULL,
UInt_t w = 800, UInt_t h = 600);
~TStructViewerGUI();
void AutoRefreshButtonSlot(Bool_t on);
void BoxHeightValueSetSlot(Long_t h);
void CloseWindow();
void ColorSelectedSlot(Pixel_t pixel);
void DoubleClickedSlot();
void Draw(Option_t* option = "");
TCanvas *GetCanvas();
Int_t GetColor(TStructNode* node);
TStructNodeProperty* GetDefaultColor();
Bool_t GetLinksVisibility() const;
TStructNode *GetNodePtr() const;
void GLWidgetProcessedEventSlot(Event_t* event);
void LevelDistValueSetSlot(Long_t dist);
void MouseOverSlot(TGLPhysicalShape* shape);
void RedoButtonSlot();
void ResetButtonSlot();
void ScaleByChangedSlot();
void SetLinksVisibility(Bool_t val);
void SetNodePtr(TStructNode* val);
void SetPointerButtonSlot();
void ShowLinksToggled(Bool_t on);
void UndoButtonSlot();
void Update(Bool_t resetCamera = false);
void UpdateButtonSlot();
ClassDef(TStructViewerGUI, 1);
};
#endif