Skip to content

Commit

Permalink
[graphics] draw_pie for IPE
Browse files Browse the repository at this point in the history
  • Loading branch information
godardma committed Nov 4, 2024
1 parent 03dead1 commit a4d1b46
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/graphics/3rd/ipe/codac2_Figure2D_IPE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,20 @@ void Figure2D_IPE::draw_pie(const Vector& c, const Interval& r, const Interval&
{
assert(_fig.size() <= c.size());
assert(r.lb() >= 0.);
// Not implemented yet

begin_path(s);

_f_temp_content << scale_x(c[0] + r.lb() * cos(theta.lb()).mid()) << " " << scale_y(c[1] + r.lb() * sin(theta.lb()).mid()) << " m \n";
_f_temp_content << scale_x(c[0] + r.ub() * cos(theta.lb()).mid()) << " " << scale_y(c[1] + r.ub() * sin(theta.lb()).mid()) << " l \n";
_f_temp_content << scale_length(r.ub()) << " 0 0 " << scale_length(r.ub()) << " "
<< scale_x(c[i()]) << " " << scale_y(c[j()]) << " "
<< scale_x(c[0] + r.ub() * cos(theta.ub()).mid()) << " " << scale_y(c[1] + r.ub() * sin(theta.ub()).mid()) << " a \n";
_f_temp_content << scale_x(c[0] + r.lb() * cos(theta.ub()).mid()) << " " << scale_y(c[1] + r.lb() * sin(theta.ub()).mid()) << " l \n";
_f_temp_content << scale_length(r.lb()) << " 0 0 " << - scale_length(r.lb()) << " "
<< scale_x(c[i()]) << " " << scale_y(c[j()]) << " "
<< scale_x(c[0] + r.lb() * cos(theta.lb()).mid()) << " " << scale_y(c[1] + r.lb() * sin(theta.lb()).mid()) << " a \n";

_f_temp_content << "</path>";
}

void Figure2D_IPE::draw_ellipse(const Vector& c, const Vector& ab, double theta, const StyleProperties& s)
Expand Down

0 comments on commit a4d1b46

Please sign in to comment.