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_get_matrix_action 4 #ifndef tools_sg_get_matrix_action 5 #define tools_sg_get_matrix_action 5 #define tools_sg_get_matrix_action 6 6 7 #include "matrix_action" 7 #include "matrix_action" 8 8 9 namespace tools { 9 namespace tools { 10 namespace sg { 10 namespace sg { 11 class node; 11 class node; 12 }} 12 }} 13 13 14 namespace tools { 14 namespace tools { 15 namespace sg { 15 namespace sg { 16 16 17 class get_matrix_action : public matrix_action 17 class get_matrix_action : public matrix_action { 18 TOOLS_ACTION(get_matrix_action,tools::sg::ge 18 TOOLS_ACTION(get_matrix_action,tools::sg::get_matrix_action,matrix_action) 19 public: 19 public: 20 get_matrix_action(std::ostream& a_out,unsign 20 get_matrix_action(std::ostream& a_out,unsigned int a_ww,unsigned int a_wh) 21 :matrix_action(a_out,a_ww,a_wh) 21 :matrix_action(a_out,a_ww,a_wh) 22 ,m_node(0) //not owner 22 ,m_node(0) //not owner 23 ,m_done(false) 23 ,m_done(false) 24 {} 24 {} 25 virtual ~get_matrix_action(){} 25 virtual ~get_matrix_action(){} 26 public: 26 public: 27 get_matrix_action(const get_matrix_action& a 27 get_matrix_action(const get_matrix_action& a_from) 28 :matrix_action(a_from) 28 :matrix_action(a_from) 29 ,m_node(a_from.m_node) 29 ,m_node(a_from.m_node) 30 ,m_done(false) 30 ,m_done(false) 31 {} 31 {} 32 get_matrix_action& operator=(const get_matri 32 get_matrix_action& operator=(const get_matrix_action& a_from){ 33 matrix_action::operator=(a_from); 33 matrix_action::operator=(a_from); 34 m_node = a_from.m_node; 34 m_node = a_from.m_node; 35 reset(); 35 reset(); 36 return *this; 36 return *this; 37 } 37 } 38 public: 38 public: 39 void reset() { 39 void reset() { 40 m_found_model.set_zero(); 40 m_found_model.set_zero(); 41 m_done = false; 41 m_done = false; 42 } 42 } 43 43 44 void set_found_model(const mat4f& a_m) {m_fo 44 void set_found_model(const mat4f& a_m) {m_found_model = a_m;} 45 const mat4f& found_model() const {return m_f 45 const mat4f& found_model() const {return m_found_model;} 46 46 47 void set_done(bool a_value) {m_done = a_valu 47 void set_done(bool a_value) {m_done = a_value;} 48 bool done() const {return m_done;} 48 bool done() const {return m_done;} 49 49 50 void set_node(sg::node* a_v) {m_node = a_v;} 50 void set_node(sg::node* a_v) {m_node = a_v;} 51 sg::node* node() const {return m_node;} 51 sg::node* node() const {return m_node;} 52 52 53 protected: 53 protected: 54 sg::node* m_node; //not owner. 54 sg::node* m_node; //not owner. 55 bool m_done; 55 bool m_done; 56 mat4f m_found_model; 56 mat4f m_found_model; 57 }; 57 }; 58 58 59 }} 59 }} 60 60 61 #endif 61 #endif