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

Public Member Functions

virtual const desc_fieldsnode_desc_fields () const
 
 style ()
 
virtual ~style ()
 
 style (const style &a_from)
 
styleoperator= (const style &a_from)
 
void reset ()
 
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_vec< colorf, float > color
 
sf_vec< colorf, float > highlight_color
 
sf_vec< colorf, float > back_color
 
sf< float > line_width
 
sf< float > marker_size
 
sf< float > point_size
 
sf< float > font_size
 
sf_enum< sg::font_modelingfont_modeling
 
sf_enum< winding_typefront_face
 
sf< lpatline_pattern
 
sf_enum< sg::marker_stylemarker_style
 
sf_enum< sg::area_stylearea_style
 
sf_string modeling
 
sf_string light_model
 
sf_string tick_modeling
 
sf_string encoding
 
sf< bool > smoothing
 
sf< bool > hinting
 
sf_string cut
 
sf_enum< sg::painting_policypainting
 
sf_enum< sg::hatching_policyhatching
 
sf_enum< sg::projection_typeprojection
 
sf_string font
 
sf< int > multi_node_limit
 
sf< int > divisions
 
sf< unsigned int > rotation_steps
 
sf< float > spacing
 
sf< float > angle
 
sf< float > scale
 
sf< float > offset
 
sf< float > strip_width
 
sf< bool > visible
 
sf< float > bar_offset
 
sf< float > bar_width
 
sf< bool > editable
 
sf< bool > pickable
 
sf< bool > automated
 
sf_string options
 
sf_string color_mapping
 
sf< bool > enforced
 
sf_vec3f translation
 
sf_string coloring
 
sf_string title
 

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

Constructor & Destructor Documentation

◆ style() [1/2]

tools::sg::style::style ( )
inline

Definition at line 166 of file style.

167  :parent()
168  ,color(colorf_black())
169  ,highlight_color(colorf_black())
170  ,back_color(colorf_white())
171  ,line_width(1)
172  ,marker_size(1)
173  ,point_size(1)
174  ,font_size(10)
184  ,smoothing(false)
185  ,hinting(false)
186  ,cut()
190  ,font(font_hershey())
192  ,divisions(510) //Same as ROOT/TAttAxis
193  ,rotation_steps(24) //Same as SbPolyhedron default.
194  ,spacing(0.05F)
195  ,angle(fpi()/4.0F)
196  ,scale(1)
197  ,offset(0)
198  ,strip_width(0)
199  ,visible(true)
200  ,bar_offset(0.25F)
201  ,bar_width(0.5F)
202  ,editable(false)
203  ,pickable(false)
204  ,automated(true)
205  ,options()
206  ,color_mapping()
207  ,enforced(false)
208  ,translation(vec3f(0,0,0))
209  ,coloring()
210  ,title()
211  {
212  add_fields();
213  }

◆ ~style()

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

Definition at line 214 of file style.

214 {}

◆ style() [2/2]

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

Definition at line 216 of file style.

217  :parent(a_from)
218  ,color(a_from.color)
219  ,highlight_color(a_from.highlight_color)
220  ,back_color(a_from.back_color)
221  ,line_width(a_from.line_width)
222  ,marker_size(a_from.marker_size)
223  ,point_size(a_from.point_size)
224  ,font_size(a_from.font_size)
225  ,font_modeling(a_from.font_modeling)
226  ,front_face(a_from.front_face)
227  ,line_pattern(a_from.line_pattern)
228  ,marker_style(a_from.marker_style)
229  ,area_style(a_from.area_style)
230  ,modeling (a_from.modeling )
231  ,light_model(a_from.light_model)
232  ,tick_modeling(a_from.tick_modeling)
233  ,encoding(a_from.encoding)
234  ,smoothing(a_from.smoothing)
235  ,hinting(a_from.hinting)
236  ,cut(a_from.cut)
237  ,painting(a_from.painting)
238  ,hatching(a_from.hatching)
239  ,projection(a_from.projection)
240  ,font(a_from.font)
241  ,multi_node_limit(a_from.multi_node_limit)
242  ,divisions(a_from.divisions)
243  ,rotation_steps(a_from.rotation_steps)
244  ,spacing(a_from.spacing)
245  ,angle(a_from.angle)
246  ,scale(a_from.scale)
247  ,offset(a_from.offset)
248  ,strip_width(a_from.strip_width)
249  ,visible(a_from.visible)
250  ,bar_offset(a_from.bar_offset)
251  ,bar_width(a_from.bar_width)
252  ,editable(a_from.editable)
253  ,pickable(a_from.pickable)
254  ,automated(a_from.automated)
255  ,options(a_from.options)
256  ,color_mapping(a_from.color_mapping)
257  ,enforced(a_from.enforced)
258  ,translation(a_from.translation)
259  ,coloring(a_from.coloring)
260  ,title(a_from.title)
261  {
262  add_fields();
263  }

