Objective: We now need to populate ellipse to achieve the depiction of Taiji.

Source: Internet
Author: User

MFC depicts Taiji figure can use Pie for round filling, but how AGG can depict the semicircle, and then fill the semicircle, currently found Agg::ellipse can not be this big.

inline unsigned Ellipse::vertex (double* x, double* y)

{

if (M_step = = M_num)

{

++m_step;

return Path_cmd_end_poly | Path_flags_close | PATH_FLAGS_CCW;

}

if (M_step > M_num) return path_cmd_stop;

Double angle = double (m_step)/double (m_num) * 2.0 * PI;

if (M_CW) angle = 2.0 * Pi-angle;

*x = m_x + cos (angle) * M_RX;

*y = m_y + sin (angle) * M_RY;

m_step++;

Return ((M_step = = 1)? path_cmd_move_to:path_cmd_line_to);

}

currently even by modifying agg::ellipse 's function code as above:

To modify a row:

Double angle =double (m_step)/double (m_num) * 1.0 * PI;

Depict half the angle, just show semicircle!!

It is then able to depict a semicircle and fill, but here is a problem where the semicircular position needs to be adjusted and slightly rotated according to the center of the circle. Here's the problem:

The previous section has explained that the rotation of the rotate function for the Agg::trans_affine class is completely uncontrollable and does not know where to go!!!


Objective: We now need to populate ellipse to achieve the depiction of Taiji.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.