|
|
@ -249,6 +249,7 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgRect(const QDomElement &elem |
|
|
|
painter.end(); |
|
|
|
painter.end(); |
|
|
|
|
|
|
|
|
|
|
|
UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); |
|
|
|
UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); |
|
|
|
|
|
|
|
svgItem->setUuid(QUuid::createUuid()); |
|
|
|
QTransform transform; |
|
|
|
QTransform transform; |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
|
|
|
|
|
|
|
@ -299,6 +300,7 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgEllipse(const QDomElement &e |
|
|
|
painter.end(); |
|
|
|
painter.end(); |
|
|
|
|
|
|
|
|
|
|
|
UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); |
|
|
|
UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); |
|
|
|
|
|
|
|
svgItem->setUuid(QUuid::createUuid()); |
|
|
|
QTransform transform; |
|
|
|
QTransform transform; |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
|
|
|
|
|
|
|
@ -382,7 +384,6 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgPolygon(const QDomElement &e |
|
|
|
UBGraphicsPolygonItem *graphicsPolygon = mCurrentScene->polygonToPolygonItem(polygon); |
|
|
|
UBGraphicsPolygonItem *graphicsPolygon = mCurrentScene->polygonToPolygonItem(polygon); |
|
|
|
|
|
|
|
|
|
|
|
graphicsPolygon->setBrush(brush); |
|
|
|
graphicsPolygon->setBrush(brush); |
|
|
|
//graphicsPolygon->setPen(pen);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QTransform transform; |
|
|
|
QTransform transform; |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
@ -414,7 +415,7 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgPolygon(const QDomElement &e |
|
|
|
UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); |
|
|
|
UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); |
|
|
|
QTransform transform; |
|
|
|
QTransform transform; |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
|
|
|
|
svgItem->setUuid(QUuid::createUuid()); |
|
|
|
svgItem->resetTransform(); |
|
|
|
svgItem->resetTransform(); |
|
|
|
if (!textTransform.isNull()) { |
|
|
|
if (!textTransform.isNull()) { |
|
|
|
transform = transformFromString(textTransform, svgItem); |
|
|
|
transform = transformFromString(textTransform, svgItem); |
|
|
@ -524,6 +525,7 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgPolyline(const QDomElement & |
|
|
|
|
|
|
|
|
|
|
|
//add resulting svg file to scene
|
|
|
|
//add resulting svg file to scene
|
|
|
|
UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); |
|
|
|
UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); |
|
|
|
|
|
|
|
svgItem->setUuid(QUuid::createUuid()); |
|
|
|
QTransform transform; |
|
|
|
QTransform transform; |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
|
|
|
|
|
|
|
@ -1132,7 +1134,7 @@ UBGraphicsGroupContainerItem *UBCFFSubsetAdaptor::UBCFFSubsetReader::parseIwbGro |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (uuid.size() > QUuid().toString().length()) // create stroke group
|
|
|
|
if (uuid.size() > QUuid().toString().length()) // create stroke group
|
|
|
|
{
|
|
|
|
{
|
|
|
|
currentStrokeIdentifier = uuid.left(QUuid().toString().length()); |
|
|
|
currentStrokeIdentifier = uuid.left(QUuid().toString().length()-1); |
|
|
|
UBGraphicsPolygonItem *strokeByUuid = qgraphicsitem_cast<UBGraphicsPolygonItem *>(mCurrentScene->itemForUuid(QUuid(uuid.right(QUuid().toString().length())))); |
|
|
|
UBGraphicsPolygonItem *strokeByUuid = qgraphicsitem_cast<UBGraphicsPolygonItem *>(mCurrentScene->itemForUuid(QUuid(uuid.right(QUuid().toString().length())))); |
|
|
|
|
|
|
|
|
|
|
|
if (strokeByUuid) |
|
|
|
if (strokeByUuid) |
|
|
@ -1147,7 +1149,7 @@ UBGraphicsGroupContainerItem *UBCFFSubsetAdaptor::UBCFFSubsetReader::parseIwbGro |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (QString key, strokesGroupsContainer.keys()) |
|
|
|
foreach (QString key, strokesGroupsContainer.keys().toSet()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
UBGraphicsStrokesGroup* pStrokesGroup = new UBGraphicsStrokesGroup(); |
|
|
|
UBGraphicsStrokesGroup* pStrokesGroup = new UBGraphicsStrokesGroup(); |
|
|
|
UBGraphicsStroke *currentStroke = new UBGraphicsStroke(); |
|
|
|
UBGraphicsStroke *currentStroke = new UBGraphicsStroke(); |
|
|
@ -1164,13 +1166,17 @@ UBGraphicsGroupContainerItem *UBCFFSubsetAdaptor::UBCFFSubsetReader::parseIwbGro |
|
|
|
} |
|
|
|
} |
|
|
|
if (currentStroke->polygons().empty()) |
|
|
|
if (currentStroke->polygons().empty()) |
|
|
|
delete currentStroke; |
|
|
|
delete currentStroke; |
|
|
|
|
|
|
|
|
|
|
|
if (pStrokesGroup->childItems().count()) |
|
|
|
if (pStrokesGroup->childItems().count()) |
|
|
|
mCurrentScene->addItem(pStrokesGroup); |
|
|
|
mCurrentScene->addItem(pStrokesGroup); |
|
|
|
else |
|
|
|
else |
|
|
|
delete pStrokesGroup; |
|
|
|
delete pStrokesGroup; |
|
|
|
|
|
|
|
|
|
|
|
if (pStrokesGroup) |
|
|
|
if (pStrokesGroup) |
|
|
|
group->addToGroup(pStrokesGroup); |
|
|
|
{ |
|
|
|
|
|
|
|
QGraphicsItem *strokeGroup = qgraphicsitem_cast<QGraphicsItem *>(pStrokesGroup); |
|
|
|
|
|
|
|
groupContainer.append(strokeGroup); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
foreach(QGraphicsItem* item, groupContainer) |
|
|
|
foreach(QGraphicsItem* item, groupContainer) |
|
|
@ -1180,7 +1186,7 @@ UBGraphicsGroupContainerItem *UBCFFSubsetAdaptor::UBCFFSubsetReader::parseIwbGro |
|
|
|
{ |
|
|
|
{ |
|
|
|
mCurrentScene->addItem(group); |
|
|
|
mCurrentScene->addItem(group); |
|
|
|
|
|
|
|
|
|
|
|
if (!groupContainer.count()) |
|
|
|
if (1 == group->childItems().count()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
group->destroy(false); |
|
|
|
group->destroy(false); |
|
|
|
} |
|
|
|
} |
|
|
|