Member Function Documentation

◆ from_string()

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

Definition at line 360 of file style.

360  {
361  style_parser sp;
362 
363  sp.color(color.value());
364  sp.highlight_color(highlight_color.value());
365  sp.back_color(back_color.value());
366  sp.line_width(line_width.value());
367  sp.marker_size(marker_size.value());
368  sp.point_size(point_size.value());
369  sp.font_size(font_size.value());
370  sp.font_modeling(font_modeling.value());
371  sp.front_face(front_face.value());
372  sp.line_pattern(line_pattern.value());
373  sp.marker_style(marker_style.value());
374  sp.area_style(area_style.value());
375  sp.modeling(modeling.value());
376  sp.light_model(light_model.value());
377  sp.tick_modeling(tick_modeling.value());
378  sp.encoding(encoding.value());
379  sp.smoothing(smoothing.value());
380  sp.hinting(hinting.value());
381  sp.cut(cut.value());
382  sp.painting(painting.value());
383  sp.hatching(hatching.value());
384  sp.projection(projection.value());
385  sp.font(font.value());
386  sp.multi_node_limit(multi_node_limit.value());
387  sp.divisions(divisions.value());
388  sp.rotation_steps(rotation_steps.value());
389  //sp.transparency(transparency.value());
390  //sp.back_transparency(back_transparency.value());
391  sp.spacing(spacing.value());
392  sp.angle(angle.value());
393  sp.scale(scale.value());
394  sp.offset(offset.value());
395  sp.strip_width(strip_width.value());
396  sp.visible(visible.value());
397  sp.bar_offset(bar_offset.value());
398  sp.bar_width(bar_width.value());
399  sp.editable(editable.value());
400  sp.pickable(pickable.value());
401  sp.automated(automated.value());
402  sp.options(options.value());
403  sp.color_mapping(color_mapping.value());
404  sp.enforced(enforced.value());
405  sp.translation(translation.value());
406  sp.coloring(coloring.value());
407  sp.title(title.value());
408 
409  //if(!sp.parse(a_s,style_parser::def_error_func))
410  // return false;
411 
412  if(!sp.parse(a_out,a_cmaps,a_s)) {
413  a_out << "tools::sg::style::from_string :"
414  << " parse failed."
415  << std::endl;
416  return false;
417  }
418 
419  color.value(sp.color());
420  highlight_color.value(sp.highlight_color());
421  back_color.value(sp.back_color());
422  line_width.value(sp.line_width());
423  marker_size.value(sp.marker_size());
424  point_size.value(sp.point_size());
425  font_size.value(sp.font_size());
426  font_modeling.value(sp.font_modeling());
427  front_face = sp.front_face();
428  line_pattern.value(sp.line_pattern());
429  marker_style.value(sp.marker_style());
430  area_style.value(sp.area_style());
431  modeling.value(sp.modeling());
432  light_model.value(sp.light_model());
433  tick_modeling.value(sp.tick_modeling());
434  encoding.value(sp.encoding());
435  smoothing.value(sp.smoothing());
436  hinting.value(sp.hinting());
437  cut.value(sp.cut());
438  painting.value(sp.painting());
439  hatching.value(sp.hatching());
440  projection.value(sp.projection());
441  font.value(sp.font());
442  multi_node_limit.value(sp.multi_node_limit());
443  divisions.value(sp.divisions());
444  rotation_steps.value(sp.rotation_steps());
445  //transparency.value(sp.transparency());
446  //back_transparency.value(sp.back_transparency());
447  spacing.value(sp.spacing());
448  angle.value(sp.angle());
449  scale.value(sp.scale());
450  offset.value(sp.offset());
451  strip_width.value(sp.strip_width());
452  visible.value(sp.visible());
453  bar_offset.value(sp.bar_offset());
454  bar_width.value(sp.bar_width());
455  editable.value(sp.editable());
456  pickable.value(sp.pickable());
457  automated.value(sp.automated());
458  options.value(sp.options());
459  color_mapping.value(sp.color_mapping());
460  enforced.value(sp.enforced());
461  translation.value(sp.translation());
462  coloring.value(sp.coloring());
463  title.value(sp.title());
464 
465  return true;
466  }

