Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4FitGUI/TGo4FitPanelSlots.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #ifndef TGO4FITPANELSLOTS_H
00017 #define TGO4FITPANELSLOTS_H
00018 #include "Go4GUIBase/TGo4SlotsBaseClass.h"
00019 
00020 class QString;
00021 class QPopupMenu;
00022 class QListViewItem;
00023 class QFitItem;
00024 class QPoint;
00025 class QDragMoveEvent;
00026 class QDropEvent;
00027 class QDragEnterEvent;
00028 class QPopupMenu;
00029 
00030 class TGo4FitGUIArrow;
00031 class TGo4PreviewPanelSlots;
00032 
00033 class TMutex;
00034 class TNamed;
00035 class TObject;
00036 class TObjArray;
00037 class TArrayI;
00038 class TVirtualPad;
00039 class TPad;
00040 class TH1;
00041 class TGo4FitGUIOptions;
00042 class TGo4FitSlotStatus;
00043 
00044 class TGo4Status;
00045 class TGo4EditPolyCond;
00046 class TGo4FitPanel;
00047 class TGo4GUIRegistry;
00048 class TGo4PreviewPanelSlots;
00049 class TGo4PreviewPanel;
00050 class TGo4FitPanelStatus;
00051 class TGo4FitParameter;
00052 class TGo4FitParsList;
00053 class TGo4FitComponent;
00054 class TGo4FitData;
00055 class TGo4FitModel;
00056 class TGo4Fitter;
00057 class TGo4FitSlot;
00058 
00059 class TGo4FitPanelSlots : public TGo4SlotsBaseClass {
00060    public:
00061 
00062 enum { ot_none = -1, ot_empty,
00063        ot_datalist, ot_data, ot_modellist, ot_model, ot_parslist, ot_par, ot_parcfg,
00064        ot_asslist, ot_ass, ot_rangelist, ot_range, ot_rangecut,
00065        ot_actlist, ot_action, ot_amplest, ot_peakfinder, ot_output, ot_config, ot_minuit,
00066        ot_parinitlist, ot_pardeplist, ot_reslist,
00067        ot_depend, ot_newpars, ot_parscfg, ot_minuitres, ot_slot, ot_fitter,
00068        ot_trans, ot_lintrans, ot_matrtrans,
00069        ot_results, ot_allslots,
00070        ot_wizdatalist };
00071       TGo4FitPanelSlots(const char * name, const char * title, TGo4FitPanel * p);
00072       virtual ~TGo4FitPanelSlots();
00073 
00074       void SetGUI(TGo4FitPanel *);
00075       TGo4Status* GetStatus();
00076       void AddObject(TNamed* );
00077 
00078       // general interface
00079 
00080       void ActivateByFitter(TGo4Fitter* fitter);
00081       void ActivePadSelected(TGo4PreviewPanel* panel, TPad* pad);
00082       void ViewPanelRemoved(TGo4PreviewPanel* panel);
00083       void ViewPanelPadUpdate(TGo4PreviewPanel* panel, TPad* pad);
00084 
00085       // general information
00086 
00087       Bool_t WorkingWithPanel();
00088       Bool_t WorkingWithOnlyPad();
00089 
00090       TGo4PreviewPanel* ActiveViewPanel();
00091       TPad* ActivePad();
00092       TGo4FitGUIOptions* FitOptions();
00093 
00094       TGo4Fitter* GetFitter();
00095 
00096       // general status changing
00097 
00098       void ChangeActivePage(int id = -1);
00099       void UpdateActivePage();
00100 
00101       void ChangeSettings(int);
00102 
00103       // general public commands (actions)
00104 
00105       void Fitter_New();
00106       void Fitter_NewForActivePad(bool overwrite);
00107       void Fitter_Delete();
00108       void Fitter_MoveCopy(bool IsMove, bool ToPad);
00109       void Fitter_SaveToBrowser();
00110       void Fitter_SaveToFile();
00111       void Fitter_UseWorkspace();
00112       void Fitter_UpdateReferences();
00113       void Fitter_PrintParameters();
00114       void Fitter_RollbackParameters();
00115       void Fitter_DropToPanel(TGo4Fitter* fitter, TGo4PreviewPanel* panel);
00116 
00117       void Button_WorkWithPanel();
00118       void Button_SimpleFit(int nmodel);
00119       void Button_SimpleClear();
00120       void Button_PeakFinder();
00121       void Button_PerformFit();
00122       void Button_FitterDraw(TGo4FitData* selecteddata = 0);
00123 
00124       // page specific commands & services
00125 
00126       void Wiz_PrepareModelTypeList(QPopupMenu* menu);
00127       TGo4FitModel* Wiz_CreateNewModel(int id);
00128       void Wiz_PrepareDataTypeList(QPopupMenu* menu);
00129       TGo4FitData* Wiz_CreateNewData(int id);
00130       void Wiz_RebuildDataList();
00131       bool Wiz_RemoveData();
00132       bool Wiz_DataHasPad();
00133       void Wiz_UseSelectedRange();
00134       void Wiz_TakeCurrentRange();
00135       void Wiz_GetSlotSourceInfo(TGo4FitSlot* slot, QString* info);
00136       void Wiz_GetModelInfo(TGo4FitModel* model, QString* info);
00137       void Wiz_ClearPaint();
00138       bool Wiz_PaintData();
00139       bool Wiz_PaintModel();
00140 
00141       // extended page commands and services
00142 
00143       void ListItemClicked(QListViewItem* item);
00144       void SetItemText(QFitItem* item, bool trace);
00145       void UpdateItem(QFitItem* item, bool trace);
00146       void UpdateItemsOfType(int typ, QFitItem* parent = 0);
00147       bool ChangeObjectName(QFitItem* item, const char* newname);
00148       void FitItemDeleted(QFitItem* item);
00149       void ArrowChanged(TGo4FitGUIArrow* arr);
00150       void DeleteModelWithPrimit(TGo4FitGUIArrow* arr);
00151 
00152       // popup menus
00153 
00154       bool FillPopupForItem(QFitItem* item, QPopupMenu* menu);
00155       bool ExecPopupForItem(QFitItem* item, int id);
00156 
00157       bool FillPopupForSlot(TGo4FitSlot* slot, QPopupMenu* menu);
00158       void ExecutePopupForSlot(QFitItem* item, TGo4FitSlot* slot, int id);
00159 
00160       // drag and drop from Go4Browser, should be delivered by MainGUI !!!!!!!!!!!!!!!!!!!!
00161 
00162       void DragEnterEvent(QDragEnterEvent * Event);
00163       void DragMoveEvent(TObject* obj, int typ, QDragMoveEvent * Event);
00164       bool DropEvent(TObject* obj, int typ, QDropEvent * Event, QFitItem* item = 0);
00165 
00166    private:
00167 
00168       void FillPadsList(TObjArray& lst, TPad* pad);
00169       int GetNumberOfPads();
00170       TPad* GetPad(int);
00171       TObject* GetPadObject(TGo4PreviewPanel*, TPad*);
00172       TGo4FitGUIOptions* GetPadFitOptions(TGo4PreviewPanel*, TPad*, bool);
00173       void DeletePadFitOptions(TGo4PreviewPanel*, TPad*);
00174       void GetCombinationName(TGo4PreviewPanel*, TPad*, QString*);
00175 
00176       void ClearSlotsStatusList();
00177       void UpdateSlotsStatusList();
00178       bool UpdateObjectReferenceInSlots(bool clear, TObject* slotowner = 0);
00179       bool UpdateObjectReferenceFor(TGo4FitSlotStatus* sstatus);
00180       void UpdateRestPrimitives(TGo4FitGUIArrow* arr);
00181       void RemovePrimitives(TObject* obj = 0);
00182       void UpdateAllPads();
00183       TGo4FitSlotStatus* FindSlotStatusForSlot(TGo4FitSlot* slot);
00184       TGo4FitSlotStatus* FindSlotStatusForData(TGo4FitData* data, bool withpad);
00185       TGo4FitSlotStatus* FindSlotStatusForModel(TGo4Fitter* fitter, TGo4FitModel* model);
00186       TGo4FitSlotStatus* FindSlotStatusForDraw(TGo4FitData* data, bool withpad);
00187       TPad* FindPadWhereData(TGo4FitData* data);
00188       void RemovePanelFromSlotsStatusList(TGo4PreviewPanel*);
00189       void AddModelToPad(TGo4FitSlotStatus* sstatus, TObject* model);
00190       void RemoveAllDrawObjects(bool update = true);
00191 
00192       void SetFitter(TGo4Fitter*);
00193       TGo4FitData* CreateDataFor(TGo4Fitter* fitter, TObject* obj, bool ownership = false, bool setobj = false);
00194       void CreateAppropriateData(TGo4Fitter*);
00195       TGo4Fitter* CreateAppropriateFitter(const char* name = "Fitter");
00196 
00197       void CloseDrawPanel();
00198 
00199       void UpdateSimplePage();
00200       void UpdateWizardPage();
00201       void UpdateExtendedPage();
00202 
00203       QFitItem* GetFitterItem();
00204       QFitItem* FindItem(TObject* obj = 0, int ObjectType = ot_none, QFitItem* parent = 0);
00205       void RemoveWidgetFromListStack();
00206       bool ShowItem(QFitItem* item, bool force = 0);
00207       bool ShowItemAsText(QFitItem* item, bool force = 0);
00208       bool ShowItemAsGraph(QFitItem* item, bool force = 0);
00209 
00210       void PaintFitter(TGo4Fitter* fitter, QFitItem* item = 0, bool update = 0);
00211       void PaintModel(TGo4FitModel* model, TGo4FitSlotStatus* sstatus, QFitItem* item = 0);
00212       TGo4FitSlotStatus* PaintModelsFor(TGo4Fitter* fitter, TGo4FitData* data, QFitItem* item = 0, bool update = 0);
00213       void PaintRange(TGo4FitComponent* comp, int nrange, TGo4FitSlotStatus* sstatus, QFitItem* item = 0);
00214 
00215       void FillModelTypesList(QPopupMenu* menu, int id, bool extend);
00216       void FillDataTypesList(QPopupMenu* menu, int id);
00217       TGo4FitData* CreateData(Int_t id, const char* name);
00218       TGo4FitModel* CreateModel(Int_t id, const char* namebase = 0, TGo4Fitter* fitter = 0, TGo4FitData* data = 0);
00219       void LocateModel(TGo4FitModel* model, TGo4FitData* data = 0, bool usepad = true);
00220       int DefineModelWidgetType(TObject* obj);
00221 
00222       void FillParsList(QFitItem* item);
00223       void FillSlotsList(QFitItem* parent, const TObjArray* lst, TObject* owner);
00224       void FillDependencyList(QFitItem* parent);
00225 
00226    // commands list
00227 
00228       void Cmd_CreateFitter();
00229       void Cmd_CreateAppropriateFitter();
00230       void Cmd_DeleteFitter();
00231       void Cmd_ClearFitter();
00232       void Cmd_SaveFitter(bool ask);
00233 
00234       void Cmd_ItemPrint(QFitItem* item);
00235 
00236       void Cmd_AddNewData(QFitItem * item, Int_t id);
00237       void Cmd_DrawData(QFitItem * item);
00238       void Cmd_DeleteData(QFitItem * item);
00239       void Cmd_DeleteAssosiatedModels(QFitItem * item);
00240       void Cmd_DeleteAllData(QFitItem * item);
00241 
00242       void Cmd_AddNewModel(QFitItem * item, Int_t id);
00243       void Cmd_DeleteModel(QFitItem * item);
00244       bool Cmd_RemoveModel(TGo4FitModel* model);
00245       void Cmd_DeleteModels(QFitItem * item);
00246 
00247       void Cmd_ClearAssigment(QFitItem* item);
00248       void Cmd_ClearAssigments(QFitItem* item);
00249       void Cmd_AssignModelToAllData(QFitItem* item);
00250       void Cmd_AssignModelToData(QFitItem* item, int id);
00251 
00252       void Cmd_RemoveRangeCondition(QFitItem* item);
00253       void Cmd_RemoveRangeConditions(QFitItem* item);
00254       void Cmd_AddRangeCondition(QFitItem* item, int id);
00255 
00256       void Cmd_DeleteAction(QFitItem* item);
00257       void Cmd_DeleteActions(QFitItem* item);
00258       void Cmd_MoveAction(QFitItem* item, int dir);
00259       void Cmd_ExecuteAction(QFitItem* item);
00260       void Cmd_ExecuteActions(QFitItem* item, bool expert);
00261       void Cmd_DeleteOutputActions(QFitItem* item);
00262       void Cmd_AddNewAction(QFitItem* item, int id);
00263 
00264       void Cmd_DeleteDependency(QFitItem* item);
00265       void Cmd_DeleteDependencies(QFitItem* item);
00266       void Cmd_AddDependency(QFitItem* item);
00267 
00268       void Cmd_MemorizePars(QFitItem* item);
00269       void Cmd_RememberPars(QFitItem* item);
00270       void Cmd_DeletePars(QFitItem* item);
00271       void Cmd_AddNewPar(QFitItem* item);
00272       void Cmd_MemorizePar(QFitItem* item);
00273       void Cmd_RememberPar(QFitItem* item);
00274       void Cmd_DeletePar(QFitItem* item);
00275 
00276       void Cmd_DeleteMinuitResult(QFitItem* item);
00277 
00278       void Cmd_UpdateAllSlots(QFitItem* item);
00279 
00280       bool GetDropedObject(const char* source, const char* name, TObject** obj, bool& ownership, TString* SourceInfo);
00281 
00282 
00283       TGo4FitPanel* fxPanel;                    
00284       TGo4FitPanelStatus* fxStatus;             
00285       TGo4GUIRegistry* fxRegistry;              
00286 
00287       Bool_t fbWorkingWithPanel;                
00288       TGo4PreviewPanel* fxActiveViewPanel;      
00289       TPad* fxActivePad;                        
00290 
00291       TGo4PreviewPanel* fxDrawPanel;            
00292       Bool_t fbDrawPanelCreation;              
00293 
00294       QFitItem* fxCurrentItem;                  
00295 
00296       TObjArray* fxSlotStatusList;              
00297 };
00298 
00299 #endif //TGO4FITPANELSLOTS_H
00300 
00301 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:55:59 2005 for Go4-v2.10-5 by doxygen1.2.15