Logo ROOT   6.16/01
Reference Guide
TGLAnnotation.cxx
Go to the documentation of this file.
1// @(#)root/gl:$Id$
2// Author: Matevz and Alja Tadel 20/02/2009
3
4/*************************************************************************
5 * Copyright (C) 1995-2004, 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#include "TGLAnnotation.h"
13
14#include "TGLIncludes.h"
15#include "TROOT.h"
16#include "TColor.h"
17#include "TGLUtil.h"
18#include "TGLCamera.h"
19#include "TGLRnrCtx.h"
20#include "TGLSelectRecord.h"
21#include "TGLViewerBase.h"
22#include "TObjString.h"
23#include "TGFrame.h"
24#include "TGTextEdit.h"
25#include "TGButton.h"
26#include "TGLViewer.h"
27
28#include "TMath.h"
29
30#include <KeySymbols.h>
31
32/** \class TGLAnnotation
33\ingroup opengl
34GL-overlay annotation.
35*/
36
38
41
42////////////////////////////////////////////////////////////////////////////////
43
46
47 fPosX(posx), fPosY(posy),
48 fMouseX(0), fMouseY(0),
49 fDrag(kNone),
50 fDrawW(0), fDrawH(0), fTextSizeDrag(0),
51 fActive(kFALSE),
52 fMainFrame(0), fTextEdit(0),
53
54 fParent(0),
55
56 fText(text),
57 fTextSize(0.03),
58 fTextAlign(TGLFont::kLeft),
59 fBackColor(fgBackColor),
60 fTextColor(fgTextColor),
61 fTransparency(100),
62 fDrawRefLine(kFALSE),
63 fUseColorSet(kTRUE),
64 fAllowClose(kTRUE)
65{
66 // Constructor.
67 // Create annotation as plain text
68
69 parent->AddOverlayElement(this);
70 fParent = (TGLViewer*)parent;
71}
72
73////////////////////////////////////////////////////////////////////////////////
74
77 fPosX(posx), fPosY(posy),
78 fMouseX(0), fMouseY(0),
79 fDrag(kNone),
80 fDrawW(0), fDrawH(0), fTextSizeDrag(0),
81 fActive(kFALSE),
82 fMainFrame(0), fTextEdit(0),
83
84 fParent(0),
85
86 fText(text),
87 fTextSize(0.03),
88 fTextAlign(TGLFont::kLeft),
89 fBackColor(fgBackColor),
90 fTextColor(fgTextColor),
91 fTransparency(40),
92 fDrawRefLine(kTRUE),
93 fUseColorSet(kTRUE),
94 fAllowClose(kTRUE)
95{
96 // Constructor.
97 // Create annotation by picking an object.
98
99 fPointer = ref;
100 parent->AddOverlayElement(this);
101 fParent = (TGLViewer*)parent;
102}
103
104////////////////////////////////////////////////////////////////////////////////
105/// Destructor.
106
108{
110 delete fMainFrame;
111}
112
113////////////////////////////////////////////////////////////////////////////////
114/// Handle overlay event.
115/// Return TRUE if event was handled.
116
118 TGLOvlSelectRecord& selRec,
119 Event_t* event)
120{
121 if (selRec.GetN() < 2) return kFALSE;
122 Int_t recID = selRec.GetItem(1);
123 switch (event->fType)
124 {
125 case kButtonPress:
126 {
127 fMouseX = event->fX;
128 fMouseY = event->fY;
129 fDrag = (recID == kResizeID) ? kResize : kMove;
131 return kTRUE;
132 }
133 case kButtonRelease:
134 {
135 fDrag = kNone;
136 if (recID == kDeleteID)
137 {
139 delete this;
140 v->RequestDraw(rnrCtx.ViewerLOD());
141 }
142 else if (recID == kEditID)
143 {
144 MakeEditor();
145 }
146 return kTRUE;
147 }
148 case kMotionNotify:
149 {
150 const TGLRect& vp = rnrCtx.RefCamera().RefViewport();
151 if (vp.Width() == 0 || vp.Height() == 0) return kFALSE;
152
153 if (fDrag == kMove)
154 {
155 fPosX += (Float_t)(event->fX - fMouseX) / vp.Width();
156 fPosY -= (Float_t)(event->fY - fMouseY) / vp.Height();
157 fMouseX = event->fX;
158 fMouseY = event->fY;
159 // Make sure we don't go offscreen (use fDraw variables set in draw)
160 if (fPosX < 0)
161 fPosX = 0;
162 else if (fPosX + fDrawW > 1.0f)
163 fPosX = 1.0f - fDrawW;
164 if (fPosY < fDrawH)
165 fPosY = fDrawH;
166 else if (fPosY > 1.0f)
167 fPosY = 1.0f;
168 }
169 else if (fDrag == kResize)
170 {
171 using namespace TMath;
172 Float_t oovpw = 1.0f / vp.Width(), oovph = 1.0f / vp.Height();
173
174 Float_t xw = oovpw * Min(Max(0, event->fX), vp.Width());
175 Float_t yw = oovph * Min(Max(0, vp.Height() - event->fY), vp.Height());
176
177 Float_t rx = Max((xw - fPosX) / (oovpw * fMouseX - fPosX), 0.0f);
178 Float_t ry = Max((yw - fPosY) / (oovph*(vp.Height() - fMouseY) - fPosY), 0.0f);
179
180 fTextSize = Max(fTextSizeDrag * Min(rx, ry), 0.01f);
181 }
182 return kTRUE;
183 }
184 default:
185 {
186 return kFALSE;
187 }
188 }
189}
190
191////////////////////////////////////////////////////////////////////////////////
192/// Mouse has entered overlay area.
193
195{
196 fActive = kTRUE;
197 return kTRUE;
198}
199
200////////////////////////////////////////////////////////////////////////////////
201/// Mouse has left overlay area.
202
204{
205 fActive = kFALSE;
206}
207
208////////////////////////////////////////////////////////////////////////////////
209/// Render the annotation.
210
212{
213 const TGLRect& vp = rnrCtx.RefCamera().RefViewport();
214 if (vp.Width() == 0 && vp.Height() == 0)
215 return;
216
217 Float_t old_depth_range[2];
218 glGetFloatv(GL_DEPTH_RANGE, old_depth_range);
219 glDepthRange(0, 0.001);
220
221
222 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT | GL_POLYGON_BIT);
223 TGLCapabilitySwitch lights_off(GL_LIGHTING, kFALSE);
224 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
225 glDisable(GL_CULL_FACE);
226 glEnable(GL_BLEND);
227 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
228
229 // prepare colors
230 Color_t bgCol = fBackColor;
231 Color_t fgCol = fTextColor;
232
233 if (fUseColorSet)
234 {
235 fgCol = rnrCtx.ColorSet().Markup().GetColorIndex();
236
237 TColor* c1 = gROOT->GetColor(rnrCtx.ColorSet().Markup().GetColorIndex());
238 TColor* c2 = gROOT->GetColor(rnrCtx.ColorSet().Background().GetColorIndex());
239
240 if (c1 && c2) {
241 Float_t f1 = 0.5, f2 = 0.5;
242 bgCol = TColor::GetColor(c1->GetRed() *f1 + c2->GetRed() *f2,
243 c1->GetGreen()*f1 + c2->GetGreen()*f2,
244 c1->GetBlue() *f1 + c2->GetBlue() *f2);
245 }
246 }
247
248 // reset matrix
250
251 glPushMatrix();
252 // set ortho camera to [0,1] [0.1]
253 glLoadIdentity();
254 glTranslatef(-1.0f, -1.0f, 0.0f);
255 glScalef(2.0f, 2.0f, 1.0f);
256
257 glEnable(GL_POLYGON_OFFSET_FILL);
258 glPolygonOffset(0.1f, 1.0f);
259
260 glPushMatrix();
261
262 TGLUtil::LineWidth(1.0f);
263
264 // move to pos
265 glTranslatef(fPosX, fPosY, 0.0f);
266
267 TObjArray *lines = fText.Tokenize("\n");
268 TIter line_iter(lines);
269 TObjString *osl;
270
271 Float_t widthTxt, heightTxt, sx, sy, descent, line_height;
272 {
273 // get unscaled text size
275 rnrCtx.RegisterFontNoScale(fs, "arial", TGLFont::kTexture, fFont);
276 descent = fFont.GetDescent();
277 line_height = fFont.GetLineHeight();
278
279 Float_t llx, lly, llz, urx, ury, urz;
280 widthTxt = heightTxt = 0;
281 while ((osl = (TObjString*) line_iter()) != 0)
282 {
283 fFont.BBox(osl->GetString().Data(), llx, lly, llz, urx, ury, urz);
284 widthTxt = TMath::Max(widthTxt, urx);
285 heightTxt += line_height;
286 }
287 widthTxt += 2.0f * descent;
288 heightTxt += 2.0f * descent;
289
290 // keep proportions
291 sy = fTextSize / (line_height + descent);
292 sx = sy / vp.Aspect();
293 fDrawW = sx*widthTxt;
294 fDrawH = sy*heightTxt;
295 }
296 glScalef(sx, sy, 1.0f);
297
298 glPushName(kMoveID);
299
300 Float_t x1, x2, y1, y2;
301 Float_t z3 = 0.0f; // main background
302 Float_t z2 = -0.01f; // outlines and text
303 Float_t z1 = -0.02f; // button on top of text
304 Float_t z0 = -0.03f; // button on top of text
305
306 // main background
307 glLoadName(kMoveID);
308 x1 = 0.0f;
309 x2 = widthTxt;
310 y1 = -heightTxt;
311 y2 = 0.0f;
313 glBegin(GL_QUADS);
314 glVertex3f(x1, y1, z3);
315 glVertex3f(x2, y1, z3);
316 glVertex3f(x2, y2, z3);
317 glVertex3f(x1, y2, z3);
318 glEnd();
319 // main polygon outline
321 glBegin(GL_LINE_LOOP);
322 glVertex3f(x1, y1, z2);
323 glVertex3f(x2, y1, z2);
324 glVertex3f(x2, y2, z2);
325 glVertex3f(x1, y2, z2);
326 glEnd();
327
328 // annotation text
329 TGLUtil::Color(fgCol);
331 glPushMatrix();
332 Float_t tx = 0;
333 line_iter.Reset();
334 while ((osl = (TObjString*) line_iter()) != 0)
335 {
336 if (fTextAlign == TGLFont::kLeft) {
337 tx = 0;
338 }
339 else if (fTextAlign == TGLFont::kCenterH) {
340 tx = 0.5f * widthTxt - descent ;
341 }
342 else {
343 tx = widthTxt - 2.0f * descent;
344 }
345 glTranslatef(0.0f, -line_height, 0.0f);
346 fFont.Render(osl->GetString(), tx+descent, 0, z2, fTextAlign, TGLFont::kTop) ;
347 }
348 glPopMatrix();
350
351 delete lines;
352
353 // buttons
354 if (fActive)
355 {
356 Float_t bbox[6];
358 fFont.BBox("X", bbox[0], bbox[1], bbox[2], bbox[3], bbox[4], bbox[5]);
359 glLoadName(kEditID);
360 fFont.Render("E", descent, descent, z2, fTextAlign, TGLFont::kTop);
361 x2 = bbox[3] + 2.0f * descent;
362 if (fAllowClose)
363 {
364 glLoadName(kDeleteID);
365 fFont.Render("X", x2 + descent, descent, z2, fTextAlign, TGLFont::kTop);
366 }
368
369 x1 = 0.0f;
370 y1 = 0.0f;
371 y2 = line_height + descent;
372 {
373 // edit button
374 glLoadName(kEditID);
375 // polygon
377 glBegin(GL_QUADS);
378 glVertex3f(x1, y1, z3);
379 glVertex3f(x2, y1, z3);
380 glVertex3f(x2, y2, z3);
381 glVertex3f(x1, y2, z3);
382 glEnd();
383 // outline
385 glBegin(GL_LINE_LOOP);
386 glVertex3f(x1, y1, z0);
387 glVertex3f(x2, y1, z0);
388 glVertex3f(x2, y2, z0);
389 glVertex3f(x1, y2, z0);
390 glEnd();
391 }
392 x1 += x2;
393 x2 += x2;
394 if (fAllowClose)
395 {
396 // close button
397 glLoadName(kDeleteID);
398 // polygon
400 glBegin(GL_QUADS);
401 glVertex3f(x1, y1, z3);
402 glVertex3f(x2, y1, z3);
403 glVertex3f(x2, y2, z3);
404 glVertex3f(x1, y2, z3);
405 glEnd();
406 // outline
408 glBegin(GL_LINE_LOOP);
409 glVertex3f(x1, y1, z0);
410 glVertex3f(x2, y1, z0);
411 glVertex3f(x2, y2, z0);
412 glVertex3f(x1, y2, z0);
413 glEnd();
414 }
415 {
416 // resize button
417 glLoadName(kResizeID);
418 // polygon
419 x1 = widthTxt - line_height;
420 x2 = widthTxt;
421 y1 = -heightTxt;
422 y2 = -heightTxt + line_height;
424 glBegin(GL_QUADS);
425 glVertex3f(x1, y1, z1);
426 glVertex3f(x2, y1, z1);
427 glVertex3f(x2, y2, z1);
428 glVertex3f(x1, y2, z1);
429 glEnd();
430 // draw resize corner lines
432 glBegin(GL_LINES);
433 Float_t aOff = 0.25*line_height;
434 glVertex3f(x1+aOff, y1+aOff, z0);
435 glVertex3f(x2-aOff, y1+aOff, z0);
436 glVertex3f(x2-aOff, y1+aOff, z0);
437 glVertex3f(x2-aOff, y2-aOff, z0);
438 glEnd();
439 }
440 }
441
442 glPopName();
443
444 glPopMatrix();
445
446 if (fDrawRefLine)
447 {
449 op[0] /= vp.Width(); op[1] /= vp.Height();
450
451 Float_t fx = op[0] < fPosX ? 0.0f : (op[0] > fPosX + fDrawW ? 1.0f : 0.5f);
452 Float_t fy = op[1] < fPosY-fDrawH ? 1.0f : (op[1] > fPosY ? 0.0f : 0.5f);
453
454 if (fx != 0.5f || fy != 0.5f)
455 {
458 glBegin(GL_LINES);
459 glVertex3f(fPosX + fx*fDrawW, fPosY - fy*fDrawH, z3);
460 glVertex3f(op[0], op[1], z3);
461 glEnd();
462 }
463 }
464
465 glPopMatrix();
466 rnrCtx.ProjectionMatrixPop();
467
468 glDepthRange(old_depth_range[0], old_depth_range[1]);
469 glPopAttrib();
470}
471
472////////////////////////////////////////////////////////////////////////////////
473/// Returns transparency of annotation outline.
474/// If annotation is selected enforce visibility of outline.
475
477{
478 if (fActive)
479 return TMath::Min(70, fTransparency);
480 else
481 return fTransparency;
482}
483
484////////////////////////////////////////////////////////////////////////////////
485/// Show the annotation editor.
486
488{
489 if (fMainFrame == 0)
490 {
491 fMainFrame = new TGMainFrame(gClient->GetRoot(), 1000, 1000);
492 fMainFrame->SetWindowName("Annotation Editor");
493
495
496 fTextEdit = new TGTextEdit(vf, 1000, 1000, kSunkenFrame);
498
500
501 TGTextButton* btt1 = new TGTextButton(hf, "OK");
502 hf->AddFrame(btt1, new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2));
503
504 TGTextButton* btt2 = new TGTextButton(hf, "Cancel");
505 hf->AddFrame(btt2, new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2));
506
507 btt1->Connect("Clicked()", "TGLAnnotation", this, "UpdateText()");
508 btt2->Connect("Clicked()", "TGLAnnotation", this, "CloseEditor()");
509
510 vf->AddFrame(hf, new TGLayoutHints(kLHintsBottom | kLHintsRight | kLHintsExpandX, 2, 2, 5, 1));
511
515 }
516
517 TGText *tgt = new TGText();
518 tgt->LoadBuffer(fText.Data());
519 fTextEdit->SetText(tgt);
520
521 Int_t nrow = tgt->RowCount();
522 Int_t h = nrow*20;
524 fMainFrame->Resize(TMath::Max(100, w+30), TMath::Max(100, h+40));
525
528}
529
530////////////////////////////////////////////////////////////////////////////////
531/// Close the annotation editor.
532
534{
536}
537
538////////////////////////////////////////////////////////////////////////////////
539/// Modify the annotation text from the text-edit widget.
540
542{
546}
SVector< double, 2 > v
Definition: Dict.h:5
@ kButtonRelease
Definition: GuiTypes.h:59
@ kButtonPress
Definition: GuiTypes.h:59
@ kMotionNotify
Definition: GuiTypes.h:60
const Handle_t kNone
Definition: GuiTypes.h:87
#define h(i)
Definition: RSha256.hxx:106
static const double x2[5]
static const double x1[5]
int Int_t
Definition: RtypesCore.h:41
char Char_t
Definition: RtypesCore.h:29
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
short Color_t
Definition: RtypesCore.h:79
float Float_t
Definition: RtypesCore.h:53
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassImp(name)
Definition: Rtypes.h:363
@ kOrange
Definition: Rtypes.h:64
@ kAzure
Definition: Rtypes.h:64
#define gClient
Definition: TGClient.h:166
@ kDeepCleanup
Definition: TGFrame.h:51
@ kSunkenFrame
Definition: TGFrame.h:61
@ kLHintsRight
Definition: TGLayout.h:33
@ kLHintsExpandY
Definition: TGLayout.h:38
@ kLHintsBottom
Definition: TGLayout.h:36
@ kLHintsExpandX
Definition: TGLayout.h:37
#define gROOT
Definition: TROOT.h:410
The color creation and management class.
Definition: TColor.h:19
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
Definition: TColor.cxx:1758
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1099
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1239
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1054
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1146
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:587
virtual void MapWindow()
Definition: TGFrame.h:251
virtual void UnmapWindow()
Definition: TGFrame.h:253
GL-overlay annotation.
Definition: TGLAnnotation.h:26
static Color_t fgBackColor
Definition: TGLAnnotation.h:54
static Color_t fgTextColor
Definition: TGLAnnotation.h:55
TGMainFrame * fMainFrame
Definition: TGLAnnotation.h:51
Float_t fTextSize
Definition: TGLAnnotation.h:60
Bool_t fDrawRefLine
Definition: TGLAnnotation.h:69
void MakeEditor()
Show the annotation editor.
void UpdateText()
Modify the annotation text from the text-edit widget.
Color_t fTextColor
Definition: TGLAnnotation.h:66
TGTextEdit * fTextEdit
Definition: TGLAnnotation.h:52
TGLViewer * fParent
Definition: TGLAnnotation.h:57
Float_t fDrawH
Definition: TGLAnnotation.h:45
Float_t fDrawW
Definition: TGLAnnotation.h:45
void CloseEditor()
Close the annotation editor.
TGLFont::ETextAlignH_e fTextAlign
Definition: TGLAnnotation.h:63
virtual ~TGLAnnotation()
Destructor.
virtual Bool_t MouseEnter(TGLOvlSelectRecord &selRec)
Mouse has entered overlay area.
virtual void Render(TGLRnrCtx &rnrCtx)
Render the annotation.
Char_t GetLineTransparency() const
Returns transparency of annotation outline.
TGLAnnotation(const TGLAnnotation &)
Bool_t fUseColorSet
Definition: TGLAnnotation.h:70
virtual void MouseLeave()
Mouse has left overlay area.
EDrag fDrag
last mouse position
Definition: TGLAnnotation.h:44
Float_t fTextSizeDrag
width and height when drawing
Definition: TGLAnnotation.h:46
Char_t fTransparency
Definition: TGLAnnotation.h:67
virtual Bool_t Handle(TGLRnrCtx &rnrCtx, TGLOvlSelectRecord &selRec, Event_t *event)
Handle overlay event.
Bool_t fAllowClose
Definition: TGLAnnotation.h:71
Color_t fBackColor
Definition: TGLAnnotation.h:65
TGLVector3 fPointer
text-size at start of drag
Definition: TGLAnnotation.h:48
TGLVertex3 WorldToViewport(const TGLVertex3 &worldVertex, TGLMatrix *modviewMat=0) const
Convert a 3D world vertex to '3D' viewport (screen) one.
Definition: TGLCamera.cxx:403
TGLRect & RefViewport()
Definition: TGLCamera.h:128
TGLColor & Markup()
Definition: TGLUtil.h:852
TGLColor & Background()
Definition: TGLUtil.h:849
Color_t GetColorIndex() const
Returns color-index representing the color.
Definition: TGLUtil.cxx:1240
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.
An overlay element.
Definition: TGLOverlay.h:23
Selection record for overlay objects.
Viewport (pixel base) 2D rectangle class.
Definition: TGLUtil.h:423
Int_t Height() const
Definition: TGLUtil.h:453
Int_t Width() const
Definition: TGLUtil.h:451
Double_t Aspect() const
Definition: TGLUtil.h:501
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Definition: TGLRnrCtx.h:41
void RegisterFontNoScale(Int_t size, Int_t file, Int_t mode, TGLFont &out)
Get font in the GL rendering context.
Definition: TGLRnrCtx.cxx:367
TGLColorSet & ColorSet()
Return reference to current color-set (top of the stack).
Definition: TGLRnrCtx.cxx:278
TGLCamera & RefCamera()
Definition: TGLRnrCtx.h:157
Short_t ViewerLOD() const
Definition: TGLRnrCtx.h:171
void ProjectionMatrixPushIdentity()
Definition: TGLRnrCtx.cxx:423
void ProjectionMatrixPop()
Definition: TGLRnrCtx.cxx:438
UInt_t GetItem(Int_t i) const
Int_t GetN() const
static void ColorTransparency(Color_t color_index, Char_t transparency=0)
Set color from color_index and ROOT-style transparency (default 0).
Definition: TGLUtil.cxx:1752
static void Color(const TGLColor &color)
Set color from TGLColor.
Definition: TGLUtil.cxx:1708
static Float_t LineWidth()
Get the line-width, taking the global scaling into account.
Definition: TGLUtil.cxx:1954
3 component (x/y/z) vector class.
Definition: TGLUtil.h:247
3 component (x/y/z) vertex class.
Definition: TGLUtil.h:83
Base class for GL viewers.
Definition: TGLViewerBase.h:37
virtual void AddOverlayElement(TGLOverlayElement *el)
Add overlay element.
Base GL viewer object - used by both standalone and embedded (in pad) GL.
Definition: TGLViewer.h:57
virtual void RemoveOverlayElement(TGLOverlayElement *el)
Remove overlay element.
Definition: TGLViewer.cxx:2306
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...
Definition: TGLViewer.cxx:440
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1746
virtual Long_t ReturnLongestLineWidth()
Return width of longest line in widget.
Definition: TGTextEdit.cxx:365
TGText * GetText() const
Definition: TGTextView.h:126
virtual void SetText(TGText *text)
Adopt a new text buffer. The text will be deleted by this object.
Definition: TGTextView.cxx:195
Definition: TGText.h:67
Long_t RowCount() const
Definition: TGText.h:116
Bool_t LoadBuffer(const char *txtbuf)
Load a 0 terminated buffer. Lines will be split at ' '.
Definition: TGText.cxx:512
TString AsString()
Returns content as ROOT string.
Definition: TGText.cxx:1237
void Reset()
Definition: TCollection.h:252
An array of TObjects.
Definition: TObjArray.h:37
Collectable string class.
Definition: TObjString.h:28
const TString & GetString() const
Definition: TObjString.h:47
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition: TQObject.cxx:867
TText * text
return c1
Definition: legend1.C:41
TF1 * f1
Definition: legend1.C:11
return c2
Definition: legend2.C:14
TMath.
Definition: TMathBase.h:35
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Definition: TMath.h:701
Short_t Max(Short_t a, Short_t b)
Definition: TMathBase.h:212
Short_t Min(Short_t a, Short_t b)
Definition: TMathBase.h:180
EGEventType fType
Definition: GuiTypes.h:174
Int_t fY
Definition: GuiTypes.h:177
Int_t fX
Definition: GuiTypes.h:177