◆ node_desc_fields()

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

Reimplemented from tools::sg::node.

Definition at line 66 of file style.

66  {
68  static const desc_fields s_v(parent::node_desc_fields(),43, //WARNING : take care of count.
79 
90 
101 
112 
116  );
117  return s_v;
118  }

◆ operator=()

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

Definition at line 264 of file style.

264  {
265  parent::operator=(a_from);
266 
267  color = a_from.color;
268  highlight_color = a_from.highlight_color;
269  back_color = a_from.back_color;
270  line_width = a_from.line_width;
271  marker_size = a_from.marker_size;
272  point_size = a_from.point_size;
273  font_size = a_from.font_size;
274  font_modeling = a_from.font_modeling;
275  front_face = a_from.front_face;
276  line_pattern = a_from.line_pattern;
277  marker_style = a_from.marker_style;
278  area_style = a_from.area_style;
279  modeling = a_from.modeling ;
280  light_model = a_from.light_model;
281  tick_modeling = a_from.tick_modeling;
282  encoding = a_from.encoding;
283  smoothing = a_from.smoothing;
284  hinting = a_from.hinting;
285  cut = a_from.cut;
286  painting = a_from.painting;
287  hatching = a_from.hatching;
288  projection = a_from.projection;
289  font = a_from.font;
290  multi_node_limit = a_from.multi_node_limit;
291  divisions = a_from.divisions;
292  rotation_steps = a_from.rotation_steps;
293  spacing = a_from.spacing;
294  angle = a_from.angle;
295  scale = a_from.scale;
296  offset = a_from.offset;
297  strip_width = a_from.strip_width;
298  visible = a_from.visible;
299  bar_offset = a_from.bar_offset;
300  bar_width = a_from.bar_width;
301  editable = a_from.editable;
302  pickable = a_from.pickable;
303  automated = a_from.automated;
304  options = a_from.options;
305  color_mapping = a_from.color_mapping;
306  enforced = a_from.enforced;
307  translation = a_from.translation;
308  coloring = a_from.coloring;
309  title = a_from.title;
310 
311  return *this;
312  }

◆ reset()

void tools::sg::style::reset ( )
inline

Definition at line 314 of file style.

314  {
315  color = colorf_black();
316  highlight_color = colorf_black();
317  back_color = colorf_white();
318  line_width = 1;
319  marker_size = 1;
320  point_size = 1;
321  font_size = 10;
331  smoothing = false;
332  hinting = false;
333  cut = "";
337  font = font_hershey();
339  divisions = 510;
340  rotation_steps = 24;
341  spacing = 0.05F;
342  angle = fpi()/4.0F;
343  scale = 1;
344  offset = 0;
345  strip_width = 0;
346  visible = true;
347  bar_offset = 0.25F;
348  bar_width = 0.5F;
349  editable = false;
350  pickable = false;
351  automated = true;
352  options = "";
353  color_mapping = "";
354  enforced = false;
355  translation = vec3f(0,0,0);
356  coloring = "";
357  title = "";
358  }

Member Data Documentation

◆ angle

sf<float> tools::sg::style::angle

Definition at line 49 of file style.

◆ area_style

sf_enum<sg::area_style> tools::sg::style::area_style

Definition at line 33 of file style.

◆ automated

sf<bool> tools::sg::style::automated

Definition at line 58 of file style.

