本文整理汇总了C++中Allocation::allot_x方法的典型用法代码示例。如果您正苦于以下问题:C++ Allocation::allot_x方法的具体用法?C++ Allocation::allot_x怎么用?C++ Allocation::allot_x使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Allocation
的用法示例。
在下文中一共展示了Allocation::allot_x方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: transform
void XYView::transform(
Transformer& t, const Allocation& a, const Allocation& n
) const {
#if 0
Allotment ax, ay;
if (view_margin()) {
const Allotment& alx = a.x_allotment();
ax.span(alx.span() - 2*view_margin());
ax.origin(alx.begin() + view_margin());
ax.alignment(0);
const Allotment& aly = a.y_allotment();
ay.span(aly.span() - 2*view_margin());
ay.origin(aly.begin() + view_margin());
ay.alignment(0);
} else {
ax = a.x_allotment();
ay = a.y_allotment();
}
Allocation al;
al.allot_x(ax);
al.allot_y(ay);
scene2view(al);
#else
scene2view(a);
const Allotment& ax = a.x_allotment();
const Allotment& ay = a.y_allotment();
#endif
const Allotment& nx = n.x_allotment();
const Allotment& ny = n.y_allotment();
XYView* v = (XYView*)this;
csize(ax.begin(), ax.span(), ay.begin(), ay.span());
float sx = xsize_/width();
float sy = ysize_/height();
XYView* xv = (XYView*)this;
xv->x_pick_epsilon_ = pick_epsilon/sx;
xv->y_pick_epsilon_ = pick_epsilon/sy;
t.translate( -left(), -bottom());
t.scale(sx, sy);
t.translate(ax.begin(), ay.begin());
#if 0
printf("XYView::transform ax origin=%g span=%g alignment=%g begin=%g\n",
ax.origin(), ax.span(), ax.alignment(), ax.begin());
printf("XYView::transform ay origin=%g span=%g alignment=%g begin=%g %g\n",
ay.origin(), ay.span(), ay.alignment(), ay.begin(), ay.end());
printf("XYView::transform natx origin=%g span=%g alignment=%g begin=%g\n",
nx.origin(), nx.span(), nx.alignment(), nx.begin());
printf("XYView::transform naty origin=%g span=%g alignment=%g begin=%g %g\n",
ny.origin(), ny.span(), ny.alignment(), ny.begin(), ny.end());
#endif
}