]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVE/EveDet/AliEveTRDTrackListEditor.h
Coverity
[u/mrichter/AliRoot.git] / EVE / EveDet / AliEveTRDTrackListEditor.h
index 868a008b295271f3a2eedc7ae2dd8e98219f598f..d9d4c57906f505d7bc165964dffbf875d8611636 100644 (file)
@@ -1,20 +1,62 @@
+// Author: Benjamin Hess   29/01/2010
+
+/*************************************************************************
+ * Copyright (C) 2009-2010, Alexandru Bercuci, Benjamin Hess.            *
+ * All rights reserved.                                                  *
+ *************************************************************************/
+
 #ifndef AliEveTRDTrackListEditor_H
 #define AliEveTRDTrackListEditor_H
 
+//////////////////////////////////////////////////////////////////////////
+//                                                                      //
+// AliEveTRDTrackListEditor                                             //
+//                                                                      //
+// The AliEveTRDTrackListEditor provides the graphical functionality    //
+// for the AliEveTRDTrackList. It creates the tabs and canvases, when   //
+// they are needed and, as well, frees allocated memory on destruction  //
+// (or if new events are loaded and thus some tabs are closed).         //
+// The function DrawHistos() accesses the temporary file created by the //
+// AliEveTRDTrackList and draws the desired data (the file will be      //
+// created within the call of ApplyMacros()). Have a look at this       //
+// function to learn more about the structure of the file and how to    //
+// access the data.                                                     //
+//////////////////////////////////////////////////////////////////////////
+
+#ifndef ROOT_TGedFrame
 #include <TGedFrame.h>
+#endif
+
+#ifndef ROOT_TGFrame
+#include <TGFrame.h>
+#endif
 
 class AliEveTRDTrack;
 class AliEveTRDTrackList;
+class AliTRDReconstructor;
+class TCanvas;     
+class TEveBrowser;           
+class TEveGedEditor;
+class TEveManager;
 class TFile;
+class TGButtonGroup;
 class TGCheckButton;
 class TGFileInfo;
+class TGGroupFrame;
 class TGHorizontal3DLine;
 class TGHorizontalFrame;
 class TGLabel;
 class TGListBox;
+class TGRadioButton;
+class TGString;
+class TGTab;
 class TGTextButton;
 class TGTextEntry;
 class TGVerticalFrame;
+class TH1;
+class TMacroData;
+class TMap;
+class TMapIter;
 class TTree;
 
 class AliEveTRDTrackListEditor: public TGedFrame
@@ -23,34 +65,59 @@ public:
   AliEveTRDTrackListEditor(const TGWindow* p = 0, Int_t width = 170, Int_t height = 30,
                                       UInt_t options = kChildFrame, Pixel_t back = GetDefaultFrameBackground());
   virtual ~AliEveTRDTrackListEditor();
-
   virtual void SetModel(TObject* obj);
 
-  void ApplyMacros();               // Apply macros
-  void BrowseMacros();              // Browse macros
-  void DrawHistos();                // Draw histograms
-  void HandleMacroPathSet();        // Handles the "macro path set"-event 
-  void RemoveMacros();              // Removes the selected macros from the lists
-
+  void    AddMacro(const Char_t* name, const Char_t* path = ".");  
+  void    ApplyMacros();
+  void    BrowseMacros();
+  void    CloseTabs();
+  void    DrawHistos();
+  Int_t   GetNSelectedHistograms() const;
+  void    HandleMacroPathSet();
+  void    HandleNewEventLoaded();
+  void    HandleTabChangedToIndex(Int_t);
+  void    NewMacros();
+  void    RemoveMacros();
+  void    SaveMacroList(TMap* list);
+  void    SetTrackColor(Int_t ind);
+  void    SetTrackModel(Int_t ind);
+  void    UpdateDataFromMacroListSelection();
+  void    UpdateHistoList();
+  void    UpdateMacroList();
+  void    UpdateMacroListSelection(Int_t ind);
+  
 protected:
-  AliEveTRDTrackList* fM;           // Model object.
+  AliEveTRDTrackList* fM;                                               // Model object
+
+  void InheritMacroList();                               
+  void InheritStyle();                                    
 
 private:
   AliEveTRDTrackListEditor(const AliEveTRDTrackListEditor&);            // Not implemented
   AliEveTRDTrackListEditor& operator=(const AliEveTRDTrackListEditor&); // Not implemented 
 
