00001 // @(#)root/fitpanel:$Id: TFitParametersDialog.h 26245 2008-11-17 16:32:49Z moneta $ 00002 // Author: Ilka Antcheva, Lorenzo Moneta, David Gonzalez Maline 03/10/06 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #ifndef ROOT_TFitParametersDialog 00013 #define ROOT_TFitParametersDialog 00014 00015 ////////////////////////////////////////////////////////////////////////// 00016 // // 00017 // TFitParametersDialog // 00018 // // 00019 // This class is used for fit function parameter settings. // 00020 // // 00021 ////////////////////////////////////////////////////////////////////////// 00022 00023 #ifndef ROOT_TGButton 00024 #include "TGWidget.h" 00025 #endif 00026 #ifndef ROOT_TGFrame 00027 #include "TGFrame.h" 00028 #endif 00029 00030 enum EFPDialogBound { 00031 kFPDBounded, 00032 kFPDNoneBounded 00033 }; 00034 00035 class TF1; 00036 class TGNumberEntry; 00037 class TGTextEntry; 00038 class TGCheckButton; 00039 class TGTextButton; 00040 class TGTripleHSlider; 00041 class TGNumberEntryField; 00042 class TVirtualPad; 00043 00044 00045 class TFitParametersDialog : public TGTransientFrame { 00046 00047 protected: 00048 TF1 *fFunc; // function passed to this dialog 00049 TVirtualPad *fFpad; // pad where the function is drawn 00050 Bool_t fHasChanges; // kTRUE if function was redrawn; 00051 Bool_t fImmediateDraw; // kTRUE if function is updated on run-time 00052 Int_t *fRetCode; // address to store return code 00053 Int_t fNP; // number of function parameters 00054 Double_t fRangexmin; // min function range 00055 Double_t fRangexmax; // max function range 00056 Double_t *fPmin; // min limits of patameters range 00057 Double_t *fPmax; // max limits of patameters range 00058 Double_t *fPval; // original patameters' values 00059 Double_t *fPerr; // original patameters' errors 00060 Double_t *fPstp; // original patameters' step 00061 TGCompositeFrame *fContNam; // container of parameter names 00062 TGCompositeFrame *fContVal; // container of parameter values 00063 TGCompositeFrame *fContFix; // container of fix settings 00064 TGCompositeFrame *fContBnd; // container of bound settings 00065 TGCompositeFrame *fContSld; // container of sliders 00066 TGCompositeFrame *fContMin; // container of min range values 00067 TGCompositeFrame *fContMax; // container of max range values 00068 TGCompositeFrame *fContStp; // container of step values 00069 TGCompositeFrame *fContErr; // container of error values 00070 TGTextEntry **fParNam; // parameter names 00071 TGCheckButton **fParBnd; // bound setting switch 00072 TGCheckButton **fParFix; // fix setting switch 00073 TGNumberEntry **fParVal; // parameter values 00074 TGNumberEntryField **fParMin; // min range values 00075 TGNumberEntryField **fParMax; // max range values 00076 TGNumberEntry **fParStp; // step values 00077 TGTripleHSlider **fParSld; // triple sliders 00078 TGNumberEntryField **fParErr; // error values 00079 TGCheckButton *fUpdate; // immediate update switch 00080 TGTextButton *fApply; // Apply button 00081 TGTextButton *fReset; // Reset button 00082 TGTextButton *fOK; // OK button 00083 TGTextButton *fCancel; // Cancel button 00084 00085 void DisconnectSlots(); 00086 public: 00087 TFitParametersDialog(const TGWindow *p, const TGWindow *main, TF1 *func, 00088 TVirtualPad *pad, Int_t *ret_code = 0); 00089 virtual ~TFitParametersDialog(); 00090 00091 virtual void CloseWindow(); 00092 virtual void DoApply(); 00093 virtual void DoCancel(); 00094 virtual void DoOK(); 00095 virtual void DoParFix(Bool_t on); 00096 virtual void DoParBound(Bool_t on); 00097 virtual void DoParMaxLimit(); 00098 virtual void DoParMinLimit(); 00099 virtual void DoParStep(); 00100 virtual void DoParValue(); 00101 virtual void DoReset(); 00102 virtual void DoSlider(); 00103 virtual void DrawFunction(); 00104 virtual void HandleButtons(Bool_t update); 00105 00106 protected: 00107 void SetParameters(); 00108 00109 ClassDef(TFitParametersDialog, 0) // Fit function parameters dialog 00110 }; 00111 00112 #endif