Logo ROOT   6.07/09
Reference Guide
TFitParametersDialog.h
Go to the documentation of this file.
1 // @(#)root/fitpanel:$Id$
2 // Author: Ilka Antcheva, Lorenzo Moneta, David Gonzalez Maline 03/10/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 #ifndef ROOT_TFitParametersDialog
13 #define ROOT_TFitParametersDialog
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TFitParametersDialog //
18 // //
19 // This class is used for fit function parameter settings. //
20 // //
21 //////////////////////////////////////////////////////////////////////////
22 
23 #ifndef ROOT_TGButton
24 #include "TGWidget.h"
25 #endif
26 #ifndef ROOT_TGFrame
27 #include "TGFrame.h"
28 #endif
29 
33 };
34 
35 /// Enumeration specifying if parameters
36 /// have been modified by the user
40 };
41 
42 class TF1;
43 class TGNumberEntry;
44 class TGTextEntry;
45 class TGCheckButton;
46 class TGTextButton;
47 class TGTripleHSlider;
48 class TGNumberEntryField;
49 class TVirtualPad;
50 
51 
53 
54 protected:
55  TF1 *fFunc; // function passed to this dialog
56  TVirtualPad *fFpad; // pad where the function is drawn
57  Bool_t fHasChanges; // kTRUE if function was redrawn;
58  Bool_t fImmediateDraw; // kTRUE if function is updated on run-time
59  Int_t *fRetCode; // address to store return code
60  Int_t fNP; // number of function parameters
61  Double_t fRangexmin; // min function range
62  Double_t fRangexmax; // max function range
63  Double_t *fPmin; // min limits of patameters range
64  Double_t *fPmax; // max limits of patameters range
65  Double_t *fPval; // original patameters' values
66  Double_t *fPerr; // original patameters' errors
67  Double_t *fPstp; // original patameters' step
68  TGCompositeFrame *fContNam; // container of parameter names
69  TGCompositeFrame *fContVal; // container of parameter values
70  TGCompositeFrame *fContFix; // container of fix settings
71  TGCompositeFrame *fContBnd; // container of bound settings
72  TGCompositeFrame *fContSld; // container of sliders
73  TGCompositeFrame *fContMin; // container of min range values
74  TGCompositeFrame *fContMax; // container of max range values
75  TGCompositeFrame *fContStp; // container of step values
76  TGCompositeFrame *fContErr; // container of error values
77  TGTextEntry **fParNam; // parameter names
78  TGCheckButton **fParBnd; // bound setting switch
79  TGCheckButton **fParFix; // fix setting switch
80  TGNumberEntry **fParVal; // parameter values
81  TGNumberEntryField **fParMin; // min range values
82  TGNumberEntryField **fParMax; // max range values
83  TGNumberEntry **fParStp; // step values
84  TGTripleHSlider **fParSld; // triple sliders
85  TGNumberEntryField **fParErr; // error values
86  TGCheckButton *fUpdate; // immediate update switch
87  TGTextButton *fApply; // Apply button
88  TGTextButton *fReset; // Reset button
89  TGTextButton *fOK; // OK button
90  TGTextButton *fCancel; // Cancel button
91  TList fTextEntries; // list of text entries used for keyboard navigation
92 
93  void DisconnectSlots();
94 public:
96  TVirtualPad *pad, Int_t *ret_code = 0);
97  virtual ~TFitParametersDialog();
98 
99  virtual void CloseWindow();
100  virtual void DoApply();
101  virtual void DoCancel();
102  virtual void DoOK();
103  virtual void DoParFix(Bool_t on);
104  virtual void DoParBound(Bool_t on);
105  virtual void DoParMaxLimit();
106  virtual void DoParMinLimit();
107  virtual void DoParStep();
108  virtual void DoParValue();
109  virtual void DoReset();
110  virtual void DoSlider();
111  virtual void DrawFunction();
112  virtual void HandleButtons(Bool_t update);
113  virtual void HandleShiftTab();
114  virtual void HandleTab();
115  virtual Bool_t HasChanges() { return fHasChanges; }
116 
117 protected:
118  void SetParameters();
119 
120  ClassDef(TFitParametersDialog, 0) // Fit function parameters dialog
121 };
122 
123 #endif
virtual void DoParFix(Bool_t on)
Slot related to the Fix check button.
virtual void DoParMaxLimit()
Slot related to the maximum parameter limit settings.
virtual void HandleTab()
Handle Tab key event (set focus to the next number entry field)
TGCheckButton ** fParBnd
TGNumberEntry ** fParStp
virtual void DoApply()
Slot related to the Preview button.
virtual void DoCancel()
Slot related to the Cancel button.
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TGTripleHSlider ** fParSld
TFitParametersDialog(const TGWindow *p, const TGWindow *main, TF1 *func, TVirtualPad *pad, Int_t *ret_code=0)
TGCompositeFrame * fContVal
TGNumberEntryField ** fParErr
#define ClassDef(name, id)
Definition: Rtypes.h:254
TGCompositeFrame * fContErr
virtual void DoParMinLimit()
Slot related to the minumum parameter limit settings.
virtual void CloseWindow()
Close parameters' dialog.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:59
A doubly linked list.
Definition: TList.h:47
virtual Bool_t HasChanges()
EFPDialogBound
virtual void HandleButtons(Bool_t update)
Handle the button dependent states in this dialog.
TGCompositeFrame * fContNam
virtual void DoParBound(Bool_t on)
Slot related to the Bound check button.
TGNumberEntryField ** fParMax
static void update(gsl_integration_workspace *workspace, double a1, double b1, double area1, double error1, double a2, double b2, double area2, double error2)
virtual void DrawFunction()
Redraw function graphics.
virtual void DoOK()
Slot related to the OK button.
virtual void HandleShiftTab()
Handle Shift+Tab key event (set focus to the previous number entry field)
virtual void DoReset()
Slot related to the Reset button.
TGNumberEntry ** fParVal
TGNumberEntryField ** fParMin
virtual void DoParStep()
Slot related to parameter step setting.
virtual void DoParValue()
Slot related to the parameter value settings.
double Double_t
Definition: RtypesCore.h:55
double func(double *x, double *p)
Definition: stressTF1.cxx:213
TGCompositeFrame * fContMax
virtual void DoSlider()
Slot related to the parameters' value settings.
void SetParameters()
Set the parameter values inside the function.
TGCompositeFrame * fContBnd
1-Dim function class
Definition: TF1.h:149
TGCompositeFrame * fContSld
void DisconnectSlots()
Disconnect signals from slot methods.
TGCheckButton ** fParFix
virtual ~TFitParametersDialog()
Destructor.
EFPDialogChange
Enumeration specifying if parameters have been modified by the user.
int main(int argc, char **argv)
TGCompositeFrame * fContFix
TGCompositeFrame * fContStp
TGCompositeFrame * fContMin