本文整理汇总了C++中Extent::Merge方法的典型用法代码示例。如果您正苦于以下问题:C++ Extent::Merge方法的具体用法?C++ Extent::Merge怎么用?C++ Extent::Merge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Extent
的用法示例。
在下文中一共展示了Extent::Merge方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getextent_gs
void PolyGraphic::getextent_gs (
Coord& l, Coord& b, Coord& cx, Coord& cy, float& tol, Graphic31* gs
) {
Extent e;
l = b = cx = cy = tol = 0.0;
Graphic31 gstemp;
Transformer ttemp;
Extent te;
gstemp.transformer(&ttemp);
GlyphIndex count = _body->count();
for (GlyphIndex i = 0; i < count; i++) {
Graphic31* gr = (Graphic31*) _body->component(i);
concatgs_(gr, gr, gs, &gstemp);
concatXform_(gr, nil, gr->transformer(), &ttemp);
getextent_(gr, te._left, te._bottom, te._cx, te._cy, te._tol, &gstemp);
e.Merge(te);
}
gstemp.transformer(nil); // to avoid deleting ttemp explicitly
l = e._left; b = e._bottom; cx = l+(e._cx-l)*2.0; cy = b+(e._cy-b)*2.0;
tol = e._tol;
Transformer* tx = gs->transformer();
if (tx != nil) {
corners(l, b, cx, cy, *tx);
}
cx = (cx + l)/2.0;
cy = (cy + b)/2.0;
}
示例2: getExtent
void BSplineSelection::getExtent (float& l, float& b, float& cx, float& cy,
float& tol, Graphic* gs) {
Extent e;
if (extentCached()) {
getCachedExtent(e.left, e.bottom, e.cx, e.cy, e.tol);
} else {
FullGraphic gstmp;
concatGSGraphic(ifillbspline, this, gs, &gstmp);
getExtentGraphic(
ifillbspline, e.left, e.bottom, e.cx, e.cy, e.tol, &gstmp
);
Extent te;
concatGSGraphic(bspline, this, gs, &gstmp);
getExtentGraphic(
bspline, te.left, te.bottom, te.cx, te.cy, te.tol, &gstmp
);
e.Merge(te);
cacheExtent(e.left, e.bottom, e.cx, e.cy, e.tol);
}
float right = 2*e.cx - e.left;
float top = 2*e.cy - e.bottom;
float dummy = 0;
transformRect(e.left, e.bottom, right, top, l, b, dummy, dummy, gs);
transform(e.cx, e.cy, cx, cy, gs);
tol = MergeArrowHeadTol(e.tol, gs);
}
示例3: getExtent
void Picture::getExtent (
float& l, float& b, float& cx, float& cy, float& tol, Graphic* gs
) {
Extent e;
float right, top, dummy1, dummy2;
if (extentCached()) {
getCachedExtent(e._left, e._bottom, e._cx, e._cy, e._tol);
} else {
if (IsEmpty()) {
l = b = cx = cy = tol = 0.0;
return;
} else {
Iterator i;
FullGraphic gstemp;
Transformer ttemp;
Extent te;
gstemp.SetTransformer(&ttemp);
First(i);
Graphic* gr = GetGraphic(i);
concatGSGraphic(gr, gr, gs, &gstemp);
concatTransformerGraphic(gr, nil, gr->GetTransformer(), &ttemp);
getExtentGraphic(gr, e._left,e._bottom,e._cx,e._cy,e._tol,&gstemp);
for (Next(i); !Done(i); Next(i)) {
gr = GetGraphic(i);
concatGSGraphic(gr, gr, gs, &gstemp);
concatTransformerGraphic(gr,nil, gr->GetTransformer(), &ttemp);
getExtentGraphic(
gr, te._left, te._bottom, te._cx, te._cy, te._tol, &gstemp
);
e.Merge(te);
}
cacheExtent(e._left, e._bottom, e._cx, e._cy, e._tol);
gstemp.SetTransformer(nil); // to avoid deleting ttemp explicitly
}
}
right = 2*e._cx - e._left;
top = 2*e._cy - e._bottom;
transformRect(e._left, e._bottom, right, top, l, b, dummy1, dummy2, gs);
transform(e._cx, e._cy, cx, cy, gs);
tol = e._tol;
}