core.h
Go to the documentation of this file.
00001 
00063 #ifndef COB_3D_MAPPING_TOOLS_GUI_CORE_H_
00064 #define COB_3D_MAPPING_TOOLS_GUI_CORE_H_
00065 
00066 #include <wx/wx.h>
00067 #include <wx/minifram.h>
00068 #include "cob_3d_mapping_tools/gui/resource.h"
00069 
00070 namespace Gui
00071 {
00072   class Window : public wxFrame
00073   {
00074   public:
00075     Window(const std::string& title) : wxFrame(NULL, -1, wxString(title.c_str(), wxConvUTF8)), id(title)
00076     { }
00077 
00078     std::string id;
00079   };
00080 
00081   /* ---------------------------------*/
00082  /* --------- WindowManager ---------*/
00083 /* ---------------------------------*/
00084 
00085   class WindowManager
00086   {
00087   public:
00088     ~WindowManager() { std::cout << "wm destroyed" << std::endl; }
00089     template<typename RT, typename VT> void create(ImageView<RT,VT>* object, const std::string& status_msg="");
00090     template<typename RT, typename VT> void moveWindow(View<RT,VT>* window_ptr, int x, int y);
00091   private:
00092     WindowManager() { }
00093 
00094     template<typename RT, typename VT> void moveWindow(View<RT,VT>* w, const wxPoint& p, ViewTypes::View2D);
00095     friend class Core;
00096   };
00097 
00098   /* -----------------------------------*/
00099  /* --------- ResourceManager ---------*/
00100 /* -----------------------------------*/
00101   class ResourceManager
00102   {
00103   public:
00104     ~ResourceManager() { std::cout << "res manager destroyed" << std::endl; }
00105 
00106     // --- delegated construction ---
00107     template<typename RT> Resource<RT>* create(const std::string& name, const std::string& file) {return create<RT>(name,file,RT());}
00108     template<typename RT> Resource<RT>* create(const std::string& name, const typename RT::DataTypePtr& data);
00109 
00110     template<typename RT> void destroy(const std::string& name);
00111 
00112   private:
00113     ResourceManager() { }
00114 
00115     template<typename RT> std::map<std::string, Resource<RT>* >* get();
00116 
00117     // --- specializations ---
00118     template<typename RT> Resource<RT>* create(const std::string& name, const std::string& file, ResourceTypes::BaseCloud);
00119     template<typename RT> Resource<RT>* create(const std::string& name, const std::string& file, ResourceTypes::Image);
00120 
00121     friend class Core;
00122   };
00123 
00124   /* ------------------------*/
00125  /* --------- CORE ---------*/
00126 /* ------------------------*/
00127   class Core
00128   {
00129   public:
00130     ~Core() { std::cout << "Core Destroyed" << std::endl; }
00131     static Core* Get() { static Core* c_ = new Core(); return c_; }
00132     static WindowManager* wMan() { static WindowManager* wm_ = new WindowManager(); return wm_; }
00133     static ResourceManager* rMan() { static ResourceManager* rm_ = new ResourceManager(); return rm_; }
00134   private:
00135     Core() { }
00136   };
00137 }
00138 
00139 #endif


cob_3d_mapping_tools
Author(s): Georg Arbeiter
autogenerated on Wed Aug 26 2015 11:04:27