Warning, file /include/root/TGLAnnotation.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TGLAnnotation
0013 #define ROOT_TGLAnnotation
0014
0015 #include "TGLOverlay.h"
0016 #include "TGLUtil.h"
0017 #include "TGLFontManager.h"
0018
0019 class TGLViewer;
0020 class TGLViewerBase;
0021 class TGLFont;
0022 class TGTextEdit;
0023 class TGMainFrame;
0024
0025 class TGLAnnotation : public TGLOverlayElement
0026 {
0027 private:
0028 TGLAnnotation(const TGLAnnotation&) = delete;
0029 TGLAnnotation& operator=(const TGLAnnotation&) = delete;
0030
0031 protected:
0032 enum EDrag { kMove, kResize, kNone };
0033 enum ENameStack { kMoveID, kEditID, kDeleteID, kResizeID };
0034
0035 void MakeEditor();
0036 Char_t GetLineTransparency() const;
0037
0038 Float_t fPosX;
0039 Float_t fPosY;
0040 Float_t fWidth;
0041 Float_t fHeight;
0042
0043 Int_t fMouseX, fMouseY;
0044 EDrag fDrag;
0045 Float_t fDrawW, fDrawH;
0046 Float_t fTextSizeDrag;
0047
0048 TGLVector3 fPointer;
0049 Bool_t fActive;
0050
0051 TGMainFrame *fMainFrame;
0052 TGTextEdit *fTextEdit;
0053
0054 static Color_t fgBackColor;
0055 static Color_t fgTextColor;
0056
0057 TGLViewer *fParent;
0058
0059 TString fText;
0060 Float_t fTextSize;
0061 TGLFont fFont;
0062 TGLFont fMenuFont;
0063 TGLFont::ETextAlignH_e fTextAlign;
0064
0065 Color_t fBackColor;
0066 Color_t fTextColor;
0067 Char_t fTransparency;
0068
0069 Bool_t fDrawRefLine;
0070 Bool_t fUseColorSet;
0071 Bool_t fAllowClose;
0072
0073 public:
0074 TGLAnnotation(TGLViewerBase *parent, const char *text, Float_t posx, Float_t posy);
0075 TGLAnnotation(TGLViewerBase *parent, const char *text, Float_t posx, Float_t posy, TGLVector3 ref);
0076 ~TGLAnnotation() override;
0077
0078 void SetText(const TString& x) { fText = x; }
0079 const TString& GetText() const { return fText; }
0080
0081 void SetTransparency(Char_t x) { fTransparency = x; }
0082 Char_t GetTransparency() const { return fTransparency; }
0083
0084 void SetUseColorSet(Bool_t x) { fUseColorSet = x; }
0085 Bool_t GetUseColorSet() const { return fUseColorSet; }
0086
0087 void SetBackColor(Color_t x) { fBackColor = x; }
0088 Color_t GetBackColor() const { return fBackColor; }
0089
0090 void SetTextColor(Color_t x) { fTextColor = x; }
0091 Color_t GetTextColor() const { return fTextColor; }
0092
0093 void SetTextSize(Float_t x) { fTextSize = x; }
0094 Float_t GetTextSize() const { return fTextSize; }
0095
0096 void SetAllowClose(Bool_t x) { fAllowClose = x; }
0097 Bool_t GetAllowClose() const { return fAllowClose; }
0098
0099 TGLFont::ETextAlignH_e GetTextAlign() const { return fTextAlign; }
0100 void SetTextAlign(TGLFont::ETextAlignH_e a) { fTextAlign = a; }
0101
0102 Bool_t MouseEnter(TGLOvlSelectRecord& selRec) override;
0103 Bool_t Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec,
0104 Event_t* event) override;
0105 void MouseLeave() override;
0106
0107 void CloseEditor();
0108
0109 void UpdateText();
0110
0111 void Render(TGLRnrCtx& rnrCtx) override;
0112
0113 ClassDefOverride(TGLAnnotation, 0);
0114 };
0115
0116 #endif