Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TFunctionParametersDialog.cxx
Go to the documentation of this file.
1// @(#)root/ged:$Id$
2// Author: Ilka Antcheva 08/05/06
3
4/*************************************************************************
5 * Copyright (C) 1995-2006, 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/** \class TFunctionParametersDialog
13 \ingroup ged
14
15This class is used for function parameter settings.
16
17*/
18
20#include "TTimer.h"
21#include "TList.h"
22#include "TF1.h"
23#include "TGButton.h"
24#include "TGFrame.h"
25#include "TGLabel.h"
26#include "TGLayout.h"
27#include "TGTextEntry.h"
28#include "TGMsgBox.h"
29#include "TGNumberEntry.h"
30#include "TGTripleSlider.h"
31#include "TVirtualPad.h"
32
33
47
48
49////////////////////////////////////////////////////////////////////////////////
50/// Create the parameters' dialog of currently selected function 'func'.
51
53 const TGWindow *main,
54 TF1 *func,
56 Double_t rx, Double_t ry) :
58{
59 fFunc = func;
60 fFpad = pad;
61 fRXmin = rx;
62 fRXmax = ry;
64 fNP = fFunc->GetNpar();
66 fPmin = new Double_t[fNP];
67 fPmax = new Double_t[fNP];
68 fPval = new Double_t[fNP];
69 fPerr = new Double_t[fNP];
70
71 for (Int_t i = 0; i < fNP; i++) {
72 fFunc->GetParLimits(i, fPmin[i], fPmax[i]);
73 fPval[i] = fFunc->GetParameter(i);
74 fPerr[i] = fFunc->GetParError(i);
75 }
76 fParNam = new TGTextEntry*[fNP];
82
83 memset(fParNam, 0, sizeof(TGTextEntry*)*fNP);
84 memset(fParFix, 0, sizeof(TGCheckButton*)*fNP);
85 memset(fParVal, 0, sizeof(TGNumberEntry*)*fNP);
88 memset(fParMax, 0, sizeof(TGTripleHSlider*)*fNP);
89
91 AddFrame(f1, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
92
93 // column 'Name'
95 fContNam->AddFrame(new TGLabel(fContNam,"Name"),
96 new TGLayoutHints(kLHintsTop, 5, 0, 0, 0));
97 for (Int_t i = 0; i < fNP; i++ ) {
98 fParNam[i] = new TGTextEntry(fContNam, new TGTextBuffer(80), kNAME+i);
99 fParNam[i]->SetText(Form("%s", fFunc->GetParName(i)));
102 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 5));
103 }
104 f1->AddFrame(fContNam, new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
105
106 // column 'Fix'
108 fContFix->AddFrame(new TGLabel(fContFix,"Fix"),
109 new TGLayoutHints(kLHintsTop, 2, 0, 0, 0));
110 for (Int_t i = 0; i < fNP; i++ ) {
111 fParFix[i] = new TGCheckButton(fContFix, "", kFIX*fNP+i);
112 fParFix[i]->SetToolTipText(Form("Set %s to fixed", fFunc->GetParName(i)));
114 5, 5, 10, 7));
115 if ((fPmin[i] == fPmax[i]) && (fPmin[i] || fPmax[i]))
117 else
119 fParFix[i]->Connect("Toggled(Bool_t)", "TFunctionParametersDialog", this, "DoFix(Bool_t)");
120 }
121 f1->AddFrame(fContFix, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
122
123 // column 'Value'
125 fContVal->AddFrame(new TGLabel(fContVal,"Value"),
126 new TGLayoutHints(kLHintsTop, 5, 0, 0, 0));
127 for (Int_t i = 0; i < fNP; i++ ) {
128 fParVal[i] = new TGNumberEntry(fContVal, 1.2E-12, 15, kVAL*fNP+i,
130 fParVal[i]->SetNumber(fPval[i]);
133 (fParVal[i]->GetNumberEntry())->SetToolTipText(Form("%s", fFunc->GetParName(i)));
134 (fParVal[i]->GetNumberEntry())->Connect("ReturnPressed()", "TFunctionParametersDialog",
135 this, "DoParValue()");
136 fParVal[i]->Connect("ValueSet(Long_t)", "TFunctionParametersDialog", this, "DoParValue()");
137 }
138 f1->AddFrame(fContVal, new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
139
140 // column 'Min'
142 fContMin->AddFrame(new TGLabel(fContMin,"Min"),
143 new TGLayoutHints(kLHintsTop, 5, 0, 0, 0));
144 for (Int_t i = 0; i < fNP; i++ ) {
145 fParMin[i] = new TGNumberEntryField(fContMin, kMIN*fNP+i, 0.0,
148 ((TGTextEntry*)fParMin[i])->SetToolTipText(Form("Lower limit of %s",
149 fFunc->GetParName(i)));
151 if (fPmin[i])
152 fParMin[i]->SetNumber(fPmin[i]);
153 else if (fPerr[i])
154 fParMin[i]->SetNumber(fPval[i]-3*fPerr[i]);
155 else if (fPval[i])
156 fParMin[i]->SetNumber(fPval[i]-0.1*fPval[i]);
157 else
158 fParMin[i]->SetNumber(1.0);
159 fParMin[i]->Connect("ReturnPressed()", "TFunctionParametersDialog", this, "DoParMinLimit()");
160 }
161 f1->AddFrame(fContMin, new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
162
163 // column 'Set Range'
165 fContSld->AddFrame(new TGLabel(fContSld,"Set Range"),
166 new TGLayoutHints(kLHintsTop, 5, 0, 0, 0));
167 for (Int_t i = 0; i < fNP; i++ ) {
173 }
174 f1->AddFrame(fContSld, new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
175
176 // column 'Max'
178 fContMax->AddFrame(new TGLabel(fContMax,"Max"),
179 new TGLayoutHints(kLHintsTop, 5, 0, 0, 0));
180 for (Int_t i = 0; i < fNP; i++ ) {
181 fParMax[i] = new TGNumberEntryField(fContMax, kMAX*fNP+i, 0.0,
184 ((TGTextEntry*)fParMax[i])->SetToolTipText(Form("Upper limit of %s",
185 fFunc->GetParName(i)));
187 if (fPmax[i])
188 fParMax[i]->SetNumber(fPmax[i]);
189 else if (fPerr[i])
190 fParMax[i]->SetNumber(fPval[i]+3*fPerr[i]);
191 else if (fPval[i])
192 fParMax[i]->SetNumber(fPval[i]+0.1*fPval[i]);
193 else
194 fParMax[i]->SetNumber(1.0);
195 if (fParMax[i]->GetNumber() < fParMin[i]->GetNumber()){
196 Double_t temp;
197 temp = fParMax[i]->GetNumber();
198 fParMax[i]->SetNumber(fParMin[i]->GetNumber());
199 fParMin[i]->SetNumber(temp);
200 }
201 fParMax[i]->Connect("ReturnPressed()", "TFunctionParametersDialog", this, "DoParMaxLimit()");
202 }
203 f1->AddFrame(fContMax, new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
204
205
206 fUpdate = new TGCheckButton(this, "&Immediate preview", kUPDATE);
207 fUpdate->SetToolTipText("Immediate function redrawing");
209 fUpdate->Connect("Toggled(Bool_t)", "TFunctionParametersDialog", this, "HandleButtons(Bool_t)");
210
212 AddFrame(f2, new TGLayoutHints(kLHintsRight, 20, 20, 5, 1));
213
214 fReset = new TGTextButton(f2, "&Reset", kRESET);
216 fReset->SetToolTipText("Reset the parameter settings");
218 fReset->Connect("Clicked()", "TFunctionParametersDialog", this, "DoReset()");
219
220 fApply = new TGTextButton(f2, "&Apply", kAPPLY);
223 fApply->Connect("Clicked()", "TFunctionParametersDialog", this, "DoApply()");
224 fApply->SetToolTipText("Apply parameter settings and redraw the function");
225
226 fOK = new TGTextButton(f2, "&OK", kOK);
228 fOK->SetToolTipText("Apply parameter settings, redraw function and close this dialog");
229 fOK->Connect("Clicked()", "TFunctionParametersDialog", this, "DoOK()");
230
231 fCancel = new TGTextButton(f2, "&Cancel", kCANCEL);
233 fCancel->SetToolTipText("Close this dialog with no parameter changes");
234 fCancel->Connect("Clicked()", "TFunctionParametersDialog", this, "DoCancel()");
235
239 SetWindowName(Form("Set Parameters of %s", fFunc->GetTitle()));
240 MapWindow();
241
242 for (Int_t i = 0; i < fNP; i++ ) {
243 if (fParFix[i]->GetState() == kButtonDown) {
247 fParSld[i]->UnmapWindow();
248 } else {
249 fParSld[i]->SetRange(fParMin[i]->GetNumber(), fParMax[i]->GetNumber());
250 fParSld[i]->SetPosition(fParMin[i]->GetNumber(), fParMax[i]->GetNumber());
252 fParSld[i]->Connect("PointerPositionChanged()", "TFunctionParametersDialog",
253 this, "DoSlider()");
254 fParSld[i]->Connect("PositionChanged()", "TFunctionParametersDialog",
255 this, "DoSlider()");
256 }
257 }
258
259 gClient->WaitFor(this);
260}
261
262////////////////////////////////////////////////////////////////////////////////
263/// Destructor.
264
266{
268 TIter next(GetList());
269
270 while ((el = (TGFrameElement *)next())) {
271 if (!strcmp(el->fFrame->ClassName(), "TGCompositeFrame")) {
273 TIter next1(((TGCompositeFrame *)el->fFrame)->GetList());
274 while ((el1 = (TGFrameElement *)next1())) {
275 if (!strcmp(el1->fFrame->ClassName(), "TGCompositeFrame"))
276 ((TGCompositeFrame *)el1->fFrame)->Cleanup();
277 }
278 ((TGCompositeFrame *)el->fFrame)->Cleanup();
279 }
280 }
281 Cleanup();
282 delete [] fPval;
283 delete [] fPmin;
284 delete [] fPmax;
285 delete [] fPerr;
286}
287
288////////////////////////////////////////////////////////////////////////////////
289/// Close parameters' dialog.
290
292{
293 if (fHasChanges) {
294 Int_t ret;
295 const char *txt;
296 txt = "Do you want to apply last parameters' setting?";
298 "Parameters Have Been Changed", txt, kMBIconExclamation,
299 kMBYes | kMBNo | kMBCancel, &ret);
300 if (ret == kMBYes) {
301 DoOK();
302 return;
303 } else if (ret == kMBNo) {
304 DoReset();
305 } else return;
306 }
307 DeleteWindow();
308}
309
310////////////////////////////////////////////////////////////////////////////////
311/// Slot related to the Cancel button.
312
314{
315 if (fHasChanges)
316 DoReset();
317 TTimer::SingleShot(50, "TFunctionParametersDialog", this, "CloseWindow()");
318}
319
320////////////////////////////////////////////////////////////////////////////////
321/// Slot related to the Fix check button.
322
324{
327 Int_t id = bt->WidgetId();
329 for (Int_t i = 0; i < fNP; i++ ) {
330 if (id == kFIX*fNP+i) {
331 if (on) {
332 if (fParVal[i]->GetNumber() != 0) {
333 fParMin[i]->SetNumber(fParVal[i]->GetNumber());
335 fParMax[i]->SetNumber(fParVal[i]->GetNumber());
337 } else {
338 fParMin[i]->SetNumber(1.);
340 fParMax[i]->SetNumber(1.);
342 }
344 fParSld[i]->Disconnect("PointerPositionChanged()");
345 fParSld[i]->Disconnect("PositionChanged()");
346 fParSld[i]->UnmapWindow();
347 fFunc->FixParameter(i, fParVal[i]->GetNumber());
348 } else if (!fParMin[i]->IsEnabled()) {
349 if (fPmin[i] != fPmax[i]) {
350 if (fPmin[i])
351 fParMin[i]->SetNumber(fPmin[i]);
352 else if (fPerr[i])
353 fParMin[i]->SetNumber(fPval[i]-3*fPerr[i]);
354 else if (fPval[i])
355 fParMin[i]->SetNumber(fPval[i]-0.1*fPval[i]);
356 else
357 fParMin[i]->SetNumber(1.0);
358 if (fPmax[i])
359 fParMax[i]->SetNumber(fPmax[i]);
360 else if (fPerr[i])
361 fParMax[i]->SetNumber(fPval[i]+3*fPerr[i]);
362 else if (fPval[i])
363 fParMax[i]->SetNumber(fPval[i]+0.1*fPval[i]);
364 else
365 fParMax[i]->SetNumber(1.0);
366 } else if (fPval[i]) {
367 fParMin[i]->SetNumber(fPval[i]-0.1*fPval[i]);
368 fParMax[i]->SetNumber(fPval[i]+0.1*fPval[i]);
369 } else {
370 fParMin[i]->SetNumber(1.0);
371 fParMax[i]->SetNumber(1.0);
372 }
373 if (fParMax[i]->GetNumber() < fParMin[i]->GetNumber()){
374 Double_t temp;
375 temp = fParMax[i]->GetNumber();
376 fParMax[i]->SetNumber(fParMin[i]->GetNumber());
377 fParMin[i]->SetNumber(temp);
378 }
381 fParSld[i]->MapWindow();
383 fParSld[i]->SetRange(fParMin[i]->GetNumber(), fParMax[i]->GetNumber());
384 fParSld[i]->SetPosition(fParMin[i]->GetNumber(), fParMax[i]->GetNumber());
386 fParSld[i]->Connect("PointerPositionChanged()", "TFunctionParametersDialog",
387 this, "DoSlider()");
388 fParSld[i]->Connect("PositionChanged()", "TFunctionParametersDialog",
389 this, "DoSlider()");
390 fFunc->SetParLimits(i, fParMin[i]->GetNumber(), fParMax[i]->GetNumber());
391 }
392 }
393 }
394 if (fUpdate->GetState() == kButtonDown)
396 else if ((fApply->GetState() == kButtonDisabled) && fHasChanges)
398}
399
400////////////////////////////////////////////////////////////////////////////////
401/// Slot related to the OK button.
402
404{
405 if (fHasChanges)
408 TTimer::SingleShot(50, "TFunctionParametersDialog", this, "CloseWindow()");
409}
410
411////////////////////////////////////////////////////////////////////////////////
412/// Slot related to the Preview button.
413
421
422////////////////////////////////////////////////////////////////////////////////
423/// Slot related to the Reset button.
424
426{
428 Int_t k = fNP;
429 for (Int_t i = 0; i < fNP; i++) {
430 if (fParVal[i]->GetNumber() == fPval[i])
431 k--;
432 else
433 break;
434 }
435
436 if (!k) {
437 if (fReset->GetState() == kButtonUp)
440 return;
441 }
442 for (Int_t i = 0; i < fNP; i++) {
443 fFunc->SetParameter(i, fPval[i]);
444 fFunc->SetParLimits(i, fPmin[i], fPmax[i]);
445 fFunc->SetParError(i, fPerr[i]);
446
447 if (fPmin[i])
448 fParMin[i]->SetNumber(fPmin[i]);
449 else if (fPerr[i])
450 fParMin[i]->SetNumber(fPval[i]-3*fPerr[i]);
451 else if (fPval[i])
452 fParMin[i]->SetNumber(fPval[i]-0.1*fPval[i]);
453 else
454 fParMin[i]->SetNumber(1.0);
455
456 if (fPmax[i])
457 fParMax[i]->SetNumber(fPmax[i]);
458 else if (fPerr[i])
459 fParMax[i]->SetNumber(fPval[i]+3*fPerr[i]);
460 else if (fPval[i])
461 fParMax[i]->SetNumber(fPval[i]+0.1*fPval[i]);
462 else
463 fParMax[i]->SetNumber(1.0);
464 if (fParMax[i]->GetNumber() < fParMin[i]->GetNumber()){
465 Double_t temp;
466 temp = fParMax[i]->GetNumber();
467 fParMax[i]->SetNumber(fParMin[i]->GetNumber());
468 fParMin[i]->SetNumber(temp);
469 }
470 if (fParMin[i]->GetNumber() == fParMax[i]->GetNumber()) {
474 fParSld[i]->Disconnect("PointerPositionChanged()");
475 fParSld[i]->Disconnect("PositionChanged()");
476 fParSld[i]->UnmapWindow();
477 fFunc->FixParameter(i, fParVal[i]->GetNumber());
479 } else {
481 if (!fParMax[i]->IsEnabled()) {
485 fParSld[i]->SetRange(fParMin[i]->GetNumber(), fParMax[i]->GetNumber());
486 fParSld[i]->SetPosition(fParMin[i]->GetNumber(), fParMax[i]->GetNumber());
488 fParSld[i]->MapWindow();
489 fParSld[i]->Connect("PointerPositionChanged()", "TFunctionParametersDialog",
490 this, "DoSlider()");
491 fParSld[i]->Connect("PositionChanged()", "TFunctionParametersDialog",
492 this, "DoSlider()");
493 }
494 }
495 fParVal[i]->SetNumber(fPval[i]);
496
497 fParSld[i]->SetRange(fParMin[i]->GetNumber(), fParMax[i]->GetNumber());
498 fParSld[i]->SetPosition(fParMin[i]->GetNumber(), fParMax[i]->GetNumber());
500 }
501
502 if (fUpdate->GetState() == kButtonDown)
504 else if ((fApply->GetState() == kButtonDisabled) && fHasChanges)
508}
509
510////////////////////////////////////////////////////////////////////////////////
511/// Slot related to the parameters' value settings.
512
514{
516 Int_t id = sl->WidgetId();
517
519 for (Int_t i = 0; i < fNP; i++ ) {
520 if (id == kSLD*fNP+i) {
521 fFunc->SetParameter(i,fParSld[i]->GetPointerPosition());
522 fFunc->SetParLimits(i,fParSld[i]->GetMinPosition(),
523 fParSld[i]->GetMaxPosition());
524 fParMin[i]->SetNumber(fParSld[i]->GetMinPosition());
525 fParMax[i]->SetNumber(fParSld[i]->GetMaxPosition());
526 fParVal[i]->SetNumber(fParSld[i]->GetPointerPosition());
527 }
528 }
529 if (fUpdate->GetState() == kButtonDown)
531 else if ((fApply->GetState() == kButtonDisabled) && fHasChanges)
535}
536
537////////////////////////////////////////////////////////////////////////////////
538/// Slot related to the parameter value settings.
539
541{
543 Int_t id = ne->WidgetId();
544
545 for (Int_t i = 0; i < fNP; i++ ) {
546 if (id == kVAL*fNP+i) {
547 fParSld[i]->SetPointerPosition(fParVal[i]->GetNumber());
548 if (fParVal[i]->GetNumber() < fParMin[i]->GetNumber()) {
549 fParMin[i]->SetNumber(fParVal[i]->GetNumber());
551 fParSld[i]->SetRange(fParMin[i]->GetNumber(),
552 fParMax[i]->GetNumber());
553 fParSld[i]->SetPosition(fParMin[i]->GetNumber(),
554 fParMax[i]->GetNumber());
555 }
556 if (fParVal[i]->GetNumber() > fParMax[i]->GetNumber()) {
557 fParMax[i]->SetNumber(fParVal[i]->GetNumber());
559 fParSld[i]->SetRange(fParMin[i]->GetNumber(),
560 fParMax[i]->GetNumber());
561 fParSld[i]->SetPosition(fParMin[i]->GetNumber(),
562 fParMax[i]->GetNumber());
563 }
565 fFunc->SetParameter(i,fParSld[i]->GetPointerPosition());
566 fFunc->SetParLimits(i,fParSld[i]->GetMinPosition(),
567 fParSld[i]->GetMaxPosition());
568 }
569 }
571 if (fUpdate->GetState() == kButtonDown)
573 else if ((fApply->GetState() == kButtonDisabled) && fHasChanges)
577}
578
579////////////////////////////////////////////////////////////////////////////////
580/// Slot related to the minumum parameter limit settings.
581
583{
585 Int_t id = ne->WidgetId();
586
587 for (Int_t i = 0; i < fNP; i++ ) {
588 if (id == kMIN*fNP+i) {
589 if (fParMin[i]->GetNumber() > fParMax[i]->GetNumber()) {
590 Int_t ret;
591 const char *txt;
592 txt = "The lower parameter bound cannot be bigger then the upper one.";
594 "Parameter Limits", txt, kMBIconExclamation,kMBOk,&ret);
595 fParMin[i]->SetNumber(fParVal[i]->GetNumber());
596 return;
597 }
598 fParSld[i]->SetRange(fParMin[i]->GetNumber(),
599 fParMax[i]->GetNumber());
600 fParSld[i]->SetPosition(fParMin[i]->GetNumber(),
601 fParMax[i]->GetNumber());
602 fParSld[i]->SetPointerPosition(fParVal[i]->GetNumber());
604 }
605 }
607 if (fUpdate->GetState() == kButtonDown)
609 else if ((fApply->GetState() == kButtonDisabled) && fHasChanges)
613}
614
615////////////////////////////////////////////////////////////////////////////////
616/// Slot related to the maximum parameter limit settings.
617
619{
621 Int_t id = ne->WidgetId();
622
623 for (Int_t i = 0; i < fNP; i++ ) {
624 if (id == kMAX*fNP+i) {
625 if (fParMin[i]->GetNumber() > fParMax[i]->GetNumber()) {
626 Int_t ret;
627 const char *txt;
628 txt = "The lower parameter bound cannot be bigger then the upper one.";
630 "Parameter Limits", txt, kMBIconExclamation,kMBOk,&ret);
631 fParMax[i]->SetNumber(fParVal[i]->GetNumber());
632 return;
633 }
634 fParSld[i]->SetRange(fParMin[i]->GetNumber(),
635 fParMax[i]->GetNumber());
636 fParSld[i]->SetPosition(fParMin[i]->GetNumber(),
637 fParMax[i]->GetNumber());
638 fParSld[i]->SetPointerPosition(fParVal[i]->GetNumber());
640 }
641 }
643 if (fUpdate->GetState() == kButtonDown)
645 else if ((fApply->GetState() == kButtonDisabled) && fHasChanges)
649}
650
651////////////////////////////////////////////////////////////////////////////////
652/// Redraw function graphics.
653
655{
656 TString opt = fFunc->GetDrawOption();
657 opt.ToUpper();
658 if (!opt.Contains("SAME"))
659 opt += "SAME";
661 fFunc->Draw(opt);
662 fFpad->Modified();
663 fFpad->Update();
665}
666
667////////////////////////////////////////////////////////////////////////////////
668/// Handle the button dependent states in this dialog.
669
@ kVerticalFrame
Definition GuiTypes.h:381
@ kFixedWidth
Definition GuiTypes.h:387
@ kHorizontalFrame
Definition GuiTypes.h:382
int main()
Definition Prototype.cxx:12
static void update(gsl_integration_workspace *workspace, double a1, double b1, double area1, double error1, double a2, double b2, double area2, double error2)
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
@ kButtonDown
Definition TGButton.h:54
@ kButtonDisabled
Definition TGButton.h:56
@ kButtonUp
Definition TGButton.h:53
#define gClient
Definition TGClient.h:157
@ kDoubleScaleBoth
@ kLHintsRight
Definition TGLayout.h:26
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsCenterY
Definition TGLayout.h:28
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
@ kMBNo
Definition TGMsgBox.h:32
@ kMBYes
Definition TGMsgBox.h:31
@ kMBCancel
Definition TGMsgBox.h:37
@ kMBOk
Definition TGMsgBox.h:33
@ kMBIconExclamation
Definition TGMsgBox.h:24
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
R__EXTERN void * gTQSender
Definition TQObject.h:46
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2495
1-Dim function class
Definition TF1.h:182
virtual void SetParError(Int_t ipar, Double_t error)
Set error for parameter number ipar.
Definition TF1.cxx:3510
virtual void GetParLimits(Int_t ipar, Double_t &parmin, Double_t &parmax) const
Return limits for parameter ipar.
Definition TF1.cxx:1967
virtual Double_t GetParError(Int_t ipar) const
Return value of parameter number ipar.
Definition TF1.cxx:1957
virtual void SetRange(Double_t xmin, Double_t xmax)
Initialize the upper and lower bounds to draw the function.
Definition TF1.cxx:3559
virtual Int_t GetNpar() const
Definition TF1.h:461
void Draw(Option_t *option="") override
Draw this function with its current attributes.
Definition TF1.cxx:1340
virtual void GetRange(Double_t *xmin, Double_t *xmax) const
Return range of a generic N-D function.
Definition TF1.cxx:2306
virtual const char * GetParName(Int_t ipar) const
Definition TF1.h:509
virtual void SetParLimits(Int_t ipar, Double_t parmin, Double_t parmax)
Set lower and upper limits for parameter ipar.
Definition TF1.cxx:3538
virtual void SetParameter(Int_t param, Double_t value)
Definition TF1.h:623
virtual void FixParameter(Int_t ipar, Double_t value)
Fix the value of a parameter for a fit operation The specified value will be used in the fit and the ...
Definition TF1.cxx:1584
virtual Double_t GetParameter(Int_t ipar) const
Definition TF1.h:492
TGCompositeFrame * fContMin
container of min range values
Double_t * fPmax
max limits of patameters range
TGNumberEntryField ** fParMin
min range values
virtual void DoApply()
Slot related to the Preview button.
TGCompositeFrame * fContNam
container of parameter names
TGTextButton * fApply
Apply button.
Double_t * fPerr
original patameters' errors
virtual void DoReset()
Slot related to the Reset button.
virtual void RedrawFunction()
Redraw function graphics.
TGCheckButton ** fParFix
fix setting check buttons
TGNumberEntryField ** fParMax
max range values
TF1 * fFunc
function passed to this dialog
Int_t fNP
number of function parameters
void CloseWindow() override
Close parameters' dialog.
virtual void DoFix(Bool_t on)
Slot related to the Fix check button.
TGTextEntry ** fParNam
parameter names
virtual void DoParMinLimit()
Slot related to the minumum parameter limit settings.
Double_t fRangexmin
min limits of patameters range
TGTextButton * fOK
Cancel button.
TFunctionParametersDialog(const TGWindow *p, const TGWindow *main, TF1 *func, TVirtualPad *pad, Double_t rmin, Double_t rmax)
Create the parameters' dialog of currently selected function 'func'.
virtual void DoOK()
Slot related to the OK button.
Double_t fRXmax
original max range
TGCompositeFrame * fContVal
container of parameter values
Double_t * fPmin
min limits of patameters range
virtual void DoParMaxLimit()
Slot related to the maximum parameter limit settings.
virtual void HandleButtons(Bool_t update)
Handle the button dependent states in this dialog.
TGTripleHSlider ** fParSld
triple sliders
Double_t * fPval
original patameters' values
TGCheckButton * fUpdate
Immediate update check button.
TGTextButton * fCancel
Cancel button.
virtual void DoSlider()
Slot related to the parameters' value settings.
TGCompositeFrame * fContMax
container of max range values
Double_t fRangexmax
max limits of patameters range
Bool_t fHasChanges
kTRUE if function was redrawn;
~TFunctionParametersDialog() override
Destructor.
TGCompositeFrame * fContSld
container of sliders
TGNumberEntry ** fParVal
parameter values
TGTextButton * fReset
Reset button.
TVirtualPad * fFpad
pad where the function is drawn
virtual void DoCancel()
Slot related to the Cancel button.
virtual void DoParValue()
Slot related to the parameter value settings.
TGCompositeFrame * fContFix
container of fix settings
Double_t fRXmin
original min range
A button abstract base class.
Definition TGButton.h:68
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition TGButton.cxx:439
virtual EButtonState GetState() const
Definition TGButton.h:112
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition TGButton.cxx:229
Selects different options.
Definition TGButton.h:264
void SetState(EButtonState state, Bool_t emit=kFALSE) override
Set check button state.
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition TGClient.cxx:223
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition TGClient.cxx:380
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:289
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGFrame.h:318
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
virtual TList * GetList() const
Definition TGFrame.h:312
Int_t GetState(TGFrame *f) const
Get state of sub frame.
Definition TGFrame.cxx:1210
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:959
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1156
TGCompositeFrame(const TGCompositeFrame &)=delete
virtual Float_t GetMaxPosition() const
virtual void SetRange(Float_t min, Float_t max)
virtual void SetPosition(Float_t min, Float_t max)
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:597
void MapWindow() override
map window
Definition TGFrame.h:206
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition TGFrame.cxx:675
virtual void DeleteWindow()
Delete window.
Definition TGFrame.cxx:268
void UnmapWindow() override
unmap window
Definition TGFrame.h:208
This class handles GUI labels.
Definition TGLabel.h:24
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1780
virtual void SetNumber(Double_t val, Bool_t emit=kTRUE)
Set the numeric value (floating point representation).
virtual Double_t GetNumber() const
Get the numeric value (floating point representation).
TGNumberEntry is a number entry input widget with up/down buttons.
TGNumberEntryField * GetNumberEntry() const
Get the number entry field.
virtual void SetState(Bool_t enable=kTRUE)
Set the active state.
virtual void SetFormat(EStyle style, EAttribute attr=TGNumberFormat::kNEAAnyNumber)
virtual void SetNumber(Double_t val, Bool_t emit=kTRUE)
@ kNEAAnyNumber
Attributes of number entry field.
@ kNESReal
Real number.
TGClient * fClient
Connection to display server.
Definition TGObject.h:25
A text buffer is used in several widgets, like TGTextEntry, TGFileDialog, etc.
Yield an action as soon as it is clicked.
Definition TGButton.h:142
A TGTextEntry is a one line text input widget.
Definition TGTextEntry.h:24
void SetEnabled(Bool_t flag=kTRUE)
virtual void SetText(const char *text, Bool_t emit=kTRUE)
Sets text entry to text, clears the selection and moves the cursor to the end of the line.
Defines transient windows that typically are used for dialogs windows.
Definition TGFrame.h:500
virtual void CenterOnParent(Bool_t croot=kTRUE, EPlacement pos=kCenter)
Position transient frame centered relative to the parent frame.
Definition TGFrame.cxx:1949
TripleSlider inherit from DoubleSlider widgets and allow easy selection of a min, max and pointer val...
virtual void SetPointerPosition(Double_t pos)
Set pointer position in scaled (real) value.
virtual void SetConstrained(Bool_t on=kTRUE)
Set pointer position constrained in the slider range.
ROOT GUI Window base class.
Definition TGWindow.h:23
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
Definition TGWindow.cxx:150
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:50
virtual Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
Definition TObject.cxx:441
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:865
Bool_t Disconnect(const char *signal=nullptr, void *receiver=nullptr, const char *slot=nullptr)
Disconnects signal of this object from slot of receiver.
Basic string class.
Definition TString.h:138
void ToUpper()
Change string to upper case.
Definition TString.cxx:1202
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:640
static void SingleShot(Int_t milliSec, const char *receiver_class, void *receiver, const char *method)
This static function calls a slot after a given time interval.
Definition TTimer.cxx:261
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
virtual void Modified(Bool_t flag=1)=0
virtual void Update()=0
TF1 * f1
Definition legend1.C:11