本文整理汇总了C++中Transform2D::transform方法的典型用法代码示例。如果您正苦于以下问题:C++ Transform2D::transform方法的具体用法?C++ Transform2D::transform怎么用?C++ Transform2D::transform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transform2D
的用法示例。
在下文中一共展示了Transform2D::transform方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write_eps_quadratic_edge
/** Write quadratic edge shape in PostScript format.
*
* Given the three points composing a quadratic mesh edge,
* write the cubic Bezier curve of the same shape in
* PostScript format. The formulas for P1 and P2
* at the start of this function will result in the cubic
* terms of the Bezier curve dropping out, leaving the
* quadratic curve matching the edge shape function as
* described in Section 3.6 of Hughes. (If you're attempting
* to verify this, don't forget to adjust for the different
* parameter ranges: \f$ \xi = 2 t - 1 \f$).
*/
static void write_eps_quadratic_edge( ostream &s,
Transform2D& xform,
Vector3D start,
Vector3D mid,
Vector3D end )
{
Vector3D P1 = 1./3 * (4 * mid - end);
Vector3D P2 = 1./3 * (4 * mid - start);
int x, y;
xform.transform( start, x, y );
s << x << ' ' << y << " moveto" << endl;
xform.transform( P1, x, y );
s << x << ' ' << y << ' ';
xform.transform( P2, x, y );
s << x << ' ' << y << ' ';
xform.transform( end, x, y );
s << x << ' ' << y << " curveto" << endl;
}