Logo ROOT  
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 
51  TEveElement* GetEveElement() const;
52 
53  void DisplayElement(TEveElement* re);
54  void DisplayObject(TObject* obj);
55 
56  virtual void SetModel(TVirtualPad* pad, TObject* obj, Int_t event, Bool_t force=kFALSE);
57  virtual void Update(TGedFrame* gframe=0);
58 
59  // --- Statics for extra editors. ---
60 
61  static void SpawnNewEditor(TObject* obj);
62  static void ElementChanged(TEveElement* el);
63  static void ElementDeleted(TEveElement* el);
64 
65  static void DestroyEditors();
66 
67  static TContextMenu* GetContextMenu();
68 
69  ClassDef(TEveGedEditor, 0); // Specialization of TGedEditor for proper update propagation to TEveManager.
70 };
71 
72 
73 //==============================================================================
74 // TEveGedNameFrame
75 //==============================================================================
76 
78 {
79 private:
80  TEveGedNameFrame(const TEveGedNameFrame&); // Not implemented
81  TEveGedNameFrame& operator=(const TEveGedNameFrame&); // Not implemented
82 
83 protected:
84  TGTextButton *fNCButton; // Name/Class button.
85 
86 public:
87  TEveGedNameFrame(const TGWindow *p=0, Int_t width=140, Int_t height=30,
89  virtual ~TEveGedNameFrame();
90 
91  virtual void SetModel(TObject* obj);
92 
93  void SpawnEditorClone();
94 
95  ClassDef(TEveGedNameFrame, 0); // Top name-frame used in EVE.
96 };
97 
98 
99 //==============================================================================
100 // TEveGedNameTextButton
101 //==============================================================================
102 
104 {
105 private:
106  TEveGedNameTextButton(const TEveGedNameTextButton&); // Not implemented
107  TEveGedNameTextButton& operator=(const TEveGedNameTextButton&); // Not implemented
108 
110 
111 public:
113  virtual ~TEveGedNameTextButton();
114 
115  virtual Bool_t HandleButton(Event_t* event);
116 
117  ClassDef(TEveGedNameTextButton, 0); // Button for GED name-frame.
118 };
119 
120 #endif
TGWindow
Definition: TGWindow.h:31
TEveElement
Definition: TEveElement.h:35
TEveGedEditor::fgMaxExtraEditors
static Int_t fgMaxExtraEditors
Definition: TEveGedEditor.h:40
TEveGedNameFrame::TEveGedNameFrame
TEveGedNameFrame(const TEveGedNameFrame &)
TEveGedEditor::DestroyEditors
static void DestroyEditors()
Destroys all editors. Called from EVE termination.
Definition: TEveGedEditor.cxx:230
TEveGedEditor::fgContextMenu
static TContextMenu * fgContextMenu
Definition: TEveGedEditor.h:43
TEveGedEditor::SetModel
virtual void SetModel(TVirtualPad *pad, TObject *obj, Int_t event, Bool_t force=kFALSE)
Set model object.
Definition: TEveGedEditor.cxx:142
TEveGedNameFrame
Definition: TEveGedEditor.h:77
TGedEditor.h
width
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
TGTextButton
Definition: TGButton.h:142
TEveGedNameTextButton::operator=
TEveGedNameTextButton & operator=(const TEveGedNameTextButton &)
TEveGedEditor::GetEveElement
TEveElement * GetEveElement() const
Return eve-element if it is the model object.
Definition: TEveGedEditor.cxx:112
TEveGedEditor
Definition: TEveGedEditor.h:26
TEveGedEditor::Update
virtual void Update(TGedFrame *gframe=0)
Virtual method from TGedEditor, called on every change.
Definition: TEveGedEditor.cxx:153
TEveGedNameFrame::SetModel
virtual void SetModel(TObject *obj)
Set model object.
Definition: TEveGedEditor.cxx:283
TEveGedEditor::CloseWindow
virtual void CloseWindow()
Called from window-manger close button.
Definition: TEveGedEditor.cxx:85
TEveGedNameTextButton
Definition: TEveGedEditor.h:103
TEveGedEditor::DisplayObject
void DisplayObject(TObject *obj)
Show a TObject in editor.
Definition: TEveGedEditor.cxx:132
bool
TEveGedEditor::~TEveGedEditor
virtual ~TEveGedEditor()
Destructor.
Definition: TEveGedEditor.cxx:75
TEveGedEditor::ElementChanged
static void ElementChanged(TEveElement *el)
Element was changed. Update editors showing it.
Definition: TEveGedEditor.cxx:190
TContextMenu
Definition: TContextMenu.h:44
TEveGedNameTextButton::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle button.
Definition: TEveGedEditor.cxx:337
TEveGedEditor::GetContextMenu
static TContextMenu * GetContextMenu()
Return context menu object shared among eve-ged-editors.
Definition: TEveGedEditor.cxx:243
TEveGedNameTextButton::fFrame
TEveGedNameFrame * fFrame
Definition: TEveGedEditor.h:109
TGedFrame.h
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TEveGedNameFrame::SpawnEditorClone
void SpawnEditorClone()
Create a new floating editor with current object.
Definition: TEveGedEditor.cxx:302
TEveGedEditor::operator=
TEveGedEditor & operator=(const TEveGedEditor &)
TEveGedEditor::SpawnNewEditor
static void SpawnNewEditor(TObject *obj)
Static function to create a new extra editor.
Definition: TEveGedEditor.cxx:167
TEveGedEditor::fgExtraEditors
static TList * fgExtraEditors
Definition: TEveGedEditor.h:41
unsigned int
TEveGedEditor::fElement
TEveElement * fElement
Definition: TEveGedEditor.h:35
kHorizontalFrame
@ kHorizontalFrame
Definition: GuiTypes.h:382
TEveGedEditor::TEveGedEditor
TEveGedEditor(const TEveGedEditor &)
TGedFrame
Definition: TGedFrame.h:33
TVirtualPad
Definition: TVirtualPad.h:50
TCanvas
Definition: TCanvas.h:23
TEveGedNameFrame::fNCButton
TGTextButton * fNCButton
Definition: TEveGedEditor.h:84
TEveGedEditor::ElementDeleted
static void ElementDeleted(TEveElement *el)
Element is being deleted. Close editors showing it.
Definition: TEveGedEditor.cxx:206
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGButton.h
Event_t
Definition: GuiTypes.h:173
TEveGedEditor::CreateNameFrame
virtual TGedFrame * CreateNameFrame(const TGWindow *parent, const char *tab_name)
Create name-frame for a tab.
Definition: TEveGedEditor.cxx:104
TEveGedEditor::fObject
TObject * fObject
Definition: TEveGedEditor.h:36
TEveGedNameFrame::~TEveGedNameFrame
virtual ~TEveGedNameFrame()
Destructor.
Definition: TEveGedEditor.cxx:276
TEveGedNameFrame::operator=
TEveGedNameFrame & operator=(const TEveGedNameFrame &)
TEveGedNameTextButton::TEveGedNameTextButton
TEveGedNameTextButton(const TEveGedNameTextButton &)
TEveGedEditor::DisplayElement
void DisplayElement(TEveElement *re)
Show a TEveElement in editor.
Definition: TEveGedEditor.cxx:120
TEveGedNameTextButton::~TEveGedNameTextButton
virtual ~TEveGedNameTextButton()
Destructor.
Definition: TEveGedEditor.cxx:330
TGedEditor
Definition: TGedEditor.h:41
TList
Definition: TList.h:44
kChildFrame
@ kChildFrame
Definition: GuiTypes.h:379
int