inlib
1.2.0
|
00001 // Copyright (C) 2010, Guy Barrand. All rights reserved. 00002 // See the file inlib.license for terms. 00003 00004 #ifndef inlib_sg_render_action 00005 #define inlib_sg_render_action 00006 00007 // inheritance : 00008 #include "mtx_action" 00009 00010 #include "state" 00011 00012 namespace inlib { 00013 namespace sg { 00014 00015 class render_action : public mtx_action { 00016 //public: 00017 //static const std::string& s_class() { 00018 // static const std::string s_v("inlib::sg::render_action"); 00019 // return s_v; 00020 //} 00021 public: 00022 /* 00023 virtual void* cast(const std::string& a_class) const { 00024 if(void* p = inlib::cmp_cast<render_action>(this,a_class)) {return p;} 00025 if(void* p = inlib::cmp_cast<action>(this,a_class)) {return p;} 00026 return 0; 00027 } 00028 */ 00029 public: 00030 render_action(std::ostream& a_out,unsigned int a_ww,unsigned int a_wh) 00031 : mtx_action(a_out,a_ww,a_wh) 00032 {} 00033 virtual ~render_action(){} 00034 private: 00035 render_action(const inlib::sg::render_action& a_from) 00036 : mtx_action(a_from) 00037 {} 00038 inlib::sg::render_action& operator=(const inlib::sg::render_action& a_from){ 00039 mtx_action::operator=(a_from); 00040 return *this; 00041 } 00042 public: 00043 inlib::sg::state& state() {return m_state;} 00044 void pop_state() { 00045 //if(!m_states.size()) return; //throw. 00046 m_state = m_states.back(); 00047 m_states.pop_back(); 00048 } 00049 void push_state() {m_states.push_back(m_state);} 00050 private: 00051 inlib::sg::state m_state; 00052 std::vector<inlib::sg::state> m_states; 00053 }; 00054 00055 }} 00056 00057 #endif