本文整理汇总了C++中FPointArray::parseSVG方法的典型用法代码示例。如果您正苦于以下问题:C++ FPointArray::parseSVG方法的具体用法?C++ FPointArray::parseSVG怎么用?C++ FPointArray::parseSVG使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FPointArray
的用法示例。
在下文中一共展示了FPointArray::parseSVG方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processArrows
void XfigPlug::processArrows(int forward_arrow, QString fArrowData, int backward_arrow, QString bArrowData, int depth, PageItem *ite)
{
int arrow_typeAF; // (enumeration type)
int arrow_styleAF; // (enumeration type)
float arrow_thicknessAF; // (1/80 inch)
float arrow_widthAF; // (Fig units)
float arrow_heightAF; // (Fig units)
int arrow_typeAB; // (enumeration type)
int arrow_styleAB; // (enumeration type)
float arrow_thicknessAB; // (1/80 inch)
float arrow_widthAB; // (Fig units)
float arrow_heightAB; // (Fig units)
FPointArray arrow;
int z = -1;
PageItem::ItemType iteType;
if (forward_arrow == 1)
{
arrow.resize(0);
ScTextStream CodeAF(&fArrowData, QIODevice::ReadOnly);
CodeAF >> arrow_typeAF >> arrow_styleAF >> arrow_thicknessAF >> arrow_widthAF >> arrow_heightAF;
arrow_widthAF = fig2Pts(arrow_widthAF);
arrow_heightAF = fig2Pts(arrow_heightAF);
arrow_thicknessAF = arrow_thicknessAF / 80.0 * 72.0;
FPoint End = ite->PoLine.point(ite->PoLine.size()-2);
for (uint xx = ite->PoLine.size()-1; xx > 0; xx -= 2)
{
FPoint Vector = ite->PoLine.point(xx);
if ((End.x() != Vector.x()) || (End.y() != Vector.y()))
{
double r = atan2(End.y()-Vector.y(),End.x()-Vector.x())*(180.0/M_PI);
QTransform arrowTrans;
if (arrow_typeAF == 0)
arrow.parseSVG("M -1, -0.5 L 0, 0 L -1, 0.5");
else if (arrow_typeAF == 1)
arrow.parseSVG("M -1, -0.5 L 0, 0 L -1, 0.5 z");
else if (arrow_typeAF == 2)
arrow.parseSVG("M -1, -0.5 L 0, 0 L -1, 0.5 L -0.7 0 z");
else if (arrow_typeAF == 3)
arrow.parseSVG("M -0.7, -0.5 L 0, 0 L -0.7, 0.5 L -1 0 z");
arrowTrans.translate(End.x(), End.y());
arrowTrans.rotate(r);
arrowTrans.scale(arrow_heightAF, arrow_widthAF);
arrow.map(arrowTrans);
break;
}
}
QString fillC = "White";
if (arrow_styleAF == 1)
fillC = CurrColorStroke;
if (arrow_typeAF == 0)
{
fillC = CommonStrings::None;
iteType = PageItem::PolyLine;
}
else
iteType = PageItem::Polygon;
z = m_Doc->itemAdd(iteType, PageItem::Unspecified, ite->xPos(), ite->yPos(), 10, 10, arrow_thicknessAF, fillC, CurrColorStroke);
if (z >= 0)
{
PageItem *item = m_Doc->Items->at(z);
item->PoLine = arrow.copy();
item->ClipEdited = true;
item->FrameType = 3;
item->setFillShade(CurrFillShade);
item->setLineShade(CurrStrokeShade);
FPoint wh = getMaxClipF(&item->PoLine);
item->setWidthHeight(wh.x(),wh.y());
item->setTextFlowMode(PageItem::TextFlowDisabled);
m_Doc->adjustItemSize(item);
item->setWidthHeight(qMax(item->width(), 1.0), qMax(item->height(), 1.0));
depthMap.insert(999 - depth, currentItemNr);
currentItemNr++;
}
}