Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-02-13 21:48:42 +0000
committerStijn Buys <ingar@osirion.org>2012-02-13 21:48:42 +0000
commit5f04e8e41f287b8aa1c7298654b9217f98df46d1 (patch)
tree13ef058b29b3e3e9e0d90f19694dabe6c65780ef /src/ui/modelview.h
parent81922a29eaff6f7183a728d16906eca26caf885a (diff)
Added support for globes to ui::ModelView.
Diffstat (limited to 'src/ui/modelview.h')
-rwxr-xr-xsrc/ui/modelview.h31
1 files changed, 25 insertions, 6 deletions
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;