g4tools  5.4.0
Public Member Functions | Public Attributes | List of all members
tools::sg::rgba Class Reference
Inheritance diagram for tools::sg::rgba:
Inheritance graph
[legend]
Collaboration diagram for tools::sg::rgba:
Collaboration graph
[legend]

Public Member Functions

virtual const desc_fieldsnode_desc_fields () const
 
virtual void render (render_action &a_action)
 
 rgba ()
 
virtual ~rgba ()
 
 rgba (const rgba &a_from)
 
rgbaoperator= (const rgba &a_from)
 
- Public Member Functions inherited from tools::sg::node
virtual void * cast (const std::string &a_class) const
 
virtual const std::string & s_cls () const =0
 
virtual nodecopy () const =0
 
virtual unsigned int cls_version () const
 
virtual void pick (pick_action &)
 
virtual void bbox (bbox_action &)
 
virtual void search (search_action &a_action)
 
virtual void get_matrix (get_matrix_action &a_action)
 
virtual bool write (write_action &a_action)
 
virtual void event (event_action &)
 
virtual bool read (read_action &a_action)
 
virtual void is_visible (visible_action &)
 
virtual void protocol_one_fields (std::vector< field * > &a_fields) const
 
virtual bool draw_in_frame_buffer () const
 
virtual bool touched ()
 
virtual void reset_touched ()
 
 node ()
 
virtual ~node ()
 
void touch ()
 
fieldfield_from_desc (const field_desc &a_desc) const
 
void dump_field_descs (std::ostream &a_out) const
 
fieldfind_field_by_name (const std::string &a_name) const
 

Public Attributes

sf_vec< colorf, float > color
 

Additional Inherited Members

- Protected Member Functions inherited from tools::sg::node
 node (const node &)
 
nodeoperator= (const node &)
 
void add_field (field *a_field)
 
bool write_fields (write_action &a_action)
 
bool read_fields (read_action &a_action)
 
field_desc::offset_t field_offset (const field *a_field) const
 
fieldfind_field (const field_desc &a_rdesc) const
 
void check_fields (std::ostream &a_out) const
 

Detailed Description

Definition at line 16 of file rgba.

Constructor & Destructor Documentation

◆ rgba() [1/2]

tools::sg::rgba::rgba ( )
inline

Definition at line 52 of file rgba.

53  :parent()
54  ,color(colorf_grey())
55  {
56  add_fields();
57  }

◆ ~rgba()

virtual tools::sg::rgba::~rgba ( )
inlinevirtual

Definition at line 58 of file rgba.

58 {}

◆ rgba() [2/2]

tools::sg::rgba::rgba ( const rgba a_from)
inline

Definition at line 60 of file rgba.

61  :parent(a_from)
62  ,color(a_from.color)
63  {
64  add_fields();
65  }

Member Function Documentation

◆ node_desc_fields()

virtual const desc_fields& tools::sg::rgba::node_desc_fields ( ) const
inlinevirtual

Reimplemented from tools::sg::node.

Definition at line 21 of file rgba.

21  {
23  static const desc_fields s_v(parent::node_desc_fields(),1, //WARNING : take care of count.
25  );
26  return s_v;
27  }

◆ operator=()

rgba& tools::sg::rgba::operator= ( const rgba a_from)
inline

Definition at line 66 of file rgba.

66  {
67  parent::operator=(a_from);
68  color = a_from.color;
69  return *this;
70  }

◆ render()

virtual void tools::sg::rgba::render ( render_action a_action)
inlinevirtual

Reimplemented from tools::sg::node.

Definition at line 33 of file rgba.

33  {
34  // GL-ES : ::glMaterialfv does not work. We then use :
35  // ::glEnable(GL_COLOR_MATERIAL) and ::glColor.
36 
37  //if(a_action.state().m_GL_LIGHTING) {
38  // float params[4];
39  // params[0] = rgb.value().r();
40  // params[1] = rgb.value().g();
41  // params[2] = rgb.value().b();
42  // params[3] = rgb.value().a();
43  // ::glMaterialfv(GL_FRONT,GL_DIFFUSE,params);
44  //} else {
45  //}
46 
47  state& state = a_action.state();
48  state.m_color = color.value();
49  a_action.color4f(state.m_color);
50  }

Member Data Documentation

◆ color

sf_vec<colorf,float> tools::sg::rgba::color

Definition at line 19 of file rgba.


The documentation for this class was generated from the following file:
tools::sg::rgba::color
sf_vec< colorf, float > color
Definition: rgba:19
tools::sg::rgba
Definition: rgba:16
TOOLS_FIELD_DESC_NODE_CLASS
#define TOOLS_FIELD_DESC_NODE_CLASS(a__class)
Definition: field:68
TOOLS_ARG_FIELD_DESC
#define TOOLS_ARG_FIELD_DESC(a__field)
Definition: field:71