本文整理汇总了C++中Dynamic::bbox方法的典型用法代码示例。如果您正苦于以下问题:C++ Dynamic::bbox方法的具体用法?C++ Dynamic::bbox怎么用?C++ Dynamic::bbox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dynamic
的用法示例。
在下文中一共展示了Dynamic::bbox方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: layout
void HairpinSegment::layout()
{
Dynamic* sd = 0;
Dynamic* ed = 0;
qreal _spatium = spatium();
if (autoplace()) {
setUserOff(QPointF());
setUserOff2(QPointF());
}
if (isSingleType() || isBeginType()) {
sd = lookupDynamic(hairpin()->startElement());
if (sd) {
if (autoplace()) {
qreal dx = sd->bbox().right() + sd->pos().x()
+ sd->segment()->pos().x() + sd->measure()->pos().x();
// hardcoded distance between Dynamic and Hairpin: 0.5sp
qreal dist = dx - pos().x() + score()->styleP(StyleIdx::autoplaceHairpinDynamicsDistance);
rUserXoffset() = dist;
rUserXoffset2() = -dist;
}
else
sd->doAutoplace();
}
}
if (isSingleType() || isEndType()) {
ed = lookupDynamic(hairpin()->endElement());
if (ed) {
if (autoplace()) {
rUserXoffset2() -= ed->bbox().width();
qreal dx = ed->bbox().left() + ed->pos().x()
+ ed->segment()->pos().x() + ed->measure()->pos().x();
// hardcoded distance between Hairpin and Dynamic: 0.5sp
ed->rUserXoffset() = pos2().x() + pos().x() - dx + score()->styleP(StyleIdx::autoplaceHairpinDynamicsDistance);
}
else
ed->doAutoplace();
}
}
Hairpin::Type type = hairpin()->hairpinType();
if (type == Hairpin::Type::DECRESC_LINE || type == Hairpin::Type::CRESC_LINE) {
twoLines = false;
TextLineSegment::layout();
drawCircledTip = false;
if (parent())
rypos() += score()->styleP(StyleIdx::hairpinY);
}
else {
delete _text;
delete _endText;
_text = 0;
_endText = 0;
QTransform t;
qreal h1 = hairpin()->hairpinHeight().val() * spatium() * .5;
qreal h2 = hairpin()->hairpinContHeight().val() * spatium() * .5;
qreal len;
qreal x = pos2().x();
if (x < _spatium) // minimum size of hairpin
x = _spatium;
qreal y = pos2().y();
len = sqrt(x * x + y * y);
t.rotateRadians(asin(y/len));
drawCircledTip = hairpin()->hairpinCircledTip();
circledTipRadius = drawCircledTip ? 0.6 * _spatium * .5 : 0.0;
QLine l1, l2;
twoLines = true;
switch (type) {
case Hairpin::Type::CRESC_HAIRPIN: {
switch (spannerSegmentType()) {
case SpannerSegmentType::SINGLE:
case SpannerSegmentType::BEGIN:
l1.setLine(circledTipRadius * 2.0, 0.0, len, h1);
l2.setLine(circledTipRadius * 2.0, 0.0, len, -h1);
circledTip.setX(circledTipRadius );
circledTip.setY(0.0);
break;
case SpannerSegmentType::MIDDLE:
case SpannerSegmentType::END:
drawCircledTip = false;
l1.setLine(.0, h2, len, h1);
l2.setLine(.0, -h2, len, -h1);
break;
}
}
break;
case Hairpin::Type::DECRESC_HAIRPIN: {
switch(spannerSegmentType()) {
case SpannerSegmentType::SINGLE:
case SpannerSegmentType::END:
l1.setLine(0.0, h1, len - circledTipRadius * 2, 0.0);
l2.setLine(0.0, -h1, len - circledTipRadius * 2, 0.0);
circledTip.setX(len - circledTipRadius);
circledTip.setY(0.0);
//.........这里部分代码省略.........