Warning, /include/Geant4/tools/sg/blend 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_blend
0005 #define tools_sg_blend
0006
0007 #include "node"
0008 #include "sf_vec3f"
0009 #include "render_action"
0010
0011 #include "../colorfs"
0012
0013 namespace tools {
0014 namespace sg {
0015
0016 class blend : public node {
0017 TOOLS_NODE(blend,tools::sg::blend,node)
0018 public:
0019 sf<bool> on;
0020 public:
0021 virtual const desc_fields& node_desc_fields() const {
0022 TOOLS_FIELD_DESC_NODE_CLASS(tools::sg::blend)
0023 static const desc_fields s_v(parent::node_desc_fields(),1, //WARNING : take care of count.
0024 TOOLS_ARG_FIELD_DESC(on)
0025 );
0026 return s_v;
0027 }
0028 private:
0029 void add_fields(){
0030 add_field(&on);
0031 }
0032 public:
0033 virtual void render(render_action& a_action) {
0034 state& state = a_action.state();
0035 state.m_GL_BLEND = on.value();
0036 a_action.set_blend(state.m_GL_BLEND);
0037 }
0038 public:
0039 blend()
0040 :parent()
0041 ,on(false)
0042 {
0043 add_fields();
0044 }
0045 virtual ~blend(){}
0046 public:
0047 blend(const blend& a_from)
0048 :parent(a_from)
0049 ,on(a_from.on)
0050 {
0051 add_fields();
0052 }
0053 blend& operator=(const blend& a_from){
0054 parent::operator=(a_from);
0055 on = a_from.on;
0056 return *this;
0057 }
0058 };
0059
0060 }}
0061
0062 #endif