◆ back_color

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

Definition at line 24 of file style.

◆ bar_offset

sf<float> tools::sg::style::bar_offset

Definition at line 54 of file style.

◆ bar_width

sf<float> tools::sg::style::bar_width

Definition at line 55 of file style.

◆ color

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

Definition at line 22 of file style.

◆ color_mapping

sf_string tools::sg::style::color_mapping

Definition at line 60 of file style.

◆ coloring

sf_string tools::sg::style::coloring

Definition at line 63 of file style.

◆ cut

sf_string tools::sg::style::cut

Definition at line 40 of file style.

◆ divisions

sf<int> tools::sg::style::divisions

Definition at line 46 of file style.

◆ editable

sf<bool> tools::sg::style::editable

Definition at line 56 of file style.

◆ encoding

sf_string tools::sg::style::encoding

Definition at line 37 of file style.

◆ enforced

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

Definition at line 61 of file style.

◆ font

sf_string tools::sg::style::font

Definition at line 44 of file style.

◆ font_modeling

sf_enum<sg::font_modeling> tools::sg::style::font_modeling

Definition at line 29 of file style.

◆ font_size

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

Definition at line 28 of file style.

◆ front_face

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

Definition at line 30 of file style.

◆ hatching

sf_enum<sg::hatching_policy> tools::sg::style::hatching

Definition at line 42 of file style.

◆ highlight_color

sf_vec<colorf,float> tools::sg::style::highlight_color

Definition at line 23 of file style.

◆ hinting

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

Definition at line 39 of file style.

◆ light_model

sf_string tools::sg::style::light_model

Definition at line 35 of file style.

◆ line_pattern

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

Definition at line 31 of file style.

◆ line_width

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

Definition at line 25 of file style.

◆ marker_size

sf<float> tools::sg::style::marker_size

Definition at line 26 of file style.

◆ marker_style

sf_enum<sg::marker_style> tools::sg::style::marker_style

Definition at line 32 of file style.

◆ modeling

sf_string tools::sg::style::modeling

Definition at line 34 of file style.

◆ multi_node_limit

sf<int> tools::sg::style::multi_node_limit

Definition at line 45 of file style.

◆ offset

sf<float> tools::sg::style::offset

Definition at line 51 of file style.

◆ options

sf_string tools::sg::style::options

Definition at line 59 of file style.

◆ painting

sf_enum<sg::painting_policy> tools::sg::style::painting

Definition at line 41 of file style.

◆ pickable

sf<bool> tools::sg::style::pickable

Definition at line 57 of file style.

◆ point_size

sf<float> tools::sg::style::point_size

Definition at line 27 of file style.

◆ projection

sf_enum<sg::projection_type> tools::sg::style::projection

Definition at line 43 of file style.

◆ rotation_steps

sf<unsigned int> tools::sg::style::rotation_steps

Definition at line 47 of file style.

◆ scale

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

Definition at line 50 of file style.

◆ smoothing

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

Definition at line 38 of file style.

◆ spacing

sf<float> tools::sg::style::spacing

Definition at line 48 of file style.

◆ strip_width

sf<float> tools::sg::style::strip_width

Definition at line 52 of file style.

◆ tick_modeling

sf_string tools::sg::style::tick_modeling

Definition at line 36 of file style.

◆ title

sf_string tools::sg::style::title

Definition at line 64 of file style.

◆ translation

sf_vec3f tools::sg::style::translation

Definition at line 62 of file style.

◆ visible

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

Definition at line 53 of file style.


