g4tools  5.4.0
blend
Go to the documentation of this file.
1 // Copyright (C) 2010, Guy Barrand. All rights reserved.
2 // See the file tools.license for terms.
3 
4 #ifndef tools_sg_blend
5 #define tools_sg_blend
6 
7 #include "node"
8 #include "sf_vec3f"
9 #include "render_action"
10 
11 #include "../colorfs"
12 
13 namespace tools {
14 namespace sg {
15 
16 class blend : public node {
18 public:
20 public:
21  virtual const desc_fields& node_desc_fields() const {
23  static const desc_fields s_v(parent::node_desc_fields(),1, //WARNING : take care of count.
25  );
26  return s_v;
27  }
28 private:
29  void add_fields(){
30  add_field(&on);
31  }
32 public:
33  virtual void render(render_action& a_action) {
34  state& state = a_action.state();
36  a_action.set_blend(state.m_GL_BLEND);
37  }
38 public:
40  :parent()
41  ,on(false)
42  {
43  add_fields();
44  }
45  virtual ~blend(){}
46 public:
47  blend(const blend& a_from)
48  :parent(a_from)
49  ,on(a_from.on)
50  {
51  add_fields();
52  }
53  blend& operator=(const blend& a_from){
54  parent::operator=(a_from);
55  on = a_from.on;
56  return *this;
57  }
58 };
59 
60 }}
61 
62 #endif
node
tools::sg::blend::operator=
blend & operator=(const blend &a_from)
Definition: blend:53
tools::sg::state
Definition: state:25
tools::sg::blend::on
sf< bool > on
Definition: blend:19
render_action
tools::sg::node
Definition: node:28
tools::sg::blend::blend
blend(const blend &a_from)
Definition: blend:47
TOOLS_NODE
#define TOOLS_NODE(a__class, a__sclass, a__parent)
Definition: node:324
tools::sg::blend::render
virtual void render(render_action &a_action)
Definition: blend:33
tools::sg::blend
Definition: blend:16
tools::sg::desc_fields
Definition: field_desc:148
tools::sg::render_action::set_blend
virtual void set_blend(bool)=0
sf_vec3f
tools::sg::blend::blend
blend()
Definition: blend:39
tools::sg::render_action
Definition: render_action:24
tools
inlined C code : ///////////////////////////////////
Definition: aida_ntuple:26
tools::sg::node::add_field
void add_field(field *a_field)
Definition: node:128
tools::sg::blend::~blend
virtual ~blend()
Definition: blend:45
TOOLS_FIELD_DESC_NODE_CLASS
#define TOOLS_FIELD_DESC_NODE_CLASS(a__class)
Definition: field:68
tools::sg::bsf::value
T & value()
Definition: bsf:98
tools::sg::state::m_GL_BLEND
bool m_GL_BLEND
Definition: state:254
tools::sg::states::state
const sg::state & state() const
Definition: states:76
tools::sg::blend::node_desc_fields
virtual const desc_fields & node_desc_fields() const
Definition: blend:21
tools::sg::sf< bool >
TOOLS_ARG_FIELD_DESC
#define TOOLS_ARG_FIELD_DESC(a__field)
Definition: field:71