For the agg font for a very simple introduction, the following is a simple description of the agg line.
first for drawing lines, there are several lines such as ordinary lines, actual lines, lattice-like lines. Agg is supported for each line. In addition to the beginning of the line of the end of the style there are several, this property is usually identified by LineCap. It works only if you are drawing a wider segment. The legal value of this property is shown in the following table. The default value is: "Butt". The default value of "butt" specifies that the line segment should not have a cap. The end point of the line is straight and perpendicular to the direction of the line, this segment does not extend beyond its endpoint; "Round" specifies that the line segment should have a semicircle cap, the semicircle diameter equals the width of the segment, and the segment extends beyond the endpoint by half the width of the line; "Square" This value indicates that the line segment should have a rectangular cap. This value is the same as "butt", but the segment extends half of its width. There are also three attributes corresponding to the
in agg.
Below we introduce the method of drawing the agg line. For Agg, the main implementation of the virtual line is in the AGG_CONV_DASH.H header file, you can see that it mainly provides a number of methods
template<class Vertexsource, class markers=null_markers> struct conv_dash:public con
V_adaptor_vcgen<vertexsource, Vcgen_dash, markers> {typedef markers MARKER_TYPE;
typedef conv_adaptor_vcgen<vertexsource, Vcgen_dash, markers> Base_type;
Conv_dash (vertexsource& vs): Conv_adaptor_vcgen<vertexsource, Vcgen_dash, markers> (VS) {
} void Remove_all_dashes () {base_type::generator (). Remove_all_dashes (); } void Add_dash (double dash_len, double gap_len) {Base_type::generator (). Add_dash (Dash_len
, Gap_len);
} void Dash_start (double ds) {Base_type::generator (). Dash_start (DS);
} void Shorten (double s) {Base_type::generator (). Shorten (s);} Double Shorten () const {return Base_type::generator (). Shorten ();}
The main purpose of the
in our development is to use the Add_dash method, which accepts two parameters, which can be easily discerned by the name of the parameter.