//------------------------------------------------------------------------------ // gui_2D class -- // (C) Piero Giubilato 2008-2010, Berkeley Lab -- //------------------------------------------------------------------------------ //______________________________________________________________________________ // {Trace} // [File name] "gui_2D.h" // [Author] "Piero Giubilato" // [Version] "1.5" // [Modified by] "Piero Giubilato" // [Last revision] "20 Jul 2009" // [Language] "C++" // [Compiler] "Visual C++ 9.x" // [Member of] "Cool SEAL" // [Project] "SEAL" // [Description] "Header for the gui_2D class" // [Key documentation] // "Visual C++ Reference Help" // "Root reference guide" // {Trace} //______________________________________________________________________________ // Overloading check #if !defined gui_2D_H #define gui_2D_H // Standard components #include // Root components #include #include #include #include #include // Application components #include "data_Layer.h" #include "gso_Map2D.h" #include "gso_Palette.h" #include "gso_Button.h" #include "gui_Const.h" #include "gui_Object.h" // This class creates a gui_2D object class gui_2D: public gui_Object { protected: // Constants enum k_data_Type {kdt_Null, kdt_UShort, kdt_Short, kdt_UInt, kdt_Int, kdt_Float, kdt_Double}; UInt_t k_palette_Margin; // Map-Palette margin UInt_t k_palette_Width; // Palette width UInt_t k_label_Margin; // Palette-label margin UInt_t k_btn_Size; // Accessory buttons Float_t k_btn_Radius; // Accessory buttons radius Float_t k_btn_Depth; // Accessory buttons depth UInt_t k_btn_Color; // Accessory buttons color // Main interface elements gso_Map2D* map; // The map itself gso_Palette* palette; // The palette TGPopupMenu* mnu_File; // The popup file menu gso_Button* btn_File; // The file button std::vector num_Roi; // The ROI numerics TGPopupMenu* mnu_Roi; // The popup roi menu //std::vector btn_Roi; // The ROI buttons gso_Button* btn_Roi; // The ROI button // Files TString file_Name; TString file_Dir; // Private methods void Init(UInt_t left, UInt_t top, UInt_t width, UInt_t height, UInt_t textColor); void roi_Limits(Double_t r_Left, Double_t r_Top, Double_t r_Width, Double_t r_Height, bool refresh); // Special private memebers gui_2D(const gui_2D&) {} const gui_2D& operator=(const gui_2D&) {return *this;} public: // Special member functions gui_2D(UInt_t left, UInt_t top, UInt_t width, UInt_t height, UInt_t textColor = 0x777777); gui_2D(gui_Object* parent, UInt_t left, UInt_t top, UInt_t width, UInt_t height, UInt_t textColor = 0x777777); ~gui_2D(); // General data methods template void data_Set(const U* data, UInt_t data_Width, UInt_t data_Height) { map->data_Set(data, data_Width, data_Height);}; template void data_Set(const data_Layer* layer) {map->data_Set(layer);}; void map_style_Do(); void data_Refresh(); void data_Refresh(Int_t r_Left, Int_t r_Top, Int_t r_Width, Int_t r_Height); void data_Refresh(bool x_Fit, bool y_Fit) {map->data_Refresh(x_Fit, y_Fit);}; void data_refresh_Auto(UInt_t interval); void data_Save(char* file = "", bool whole = false, bool raw = false) const; // Files void btn_file_Do(Long_t); void mnu_file_Do(Int_t); // ROI interactive void num_roi_Do(Long_t); void btn_roi_Do(Long_t); void map_roi_Do(); //void map_opt_Do(); // Menus void mnu_roi_Do(Int_t); // Overloaded gui_Object members void ReDraw(); void MoveResize(UInt_t left, UInt_t top, UInt_t width, UInt_t height); void Move(UInt_t left, UInt_t top); void Resize(UInt_t width, UInt_t height); void LowerWindow() const; void RaiseWindow() const; void color_Set(UInt_t foreColor, UInt_t backColor); // Palette interface methods virtual bool range_Auto() const {return false;}; // Pure virtual! virtual void range_Auto(bool automatic) {}; // Pure virtual! void palette_Color(const UInt_t* col_List, UInt_t col_Count); // Cint preprocessor token ClassDef(gui_2D, 1) }; // End of Overloading check #endif