an SVG tag to group elements. More...
#include <bsvg_element.h>
Public Types | |
typedef vcl_vector < bxml_data_sptr > ::const_iterator | const_data_iterator |
typedef vcl_map< vcl_string, vcl_string >::const_iterator | const_attr_iterator |
enum | datatype { TEXT, ELEMENT } |
Public Member Functions | |
bsvg_group () | |
bool | add_element (const bxml_data_sptr &element) |
void | set_transformation (float trans_x, float trans_y, float rot_angle) |
rotation angle is specified in degrees, e.g. 90. | |
void | set_location (float trans_x, float trans_y) |
void | set_rotation (float rot_angle) |
adds rotation to an existing translation if any angle is specified in degrees, e.g. 90. | |
void | set_fill_color (const vcl_string &c) |
void | set_fill_color (unsigned red, unsigned green, unsigned blue) |
turns the given red, green, blue values in range [0,255] to #00 00 00 notation (Hex color) for each color. | |
void | set_stroke_color (const vcl_string &c) |
void | set_stroke_color (unsigned red, unsigned green, unsigned blue) |
turns the given red, green, blue values in range [0,255] to #00 00 00 notation (Hex color) for each color. | |
void | set_stroke_width (float w) |
void | set_fill_opacity (float o) |
0 <= opacity <= 1. | |
void | set_stroke_opacity (float o) |
0 <= opacity <= 1. | |
datatype | type () const |
Return the type of XML data. | |
vcl_string | name () const |
Return the name of the element. | |
vcl_string | attribute (const vcl_string &attr_name) const |
Return the value of an attribute. | |
bool | get_attribute (const vcl_string &attr_name, vcl_string &value) const |
Specialization for vcl_string. | |
template<class T > | |
bool | get_attribute (const vcl_string &attr_name, T &value) const |
Return the value of an attribute. | |
vcl_vector< vcl_string > | attributes (const vcl_string &attr_name) const |
Return the values of all attributes with a given name. | |
bool | get_attributea (const vcl_string &attr_name, vcl_vector< vcl_string > &values) const |
Specialization for vcl_string. | |
template<class T > | |
bool | get_attributes (const vcl_string &attr_name, vcl_vector< T > &values) const |
Return the value of an attribute. | |
unsigned int | num_attributes () const |
Return the number of attributes. | |
const_attr_iterator | attr_begin () const |
An iterator to the beginning of the attributes. | |
const_attr_iterator | attr_end () const |
An iterator to the end of the attributes. | |
unsigned int | num_data () const |
Return the number of data nodes. | |
const_data_iterator | data_begin () const |
An iterator to the beginning of the data. | |
const_data_iterator | data_end () const |
An iterator to the end of the data. | |
void | append_text (const vcl_string &text) |
Append text in this element. | |
void | append_data (const bxml_data_sptr &el) |
Append data (typically another element) in this element. | |
template<class T > | |
void | set_attribute (const vcl_string &attr_name, const T &attr_value, unsigned p=5) |
Set attribute with and optional precision. | |
void | set_attribute (const vcl_string &attr_name, const vcl_string &attr_value) |
Specialization for vcl_string below. | |
void | ref () |
void | unref () |
int | get_references () const |
bool | is_referenced () const |
an SVG tag to group elements.
e.g. define a group translation and rotation then apply it to all the members of the group or define a stroke-color, fill opacity etc. once and apply it to all the group
Definition at line 54 of file bsvg_element.h.
typedef vcl_map<vcl_string,vcl_string>::const_iterator bxml_element::const_attr_iterator [inherited] |
Definition at line 77 of file bxml_document.h.
typedef vcl_vector<bxml_data_sptr>::const_iterator bxml_element::const_data_iterator [inherited] |
Definition at line 76 of file bxml_document.h.
enum bxml_data::datatype [inherited] |
Definition at line 33 of file bxml_document.h.
bsvg_group::bsvg_group | ( | ) | [inline] |
Definition at line 57 of file bsvg_element.h.
bool bsvg_group::add_element | ( | const bxml_data_sptr & | element | ) | [inline] |
Definition at line 58 of file bsvg_element.h.
void bxml_element::append_data | ( | const bxml_data_sptr & | el | ) | [inline, inherited] |
Append data (typically another element) in this element.
Definition at line 168 of file bxml_document.h.
void bxml_element::append_text | ( | const vcl_string & | text | ) | [inherited] |
Append text in this element.
Definition at line 35 of file bxml_document.cxx.
const_attr_iterator bxml_element::attr_begin | ( | ) | const [inline, inherited] |
An iterator to the beginning of the attributes.
Definition at line 150 of file bxml_document.h.
const_attr_iterator bxml_element::attr_end | ( | ) | const [inline, inherited] |
An iterator to the end of the attributes.
Definition at line 153 of file bxml_document.h.
vcl_string bxml_element::attribute | ( | const vcl_string & | attr_name | ) | const [inherited] |
Return the value of an attribute.
Definition at line 15 of file bxml_document.cxx.
vcl_vector<vcl_string> bxml_element::attributes | ( | const vcl_string & | attr_name | ) | const [inherited] |
Return the values of all attributes with a given name.
const_data_iterator bxml_element::data_begin | ( | ) | const [inline, inherited] |
An iterator to the beginning of the data.
Definition at line 159 of file bxml_document.h.
const_data_iterator bxml_element::data_end | ( | ) | const [inline, inherited] |
An iterator to the end of the data.
Definition at line 162 of file bxml_document.h.
bool bxml_element::get_attribute | ( | const vcl_string & | attr_name, |
vcl_string & | value | ||
) | const [inline, inherited] |
Specialization for vcl_string.
Definition at line 98 of file bxml_document.h.
bool bxml_element::get_attribute | ( | const vcl_string & | attr_name, |
T & | value | ||
) | const [inline, inherited] |
Return the value of an attribute.
Definition at line 107 of file bxml_document.h.
bool bxml_element::get_attributea | ( | const vcl_string & | attr_name, |
vcl_vector< vcl_string > & | values | ||
) | const [inline, inherited] |
Specialization for vcl_string.
Definition at line 121 of file bxml_document.h.
bool bxml_element::get_attributes | ( | const vcl_string & | attr_name, |
vcl_vector< T > & | values | ||
) | const [inline, inherited] |
Return the value of an attribute.
Definition at line 130 of file bxml_document.h.
vcl_string bxml_element::name | ( | ) | const [inline, inherited] |
Return the name of the element.
Definition at line 92 of file bxml_document.h.
unsigned int bxml_element::num_attributes | ( | ) | const [inline, inherited] |
Return the number of attributes.
Definition at line 147 of file bxml_document.h.
unsigned int bxml_element::num_data | ( | ) | const [inline, inherited] |
Return the number of data nodes.
Definition at line 156 of file bxml_document.h.
void bxml_element::set_attribute | ( | const vcl_string & | attr_name, |
const T & | attr_value, | ||
unsigned | p = 5 |
||
) | [inline, inherited] |
Set attribute with and optional precision.
Definition at line 173 of file bxml_document.h.
void bxml_element::set_attribute | ( | const vcl_string & | attr_name, |
const vcl_string & | attr_value | ||
) | [inline, inherited] |
Specialization for vcl_string below.
Definition at line 181 of file bxml_document.h.
void bsvg_element::set_fill_color | ( | const vcl_string & | c | ) | [inherited] |
Definition at line 39 of file bsvg_element.cxx.
void bsvg_element::set_fill_color | ( | unsigned | red, |
unsigned | green, | ||
unsigned | blue | ||
) | [inherited] |
turns the given red, green, blue values in range [0,255] to #00 00 00 notation (Hex color) for each color.
turns the given red, green, blue values in range [0,255] to #00 00 00 notation (Hex color) four bytes for each color.
Definition at line 76 of file bsvg_element.cxx.
void bsvg_element::set_fill_opacity | ( | float | o | ) | [inherited] |
0 <= opacity <= 1.
Definition at line 101 of file bsvg_element.cxx.
void bsvg_element::set_location | ( | float | trans_x, |
float | trans_y | ||
) | [inherited] |
Definition at line 17 of file bsvg_element.cxx.
void bsvg_element::set_rotation | ( | float | rot_angle | ) | [inherited] |
adds rotation to an existing translation if any angle is specified in degrees, e.g. 90.
adds rotation to an existing translation if any.
Definition at line 25 of file bsvg_element.cxx.
void bsvg_element::set_stroke_color | ( | const vcl_string & | c | ) | [inherited] |
Definition at line 82 of file bsvg_element.cxx.
void bsvg_element::set_stroke_color | ( | unsigned | red, |
unsigned | green, | ||
unsigned | blue | ||
) | [inherited] |
turns the given red, green, blue values in range [0,255] to #00 00 00 notation (Hex color) for each color.
turns the given red, green, blue values in range [0,255] to #00 00 00 notation (Hex color) four bytes for each color.
Definition at line 88 of file bsvg_element.cxx.
void bsvg_element::set_stroke_opacity | ( | float | o | ) | [inherited] |
0 <= opacity <= 1.
Definition at line 108 of file bsvg_element.cxx.
void bsvg_element::set_stroke_width | ( | float | w | ) | [inherited] |
Definition at line 94 of file bsvg_element.cxx.
void bsvg_element::set_transformation | ( | float | trans_x, |
float | trans_y, | ||
float | rot_angle | ||
) | [inherited] |
rotation angle is specified in degrees, e.g. 90.
Definition at line 10 of file bsvg_element.cxx.
datatype bxml_element::type | ( | ) | const [inline, virtual, inherited] |