//------------------------------------------------------------------------------ // gso_Palette class -- // (C) Piero Giubilato 2008-2010, Berkeley Lab -- //------------------------------------------------------------------------------ //______________________________________________________________________________ // {Trace} // [File name] "gso_Map2D.h" // [Author] "Piero Giubilato" // [Version] "0.5" // [Modified by] "Piero Giubilato" // [Last revision] "22 Jan 2009" // [Language] "C++" // [Compiler] "Visual C++ 9.x" // [Member of] "Cool SEAL" // [Project] "SEAL" // [Description] "Header for the gso_Map2D class" // [Key documentation] // "Visual C++ Reference Help" // "Root reference guide" // {Trace} //______________________________________________________________________________ // Overloading check #if !defined gso_Map2D_H #define gso_Map2D_H // Root components #include #include #include #include #include // Application components #include "gso_Palette.h" // Map2D Object class gso_Map2D: public TGFrame, public TGWidget { private: // Constants enum k_data_Type {kdt_Null, kdt_UShort, kdt_Short, kdt_UInt, kdt_Int, kdt_Float, kdt_Double}; // Parent frame elements TGCompositeFrame* frame_Container; // The parent frame GContext_t frame_gc_Hnd; // The graphic contect used to paint into the frame GCValues_t* frame_gc_Set; // Values structire to set the gc Pixmap_t frame_PxMap; // The paletted pixel map // The linked palette const gso_Palette* palette; // The palette range use Double_t pal_range_Max; Double_t pal_range_Min; bool pal_range_Auto; // Data reference (2D array) const UShort_t* data_US; const Short_t* data_S; const UInt_t* data_UI; const Int_t* data_I; const Float_t* data_F; const Double_t* data_D; // Data representation UInt_t data_Mode; UInt_t data_Width; UInt_t data_Height; // Private functions void Init(const TGWindow* window, const gso_Palette* pal, UInt_t data_Width_t, UInt_t data_Height_t, UInt_t width, UInt_t height); template void char_Fill(const T* data, UInt_t* map_Array); void Draw(); // Creates the map image // Special private memebers gso_Map2D(const gso_Map2D&) {} const gso_Map2D& operator=(const gso_Map2D&) {return *this;} protected: void DoRedraw(); // Put the image on screen, TGFrame overloaded public: // Default methods gso_Map2D(const TGWindow* window, const gso_Palette* pal, UInt_t width = 1, UInt_t height = 1); /* gso_Map2D(const TGWindow* window, const gso_Palette* pal, const UShort_t* data, UInt_t data_Width, UInt_t data_Height, UInt_t width = 1, UInt_t height = 1); gso_Map2D(const TGWindow* window, const gso_Palette* pal, const Short_t* data, UInt_t data_Width, UInt_t data_Height, UInt_t width = 1, UInt_t height = 1); gso_Map2D(const TGWindow* window, const gso_Palette* pal, const UInt_t* data, UInt_t data_Width, UInt_t data_Height, UInt_t width = 1, UInt_t height = 1); gso_Map2D(const TGWindow* window, const gso_Palette* pal, const Int_t* data, UInt_t data_Width, UInt_t data_Height, UInt_t width = 1, UInt_t height = 1); gso_Map2D(const TGWindow* window, const gso_Palette* pal, const Float_t* data, UInt_t data_Width, UInt_t data_Height, UInt_t width = 1, UInt_t height = 1); gso_Map2D(const TGWindow* window, const gso_Palette* pal, const Double_t* data, UInt_t data_Width, UInt_t data_Height, UInt_t width = 1, UInt_t height = 1); */ ~gso_Map2D(); // Assign data link void data_Set(const UShort_t* data, UInt_t data_Width, UInt_t data_Height); void data_Set(const Short_t* data, UInt_t data_Width, UInt_t data_Height); void data_Set(const UInt_t* data, UInt_t data_Width, UInt_t data_Height); void data_Set(const Int_t* data, UInt_t data_Width, UInt_t data_Height); void data_Set(const Float_t* data, UInt_t data_Width, UInt_t data_Height); void data_Set(const Double_t* data, UInt_t data_Width, UInt_t data_Height); // TGFrame overloaded methods void MoveResize(UInt_t left, UInt_t top, UInt_t width, UInt_t height); // Range void range_Set(Double_t max, Double_t min); void range_Get(const Double_t* max, const Double_t* min) const; bool range_Auto() const; void range_Auto(bool automatic); Double_t range_Max() const; void range_Max(Double_t max); Double_t range_Min() const; void range_Min(Double_t min); // Personal methods void Refresh(); // Cint preprocessor token ClassDef(gso_Map2D, 2) }; // End of Overloading check #endif