00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TStructViewerGUI
00013 #define ROOT_TStructViewerGUI
00014
00015 #include <TGFrame.h>
00016 #include <TGLEmbeddedViewer.h>
00017 #include <TGToolTip.h>
00018 #include <TGLabel.h>
00019 #include <TGNumberEntry.h>
00020 #include <TGeoVolume.h>
00021 #include <TExMap.h>
00022
00023 class TGeoMedium;
00024 class TStructViewer;
00025 class TGeoVolume;
00026 class TStructNode;
00027 class TCanvas;
00028 class TGCheckButton;
00029 class TGTextButton;
00030 class TGRadioButton;
00031 class TStructNodeEditor;
00032 class TStructNodeProperty;
00033 class TGLPhysicalShape;
00034 class TString;
00035 class TGTextEntry;
00036
00037 class TStructViewerGUI : public TGMainFrame {
00038
00039 private:
00040 TStructViewer *fParent;
00041 TGeoVolume *fTopVolume;
00042 TStructNode *fNodePtr;
00043 UInt_t fMaxSlices;
00044 UInt_t fMouseX;
00045 UInt_t fMouseY;
00046 TStructNode *fSelectedObject;
00047 TList fUndoList;
00048 TList fRedoList;
00049 TList fVisibleObjects;
00050 Float_t fMaxRatio;
00051 TList *fColors;
00052 static TGeoMedium *fgMedium;
00053 TExMap fVolumes;
00054 static UInt_t fgCounter;
00055
00056
00057 TCanvas *fCanvas;
00058 TGLEmbeddedViewer *fGLViewer;
00059 TGToolTip *fToolTip;
00060 TGCheckButton *fShowLinksCheckButton;
00061 TGLabel *fNodeNameLabel;
00062 TGLabel *fNodeTypelabel;
00063 TGLabel *fMembersCountLabel;
00064 TGLabel *fAllMembersCountLabel;
00065 TGLabel *fSizeLabel;
00066 TGLabel *fTotalSizeLabel;
00067 TGLabel *fLevelLabel;
00068 TGTextButton *fUndoButton;
00069 TGTextButton *fRedoButton;
00070 TGRadioButton *fScaleBySizeButton;
00071 TGRadioButton *fScaleByMembersButton;
00072 TGTextEntry *fPointerTextEntry;
00073 TGTextEntry *fPointerTypeTextEntry;
00074 TStructNodeEditor *fEditor;
00075 TGNumberEntry *fBoxHeightEntry;
00076 TGCheckButton *fAutoRefesh;
00077 TGNumberEntry *fLevelDistanceEntry;
00078
00079 private:
00080 void CalculatePosistion(TStructNode* parent);
00081 void CheckMaxObjects(TStructNode* parent);
00082 void Divide(TList* list, Float_t x1, Float_t x2, Float_t y1, Float_t y2);
00083 void DrawNode(TStructNode* node);
00084 void DrawLink(TStructNode* parent);
00085 void DrawVolumes(TStructNode* visObj);
00086 TStructNodeProperty* FindNodeProperty(TStructNode* node);
00087 void Scale(TStructNode* parent);
00088 void UnCheckMaxObjects();
00089 void UpdateLabels( TStructNode* node );
00090
00091 public:
00092 TStructViewerGUI(TStructViewer* parent, TStructNode* nodePtr, TList* colors, const TGWindow *p = NULL,
00093 UInt_t w = 800, UInt_t h = 600);
00094 ~TStructViewerGUI();
00095
00096 void AutoRefreshButtonSlot(Bool_t on);
00097 void BoxHeightValueSetSlot(Long_t h);
00098 void CloseWindow();
00099 void ColorSelectedSlot(Pixel_t pixel);
00100 void DoubleClickedSlot();
00101 void Draw(Option_t* option = "");
00102 TCanvas *GetCanvas();
00103 Int_t GetColor(TStructNode* node);
00104 TStructNodeProperty* GetDefaultColor();
00105 Bool_t GetLinksVisibility() const;
00106 TStructNode *GetNodePtr() const;
00107 void GLWidgetProcessedEventSlot(Event_t* event);
00108 void LevelDistValueSetSlot(Long_t dist);
00109 void MouseOverSlot(TGLPhysicalShape* shape);
00110 void RedoButtonSlot();
00111 void ResetButtonSlot();
00112 void ScaleByChangedSlot();
00113 void SetLinksVisibility(Bool_t val);
00114 void SetNodePtr(TStructNode* val);
00115 void SetPointerButtonSlot();
00116 void ShowLinksToggled(Bool_t on);
00117 void UndoButtonSlot();
00118 void Update(Bool_t resetCamera = false);
00119 void UpdateButtonSlot();
00120
00121 ClassDef(TStructViewerGUI, 1);
00122 };
00123
00124 #endif