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

Public Member Functions

virtual float ascent (float) const =0
 
virtual float descent (float) const =0
 
virtual float y_advance (float) const =0
 
virtual void get_bounds (float, float &, float &, float &, float &, float &, float &) const =0
 
virtual bool truncate (const std::string &, float, float, std::string &) const =0
 
virtual const desc_fieldsnode_desc_fields () const
 
 base_text ()
 
virtual ~base_text ()
 
- 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

mf_string strings
 
sf< float > height
 
sf_enum< sg::hjusthjust
 
sf_enum< sg::vjustvjust
 

Protected Member Functions

 base_text (const base_text &a_from)
 
base_textoperator= (const base_text &a_from)
 
- 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 base_text.

Constructor & Destructor Documentation

◆ base_text() [1/2]

tools::sg::base_text::base_text ( )
inline

Definition at line 52 of file base_text.

53  :parent()
54  ,height(1.0f)
55  ,hjust(left)
56  ,vjust(bottom)
57  {
58  add_fields();
59  }

◆ ~base_text()

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

Definition at line 60 of file base_text.

60 {}

◆ base_text() [2/2]

tools::sg::base_text::base_text ( const base_text a_from)
inlineprotected

Definition at line 62 of file base_text.

63  :parent(a_from)
64  ,strings(a_from.strings)
65  ,height(a_from.height)
66  ,hjust(a_from.hjust)
67  ,vjust(a_from.vjust)
68  {
69  add_fields();
70  }

Member Function Documentation

◆ ascent()

virtual float tools::sg::base_text::ascent ( float  ) const
pure virtual

◆ descent()

virtual float tools::sg::base_text::descent ( float  ) const
pure virtual

◆ get_bounds()

virtual void tools::sg::base_text::get_bounds ( float  ,
float &  ,
float &  ,
float &  ,
float &  ,
float &  ,
float &   
) const
pure virtual

◆ node_desc_fields()

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

Reimplemented from tools::sg::node.

Reimplemented in tools::sg::text_valop, tools::sg::text_hershey, and tools::sg::base_freetype.

Definition at line 34 of file base_text.

34  {
36  static const desc_fields s_v(parent::node_desc_fields(),4, //WARNING : take care of count.
41  );
42  return s_v;
43  }

◆ operator=()

base_text& tools::sg::base_text::operator= ( const base_text a_from)
inlineprotected

Definition at line 71 of file base_text.

71  {
72  parent::operator=(a_from);
73  height = a_from.height;
74  strings = a_from.strings;
75  hjust = a_from.hjust;
76  vjust = a_from.vjust;
77  return *this;
78  }

◆ truncate()

virtual bool tools::sg::base_text::truncate ( const std::string &  ,
float  ,
float  ,
std::string &   
) const
pure virtual

◆ y_advance()

virtual float tools::sg::base_text::y_advance ( float  ) const
pure virtual

Member Data Documentation

◆ height

sf<float> tools::sg::base_text::height

Definition at line 30 of file base_text.

◆ hjust

sf_enum<sg::hjust> tools::sg::base_text::hjust

Definition at line 31 of file base_text.

◆ strings

mf_string tools::sg::base_text::strings

Definition at line 29 of file base_text.

◆ vjust

sf_enum<sg::vjust> tools::sg::base_text::vjust

Definition at line 32 of file base_text.


The documentation for this class was generated from the following file:
tools::sg::base_text
Definition: base_text:17
tools::sg::base_text::height
sf< float > height
Definition: base_text:30
tools::sg::base_text::hjust
sf_enum< sg::hjust > hjust
Definition: base_text:31
tools::sg::node::operator=
node & operator=(const node &)
Definition: node:124
tools::sg::left
@ left
Definition: enums:74
tools::sg::base_text::vjust
sf_enum< sg::vjust > vjust
Definition: base_text:32
tools::sg::bottom
@ bottom
Definition: enums:80
tools::sg::node::node_desc_fields
virtual const desc_fields & node_desc_fields() const
Definition: node:48
tools::sg::base_text::strings
mf_string strings
Definition: base_text:29
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