14#include "TGLIncludes.h"
47 fMouseX(0), fMouseY(0),
49 fDrawW(0), fDrawH(0), fTextSizeDrag(0),
51 fMainFrame(nullptr), fTextEdit(nullptr),
58 fBackColor(fgBackColor),
59 fTextColor(fgTextColor),
77 fMouseX(0), fMouseY(0),
79 fDrawW(0), fDrawH(0), fTextSizeDrag(0),
81 fMainFrame(nullptr), fTextEdit(nullptr),
88 fBackColor(fgBackColor),
89 fTextColor(fgTextColor),
122 switch (event->
fType)
150 if (
vp.Width() == 0 ||
vp.Height() == 0)
return kFALSE;
165 else if (
fPosY > 1.0f)
170 using namespace TMath;
213 if (
vp.Width() == 0 &&
vp.Height() == 0)
234 fgCol =
rnrCtx.ColorSet().Markup().GetColorIndex();
242 c1->GetGreen()*
f1 +
c2->GetGreen()*f2,
243 c1->GetBlue() *
f1 +
c2->GetBlue() *f2);
248 rnrCtx.ProjectionMatrixPushIdentity();
448 op[0] /=
vp.Width();
op[1] /=
vp.Height();
453 if (
fx != 0.5f ||
fy != 0.5f)
465 rnrCtx.ProjectionMatrixPop();
506 btt1->Connect(
"Clicked()",
"TGLAnnotation",
this,
"UpdateText()");
507 btt2->Connect(
"Clicked()",
"TGLAnnotation",
this,
"CloseEditor()");
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize fs
Option_t Option_t TPoint TPoint const char text
Option_t Option_t TPoint TPoint const char y1
The color creation and management class.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
void Layout() override
Layout the elements of the composite frame.
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
void MapWindow() override
map window
void UnmapWindow() override
unmap window
A composite frame that layout their children in horizontal way.
static Color_t fgBackColor
TGLAnnotation(const TGLAnnotation &)=delete
Bool_t MouseEnter(TGLOvlSelectRecord &selRec) override
Mouse has entered overlay area.
Bool_t Handle(TGLRnrCtx &rnrCtx, TGLOvlSelectRecord &selRec, Event_t *event) override
Handle overlay event.
static Color_t fgTextColor
void MakeEditor()
Show the annotation editor.
void UpdateText()
Modify the annotation text from the text-edit widget.
void CloseEditor()
Close the annotation editor.
TGLFont::ETextAlignH_e fTextAlign
Char_t GetLineTransparency() const
Returns transparency of annotation outline.
~TGLAnnotation() override
Destructor.
void MouseLeave() override
Mouse has left overlay area.
EDrag fDrag
last mouse position
void Render(TGLRnrCtx &rnrCtx) override
Render the annotation.
Float_t fTextSizeDrag
width and height when drawing
TGLVector3 fPointer
text-size at start of drag
static Int_t GetFontSize(Int_t ds)
Get availabe font size.
A wrapper class for FTFont.
Float_t GetDescent() const
Get font's descent. The returned value is positive.
Float_t GetLineHeight() const
Get font's line-height.
void BBox(const char *txt, Float_t &llx, Float_t &lly, Float_t &llz, Float_t &urx, Float_t &ury, Float_t &urz) const
Get bounding box.
void Render(const char *txt, Double_t x, Double_t y, Double_t angle, Double_t mgn) const
virtual void PostRender() const
Reset GL state after FTFont rendering.
virtual void PreRender(Bool_t autoLight=kTRUE, Bool_t lightOn=kFALSE) const
Set-up GL state before FTFont rendering.
Selection record for overlay objects.
Viewport (pixel base) 2D rectangle class.
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
static void ColorTransparency(Color_t color_index, Char_t transparency=0)
Set color from color_index and ROOT-style transparency (default 0).
static void Color(const TGLColor &color)
Set color from TGLColor.
static Float_t LineWidth()
Get the line-width, taking the global scaling into account.
3 component (x/y/z) vector class.
3 component (x/y/z) vertex class.
Base class for GL viewers.
virtual void AddOverlayElement(TGLOverlayElement *el)
Add overlay element.
Base GL viewer object - used by both standalone and embedded (in pad) GL.
void RequestDraw(Short_t LOD=TGLRnrCtx::kLODMed)
Post request for redraw of viewer at level of detail 'LOD' Request is directed via cross thread gVirt...
void RemoveOverlayElement(TGLOverlayElement *el) override
Remove overlay element.
This class describes layout hints used by the layout classes.
Defines top level windows that interact with the system Window Manager.
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
Yield an action as soon as it is clicked.
A TGTextEdit is a specialization of TGTextView.
Long_t ReturnLongestLineWidth() override
Return width of longest line in widget.
virtual void SetText(TGText *text)
Adopt a new text buffer. The text will be deleted by this object.
A TGText is a multi line text buffer.
TString AsString()
Returns content as ROOT string.
A composite frame that layout their children in vertical way.
Collectable string class.
const char * Data() const
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
EGEventType fType
of event (see EGEventType)
Int_t fY
pointer x, y coordinates in event window