-  void AddMacro(const Char_t* path, const Char_t* name);  // Adds macro to the macro list
-  Int_t GetNSelectedHistograms();                         // Get the number of selected histograms for drawing
-  void UpdateHistoList();                                 // Updates the histogram list
-  void UpdateMacroList();                                 // Updates the macro list
+  TCanvas*          fHistoCanvas;            // Canvas for the histograms
+  TGString*         fHistoCanvasName;        // Name of the histogram canvas
 
+  TMap*             fInheritedMacroList;     // Stores the from the track list inherited macro list
 
-  TGVerticalFrame*  fMainFrame;              // Top frame for macro functionality.
-  TGVerticalFrame*  fHistoFrame;             // Top frame for the histogram stuff
-  TGVerticalFrame*  fHistoSubFrame;          // Frame for the histogram buttons themselves
-  TGHorizontalFrame* fBrowseFrame;           // For searching macros
+  Bool_t            fInheritSettings;        // Flag indicating, whether the macro list and the style settings will be 
+                                             // inherited from the previously loaded track list within the next call 
+                                             // of SetModel
+
+  TGHorizontalFrame* fStyleFrame;            // Frame for the style stuff
+  TGVerticalFrame*   fMainFrame;             // Top frame for macro functionality.
+  TGVerticalFrame*   fHistoFrame;            // Top frame for the histogram stuff
+  TGVerticalFrame*   fHistoSubFrame;         // Frame for the histogram buttons themselves
+  TGHorizontalFrame* fBrowseFrame;           // Frame for features corresponding to searching macros
+  TGButtonGroup*     fbgStyleColor;          // Button group for the color model
+  TGButtonGroup*     fbgStyleTrack;          // Button group for the track model
+  
+  TGRadioButton**    frbColor;               // Radio buttons for the color model
+  TGRadioButton**    frbTrack;               // Radio buttons for the track model
 
   TGTextButton*   fbBrowse;                  // "Browse" button
+  TGTextButton*   fbNew;                     // "New" button
   TGTextButton*   fbApplyMacros;             // "Apply macros" button
   TGTextButton*   fbRemoveMacros;            // "Remove macros" button
   TGTextButton*   fbDrawHisto;               // "Draw histogram" button
@@ -72,11 +139,46 @@ private:
   TGHorizontal3DLine *fLine2;
   TGHorizontal3DLine *fLine3;
   TGHorizontal3DLine *fLine4;
+  TGHorizontal3DLine *fLine5;  
+
+  TGCheckButton** fCheckButtons;            // Check buttons for histograms
 
-  // Check buttons for histograms
-  TGCheckButton** fCheckButtons;
+  // Help functions
+  void SetDrawingToHistoCanvasTab();        
+  void UpdateHistoCanvasTab();              
 
   ClassDef(AliEveTRDTrackListEditor, 0);    // Editor for AliEveTRDTrackList.
 };
 
+//////////////////////////////////////////////////////////////////////////
+//                                                                      //
+// AliEveTRDMacroWizard                                                //
+//                                                                      //
+// Wizard for creating new macros.                                     //
+//                                                                      //
+//////////////////////////////////////////////////////////////////////////
+
+class TGTextEdit;
+class TGComboBox;
+class AliEveTRDMacroWizard : public TGMainFrame
+{
+public:
+  AliEveTRDMacroWizard(const TGWindow* p = 0);
+  void Create(Int_t type); //*SIGNAL*
+  void Create(Char_t *pname); //*SIGNAL*
+  void HandleCreate();
+
+private:
+  AliEveTRDMacroWizard(const AliEveTRDMacroWizard&);
+  AliEveTRDMacroWizard& operator=(const AliEveTRDMacroWizard&);
+
+  TGTextEntry *fText;
+  TGComboBox  *fCombo;
+  TGTextEdit  *fTextEdit;
+  TGTextButton *fbCreate;                  // "Done" button
+  TGTextButton *fbCancel;                  // "Cancel" button
+  
+  ClassDef(AliEveTRDMacroWizard, 0);      // Helper class to create macro templates 
+};
+
 #endif