From 5f04e8e41f287b8aa1c7298654b9217f98df46d1 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Mon, 13 Feb 2012 21:48:42 +0000 Subject: Added support for globes to ui::ModelView. --- src/ui/modelview.h | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'src/ui/modelview.h') diff --git a/src/ui/modelview.h b/src/ui/modelview.h index f63dfa8..5596271 100755 --- a/src/ui/modelview.h +++ b/src/ui/modelview.h @@ -16,13 +16,19 @@ namespace ui class ModelView : public Widget { public: - ModelView(Widget *parent, const char *modelname = 0); + ModelView(Widget *parent); ~ModelView(); + + enum Mode { Model = 0, Globe = 1 }; inline std::string const &modelname() const { return modelview_modelname; } + inline Mode mode() const { + return modelview_mode; + } + inline float zoom() const { return modelview_zoom; } @@ -31,11 +37,9 @@ public: return modelview_radius; } - void set_modelname(const char *modelname); - - inline void set_modelname(const std::string & modelname) { - set_modelname(modelname.c_str()); - } + void set_globetexturename(const std::string & texturename, const bool bright, const std::string & coronaname); + + void set_modelname(const std::string & modelname); void set_colors(const math::Color & color_primary, const math::Color & color_secondary); @@ -53,6 +57,10 @@ public: inline void set_radius(const float radius) { modelview_radius = radius; } + + inline void set_mode(const Mode mode) { + modelview_mode = mode; + } protected: /// draw the widget @@ -76,9 +84,20 @@ protected: virtual void on_mousemove(const math::Vector2f &cursor); private: + void draw_model(); + + void draw_globe(); + + Mode modelview_mode; + std::string modelview_modelname; + std::string modelview_globetexturename; + std::string modelview_globecoronaname; + bool modelview_globebright; + math::Color modelview_color_primary; math::Color modelview_color_secondary; + float modelview_zoom; float modelview_radius; -- cgit v1.2.3