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

Public Member Functions

virtual const desc_fieldsnode_desc_fields () const
 
 text_style ()
 
virtual ~text_style ()
 
 text_style (const text_style &a_from)
 
text_styleoperator= (const text_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_vec< colorf, float > back_color
 
sf< float > back_shadow
 
sf_string modeling
 
sf_string font
 
sf< float > font_size
 
sf_enum< sg::font_modelingfont_modeling
 
sf_string encoding
 
sf< bool > smoothing
 
sf< bool > hinting
 
sf_enum< sg::hjusthjust
 
sf_enum< sg::vjustvjust
 
sf< float > scale
 
sf_vec3f x_orientation
 
sf_vec3f y_orientation
 
sf< bool > rotated
 
sf< float > line_width
 
sf< lpatline_pattern
 
sf< bool > enforced
 
sf_vec3f translation
 
sf_enum< winding_typefront_face
 
sf_string options
 

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 19 of file text_style.

Constructor & Destructor Documentation

◆ text_style() [1/2]

tools::sg::text_style::text_style ( )
inline

Definition at line 112 of file text_style.

113  :parent()
114  ,visible(true)
115  ,color(colorf_black())
116  ,back_color(colorf_white())
117  ,back_shadow(0)
118  ,modeling()
119  ,font(font_hershey())
120  ,font_size(10)
123  ,smoothing(false)
124  ,hinting(false)
125  ,hjust(left)
126  ,vjust(bottom)
127  ,scale(1)
128  ,x_orientation(vec3f(1,0,0))
129  ,y_orientation(vec3f(0,1,0))
130  ,rotated(false)
131  ,line_width(1)
133  ,enforced(false)
134  ,translation(vec3f(0,0,0))
136  ,options("")
137  {
138  add_fields();
139  }

◆ ~text_style()

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

Definition at line 140 of file text_style.

140 {}

◆ text_style() [2/2]

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

Definition at line 142 of file text_style.

143  :parent(a_from),visible(a_from.visible)
144  ,color(a_from.color)
145  ,back_color(a_from.back_color)
146  ,back_shadow(a_from.back_shadow)
147  ,modeling(a_from.modeling)
148  ,font(a_from.font)
149  ,font_size(a_from.font_size)
150  ,font_modeling(a_from.font_modeling)
151  ,encoding(a_from.encoding)
152  ,smoothing(a_from.smoothing)
153  ,hinting(a_from.hinting)
154  ,hjust(a_from.hjust)
155  ,vjust(a_from.vjust)
156  ,scale(a_from.scale)
157  ,x_orientation(a_from.x_orientation)
158  ,y_orientation(a_from.y_orientation)
159  ,rotated(a_from.rotated)
160  ,line_width(a_from.line_width)
161  ,line_pattern(a_from.line_pattern)
162  ,enforced(a_from.enforced)
163  ,translation(a_from.translation)
164  ,front_face(a_from.front_face)
165  ,options(a_from.options)
166  {
167  add_fields();
168  }

Member Function Documentation

◆ from_string()

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

Definition at line 197 of file text_style.

197  {
198  style_parser sp;
199 
200  sp.visible(visible.value());
201  sp.color(color.value());
202  //sp.transparency(transparency.value());
203  sp.back_color(back_color.value());
204  //sp.back_transparency(back_transparency.value());
205  sp.back_shadow(back_shadow.value());
206  sp.modeling(modeling.value());
207  sp.font(font.value());
208  sp.font_size(font_size.value());
209  sp.font_modeling(font_modeling.value());
210  sp.encoding(encoding.value());
211  sp.smoothing(smoothing.value());
212  sp.hinting(hinting.value());
213  sp.scale(scale.value());
214  //sp.angle(angle.value());
215  //sp.x_orientation(x_orientation.value());
216  //sp.y_orientation(y_orientation.value());
217  //sp.rotated(rotated.value());
218  sp.line_width(line_width.value());
219  sp.line_pattern(line_pattern.value());
220  sp.enforced(enforced.value());
221  sp.translation(translation.value());
222  sp.front_face(front_face.value());
223  sp.options(options.value());
224 
225  if(!sp.parse(a_out,a_cmaps,a_s)) {
226  a_out << "tools::sg::text_style::from_string :"
227  << " parse failed."
228  << std::endl;
229  return false;
230  }
231 
232  visible.value(sp.visible());
233  color.value(sp.color());
234  //transparency.value(sp.transparency());
235  back_color.value(sp.back_color());
236  //back_transparency.value(sp.back_transparency());
237  back_shadow.value(sp.back_shadow());
238  modeling.value(sp.modeling());
239  font.value(sp.font());
240  font_size.value(sp.font_size());
241  font_modeling.value(sp.font_modeling());
242  encoding.value(sp.encoding());
243  smoothing.value(sp.smoothing());
244  hinting.value(sp.hinting());
245  scale.value(sp.scale());
246  //angle.value(sp.angle());
247  //x_orientation.value(sp.x_orientation());
248  //y_orientation.value(sp.y_orientation());
249  //rotated.value(sp.rotated());
250  line_width.value(sp.line_width());
251  line_pattern.value(sp.line_pattern());
252  enforced.value(sp.enforced());
253  translation.value(sp.translation());
254  front_face = sp.front_face();
255  options = sp.options();
256 
257  return true;
258  }

◆ node_desc_fields()

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

◆ operator=()

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

Definition at line 169 of file text_style.

169  {
170  parent::operator=(a_from);
171  visible = a_from.visible;
172  color = a_from.color;
173  back_color = a_from.back_color;
174  back_shadow = a_from.back_shadow;
175  modeling = a_from.modeling;
176  font = a_from.font;
177  font_size = a_from.font_size;
178  font_modeling = a_from.font_modeling;
179  encoding = a_from.encoding;
180  smoothing = a_from.smoothing;
181  hinting = a_from.hinting;
182  hjust = a_from.hjust;
183  vjust = a_from.vjust;
184  scale = a_from.scale;
185  x_orientation = a_from.x_orientation;
186  y_orientation = a_from.y_orientation;
187  rotated = a_from.rotated;
188  line_width = a_from.line_width;
189  line_pattern = a_from.line_pattern;
190  enforced = a_from.enforced;
191  translation = a_from.translation;
192  front_face = a_from.front_face;
193  options = a_from.options;
194  return *this;
195  }

Member Data Documentation

◆ back_color

sf_vec<colorf,float> tools::sg::text_style::back_color

Definition at line 24 of file text_style.

◆ back_shadow

sf<float> tools::sg::text_style::back_shadow

Definition at line 25 of file text_style.

◆ color

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

Definition at line 23 of file text_style.

◆ encoding

sf_string tools::sg::text_style::encoding

Definition at line 31 of file text_style.

◆ enforced

sf<bool> tools::sg::text_style::enforced

Definition at line 46 of file text_style.

◆ font

sf_string tools::sg::text_style::font

Definition at line 28 of file text_style.

◆ font_modeling

sf_enum<sg::font_modeling> tools::sg::text_style::font_modeling

Definition at line 30 of file text_style.

◆ font_size

sf<float> tools::sg::text_style::font_size

Definition at line 29 of file text_style.

◆ front_face

sf_enum<winding_type> tools::sg::text_style::front_face

Definition at line 50 of file text_style.

◆ hinting

sf<bool> tools::sg::text_style::hinting

Definition at line 33 of file text_style.

◆ hjust

sf_enum<sg::hjust> tools::sg::text_style::hjust

Definition at line 34 of file text_style.

◆ line_pattern

sf<lpat> tools::sg::text_style::line_pattern

Definition at line 45 of file text_style.

◆ line_width

sf<float> tools::sg::text_style::line_width

Definition at line 44 of file text_style.

◆ modeling

sf_string tools::sg::text_style::modeling

Definition at line 27 of file text_style.

◆ options

sf_string tools::sg::text_style::options

Definition at line 52 of file text_style.

◆ rotated

sf<bool> tools::sg::text_style::rotated

Definition at line 41 of file text_style.

◆ scale

sf<float> tools::sg::text_style::scale

Definition at line 36 of file text_style.

◆ smoothing

sf<bool> tools::sg::text_style::smoothing

Definition at line 32 of file text_style.

◆ translation

sf_vec3f tools::sg::text_style::translation

Definition at line 47 of file text_style.

◆ visible

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

Definition at line 22 of file text_style.

◆ vjust

sf_enum<sg::vjust> tools::sg::text_style::vjust

Definition at line 35 of file text_style.

◆ x_orientation

sf_vec3f tools::sg::text_style::x_orientation

Definition at line 38 of file text_style.

◆ y_orientation

sf_vec3f tools::sg::text_style::y_orientation

Definition at line 39 of file text_style.


The documentation for this class was generated from the following file:
tools::sg::text_style::font_size
sf< float > font_size
Definition: text_style:29
tools::sg::text_style::enforced
sf< bool > enforced
Definition: text_style:46
tools::sg::text_style::x_orientation
sf_vec3f x_orientation
Definition: text_style:38
tools::sg::text_style::font
sf_string font
Definition: text_style:28
tools::sg::text_style::vjust
sf_enum< sg::vjust > vjust
Definition: text_style:35
tools::sg::text_style::hinting
sf< bool > hinting
Definition: text_style:33
tools::sg::winding_ccw
@ winding_ccw
Definition: enums:105
tools::sg::text_style::line_width
sf< float > line_width
Definition: text_style:44
tools::sg::text_style::modeling
sf_string modeling
Definition: text_style:27
tools::sg::text_style::rotated
sf< bool > rotated
Definition: text_style:41
tools::sg::text_style::back_shadow
sf< float > back_shadow
Definition: text_style:25
tools::sg::text_style::visible
sf< bool > visible
Definition: text_style:22
tools::sg::left
@ left
Definition: enums:74
tools::sg::text_style::font_modeling
sf_enum< sg::font_modeling > font_modeling
Definition: text_style:30
tools::sg::text_style::smoothing
sf< bool > smoothing
Definition: text_style:32
tools::sg::encoding_none
const std::string & encoding_none()
Definition: strings:38
tools::sg::bottom
@ bottom
Definition: enums:80
tools::sg::text_style::color
sf_vec< colorf, float > color
Definition: text_style:23
tools::sg::text_style::front_face
sf_enum< winding_type > front_face
Definition: text_style:50
tools::sg::text_style::line_pattern
sf< lpat > line_pattern
Definition: text_style:45
tools::sg::text_style::hjust
sf_enum< sg::hjust > hjust
Definition: text_style:34
tools::sg::text_style
Definition: text_style:19
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::text_style::scale
sf< float > scale
Definition: text_style:36
tools::sg::text_style::y_orientation
sf_vec3f y_orientation
Definition: text_style:39
tools::sg::bsf::value
T & value()
Definition: bsf:98
tools::sg::font_hershey
const std::string & font_hershey()
Definition: strings:186
tools::sg::text_style::translation
sf_vec3f translation
Definition: text_style:47
tools::sg::font_filled
@ font_filled
Definition: enums:93
tools::sg::text_style::options
sf_string options
Definition: text_style:52
TOOLS_ARG_FIELD_DESC
#define TOOLS_ARG_FIELD_DESC(a__field)
Definition: field:71
tools::sg::text_style::encoding
sf_string encoding
Definition: text_style:31
tools::sg::text_style::back_color
sf_vec< colorf, float > back_color
Definition: text_style:24