Logo ROOT   6.08/07
Reference Guide
TEveGedEditor.h
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TEveGedEditor
13 #define ROOT_TEveGedEditor
14 
15 #include "TGedEditor.h"
16 #include "TGedFrame.h"
17 #include "TGButton.h"
18 
19 class TEveElement;
20 class TContextMenu;
21 
22 //==============================================================================
23 // TEveGedEditor
24 //==============================================================================
25 
26 class TEveGedEditor : public TGedEditor
27 {
28  TEveGedEditor(const TEveGedEditor&); // Not implemented
29  TEveGedEditor& operator=(const TEveGedEditor&); // Not implemented
30 
31 public:
32  typedef TGedFrame* (*NameFrameCreator_t)(TEveGedEditor*, const TGWindow* parent, const char* tab_name);
33 
34 protected:
35  TEveElement *fElement; // Cached eve-element pointer.
36  TObject *fObject; // Cached tobj pointer.
37 
38  virtual TGedFrame* CreateNameFrame(const TGWindow* parent, const char* tab_name);
39 
42 
44 
45 public:
46  TEveGedEditor(TCanvas* canvas=0, UInt_t width=250, UInt_t height=400);
47  virtual ~TEveGedEditor();
48 
49  virtual void CloseWindow();
50  virtual void DeleteWindow();
51 
52  TEveElement* GetEveElement() const;
53 
54  void DisplayElement(TEveElement* re);
55  void DisplayObject(TObject* obj);
56 
57  virtual void SetModel(TVirtualPad* pad, TObject* obj, Int_t event);
58  virtual void Update(TGedFrame* gframe=0);
59 
60  // --- Statics for extra editors. ---
61 
62  static void SpawnNewEditor(TObject* obj);
63  static void ElementChanged(TEveElement* el);
64  static void ElementDeleted(TEveElement* el);
65 
66  static void DestroyEditors();
67 
68  static TContextMenu* GetContextMenu();
69 
70  ClassDef(TEveGedEditor, 0); // Specialization of TGedEditor for proper update propagation to TEveManager.
71 };
72 
73 
74 //==============================================================================
75 // TEveGedNameFrame
76 //==============================================================================
77 
79 {
80 private:
81  TEveGedNameFrame(const TEveGedNameFrame&); // Not implemented
82  TEveGedNameFrame& operator=(const TEveGedNameFrame&); // Not implemented
83 
84 protected:
85  TGTextButton *fNCButton; // Name/Class button.
86 
87 public:
88  TEveGedNameFrame(const TGWindow *p=0, Int_t width=140, Int_t height=30,
90  virtual ~TEveGedNameFrame();
91 
92  virtual void SetModel(TObject* obj);
93 
94  void SpawnEditorClone();
95 
96  ClassDef(TEveGedNameFrame, 0); // Top name-frame used in EVE.
97 };
98 
99 
100 //==============================================================================
101 // TEveGedNameTextButton
102 //==============================================================================
103 
105 {
106 private:
107  TEveGedNameTextButton(const TEveGedNameTextButton&); // Not implemented
108  TEveGedNameTextButton& operator=(const TEveGedNameTextButton&); // Not implemented
109 
111 
112 public:
114  virtual ~TEveGedNameTextButton();
115 
116  virtual Bool_t HandleButton(Event_t* event);
117 
118  ClassDef(TEveGedNameTextButton, 0); // Button for GED name-frame.
119 };
120 
121 #endif
static Int_t fgMaxExtraEditors
Definition: TEveGedEditor.h:40
void DisplayElement(TEveElement *re)
Show a TEveElement in editor.
void DisplayObject(TObject *obj)
Show a TObject in editor.
virtual void DeleteWindow()
This is exact clone of TGFrame::DeleteWindow().
static void SpawnNewEditor(TObject *obj)
Static function to create a new extra editor.
Specialization of TGedEditor for proper update propagation to TEveManager.
Definition: TEveGedEditor.h:26
Specialization of TGTextButton for EVE name frame.
TEveElement * fElement
Definition: TEveGedEditor.h:35
static void DestroyEditors()
Destroys all editors. Called from EVE termination.
TEveGedEditor(const TEveGedEditor &)
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual ~TEveGedEditor()
Destructor.
#define ClassDef(name, id)
Definition: Rtypes.h:254
static TContextMenu * GetContextMenu()
Return context menu object shared among eve-ged-editors.
virtual void CloseWindow()
Called from window-manger close button.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:59
A doubly linked list.
Definition: TList.h:47
static void ElementChanged(TEveElement *el)
Element was changed. Update editors showing it.
virtual TGedFrame * CreateNameFrame(const TGWindow *parent, const char *tab_name)
Create name-frame for a tab.
This class provides an interface to context sensitive popup menus.
Definition: TContextMenu.h:44
unsigned int UInt_t
Definition: RtypesCore.h:42
TObject * fObject
Definition: TEveGedEditor.h:36
Specialization of TGedNameFrame used in EVE.
Definition: TEveGedEditor.h:78
static TContextMenu * fgContextMenu
Definition: TEveGedEditor.h:43
The Canvas class.
Definition: TCanvas.h:41
virtual void SetModel(TVirtualPad *pad, TObject *obj, Int_t event)
Set model object.
TGTextButton * fNCButton
Definition: TEveGedEditor.h:85
virtual void Update(TGedFrame *gframe=0)
Virtual method from TGedEditor, called on every change.
Mother of all ROOT objects.
Definition: TObject.h:37
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button events.
Definition: TGFrame.cxx:1637
TEveGedNameFrame * fFrame
static void ElementDeleted(TEveElement *el)
Element is being deleted. Close editors showing it.
TEveGedEditor & operator=(const TEveGedEditor &)
TEveElement * GetEveElement() const
Return eve-element if it is the model object.
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:33
static TList * fgExtraEditors
Definition: TEveGedEditor.h:41