Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/Geant4/tools/sg/shade_model is written in an unsupported language. File is not indexed.

0001 // Copyright (C) 2010, Guy Barrand. All rights reserved.
0002 // See the file tools.license for terms.
0003 
0004 #ifndef tools_sg_shade_model
0005 #define tools_sg_shade_model
0006 
0007 #include "node"
0008 
0009 #include "sf_enum"
0010 #include "render_action"
0011 
0012 namespace tools {
0013 namespace sg {
0014 
0015 class shade_model : public node {
0016   TOOLS_NODE(shade_model,tools::sg::shade_model,node)
0017 public:
0018   sf_enum<shade_type> model;
0019 public:
0020   virtual const desc_fields& node_desc_fields() const {
0021     TOOLS_FIELD_DESC_NODE_CLASS(tools::sg::shade_model)
0022     static const desc_fields s_v(parent::node_desc_fields(),1, //WARNING : take care of count.
0023       TOOLS_ARG_FIELD_DESC(model)
0024     );
0025     return s_v;
0026   }
0027 private:
0028   void add_fields(){
0029     add_field(&model);
0030   }
0031 public:
0032   virtual void render(render_action& a_action) {
0033     state& state = a_action.state();
0034     state.m_shade_model = model;
0035     a_action.set_shade_model(state.m_shade_model);
0036   }
0037 public:
0038   shade_model()
0039   :parent()
0040   ,model(shade_flat)
0041   {
0042     add_fields();
0043   }
0044   virtual ~shade_model(){}
0045 public:
0046   shade_model(const shade_model& a_from)
0047   :parent(a_from)
0048   ,model(a_from.model)
0049   {
0050     add_fields();
0051   }
0052   shade_model& operator=(const shade_model& a_from){
0053     parent::operator=(a_from);
0054     model = a_from.model;
0055     return *this;
0056   }
0057 };
0058 
0059 }}
0060 
0061 #endif