|
inlib
1.2.0
|
Classes | |
| struct | AreaStyle |
| struct | HatchingPolicy |
| struct | hjust_rec |
| struct | MarkerStyle |
| struct | PaintingPolicy |
| struct | ProjectionType |
| struct | vjust_rec |
Public Member Functions | |
| style_parser () | |
| virtual | ~style_parser () |
| style_parser (const style_parser &a_from) | |
| style_parser & | operator= (const style_parser &a_from) |
| void | copy (const style_parser &a_from) |
| bool | equal (const style_parser &a_from) |
| virtual void | reset () |
| std::string | tos () const |
| void | color (const colorf &a_v) |
| colorf | color () const |
| void | highlight_color (const colorf &a_v) |
| colorf | highlight_color () const |
| void | back_color (const colorf &a_v) |
| colorf | back_color () const |
| void | line_width (float a_v) |
| float | line_width () const |
| float | transparency () const |
| void | transparency (float a_v) |
| float | back_transparency () const |
| void | back_transparency (float a_v) |
| float | back_shadow () const |
| void | back_shadow (float a_v) |
| void | marker_style (sg::marker_style a_v) |
| sg::marker_style | marker_style () const |
| void | marker_size (float a_v) |
| float | marker_size () const |
| void | font_size (float a_v) |
| float | font_size () const |
| void | area_style (sg::area_style a_v) |
| sg::area_style | area_style () const |
| void | modeling (const std::string &a_v) |
| const std::string & | modeling () const |
| void | light_model (const std::string &a_v) |
| const std::string & | light_model () const |
| void | tick_modeling (const std::string &a_v) |
| const std::string & | tick_modeling () const |
| void | encoding (const std::string &a_v) |
| const std::string & | encoding () const |
| void | smoothing (bool a_v) |
| bool | smoothing () const |
| void | hinting (bool a_v) |
| bool | hinting () const |
| sg::painting_policy | painting () const |
| void | painting (sg::painting_policy a_v) |
| sg::hatching_policy | hatching () const |
| void | hatching (sg::hatching_policy a_v) |
| sg::projection_type | projection () const |
| void | projection (sg::projection_type a_v) |
| void | line_pattern (lpat a_v) |
| lpat | line_pattern () const |
| void | font (const std::string &a_v) |
| const std::string & | font () const |
| void | divisions (int a_v) |
| int | divisions () const |
| void | rotation_steps (unsigned int a_v) |
| unsigned int | rotation_steps () const |
| void | offset (float a_v) |
| float | offset () const |
| void | strip_width (float a_v) |
| float | strip_width () const |
| void | angle (float a_v) |
| float | angle () const |
| void | scale (float a_v) |
| float | scale () const |
| void | bar_offset (float a_v) |
| float | bar_offset () const |
| void | bar_width (float a_v) |
| float | bar_width () const |
| void | multi_node_limit (int a_v) |
| int | multi_node_limit () const |
| void | spacing (float a_v) |
| float | spacing () const |
| void | visible (bool a_v) |
| bool | visible () const |
| void | editable (bool a_v) |
| bool | editable () const |
| void | automated (bool a_v) |
| bool | automated () const |
| void | cut (const std::string &a_v) |
| const std::string & | cut () const |
| void | options (const std::string &a_v) |
| const std::string & | options () const |
| void | color_mapping (const std::string &a_v) |
| const std::string & | color_mapping () const |
| void | enforced (bool a_v) |
| bool | enforced () const |
| void | translation (const vec3f &a_v) |
| vec3f | translation () const |
| void | front_face (winding_type a_v) |
| winding_type | front_face () const |
| void | hjust (sg::hjust a_v) |
| sg::hjust | hjust () const |
| void | vjust (sg::vjust a_v) |
| sg::vjust | vjust () const |
| bool | parse (std::ostream &a_out, const cmaps_t &a_cmaps, const std::string &a_s) |
Static Public Member Functions | |
| static int | no_limit () |
| static void | hls_to_rgb (float hue, float light, float satur, float &r, float &g, float &b) |
| static bool | scolor (const cmaps_t &a_cmaps, const std::string &a_s, colorf &a_col) |
| static bool | scolor (const colorf &a_col, std::string &a_s) |
| static bool | shjust (const std::string &a_s, sg::hjust &a_v) |
| static const char * | shjust (sg::hjust a_v) |
| static bool | svjust (const std::string &a_s, sg::vjust &a_v) |
| static const char * | svjust (sg::vjust a_v) |
| static bool | smarker_style (const std::string &a_s, sg::marker_style &a_v) |
| static const char * | smarker_style (sg::marker_style a_v) |
| static bool | sarea_style (const std::string &a_s, sg::area_style &a_v) |
| static const char * | sarea_style (sg::area_style a_v) |
| static bool | spainting_policy (const std::string &a_s, sg::painting_policy &a_v) |
| static const char * | spainting_policy (sg::painting_policy a_v) |
| static bool | shatching_policy (const std::string &a_s, sg::hatching_policy &a_v) |
| static const char * | shatching_policy (sg::hatching_policy a_v) |
| static bool | sprojection_type (const std::string &a_s, sg::projection_type &a_v) |
| static const char * | sprojection_type (sg::projection_type a_v) |
| static bool | sline_pattern (const std::string &a_s, lpat &aPattern) |
Definition at line 21 of file style_parser.
| inlib::sg::style_parser::style_parser | ( | ) | [inline] |
Definition at line 23 of file style_parser.
:m_color(0,0,0) ,m_highlight_color(0,0,0) ,m_back_color(1,1,1) ,m_line_width(1) ,m_marker_size(1) ,m_font_size(10) ,m_line_pattern(line_solid) ,m_marker_style(marker_dot) ,m_area_style(area_solid) ,m_modeling(modeling_boxes()) ,m_light_model(light_model_phong()) ,m_tick_modeling(tick_modeling_hippo()) ,m_encoding(encoding_none()) ,m_smoothing(false) ,m_hinting(false) ,m_cut("") ,m_painting(painting_uniform) ,m_hatching(hatching_none) ,m_projection(projection_none) ,m_font("default") ,m_multi_node_limit(no_limit()) ,m_divisions(510) //Same as ROOT/TAttAxis ,m_rotation_steps(24) //Same as SbPolyhedron default. ,m_transparency(0) ,m_back_transparency(0) ,m_back_shadow(0) ,m_spacing(0.05F) ,m_angle(fpi()/4.0F) ,m_scale(1) ,m_offset(0) ,m_strip_width(0) ,m_visible(true) ,m_bar_offset(0.25F) ,m_bar_width(0.5F) ,m_editable(false) ,m_automated(true) ,m_options("") ,m_color_mapping("") ,m_enforced(false) ,m_translation(0,0,0) ,m_front_face(winding_ccw) ,m_hjust(left) ,m_vjust(bottom) {}
| virtual inlib::sg::style_parser::~style_parser | ( | ) | [inline, virtual] |
Definition at line 69 of file style_parser.
{}
| inlib::sg::style_parser::style_parser | ( | const style_parser & | a_from | ) | [inline] |
Definition at line 71 of file style_parser.
:m_color(a_from.m_color)
,m_highlight_color(a_from.m_highlight_color)
,m_back_color(a_from.m_back_color)
,m_line_width(a_from.m_line_width)
,m_marker_size(a_from.m_marker_size)
,m_font_size(a_from.m_font_size)
,m_line_pattern(a_from.m_line_pattern)
,m_marker_style(a_from.m_marker_style)
,m_area_style(a_from.m_area_style)
,m_modeling (a_from.m_modeling )
,m_light_model(a_from.m_light_model)
,m_tick_modeling(a_from.m_tick_modeling)
,m_encoding(a_from.m_encoding)
,m_smoothing(a_from.m_smoothing)
,m_hinting(a_from.m_hinting)
,m_cut(a_from.m_cut)
,m_painting(a_from.m_painting)
,m_hatching(a_from.m_hatching)
,m_projection(a_from.m_projection)
,m_font(a_from.m_font)
,m_multi_node_limit(a_from.m_multi_node_limit)
,m_divisions(a_from.m_divisions)
,m_rotation_steps(a_from.m_rotation_steps)
,m_transparency(a_from.m_transparency)
,m_back_transparency(a_from.m_back_transparency)
,m_back_shadow(a_from.m_back_shadow)
,m_spacing(a_from.m_spacing)
,m_angle(a_from.m_angle)
,m_scale(a_from.m_scale)
,m_offset(a_from.m_offset)
,m_strip_width(a_from.m_strip_width)
,m_visible(a_from.m_visible)
,m_bar_offset(a_from.m_bar_offset)
,m_bar_width(a_from.m_bar_width)
,m_editable(a_from.m_editable)
,m_automated(a_from.m_automated)
,m_options(a_from.m_options)
,m_color_mapping(a_from.m_color_mapping)
,m_enforced(a_from.m_enforced)
,m_translation(a_from.m_translation)
,m_front_face(a_from.m_front_face)
,m_hjust(a_from.m_hjust)
,m_vjust(a_from.m_vjust)
{}
| void inlib::sg::style_parser::angle | ( | float | a_v | ) | [inline] |
Definition at line 490 of file style_parser.
{m_angle = a_v;}
| float inlib::sg::style_parser::angle | ( | ) | const [inline] |
Definition at line 491 of file style_parser.
{return m_angle;}
| void inlib::sg::style_parser::area_style | ( | sg::area_style | a_v | ) | [inline] |
Definition at line 442 of file style_parser.
{m_area_style = a_v;}
| sg::area_style inlib::sg::style_parser::area_style | ( | ) | const [inline] |
Definition at line 443 of file style_parser.
{return m_area_style;}
| void inlib::sg::style_parser::automated | ( | bool | a_v | ) | [inline] |
Definition at line 514 of file style_parser.
{m_automated = a_v;}
| bool inlib::sg::style_parser::automated | ( | ) | const [inline] |
Definition at line 515 of file style_parser.
{return m_automated;}
| void inlib::sg::style_parser::back_color | ( | const colorf & | a_v | ) | [inline] |
Definition at line 418 of file style_parser.
{m_back_color = a_v;}
| colorf inlib::sg::style_parser::back_color | ( | ) | const [inline] |
Definition at line 419 of file style_parser.
{return m_back_color;}
| float inlib::sg::style_parser::back_shadow | ( | ) | const [inline] |
Definition at line 430 of file style_parser.
{return m_back_shadow;}
| void inlib::sg::style_parser::back_shadow | ( | float | a_v | ) | [inline] |
Definition at line 431 of file style_parser.
{m_back_shadow = a_v;}
| float inlib::sg::style_parser::back_transparency | ( | ) | const [inline] |
Definition at line 427 of file style_parser.
{return m_back_transparency;}
| void inlib::sg::style_parser::back_transparency | ( | float | a_v | ) | [inline] |
Definition at line 428 of file style_parser.
{m_back_transparency = a_v;}
| void inlib::sg::style_parser::bar_offset | ( | float | a_v | ) | [inline] |
Definition at line 496 of file style_parser.
{m_bar_offset = a_v;}
| float inlib::sg::style_parser::bar_offset | ( | ) | const [inline] |
Definition at line 497 of file style_parser.
{return m_bar_offset;}
| void inlib::sg::style_parser::bar_width | ( | float | a_v | ) | [inline] |
Definition at line 499 of file style_parser.
{m_bar_width = a_v;}
| float inlib::sg::style_parser::bar_width | ( | ) | const [inline] |
Definition at line 500 of file style_parser.
{return m_bar_width;}
| void inlib::sg::style_parser::color | ( | const colorf & | a_v | ) | [inline] |
Definition at line 412 of file style_parser.
{m_color = a_v;}
| colorf inlib::sg::style_parser::color | ( | ) | const [inline] |
Definition at line 413 of file style_parser.
{return m_color;}
| void inlib::sg::style_parser::color_mapping | ( | const std::string & | a_v | ) | [inline] |
Definition at line 523 of file style_parser.
{m_color_mapping = a_v;}
| const std::string& inlib::sg::style_parser::color_mapping | ( | ) | const [inline] |
Definition at line 524 of file style_parser.
{return m_color_mapping;}
| void inlib::sg::style_parser::copy | ( | const style_parser & | a_from | ) | [inline] |
Definition at line 121 of file style_parser.
{
m_color = a_from.m_color;
m_highlight_color = a_from.m_highlight_color;
m_back_color = a_from.m_back_color;
m_line_width = a_from.m_line_width;
m_marker_size = a_from.m_marker_size;
m_font_size = a_from.m_font_size;
m_line_pattern = a_from.m_line_pattern;
m_marker_style = a_from.m_marker_style;
m_area_style = a_from.m_area_style;
m_modeling = a_from.m_modeling ;
m_light_model = a_from.m_light_model;
m_tick_modeling = a_from.m_tick_modeling;
m_encoding = a_from.m_encoding;
m_smoothing = a_from.m_smoothing;
m_hinting = a_from.m_hinting;
m_cut = a_from.m_cut;
m_painting = a_from.m_painting;
m_hatching = a_from.m_hatching;
m_projection = a_from.m_projection;
m_font = a_from.m_font;
m_multi_node_limit = a_from.m_multi_node_limit;
m_divisions = a_from.m_divisions;
m_rotation_steps = a_from.m_rotation_steps;
m_transparency = a_from.m_transparency;
m_back_transparency = a_from.m_back_transparency;
m_back_shadow = a_from.m_back_shadow;
m_spacing = a_from.m_spacing;
m_angle = a_from.m_angle;
m_scale = a_from.m_scale;
m_offset = a_from.m_offset;
m_strip_width = a_from.m_strip_width;
m_visible = a_from.m_visible;
m_bar_offset = a_from.m_bar_offset;
m_bar_width = a_from.m_bar_width;
m_editable = a_from.m_editable;
m_automated = a_from.m_automated;
m_options = a_from.m_options;
m_color_mapping = a_from.m_color_mapping;
m_enforced = a_from.m_enforced;
m_translation = a_from.m_translation;
m_front_face = a_from.m_front_face;
m_hjust = a_from.m_hjust;
m_vjust = a_from.m_vjust;
}
| void inlib::sg::style_parser::cut | ( | const std::string & | a_v | ) | [inline] |
Definition at line 517 of file style_parser.
{m_cut = a_v;}
| const std::string& inlib::sg::style_parser::cut | ( | ) | const [inline] |
Definition at line 518 of file style_parser.
{return m_cut;}
| void inlib::sg::style_parser::divisions | ( | int | a_v | ) | [inline] |
Definition at line 478 of file style_parser.
{m_divisions = a_v;}
| int inlib::sg::style_parser::divisions | ( | ) | const [inline] |
Definition at line 479 of file style_parser.
{return m_divisions;}
| void inlib::sg::style_parser::editable | ( | bool | a_v | ) | [inline] |
Definition at line 511 of file style_parser.
{m_editable = a_v;}
| bool inlib::sg::style_parser::editable | ( | ) | const [inline] |
Definition at line 512 of file style_parser.
{return m_editable;}
| void inlib::sg::style_parser::encoding | ( | const std::string & | a_v | ) | [inline] |
Definition at line 454 of file style_parser.
{m_encoding = a_v;}
| const std::string& inlib::sg::style_parser::encoding | ( | ) | const [inline] |
Definition at line 455 of file style_parser.
{return m_encoding;}
| void inlib::sg::style_parser::enforced | ( | bool | a_v | ) | [inline] |
Definition at line 526 of file style_parser.
{m_enforced = a_v;}
| bool inlib::sg::style_parser::enforced | ( | ) | const [inline] |
Definition at line 527 of file style_parser.
{return m_enforced;}
| bool inlib::sg::style_parser::equal | ( | const style_parser & | a_from | ) | [inline] |
Definition at line 167 of file style_parser.
{
if(m_line_width!=a_from.m_line_width) return false;
if(m_marker_size!=a_from.m_marker_size) return false;
if(m_font_size!=a_from.m_font_size) return false;
if(m_line_pattern!=a_from.m_line_pattern) return false;
if(m_marker_style!=a_from.m_marker_style) return false;
if(m_area_style!=a_from.m_area_style) return false;
if(m_smoothing!=a_from.m_smoothing) return false;
if(m_hinting!=a_from.m_hinting) return false;
if(m_painting!=a_from.m_painting) return false;
if(m_hatching!=a_from.m_hatching) return false;
if(m_projection!=a_from.m_projection) return false;
if(m_multi_node_limit!=a_from.m_multi_node_limit) return false;
if(m_divisions!=a_from.m_divisions) return false;
if(m_rotation_steps!=a_from.m_rotation_steps) return false;
if(m_transparency!=a_from.m_transparency) return false;
if(m_back_transparency!=a_from.m_back_transparency) return false;
if(m_back_shadow!=a_from.m_back_shadow) return false;
if(m_spacing!=a_from.m_spacing) return false;
if(m_angle!=a_from.m_angle) return false;
if(m_scale!=a_from.m_scale) return false;
if(m_offset!=a_from.m_offset) return false;
if(m_strip_width!=a_from.m_strip_width) return false;
if(m_visible!=a_from.m_visible) return false;
if(m_bar_offset!=a_from.m_bar_offset) return false;
if(m_bar_width!=a_from.m_bar_width) return false;
if(m_editable!=a_from.m_editable) return false;
if(m_automated!=a_from.m_automated) return false;
if(m_enforced!=a_from.m_enforced) return false;
//color
if(m_color!=a_from.m_color) return false;
if(m_highlight_color!=a_from.m_highlight_color) return false;
if(m_back_color!=a_from.m_back_color) return false;
//std::string
if(m_modeling !=a_from.m_modeling ) return false;
if(m_light_model!=a_from.m_light_model) return false;
if(m_tick_modeling!=a_from.m_tick_modeling) return false;
if(m_encoding!=a_from.m_encoding) return false;
if(m_cut!=a_from.m_cut) return false;
if(m_font!=a_from.m_font) return false;
if(m_options!=a_from.m_options) return false;
if(m_color_mapping!=a_from.m_color_mapping) return false;
if(m_translation!=a_from.m_translation) return false;
if(m_front_face!=a_from.m_front_face) return false;
if(m_hjust!=a_from.m_hjust) return false;
if(m_vjust!=a_from.m_vjust) return false;
return true;
}
| void inlib::sg::style_parser::font | ( | const std::string & | a_v | ) | [inline] |
Definition at line 475 of file style_parser.
{m_font = a_v;}
| const std::string& inlib::sg::style_parser::font | ( | ) | const [inline] |
Definition at line 476 of file style_parser.
{return m_font;}
| void inlib::sg::style_parser::font_size | ( | float | a_v | ) | [inline] |
Definition at line 439 of file style_parser.
{m_font_size = a_v;}
| float inlib::sg::style_parser::font_size | ( | ) | const [inline] |
Definition at line 440 of file style_parser.
{return m_font_size;}
| void inlib::sg::style_parser::front_face | ( | winding_type | a_v | ) | [inline] |
Definition at line 532 of file style_parser.
{m_front_face = a_v;}
| winding_type inlib::sg::style_parser::front_face | ( | ) | const [inline] |
Definition at line 533 of file style_parser.
{return m_front_face;}
| sg::hatching_policy inlib::sg::style_parser::hatching | ( | ) | const [inline] |
Definition at line 466 of file style_parser.
{return m_hatching;}
| void inlib::sg::style_parser::hatching | ( | sg::hatching_policy | a_v | ) | [inline] |
Definition at line 467 of file style_parser.
{m_hatching = a_v;}
| void inlib::sg::style_parser::highlight_color | ( | const colorf & | a_v | ) | [inline] |
Definition at line 415 of file style_parser.
{m_highlight_color = a_v;}
| colorf inlib::sg::style_parser::highlight_color | ( | ) | const [inline] |
Definition at line 416 of file style_parser.
{return m_highlight_color;}
| void inlib::sg::style_parser::hinting | ( | bool | a_v | ) | [inline] |
Definition at line 460 of file style_parser.
{m_hinting = a_v;}
| bool inlib::sg::style_parser::hinting | ( | ) | const [inline] |
Definition at line 461 of file style_parser.
{return m_hinting;}
| void inlib::sg::style_parser::hjust | ( | sg::hjust | a_v | ) | [inline] |
Definition at line 535 of file style_parser.
{m_hjust = a_v;}
| sg::hjust inlib::sg::style_parser::hjust | ( | ) | const [inline] |
Definition at line 536 of file style_parser.
{return m_hjust;}
| static void inlib::sg::style_parser::hls_to_rgb | ( | float | hue, |
| float | light, | ||
| float | satur, | ||
| float & | r, | ||
| float & | g, | ||
| float & | b | ||
| ) | [inline, static] |
Definition at line 541 of file style_parser.
{
// taken from ROOT/TColor.
// Static method to compute RGB from HLS. The l and s are between [0,1]
// and h is between [0,360]. The returned r,g,b triplet is between [0,1].
float rh, rl, rs, rm1, rm2;
rh = rl = rs = 0;
if (hue > 0) rh = hue; if (rh > 360) rh = 360;
if (light > 0) rl = light; if (rl > 1) rl = 1;
if (satur > 0) rs = satur; if (rs > 1) rs = 1;
if (rl <= 0.5F) {
rm2 = rl*(1 + rs);
} else {
rm2 = rl + rs - rl*rs;
}
rm1 = 2*rl - rm2;
if (!rs) { r = rl; g = rl; b = rl; return; }
r = hls_to_rgb2(rm1, rm2, rh+120);
g = hls_to_rgb2(rm1, rm2, rh);
b = hls_to_rgb2(rm1, rm2, rh-120);
}
| void inlib::sg::style_parser::light_model | ( | const std::string & | a_v | ) | [inline] |
Definition at line 448 of file style_parser.
{m_light_model = a_v;}
| const std::string& inlib::sg::style_parser::light_model | ( | ) | const [inline] |
Definition at line 449 of file style_parser.
{return m_light_model;}
| void inlib::sg::style_parser::line_pattern | ( | lpat | a_v | ) | [inline] |
Definition at line 472 of file style_parser.
{m_line_pattern = a_v;}
| lpat inlib::sg::style_parser::line_pattern | ( | ) | const [inline] |
Definition at line 473 of file style_parser.
{return m_line_pattern;}
| void inlib::sg::style_parser::line_width | ( | float | a_v | ) | [inline] |
Definition at line 421 of file style_parser.
{m_line_width = a_v;}
| float inlib::sg::style_parser::line_width | ( | ) | const [inline] |
Definition at line 422 of file style_parser.
{return m_line_width;}
| void inlib::sg::style_parser::marker_size | ( | float | a_v | ) | [inline] |
Definition at line 436 of file style_parser.
{m_marker_size = a_v;}
| float inlib::sg::style_parser::marker_size | ( | ) | const [inline] |
Definition at line 437 of file style_parser.
{return m_marker_size;}
| void inlib::sg::style_parser::marker_style | ( | sg::marker_style | a_v | ) | [inline] |
Definition at line 433 of file style_parser.
{m_marker_style = a_v;}
| sg::marker_style inlib::sg::style_parser::marker_style | ( | ) | const [inline] |
Definition at line 434 of file style_parser.
{return m_marker_style;}
| void inlib::sg::style_parser::modeling | ( | const std::string & | a_v | ) | [inline] |
Definition at line 445 of file style_parser.
{m_modeling = a_v;}
| const std::string& inlib::sg::style_parser::modeling | ( | ) | const [inline] |
Definition at line 446 of file style_parser.
{return m_modeling ;}
| void inlib::sg::style_parser::multi_node_limit | ( | int | a_v | ) | [inline] |
Definition at line 502 of file style_parser.
{m_multi_node_limit = a_v;}
| int inlib::sg::style_parser::multi_node_limit | ( | ) | const [inline] |
Definition at line 503 of file style_parser.
{return m_multi_node_limit;}
| static int inlib::sg::style_parser::no_limit | ( | ) | [inline, static] |
Definition at line 119 of file style_parser.
{return (-1);}
| void inlib::sg::style_parser::offset | ( | float | a_v | ) | [inline] |
Definition at line 484 of file style_parser.
{m_offset = a_v;}
| float inlib::sg::style_parser::offset | ( | ) | const [inline] |
Definition at line 485 of file style_parser.
{return m_offset;}
| style_parser& inlib::sg::style_parser::operator= | ( | const style_parser & | a_from | ) | [inline] |
Definition at line 117 of file style_parser.
{copy(a_from);return *this;}
| void inlib::sg::style_parser::options | ( | const std::string & | a_v | ) | [inline] |
Definition at line 520 of file style_parser.
{m_options = a_v;}
| const std::string& inlib::sg::style_parser::options | ( | ) | const [inline] |
Definition at line 521 of file style_parser.
{return m_options;}
| sg::painting_policy inlib::sg::style_parser::painting | ( | ) | const [inline] |
Definition at line 463 of file style_parser.
{return m_painting;}
| void inlib::sg::style_parser::painting | ( | sg::painting_policy | a_v | ) | [inline] |
Definition at line 464 of file style_parser.
{m_painting = a_v;}
| bool inlib::sg::style_parser::parse | ( | std::ostream & | a_out, |
| const cmaps_t & | a_cmaps, | ||
| const std::string & | a_s | ||
| ) | [inline] |
Definition at line 946 of file style_parser.
{
// a_s = list of "name value" separated by \n
//::printf("debug : style_parser::parse : \"%s\"\n",a_s.c_str());
std::vector<std::string> lines;
get_lines(a_s,lines);
std::vector<std::string>::const_iterator it;
for(it=lines.begin();it!=lines.end();++it) {
const std::string& line = *it;
if(line.empty()) continue;
if(line=="reset") {
reset();
continue;
}
std::vector<std::string> words;
inlib::words(line," ",false,words);
unsigned int wordn = words.size();
if(!wordn) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(line)
<< " has a bad word count (at least two expected)."
<< std::endl;
return false;
}
const std::string& word0 = words[0];
if(word0=="color") {
if(wordn==2) {
const std::string& word1 = words[1];
if(!scolor(a_cmaps,word1,m_color)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(word1)
<< " not a color."
<< std::endl;
return false;
}
} else if (wordn==4) {
const std::string& rs = words[1];
float r;
if(!inlib::to<float>(rs,r)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(rs)
<< " not a number."
<< std::endl;
return false;
}
const std::string& gs = words[2];
float g;
if(!inlib::to<float>(gs,g)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(gs)
<< " not a number."
<< std::endl;
return false;
}
const std::string& bs = words[3];
float b;
if(!inlib::to<float>(bs,b)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(bs)
<< " not a number."
<< std::endl;
return false;
}
m_color.set_value(r,g,b);
} else {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(line)
<< " has a bad word count (two or four expected)."
<< std::endl;
return false;
}
} else if(word0=="highlight_color") {
if(wordn==2) {
const std::string& word1 = words[1];
if(!scolor(a_cmaps,word1,m_highlight_color)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(word1)
<< " not a color."
<< std::endl;
return false;
}
} else if (wordn==4) {
const std::string& rs = words[1];
float r;
if(!inlib::to<float>(rs,r)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(rs)
<< " not a number."
<< std::endl;
return false;
}
const std::string& gs = words[2];
float g;
if(!inlib::to<float>(gs,g)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(gs)
<< " not a number."
<< std::endl;
return false;
}
const std::string& bs = words[3];
float b;
if(!inlib::to<float>(bs,b)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(bs)
<< " not a number."
<< std::endl;
return false;
}
m_highlight_color.set_value(r,g,b);
} else {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(line)
<< " has a bad word count (two or four expected)."
<< std::endl;
return false;
}
} else if(word0=="back_color") {
if(wordn==2) {
const std::string& word1 = words[1];
if(!scolor(a_cmaps,word1,m_back_color)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(word1)
<< " not a color."
<< std::endl;
return false;
}
} else if (wordn==4) {
const std::string& rs = words[1];
float r;
if(!inlib::to<float>(rs,r)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(rs)
<< " not a number."
<< std::endl;
return false;
}
const std::string& gs = words[2];
float g;
if(!inlib::to<float>(gs,g)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(gs)
<< " not a number."
<< std::endl;
return false;
}
const std::string& bs = words[3];
float b;
if(!inlib::to<float>(bs,b)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(bs)
<< " not a number."
<< std::endl;
return false;
}
m_back_color.set_value(r,g,b);
} else {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(line)
<< " has a bad word count (two or four expected)."
<< std::endl;
return false;
}
} else if( (word0=="line_pattern") || (word0=="line_pattern") ) {
if(!check_2(wordn,a_s,line,a_out)) return false;
const std::string& word1 = words[1];
unsigned long ul;
if(!sline_pattern(word1,m_line_pattern)) {
if(!to_ulong(word1,ul)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(word1)
<< " not a line pattern."
<< std::endl;
return false;
}
m_line_pattern = (lpat)ul;
}
} else if(word0=="marker_style") {
if(!check_2(wordn,a_s,line,a_out)) return false;
const std::string& word1 = words[1];
if(!smarker_style(word1,m_marker_style)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(word1)
<< " not a marker_style."
<< std::endl;
return false;
}
} else if(word0=="area_style") {
if(!check_2(wordn,a_s,line,a_out)) return false;
const std::string& word1 = words[1];
if(!sarea_style(word1,m_area_style)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(word1)
<< " not a area_style."
<< std::endl;
return false;
}
} else if(word0=="modeling") {
if(!check_2(wordn,a_s,line,a_out)) return false;
m_modeling = words[1];
} else if(word0=="light_model") {
if(!check_2(wordn,a_s,line,a_out)) return false;
m_light_model = words[1];
} else if(word0=="tick_modeling") {
if(!check_2(wordn,a_s,line,a_out)) return false;
m_tick_modeling = words[1];
} else if(word0=="encoding") {
if(!check_2(wordn,a_s,line,a_out)) return false;
m_encoding = words[1];
} else if(word0=="smoothing") {
if(!check_2(wordn,a_s,line,a_out)) return false;
bool value;
if(!check_bool(words[1],a_s,a_out,value)) return false;
m_smoothing = value;
} else if(word0=="hinting") {
if(!check_2(wordn,a_s,line,a_out)) return false;
bool value;
if(!check_bool(words[1],a_s,a_out,value)) return false;
m_hinting = value;
} else if(word0=="enforced") {
if(!check_2(wordn,a_s,line,a_out)) return false;
bool value;
if(!check_bool(words[1],a_s,a_out,value)) return false;
m_enforced = value;
} else if(word0=="cut") {
m_cut = "";
for(unsigned int wordi=1;wordi<wordn;wordi++) {
if(wordi!=1) m_cut += " ";
m_cut += words[wordi];
}
} else if(word0=="options") {
m_options = "";
for(unsigned int wordi=1;wordi<wordn;wordi++) {
if(wordi!=1) m_options += " ";
m_options += words[wordi];
}
} else if(word0=="color_mapping") {
m_color_mapping = "";
for(unsigned int wordi=1;wordi<wordn;wordi++) {
if(wordi!=1) m_color_mapping += " ";
m_color_mapping += words[wordi];
}
} else if(word0=="painting") {
if(!check_2(wordn,a_s,line,a_out)) return false;
if(!spainting_policy(words[1],m_painting)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(words[1])
<< " not a painting_policy."
<< std::endl;
return false;
}
} else if(word0=="hatching") {
if(!check_2(wordn,a_s,line,a_out)) return false;
if(!shatching_policy(words[1],m_hatching)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(words[1])
<< " not a hatching_policy."
<< std::endl;
return false;
}
} else if(word0=="projection") {
if(!check_2(wordn,a_s,line,a_out)) return false;
if(!sprojection_type(words[1],m_projection)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(words[1])
<< " not a projection_type."
<< std::endl;
return false;
}
} else if(word0=="font") {
if(!check_2(wordn,a_s,line,a_out)) return false;
font(words[1]);
} else if(word0=="line_width") {
if(!check_2(wordn,a_s,line,a_out)) return false;
float value;
if(!check_float(words[1],a_s,a_out,value)) return false;
m_line_width = value;
} else if(word0=="marker_size") {
if(!check_2(wordn,a_s,line,a_out)) return false;
float value;
if(!check_float(words[1],a_s,a_out,value)) return false;
m_marker_size = value;
} else if(word0=="font_size") {
if(!check_2(wordn,a_s,line,a_out)) return false;
float value;
if(!check_float(words[1],a_s,a_out,value)) return false;
m_font_size = value;
} else if(word0=="transparency") {
if(!check_2(wordn,a_s,line,a_out)) return false;
float value;
if(!check_float(words[1],a_s,a_out,value)) return false;
if(value<0.F) value = 0.F;
m_transparency = value;
} else if(word0=="back_transparency") {
if(!check_2(wordn,a_s,line,a_out)) return false;
float value;
if(!check_float(words[1],a_s,a_out,value)) return false;
if(value<0.F) value = 0.F;
m_back_transparency = value;
} else if(word0=="back_shadow") {
if(!check_2(wordn,a_s,line,a_out)) return false;
float value;
if(!check_float(words[1],a_s,a_out,value)) return false;
if(value<0.F) value = 0.F;
m_back_shadow = value;
} else if(word0=="multi_node_limit") {
if(!check_2(wordn,a_s,line,a_out)) return false;
int value;
if(!check_int(words[1],a_s,a_out,value)) return false;
m_multi_node_limit = value;
} else if(word0=="divisions") {
if(!check_2(wordn,a_s,line,a_out)) return false;
int value;
if(!check_int(words[1],a_s,a_out,value)) return false;
m_divisions = value;
} else if(word0=="rotation_steps") {
if(!check_2(wordn,a_s,line,a_out)) return false;
unsigned int value;
if(!check_uint(words[1],a_s,a_out,value)) return false;
m_rotation_steps = value;
} else if(word0=="angle") {
if(!check_2(wordn,a_s,line,a_out)) return false;
float value;
if(!check_float(words[1],a_s,a_out,value)) return false;
m_angle = value;
} else if(word0=="scale") {
if(!check_2(wordn,a_s,line,a_out)) return false;
float value;
if(!check_float(words[1],a_s,a_out,value)) return false;
m_scale = value;
} else if(word0=="offset") {
if(!check_2(wordn,a_s,line,a_out)) return false;
float value;
if(!check_float(words[1],a_s,a_out,value)) return false;
m_offset = value;
} else if(word0=="strip_width") {
if(!check_2(wordn,a_s,line,a_out)) return false;
float value;
if(!check_float(words[1],a_s,a_out,value)) return false;
m_strip_width = value;
} else if(word0=="spacing") {
if(!check_2(wordn,a_s,line,a_out)) return false;
float value;
if(!check_float(words[1],a_s,a_out,value)) return false;
m_spacing = value;
} else if(word0=="visible") {
if(!check_2(wordn,a_s,line,a_out)) return false;
bool value;
if(!check_bool(words[1],a_s,a_out,value)) return false;
m_visible = value;
} else if(word0=="editable") {
if(!check_2(wordn,a_s,line,a_out)) return false;
bool value;
if(!check_bool(words[1],a_s,a_out,value)) return false;
m_editable = value;
} else if(word0=="automated") {
if(!check_2(wordn,a_s,line,a_out)) return false;
bool value;
if(!check_bool(words[1],a_s,a_out,value)) return false;
m_automated = value;
} else if(word0=="bar_offset") {
if(!check_2(wordn,a_s,line,a_out)) return false;
float value;
if(!check_float(words[1],a_s,a_out,value)) return false;
m_bar_offset = value;
} else if(word0=="bar_width") {
if(!check_2(wordn,a_s,line,a_out)) return false;
float value;
if(!check_float(words[1],a_s,a_out,value)) return false;
m_bar_width = value;
} else if(word0=="translation") {
if (wordn==4) {
const std::string& sx = words[1];
float x;
if(!inlib::to<float>(sx,x)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(sx)
<< " not a number."
<< std::endl;
return false;
}
const std::string& sy = words[2];
float y;
if(!inlib::to<float>(sy,y)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(sy)
<< " not a number."
<< std::endl;
return false;
}
const std::string& sz = words[3];
float z;
if(!inlib::to<float>(sz,z)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(sz)
<< " not a number."
<< std::endl;
return false;
}
m_translation.set_value(x,y,z);
} else {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " has a bad word count (four expected)."
<< std::endl;
return false;
}
} else if(word0=="front_face") {
if(!check_2(wordn,a_s,line,a_out)) return false;
const std::string& word1 = words[1];
if(word1=="ccw") {
m_front_face = winding_ccw;
} else if(word1=="cw") {
m_front_face = winding_cw;
} else { //ccw
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(word1)
<< " not a winding type."
<< std::endl;
return false;
}
} else if(word0=="hjust") {
if(!check_2(wordn,a_s,line,a_out)) return false;
const std::string& word1 = words[1];
if(!shjust(word1,m_hjust)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(word1)
<< " not a hjust."
<< std::endl;
return false;
}
} else if(word0=="vjust") {
if(!check_2(wordn,a_s,line,a_out)) return false;
const std::string& word1 = words[1];
if(!svjust(word1,m_vjust)) {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(word1)
<< " not a vjust."
<< std::endl;
return false;
}
} else {
a_out << "style_parser::parse :"
<< " in " << inlib::sout(a_s)
<< " : " << inlib::sout(word0)
<< " bad option."
<< std::endl;
return false;
}
}
return true;
}
| sg::projection_type inlib::sg::style_parser::projection | ( | ) | const [inline] |
Definition at line 469 of file style_parser.
{return m_projection;}
| void inlib::sg::style_parser::projection | ( | sg::projection_type | a_v | ) | [inline] |
Definition at line 470 of file style_parser.
{m_projection = a_v;}
| virtual void inlib::sg::style_parser::reset | ( | ) | [inline, virtual] |
Definition at line 222 of file style_parser.
{ //virtual because of SoGC
m_color = colorf::black();
m_highlight_color = colorf::lightgrey();
m_back_color = colorf::white();
m_line_width = 1;
m_marker_size = 1;
m_font_size = 10;
m_line_pattern = line_solid;
m_marker_style = marker_dot;
m_area_style = area_solid;
m_modeling = modeling_boxes();
m_light_model = light_model_phong();
m_tick_modeling = tick_modeling_hippo();
m_encoding = encoding_none();
m_smoothing = false;
m_hinting = false;
m_cut = "";
m_painting = painting_uniform;
m_hatching = hatching_none;
m_projection = projection_none;
m_font = "default";
m_multi_node_limit = no_limit();
m_transparency = 0;
m_back_transparency = 0;
m_back_shadow = 0;
m_divisions = 510;
m_rotation_steps = 24;
m_spacing = 0.05F;
m_angle = fpi()/4;
m_scale = 1;
m_offset = 0;
m_strip_width = 0;
m_visible = true;
m_bar_offset = 0.25F;
m_bar_width = 0.5F;
m_editable = false;
m_automated = true;
m_options = "";
m_color_mapping = "";
m_enforced = false;
m_translation = vec3f(0,0,0);
m_front_face = winding_ccw;
m_hjust = left;
m_vjust = bottom;
}
| void inlib::sg::style_parser::rotation_steps | ( | unsigned int | a_v | ) | [inline] |
Definition at line 481 of file style_parser.
{m_rotation_steps = a_v;}
| unsigned int inlib::sg::style_parser::rotation_steps | ( | ) | const [inline] |
Definition at line 482 of file style_parser.
{return m_rotation_steps;}
| static bool inlib::sg::style_parser::sarea_style | ( | const std::string & | a_s, |
| sg::area_style & | a_v | ||
| ) | [inline, static] |
Definition at line 783 of file style_parser.
{
unsigned int number;
const AreaStyle* list = getAreaStyleList(number);
for(unsigned int count=0;count<number;count++) {
if(a_s==list[count].string) {
a_v = list[count].value;
return true;
}
}
a_v = area_solid;
return false;
}
| static const char* inlib::sg::style_parser::sarea_style | ( | sg::area_style | a_v | ) | [inline, static] |
Definition at line 795 of file style_parser.
{
unsigned int number;
const AreaStyle* list = getAreaStyleList(number);
for(unsigned int count=0;count<number;count++) {
if(a_v==list[count].value) return list[count].string;
}
return 0;
}
| void inlib::sg::style_parser::scale | ( | float | a_v | ) | [inline] |
Definition at line 493 of file style_parser.
{m_scale = a_v;}
| float inlib::sg::style_parser::scale | ( | ) | const [inline] |
Definition at line 494 of file style_parser.
{return m_scale;}
| static bool inlib::sg::style_parser::scolor | ( | const cmaps_t & | a_cmaps, |
| const std::string & | a_s, | ||
| colorf & | a_col | ||
| ) | [inline, static] |
Definition at line 566 of file style_parser.
{
//NOTE : if ret false, we do not set a_col to something.
std::string::size_type pos_slash = a_s.rfind('/');
if(pos_slash!=std::string::npos) { //<cmap>/<color name>
std::string cmap = a_s.substr(0,pos_slash);
std::string cnam = a_s.substr(pos_slash+1,a_s.size()-(pos_slash+1));
typedef inlib::sg::style_colormap cmap_t;
cmaps_t::const_iterator it = a_cmaps.find(cmap);
if(it==a_cmaps.end()) return false;
return (*it).second.get_color(cnam,a_col);
} else {
if( (a_s.size()==7) && (a_s[0]=='#') ) {
// #RRGGBB format :
// 1 3 5
unsigned long rr,gg,bb;
{std::string s("0x");
s += a_s.substr(1,2);
if(!to_ulong(s,rr)) return false;}
{std::string s("0x");
s += a_s.substr(3,2);
if(!to_ulong(s,gg)) return false;}
{std::string s("0x");
s += a_s.substr(5,2);
if(!to_ulong(s,bb)) return false;}
a_col = colorf(((float)rr)/255,((float)gg)/255,((float)bb)/255);
return true;
}
// Look if three floats :
{std::vector<std::string> words;
inlib::words(a_s," ",false,words);
if(words.size()==3) {
std::string& word_0 = words[0];
std::string& word_1 = words[1];
std::string& word_2 = words[2];
float r,g,b;
if( inlib::to<float>(word_0,r) &&
inlib::to<float>(word_1,g) &&
inlib::to<float>(word_2,b) ){
a_col = colorf(r,g,b);
return true;
}
}}
{float r,g,b;
if(inlib::colorf::to(a_s,r,g,b)) { //still use that ? cmap "default" ?
a_col = colorf(r,g,b);
return true;
}}
}
return false;
}
| static bool inlib::sg::style_parser::scolor | ( | const colorf & | a_col, |
| std::string & | a_s | ||
| ) | [inline, static] |
Definition at line 629 of file style_parser.
{
char s[256];
#ifdef WIN32
_snprintf(s,sizeof(s),"%g %g %g",a_col[0],a_col[1],a_col[2]);
#else
::snprintf(s,sizeof(s),"%g %g %g",a_col[0],a_col[1],a_col[2]);
#endif
a_s = s;
return true;
}
| static bool inlib::sg::style_parser::shatching_policy | ( | const std::string & | a_s, |
| sg::hatching_policy & | a_v | ||
| ) | [inline, static] |
Definition at line 861 of file style_parser.
{
unsigned int number;
const HatchingPolicy* list = getHatchingPolicyList(number);
for(unsigned int count=0;count<number;count++) {
if(a_s==list[count].string) {
a_v = list[count].value;
return true;
}
}
a_v = hatching_none;
return false;
}
| static const char* inlib::sg::style_parser::shatching_policy | ( | sg::hatching_policy | a_v | ) | [inline, static] |
Definition at line 875 of file style_parser.
{
unsigned int number;
const HatchingPolicy* list = getHatchingPolicyList(number);
for(unsigned int count=0;count<number;count++) {
if(a_v==list[count].value) return list[count].string;
}
return 0;
}
| static bool inlib::sg::style_parser::shjust | ( | const std::string & | a_s, |
| sg::hjust & | a_v | ||
| ) | [inline, static] |
Definition at line 655 of file style_parser.
{
unsigned int number;
const hjust_rec* list = hjust_recs(number);
for(unsigned int count=0;count<number;count++) {
if(a_s==list[count].string) {
a_v = list[count].value;
return true;
}
}
a_v = sg::left;
return false;
}
| static const char* inlib::sg::style_parser::shjust | ( | sg::hjust | a_v | ) | [inline, static] |
Definition at line 667 of file style_parser.
{
unsigned int number;
const hjust_rec* list = hjust_recs(number);
for(unsigned int count=0;count<number;count++) {
if(a_v==list[count].value) return list[count].string;
}
return 0;
}
| static bool inlib::sg::style_parser::sline_pattern | ( | const std::string & | a_s, |
| lpat & | aPattern | ||
| ) | [inline, static] |
Definition at line 926 of file style_parser.
{
if(a_s=="solid") {
aPattern = line_solid;
} else if(a_s=="dashed") {
aPattern = line_dashed;
} else if(a_s=="dotted") {
aPattern = line_dotted;
} else if(a_s=="dash_dotted") {
aPattern = line_dash_dotted;
} else {
aPattern = line_solid;
return false;
}
return true;
}
| static bool inlib::sg::style_parser::smarker_style | ( | const std::string & | a_s, |
| sg::marker_style & | a_v | ||
| ) | [inline, static] |
Definition at line 745 of file style_parser.
{
unsigned int number;
const MarkerStyle* list = getMarkerStyleList(number);
for(unsigned int count=0;count<number;count++) {
if(a_s==list[count].string) {
a_v = list[count].value;
return true;
}
}
a_v = marker_dot;
return false;
}
| static const char* inlib::sg::style_parser::smarker_style | ( | sg::marker_style | a_v | ) | [inline, static] |
Definition at line 758 of file style_parser.
{
unsigned int number;
const MarkerStyle* list = getMarkerStyleList(number);
for(unsigned int count=0;count<number;count++) {
if(a_v==list[count].value) return list[count].string;
}
return 0;
}
| void inlib::sg::style_parser::smoothing | ( | bool | a_v | ) | [inline] |
Definition at line 457 of file style_parser.
{m_smoothing = a_v;}
| bool inlib::sg::style_parser::smoothing | ( | ) | const [inline] |
Definition at line 458 of file style_parser.
{return m_smoothing;}
| void inlib::sg::style_parser::spacing | ( | float | a_v | ) | [inline] |
Definition at line 505 of file style_parser.
{m_spacing = a_v;}
| float inlib::sg::style_parser::spacing | ( | ) | const [inline] |
Definition at line 506 of file style_parser.
{return m_spacing;}
| static bool inlib::sg::style_parser::spainting_policy | ( | const std::string & | a_s, |
| sg::painting_policy & | a_v | ||
| ) | [inline, static] |
Definition at line 822 of file style_parser.
{
unsigned int number;
const PaintingPolicy* list = getPaintingPolicyList(number);
for(unsigned int count=0;count<number;count++) {
if(a_s==list[count].string) {
a_v = list[count].value;
return true;
}
}
a_v = painting_uniform;
return false;
}
| static const char* inlib::sg::style_parser::spainting_policy | ( | sg::painting_policy | a_v | ) | [inline, static] |
Definition at line 835 of file style_parser.
{
unsigned int number;
const PaintingPolicy* list = getPaintingPolicyList(number);
for(unsigned int count=0;count<number;count++) {
if(a_v==list[count].value) return list[count].string;
}
return 0;
}
| static bool inlib::sg::style_parser::sprojection_type | ( | const std::string & | a_s, |
| sg::projection_type & | a_v | ||
| ) | [inline, static] |
Definition at line 901 of file style_parser.
{
unsigned int number;
const ProjectionType* list = getProjectionTypeList(number);
for(unsigned int count=0;count<number;count++) {
if(a_s==list[count].string) {
a_v = list[count].value;
return true;
}
}
a_v = projection_none;
return false;
}
| static const char* inlib::sg::style_parser::sprojection_type | ( | sg::projection_type | a_v | ) | [inline, static] |
Definition at line 914 of file style_parser.
{
unsigned int number;
const ProjectionType* list = getProjectionTypeList(number);
for(unsigned int count=0;count<number;count++) {
if(a_v==list[count].value) return list[count].string;
}
return 0;
}
| void inlib::sg::style_parser::strip_width | ( | float | a_v | ) | [inline] |
Definition at line 487 of file style_parser.
{m_strip_width = a_v;}
| float inlib::sg::style_parser::strip_width | ( | ) | const [inline] |
Definition at line 488 of file style_parser.
{return m_strip_width;}
| static bool inlib::sg::style_parser::svjust | ( | const std::string & | a_s, |
| sg::vjust & | a_v | ||
| ) | [inline, static] |
Definition at line 691 of file style_parser.
{
unsigned int number;
const vjust_rec* list = vjust_recs(number);
for(unsigned int count=0;count<number;count++) {
if(a_s==list[count].string) {
a_v = list[count].value;
return true;
}
}
a_v = sg::bottom;
return false;
}
| static const char* inlib::sg::style_parser::svjust | ( | sg::vjust | a_v | ) | [inline, static] |
Definition at line 703 of file style_parser.
{
unsigned int number;
const vjust_rec* list = vjust_recs(number);
for(unsigned int count=0;count<number;count++) {
if(a_v==list[count].value) return list[count].string;
}
return 0;
}
| void inlib::sg::style_parser::tick_modeling | ( | const std::string & | a_v | ) | [inline] |
Definition at line 451 of file style_parser.
{m_tick_modeling = a_v;}
| const std::string& inlib::sg::style_parser::tick_modeling | ( | ) | const [inline] |
Definition at line 452 of file style_parser.
{return m_tick_modeling;}
| std::string inlib::sg::style_parser::tos | ( | ) | const [inline] |
Definition at line 268 of file style_parser.
{
char ss[23 * 32];
#ifdef WIN32
_snprintf(ss,sizeof(ss),
#else
::snprintf(ss,sizeof(ss),
#endif
"color %g %g %g\n\
highlight_color %g %g %g\n\
back_color %g %g %g\n\
line_width %g\n\
marker_size %g\n\
font_size %g\n\
line_pattern %x\n\
multi_node_limit %d\n\
transparency %g\n\
back_transparency %g\n\
back_shadow %g\n\
divisions %d\n\
rotation_steps %d\n\
angle %g\n\
scale %g\n\
offset %g\n\
strip_width %g\n\
spacing %g\n\
bar_offset %g\n\
bar_width %g\n\
translation %g %g %g"
,m_color[0],m_color[1],m_color[2]
,m_highlight_color[0],m_highlight_color[1],m_highlight_color[2]
,m_back_color[0],m_back_color[1],m_back_color[2]
,m_line_width
,m_marker_size
,m_font_size
,m_line_pattern
,m_multi_node_limit
,m_transparency
,m_back_transparency
,m_back_shadow
,m_divisions
,m_rotation_steps
,m_angle
,m_scale
,m_offset
,m_strip_width
,m_spacing
,m_bar_offset
,m_bar_width
,m_translation[0],m_translation[1],m_translation[2]);
std::string lf("\n");
std::string s(ss);
s += lf;
s += "smoothing ";
s += (m_smoothing?"true":"false");
s += lf;
s += "hinting ";
s += (m_hinting?"true":"false");
s += lf;
s += "enforced ";
s += (m_enforced?"true":"false");
s += lf;
s += "visible ";
s += (m_visible?"true":"false");
s += lf;
s += "editable ";
s += (m_editable?"true":"false");
s += lf;
s += "automated ";
s += (m_automated?"true":"false");
s += lf;
s += "marker_style ";
s += smarker_style(m_marker_style);
s += lf;
s += "area_style ";
s += sarea_style(m_area_style);
s += lf;
s += "modeling ";
s += m_modeling ;
s += lf;
s += "light_model ";
s += m_light_model;
s += lf;
s += "tick_modeling ";
s += m_tick_modeling;
s += lf;
s += "encoding ";
s += m_encoding;
s += lf;
s += "cut ";
s += m_cut;
s += lf;
s += "painting ";
s += spainting_policy(m_painting);
s += lf;
s += "hatching ";
s += shatching_policy(m_hatching);
s += lf;
s += "projection ";
s += sprojection_type(m_projection);
s += lf;
s += "font ";
s += m_font;
s += lf;
s += "options ";
s += m_options;
s += lf;
s += "color_mapping ";
s += m_color_mapping;
s += lf;
s += "front_face ";
s += (m_front_face==winding_ccw?"ccw":"cw");
s += lf;
s += "hjust ";
s += shjust(m_hjust);
s += lf;
s += "vjust ";
s += svjust(m_vjust);
return s;
}
| void inlib::sg::style_parser::translation | ( | const vec3f & | a_v | ) | [inline] |
Definition at line 529 of file style_parser.
{m_translation = a_v;}
| vec3f inlib::sg::style_parser::translation | ( | ) | const [inline] |
Definition at line 530 of file style_parser.
{return m_translation;}
| float inlib::sg::style_parser::transparency | ( | ) | const [inline] |
Definition at line 424 of file style_parser.
{return m_transparency;}
| void inlib::sg::style_parser::transparency | ( | float | a_v | ) | [inline] |
Definition at line 425 of file style_parser.
{m_transparency = a_v;}
| void inlib::sg::style_parser::visible | ( | bool | a_v | ) | [inline] |
Definition at line 508 of file style_parser.
{m_visible = a_v;}
| bool inlib::sg::style_parser::visible | ( | ) | const [inline] |
Definition at line 509 of file style_parser.
{return m_visible;}
| void inlib::sg::style_parser::vjust | ( | sg::vjust | a_v | ) | [inline] |
Definition at line 538 of file style_parser.
{m_vjust = a_v;}
| sg::vjust inlib::sg::style_parser::vjust | ( | ) | const [inline] |
Definition at line 539 of file style_parser.
{return m_vjust;}
1.7.5.1