Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TEveGedEditor.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/eve:$Id$
0002 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TEveGedEditor
0013 #define ROOT_TEveGedEditor
0014 
0015 #include "TGedEditor.h"
0016 #include "TGedFrame.h"
0017 #include "TGButton.h"
0018 
0019 class TEveElement;
0020 class TContextMenu;
0021 
0022 //==============================================================================
0023 // TEveGedEditor
0024 //==============================================================================
0025 
0026 class TEveGedEditor : public TGedEditor
0027 {
0028    TEveGedEditor(const TEveGedEditor&);            // Not implemented
0029    TEveGedEditor& operator=(const TEveGedEditor&); // Not implemented
0030 
0031 public:
0032    typedef TGedFrame* (*NameFrameCreator_t)(TEveGedEditor*, const TGWindow* parent, const char* tab_name);
0033 
0034 protected:
0035    TEveElement   *fElement;    // Cached eve-element pointer.
0036    TObject       *fObject;     // Cached tobj pointer.
0037 
0038    TGedFrame* CreateNameFrame(const TGWindow* parent, const char* tab_name) override;
0039 
0040    static Int_t   fgMaxExtraEditors;
0041    static TList  *fgExtraEditors;
0042 
0043    static TContextMenu *fgContextMenu;
0044 
0045 public:
0046    TEveGedEditor(TCanvas* canvas=nullptr, UInt_t width=250, UInt_t height=400);
0047    ~TEveGedEditor() override;
0048 
0049    void CloseWindow() override;
0050 
0051    TEveElement* GetEveElement() const;
0052 
0053    void DisplayElement(TEveElement* re);
0054    void DisplayObject(TObject* obj);
0055 
0056    void SetModel(TVirtualPad* pad, TObject* obj, Int_t event, Bool_t force=kFALSE) override;
0057    void Update(TGedFrame* gframe=nullptr) override;
0058 
0059    // --- Statics for extra editors. ---
0060 
0061    static void SpawnNewEditor(TObject* obj);
0062    static void ElementChanged(TEveElement* el);
0063    static void ElementDeleted(TEveElement* el);
0064 
0065    static void DestroyEditors();
0066 
0067    static TContextMenu* GetContextMenu();
0068 
0069    ClassDefOverride(TEveGedEditor, 0); // Specialization of TGedEditor for proper update propagation to TEveManager.
0070 };
0071 
0072 
0073 //==============================================================================
0074 // TEveGedNameFrame
0075 //==============================================================================
0076 
0077 class TEveGedNameFrame : public TGedFrame
0078 {
0079 private:
0080    TEveGedNameFrame(const TEveGedNameFrame&);            // Not implemented
0081    TEveGedNameFrame& operator=(const TEveGedNameFrame&); // Not implemented
0082 
0083 protected:
0084    TGTextButton   *fNCButton; // Name/Class button.
0085 
0086 public:
0087    TEveGedNameFrame(const TGWindow *p=nullptr, Int_t width=140, Int_t height=30,
0088                     UInt_t options=kChildFrame | kHorizontalFrame);
0089    ~TEveGedNameFrame() override;
0090 
0091    void SetModel(TObject* obj) override;
0092 
0093    void SpawnEditorClone();
0094 
0095    ClassDefOverride(TEveGedNameFrame, 0); // Top name-frame used in EVE.
0096 };
0097 
0098 
0099 //==============================================================================
0100 // TEveGedNameTextButton
0101 //==============================================================================
0102 
0103 class TEveGedNameTextButton : public TGTextButton
0104 {
0105 private:
0106    TEveGedNameTextButton(const TEveGedNameTextButton&);            // Not implemented
0107    TEveGedNameTextButton& operator=(const TEveGedNameTextButton&); // Not implemented
0108 
0109    TEveGedNameFrame *fFrame;
0110 
0111 public:
0112    TEveGedNameTextButton(TEveGedNameFrame* p);
0113    ~TEveGedNameTextButton() override;
0114 
0115    Bool_t HandleButton(Event_t* event) override;
0116 
0117    ClassDefOverride(TEveGedNameTextButton, 0); // Button for GED name-frame.
0118 };
0119 
0120 #endif