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

Public Member Functions

virtual const desc_fieldsnode_desc_fields () const
 
 line_style ()
 
virtual ~line_style ()
 
 line_style (const line_style &a_from)
 
line_styleoperator= (const line_style &a_from)
 
bool from_string (std::ostream &a_out, const cmaps_t &a_cmaps, const std::string &a_s)
 
- 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 render (render_action &)
 
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< bool > visible
 
sf_vec< colorf, float > color
 
sf< float > width
 
sf< lpatpattern
 

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 17 of file line_style.

Constructor & Destructor Documentation

◆ line_style() [1/2]

tools::sg::line_style::line_style ( )
inline

Definition at line 43 of file line_style.

44  :parent()
45  ,visible(true)
46  ,color(colorf_black())
47  ,width(1)
49  {
50  add_fields();
51  }

◆ ~line_style()

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

Definition at line 52 of file line_style.

52 {}

◆ line_style() [2/2]

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

Definition at line 54 of file line_style.

55  :parent(a_from)
56  ,visible(a_from.visible)
57  ,color(a_from.color)
58  ,width(a_from.width)
59  ,pattern(a_from.pattern)
60  {
61  add_fields();
62  }

Member Function Documentation

◆ from_string()

bool tools::sg::line_style::from_string ( std::ostream &  a_out,
const cmaps_t a_cmaps,
const std::string &  a_s 
)
inline

Definition at line 73 of file line_style.

73  {
74  style_parser sp;
75 
76  sp.visible(visible.value());
77  sp.color(color.value());
78  //sp.transparency(transparency.value());
79  sp.width(width.value());
80  sp.pattern(pattern.value());
81 
82  if(!sp.parse(a_out,a_cmaps,a_s)) {
83  a_out << "tools::sg::line_style::from_string :"
84  << " parse failed."
85  << std::endl;
86  return false;
87  }
88 
89  visible.value(sp.visible());
90  color.value(sp.color());
91  //transparency.value(sp.transparency());
92  width.value(sp.width());
93  pattern.value(sp.pattern());
94 
95  return true;
96  }

◆ node_desc_fields()

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

Reimplemented from tools::sg::node.

Definition at line 25 of file line_style.

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

◆ operator=()

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

Definition at line 63 of file line_style.

63  {
64  parent::operator=(a_from);
65 
66  visible = a_from.visible;
67  color = a_from.color;
68  width = a_from.width;
69  pattern = a_from.pattern;
70  return *this;
71  }

Member Data Documentation

◆ color

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

Definition at line 21 of file line_style.

◆ pattern

sf<lpat> tools::sg::line_style::pattern

Definition at line 23 of file line_style.

◆ visible

sf<bool> tools::sg::line_style::visible

Definition at line 20 of file line_style.

◆ width

sf<float> tools::sg::line_style::width

Definition at line 22 of file line_style.


The documentation for this class was generated from the following file:
tools::sg::line_style
Definition: line_style:17
tools::sg::line_style::pattern
sf< lpat > pattern
Definition: line_style:23
tools::sg::line_style::color
sf_vec< colorf, float > color
Definition: line_style:21
tools::sg::line_style::width
sf< float > width
Definition: line_style:22
tools::sg::line_style::visible
sf< bool > visible
Definition: line_style:20
TOOLS_FIELD_DESC_NODE_CLASS
#define TOOLS_FIELD_DESC_NODE_CLASS(a__class)
Definition: field:68
tools::sg::line_solid
@ line_solid
Definition: enums:11
tools::sg::bsf::value
T & value()
Definition: bsf:98
TOOLS_ARG_FIELD_DESC
#define TOOLS_ARG_FIELD_DESC(a__field)
Definition: field:71