C++ (Qt)void DrawLine( float x1, float y1, float x2, float y2 );
C++ (Qt)for (int i = 0; i < fig.size - 1; ++i) DrawLine(fig.pos[i].x, fig.pos[i].y, fig.pos[i + 1].x, fig.pos[i + 1].y);
C++ (Qt)for (size_t i = 0; i < obj.tri.size(); ++i) { const Point & p0 = obj.point[tri[i][0]]; const Point & p1 = obj.point[tri[i][1]]; const Point & p2 = obj.point[tri[i][2]]; DrawLine(p0.x, p0.y, p1.x, p1.y); DrawLine(p1.x, p1.y, p2.x, p2.y); DrawLine(p2.x, p2.y, p0.x, p0.y);}
C++ (Qt)inline float Area( const Point & p0, const Point & p1, const Point & p2 ){ return (p1.x - p0.x) * (p2.y - p1.y) - (p1.y - p0.y) * (p2.x - p1.x);}..if (Area(p0, p1, p2) * Area(p0, p1, p3) > 0) DrawLine(p0.x, p0.y, p1.x, p1.y);