TEveGedEditor.h

Go to the documentation of this file.
00001 // @(#)root/eve:$Id: TEveGedEditor.h 31998 2010-01-13 14:13:50Z matevz $
00002 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TEveGedEditor
00013 #define ROOT_TEveGedEditor
00014 
00015 #include "TGedEditor.h"
00016 #include "TGedFrame.h"
00017 #include "TGButton.h"
00018 
00019 class TEveElement;
00020 class TContextMenu;
00021 
00022 //==============================================================================
00023 // TEveGedEditor
00024 //==============================================================================
00025 
00026 class TEveGedEditor : public TGedEditor
00027 {
00028    TEveGedEditor(const TEveGedEditor&);            // Not implemented
00029    TEveGedEditor& operator=(const TEveGedEditor&); // Not implemented
00030 
00031 public:
00032    typedef TGedFrame* (*NameFrameCreator_t)(TEveGedEditor*, const TGWindow* parent, const char* tab_name);
00033 
00034 protected:
00035    TEveElement   *fElement;    // Cached eve-element pointer.
00036    TObject       *fObject;     // Cached tobj pointer.
00037 
00038    virtual TGedFrame* CreateNameFrame(const TGWindow* parent, const char* tab_name); 
00039 
00040    static Int_t   fgMaxExtraEditors;
00041    static TList  *fgExtraEditors;
00042 
00043    static TContextMenu *fgContextMenu;
00044 
00045 public:
00046    TEveGedEditor(TCanvas* canvas=0, UInt_t width=250, UInt_t height=400);
00047    virtual ~TEveGedEditor();
00048 
00049    virtual void CloseWindow();
00050    virtual void DeleteWindow();
00051 
00052    TEveElement* GetEveElement() const;
00053 
00054    void DisplayElement(TEveElement* re);
00055    void DisplayObject(TObject* obj);
00056 
00057    virtual void SetModel(TVirtualPad* pad, TObject* obj, Int_t event);
00058    virtual void Update(TGedFrame* gframe=0);
00059 
00060    // --- Statics for extra editors. ---
00061 
00062    static void SpawnNewEditor(TObject* obj);
00063    static void ElementChanged(TEveElement* el);
00064    static void ElementDeleted(TEveElement* el);
00065 
00066    static void DestroyEditors();
00067 
00068    static TContextMenu* GetContextMenu();
00069 
00070    ClassDef(TEveGedEditor, 0); // Specialization of TGedEditor for proper update propagation to TEveManager.
00071 };
00072 
00073 
00074 //==============================================================================
00075 // TEveGedNameFrame
00076 //==============================================================================
00077 
00078 class TEveGedNameFrame : public TGedFrame
00079 {
00080 private:
00081    TEveGedNameFrame(const TEveGedNameFrame&);            // Not implemented
00082    TEveGedNameFrame& operator=(const TEveGedNameFrame&); // Not implemented
00083 
00084 protected:
00085    TGTextButton   *fNCButton; // Name/Class button.
00086 
00087 public:
00088    TEveGedNameFrame(const TGWindow *p=0, Int_t width=140, Int_t height=30,
00089                     UInt_t options=kChildFrame | kHorizontalFrame);
00090    virtual ~TEveGedNameFrame();
00091 
00092    virtual void SetModel(TObject* obj);
00093 
00094    void SpawnEditorClone();
00095 
00096    ClassDef(TEveGedNameFrame, 0); // Top name-frame used in EVE.
00097 };
00098 
00099 
00100 //==============================================================================
00101 // TEveGedNameTextButton
00102 //==============================================================================
00103 
00104 class TEveGedNameTextButton : public TGTextButton
00105 {
00106 private:
00107    TEveGedNameTextButton(const TEveGedNameTextButton&);            // Not implemented
00108    TEveGedNameTextButton& operator=(const TEveGedNameTextButton&); // Not implemented
00109 
00110    TEveGedNameFrame *fFrame;
00111 
00112 public:
00113    TEveGedNameTextButton(TEveGedNameFrame* p);
00114    virtual ~TEveGedNameTextButton();
00115 
00116    virtual Bool_t HandleButton(Event_t* event);
00117 
00118    ClassDef(TEveGedNameTextButton, 0); // Button for GED name-frame.
00119 };
00120 
00121 #endif

Generated on Tue Jul 5 14:14:55 2011 for ROOT_528-00b_version by  doxygen 1.5.1