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

Public Types

typedef std::vector< float > line_t
 

Public Member Functions

virtual const desc_fieldsnode_desc_fields () const
 
virtual void render (render_action &a_action)
 
virtual void pick (pick_action &a_action)
 
virtual void bbox (bbox_action &a_action)
 
 line_set ()
 
virtual ~line_set ()
 
 line_set (const line_set &a_from)
 
line_setoperator= (const line_set &a_from)
 
bool add (const line_t &a_line)
 
void clear ()
 
- 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 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

mf_std_vec< float > lines
 

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 line_set.

Member Typedef Documentation

◆ line_t

typedef std::vector<float> tools::sg::line_set::line_t

Definition at line 35 of file line_set.

Constructor & Destructor Documentation

◆ line_set() [1/2]

tools::sg::line_set::line_set ( )
inline

Definition at line 73 of file line_set.

74  :parent()
75  ,lines()
76  {
77 #ifdef TOOLS_MEM
78  mem::increment(s_class().c_str());
79 #endif
80  add_fields();
81  }

◆ ~line_set()

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

Definition at line 82 of file line_set.

82  {
83 #ifdef TOOLS_MEM
84  mem::decrement(s_class().c_str());
85 #endif
86  }

◆ line_set() [2/2]

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

Definition at line 88 of file line_set.

89  :parent(a_from)
90  ,lines(a_from.lines)
91  {
92 #ifdef TOOLS_MEM
93  mem::increment(s_class().c_str());
94 #endif
95  add_fields();
96  }

Member Function Documentation

◆ add()

bool tools::sg::line_set::add ( const line_t a_line)
inline

Definition at line 103 of file line_set.

103  {
104  size_t npoint = a_line.size()/3;
105  if(npoint*3!=a_line.size()) return false;
106  lines.add(a_line);
107  return true;
108  }

◆ bbox()

virtual void tools::sg::line_set::bbox ( bbox_action a_action)
inlinevirtual

Reimplemented from tools::sg::node.

Definition at line 66 of file line_set.

66  {
68  a_action.add_points(*it);
69  }
70  }

◆ clear()

void tools::sg::line_set::clear ( )
inline

Definition at line 109 of file line_set.

109 {lines.clear();}

◆ node_desc_fields()

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

Reimplemented from tools::sg::node.

Definition at line 23 of file line_set.

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

◆ operator=()

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

Definition at line 97 of file line_set.

97  {
98  parent::operator=(a_from);
99  lines = a_from.lines;
100  return *this;
101  }

◆ pick()

virtual void tools::sg::line_set::pick ( pick_action a_action)
inlinevirtual

Reimplemented from tools::sg::node.

Definition at line 43 of file line_set.

43  {
44  if(a_action.stop_at_first()){
46  a_action.add_line_strip(*it);
47  if(a_action.done()) {
48  a_action.set_node(this);
49  return;
50  }
51  }
52  } else {
54  a_action.set_done(false);
55  a_action.zs().clear();
56  a_action.ws().clear();
57  a_action.add_line_strip(*it);
58  if(a_action.done()) {
59  a_action.add_pick(*this,a_action.zs(),a_action.ws(),a_action.state());
60  a_action.set_done(false);
61  }
62  }
63  }
64  }

◆ render()

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

Reimplemented from tools::sg::node.

Definition at line 37 of file line_set.

37  {
39  a_action.draw_vertex_array(gl::line_strip(),*it);
40  }
41  }

Member Data Documentation

◆ lines

mf_std_vec<float> tools::sg::line_set::lines

Definition at line 21 of file line_set.


The documentation for this class was generated from the following file:
tools::sg::bmf::add
void add(const T &a_value)
Definition: bmf:73
tools::gl::line_strip
mode_t line_strip()
Definition: glprims:19
tools::sg::bmf::values
const std::vector< T > & values() const
Definition: bmf:71
tools::sg::line_set
Definition: line_set:18
tools::sg::bmf::clear
void clear()
Definition: bmf:108
TOOLS_FIELD_DESC_NODE_CLASS
#define TOOLS_FIELD_DESC_NODE_CLASS(a__class)
Definition: field:68
tools_vforcit
#define tools_vforcit(a__T, a__v, a__it)
Definition: forit:7
tools::sg::line_set::line_t
std::vector< float > line_t
Definition: line_set:35
tools::sg::line_set::lines
mf_std_vec< float > lines
Definition: line_set:21
TOOLS_ARG_FIELD_DESC
#define TOOLS_ARG_FIELD_DESC(a__field)
Definition: field:71