The documentation for this class was generated from the following file:
tools::sg::style_parser::no_limit
static int no_limit()
Definition: style_parser:146
tools::sg::style::strip_width
sf< float > strip_width
Definition: style:52
tools::sg::style::visible
sf< bool > visible
Definition: style:53
tools::sg::style::smoothing
sf< bool > smoothing
Definition: style:38
tools::sg::light_model_phong
const std::string & light_model_phong()
Definition: strings:178
tools::sg::modeling_boxes
const std::string & modeling_boxes()
Definition: strings:64
tools::sg::style::painting
sf_enum< sg::painting_policy > painting
Definition: style:41
tools::sg::style::light_model
sf_string light_model
Definition: style:35
tools::sg::winding_ccw
@ winding_ccw
Definition: enums:105
tools::sg::style::translation
sf_vec3f translation
Definition: style:62
tools::sg::projection_none
@ projection_none
Definition: enums:50
tools::sg::style::color
sf_vec< colorf, float > color
Definition: style:22
tools::sg::style::automated
sf< bool > automated
Definition: style:58
tools::sg::style::area_style
sf_enum< sg::area_style > area_style
Definition: style:33
tools::sg::style::highlight_color
sf_vec< colorf, float > highlight_color
Definition: style:23
tools::sg::style::projection
sf_enum< sg::projection_type > projection
Definition: style:43
tools::sg::style::pickable
sf< bool > pickable
Definition: style:57
tools::sg::style::enforced
sf< bool > enforced
Definition: style:61
tools::sg::style::multi_node_limit
sf< int > multi_node_limit
Definition: style:45
tools::sg::style::encoding
sf_string encoding
Definition: style:37
tools::fpi
float fpi()
Definition: mathf:11
tools::sg::marker_dot
@ marker_dot
Definition: enums:18
tools::sg::style::font_size
sf< float > font_size
Definition: style:28
tools::sg::style::offset
sf< float > offset
Definition: style:51
tools::sg::style::bar_width
sf< float > bar_width
Definition: style:55
tools::sg::style::back_color
sf_vec< colorf, float > back_color
Definition: style:24
tools::sg::style::rotation_steps
sf< unsigned int > rotation_steps
Definition: style:47
tools::sg::tick_modeling_hippo
const std::string & tick_modeling_hippo()
Definition: strings:19
tools::sg::style::marker_size
sf< float > marker_size
Definition: style:26
tools::sg::style::line_pattern
sf< lpat > line_pattern
Definition: style:31
tools::sg::style
Definition: style:19
tools::sg::encoding_none
const std::string & encoding_none()
Definition: strings:38
tools::sg::style::hinting
sf< bool > hinting
Definition: style:39
tools::sg::style::options
sf_string options
Definition: style:59
tools::sg::style::modeling
sf_string modeling
Definition: style:34
tools::sg::style::marker_style
sf_enum< sg::marker_style > marker_style
Definition: style:32
tools::sg::hatching_none
@ hatching_none
Definition: enums:67
tools::sg::style::editable
sf< bool > editable
Definition: style:56
tools::sg::style::color_mapping
sf_string color_mapping
Definition: style:60
tools::sg::painting_uniform
@ painting_uniform
Definition: enums:58
tools::sg::style::bar_offset
sf< float > bar_offset
Definition: style:54
tools::sg::style::cut
sf_string cut
Definition: style:40
tools::sg::style::divisions
sf< int > divisions
Definition: style:46
tools::sg::style::front_face
sf_enum< winding_type > front_face
Definition: style:30
tools::sg::area_solid
@ area_solid
Definition: enums:43
tools::sg::style::angle
sf< float > angle
Definition: style:49
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::style::line_width
sf< float > line_width
Definition: style:25
tools::sg::style::scale
sf< float > scale
Definition: style:50
tools::sg::bsf::value
T & value()
Definition: bsf:98
tools::sg::style::coloring
sf_string coloring
Definition: style:63
tools::sg::style::title
sf_string title
Definition: style:64
tools::sg::font_hershey
const std::string & font_hershey()
Definition: strings:186
tools::sg::font_filled
@ font_filled
Definition: enums:93
tools::sg::style::hatching
sf_enum< sg::hatching_policy > hatching
Definition: style:42
tools::sg::style::font
sf_string font
Definition: style:44
tools::sg::style::point_size
sf< float > point_size
Definition: style:27
tools::sg::style::tick_modeling
sf_string tick_modeling
Definition: style:36
tools::sg::style::font_modeling
sf_enum< sg::font_modeling > font_modeling
Definition: style:29
TOOLS_ARG_FIELD_DESC
#define TOOLS_ARG_FIELD_DESC(a__field)
Definition: field:71
tools::sg::style::spacing
sf< float > spacing
Definition: style:48