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

Public Member Functions

virtual const desc_fieldsnode_desc_fields () const
 
virtual void render (render_action &a_action)
 
 torche ()
 
virtual ~torche ()
 
 torche (const torche &a_from)
 
torcheoperator= (const torche &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
 
sf_vec3f direction
 
sf< bool > on
 

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 18 of file torche.

Constructor & Destructor Documentation

◆ torche() [1/2]

tools::sg::torche::torche ( )
inline

Definition at line 55 of file torche.

56  :parent()
57  ,color(colorf_white())
58  ,direction(vec3f(0,0,-1))
59  ,on(true)
60  {
61  add_fields();
62  }

◆ ~torche()

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

Definition at line 63 of file torche.

63 {}

◆ torche() [2/2]

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

Definition at line 65 of file torche.

66  :parent(a_from)
67  ,color(a_from.color)
68  ,direction(a_from.direction)
69  ,on(a_from.on)
70  {
71  add_fields();
72  }

Member Function Documentation

◆ node_desc_fields()

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

Reimplemented from tools::sg::node.

Definition at line 25 of file torche.

25  {
27  static const desc_fields s_v(parent::node_desc_fields(),3, //WARNING : take care of count.
31  );
32  return s_v;
33  }

◆ operator=()

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

Definition at line 73 of file torche.

73  {
74  parent::operator=(a_from);
75  color = a_from.color;
76  direction = a_from.direction;
77  on = a_from.on;
78  return *this;
79  }

◆ render()

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

Reimplemented from tools::sg::node.

Reimplemented in tools::sg::head_light.

Definition at line 41 of file torche.

41  {
42  if(!on.value()) return;
43  state& state = a_action.state();
44  if((state.m_light+1)>=a_action.max_lights()) {
45  a_action.out()
46  << "GL_MAX_LIGHTS (" << a_action.max_lights() << ") reached."
47  << std::endl;
48  return;
49  }
50  state.m_GL_LIGHTING = true; //for separator
51  a_action.enable_light(state.m_light,direction.value(),color.value());
52  state.m_light++;
53  }

Member Data Documentation

◆ color

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

Definition at line 21 of file torche.

◆ direction

sf_vec3f tools::sg::torche::direction

Definition at line 22 of file torche.

◆ on

sf<bool> tools::sg::torche::on

Definition at line 23 of file torche.


The documentation for this class was generated from the following file:
tools::sg::torche
Definition: torche:18
tools::sg::torche::color
sf_vec< colorf, float > color
Definition: torche:21
TOOLS_FIELD_DESC_NODE_CLASS
#define TOOLS_FIELD_DESC_NODE_CLASS(a__class)
Definition: field:68
tools::sg::torche::direction
sf_vec3f direction
Definition: torche:22
tools::sg::bsf::value
T & value()
Definition: bsf:98
tools::sg::torche::on
sf< bool > on
Definition: torche:23
TOOLS_ARG_FIELD_DESC
#define TOOLS_ARG_FIELD_DESC(a__field)
Definition: field:71