Geant4 Cross Reference |
1 // Copyright (C) 2010, Guy Barrand. All rights 1 // Copyright (C) 2010, Guy Barrand. All rights reserved. 2 // See the file tools.license for terms. 2 // See the file tools.license for terms. 3 3 4 #ifndef tools_sg_light_off 4 #ifndef tools_sg_light_off 5 #define tools_sg_light_off 5 #define tools_sg_light_off 6 6 7 // A node to cancel/switch of the lighting dur 7 // A node to cancel/switch of the lighting during a render traversal. 8 8 9 #include "node" 9 #include "node" 10 #include "render_action" 10 #include "render_action" 11 11 12 namespace tools { 12 namespace tools { 13 namespace sg { 13 namespace sg { 14 14 15 class light_off : public node { 15 class light_off : public node { 16 TOOLS_NODE(light_off,tools::sg::light_off,no 16 TOOLS_NODE(light_off,tools::sg::light_off,node) 17 public: 17 public: 18 virtual void render(render_action& a_action) 18 virtual void render(render_action& a_action) { 19 state& state = a_action.state(); 19 state& state = a_action.state(); 20 state.m_GL_LIGHTING = false; 20 state.m_GL_LIGHTING = false; 21 a_action.set_lighting(false); 21 a_action.set_lighting(false); 22 } 22 } 23 public: 23 public: 24 light_off():parent() {} 24 light_off():parent() {} 25 virtual ~light_off(){} 25 virtual ~light_off(){} 26 public: 26 public: 27 light_off(const light_off& a_from):parent(a_ 27 light_off(const light_off& a_from):parent(a_from){} 28 light_off& operator=(const light_off& a_from 28 light_off& operator=(const light_off& a_from){ 29 parent::operator=(a_from); 29 parent::operator=(a_from); 30 return *this; 30 return *this; 31 } 31 } 32 }; 32 }; 33 33 34 }} 34 }} 35 35 36 #endif 36 #endif