Library renamed to Pdf4Qt

This commit is contained in:
Jakub Melka
2020-12-20 19:03:58 +01:00
parent 6811820e1a
commit 7614ab8240
506 changed files with 1191 additions and 1081 deletions

View File

@@ -0,0 +1,7 @@
{
"Name" : "Dimensions",
"Author" : "Jakub Melka",
"Version" : "1.0.0",
"License" : "LGPL v3",
"Description" : "Measure distances, area, perimeter in a document page."
}

View File

@@ -0,0 +1,54 @@
# Copyright (C) 2020 Jakub Melka
#
# This file is part of Pdf4Qt.
#
# Pdf4Qt is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pdf4Qt is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pdf4Qt. If not, see <https://www.gnu.org/licenses/>.
TEMPLATE = lib
DEFINES += DIMENSIONPLUGIN_LIBRARY
QT += gui widgets
LIBS += -L$$OUT_PWD/../..
LIBS += -lPdf4QtLib
QMAKE_CXXFLAGS += /std:c++latest /utf-8
INCLUDEPATH += $$PWD/../../Pdf4QtLib/Sources
DESTDIR = $$OUT_PWD/../../pdfplugins
CONFIG += c++11
SOURCES += \
dimensionsplugin.cpp \
dimensiontool.cpp \
settingsdialog.cpp
HEADERS += \
dimensionsplugin.h \
dimensiontool.h \
settingsdialog.h
CONFIG += force_debug_info
DISTFILES += \
DimensionsPlugin.json
RESOURCES += \
icons.qrc
FORMS += \
settingsdialog.ui

View File

@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="30mm"
height="30mm"
viewBox="0 0 30 30"
version="1.1"
id="svg8"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="angle.svg">
<defs
id="defs2">
<inkscape:path-effect
effect="spiro"
id="path-effect831"
is_visible="true" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="113.0623"
inkscape:cy="47.635251"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="3840"
inkscape:window-height="2035"
inkscape:window-x="-13"
inkscape:window-y="-13"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:creator>
<cc:Agent>
<dc:title>Jakub Melka</dc:title>
</cc:Agent>
</dc:creator>
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<g
inkscape:label="Vrstva 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-267)">
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 11.646391,283.58184 v 0 0"
id="path837"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 14.315848,269.9747 4.2522322,293.17299"
id="path5831"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 4.2522322,293.17299 26.03311,293.03125"
id="path5833"
inkscape:connector-curvature="0" />
<path
style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99838448;paint-order:stroke fill markers"
id="path5847"
sodipodi:type="arc"
sodipodi:cx="4.2522321"
sodipodi:cy="293.173"
sodipodi:rx="9.307663"
sodipodi:ry="9.4730282"
sodipodi:start="5.1487213"
sodipodi:end="0"
d="M 8.1858205,284.58752 A 9.307663,9.4730282 0 0 1 13.559895,293.173"
sodipodi:open="true" />
<g
aria-label="β°"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.11111069px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
id="text5851">
<path
d="m 21.426328,283.01723 q 0,1.39182 -0.930176,2.30133 -0.923285,0.9095 -2.335774,0.9095 -0.544325,0 -1.150662,-0.15158 -0.606337,-0.15159 -1.040419,-0.44098 v 3.27974 h -1.295356 v -10.26639 q 0,-1.5434 0.868164,-2.41846 0.875054,-0.87505 2.411567,-0.87505 0.620117,0 1.129991,0.15158 0.516764,0.1447 0.923286,0.46165 0.392741,0.29628 0.627007,0.7717 0.234267,0.47542 0.234267,1.10243 0,0.87505 -0.482314,1.52962 -0.475423,0.64768 -1.350477,0.90262 v 0.11713 q 1.09554,0.17914 1.743218,0.86816 0.647678,0.68213 0.647678,1.757 z m -1.336697,-0.0344 q 0,-0.61323 -0.241157,-0.99219 -0.234266,-0.38585 -0.633897,-0.59944 -0.406521,-0.22049 -0.909505,-0.29628 -0.502984,-0.0758 -1.005968,-0.0758 h -0.248047 v -1.10243 h 0.248047 q 0.454752,0 0.902615,-0.0965 0.447862,-0.10335 0.71658,-0.31005 0.316948,-0.23427 0.468533,-0.57189 0.158474,-0.33762 0.158474,-0.92329 0,-0.7717 -0.475423,-1.17133 -0.475423,-0.39963 -1.226454,-0.39963 -0.502984,0 -0.861274,0.18604 -0.35829,0.17914 -0.585666,0.48231 -0.220486,0.30317 -0.323839,0.70969 -0.103353,0.39963 -0.103353,0.82682 v 5.93935 q 0.454752,0.26182 0.971517,0.37207 0.516764,0.10335 1.012858,0.10335 1.026638,0 1.577854,-0.53744 0.558105,-0.54432 0.558105,-1.5434 z"
style="stroke-width:0.26458332"
id="path5853"
inkscape:connector-curvature="0" />
<path
d="m 28.7506,278.38702 q 0,1.15756 -0.799262,1.95682 -0.799262,0.79926 -1.963704,0.79926 -1.164442,0 -1.963704,-0.79237 -0.799263,-0.79926 -0.799263,-1.96371 0,-1.15755 0.799263,-1.95681 0.799262,-0.79926 1.963704,-0.79926 1.171332,0 1.963704,0.79926 0.799262,0.79926 0.799262,1.95681 z m -1.136881,0 q 0,-0.7028 -0.461643,-1.17822 -0.461643,-0.48231 -1.164442,-0.48231 -0.7028,0 -1.164442,0.48231 -0.461643,0.47542 -0.461643,1.17822 0,0.71658 0.468533,1.19201 0.475423,0.46853 1.157552,0.46853 0.702799,0 1.164442,-0.48231 0.461643,-0.48232 0.461643,-1.17823 z"
style="stroke-width:0.26458332"
id="path5855"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.2 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 109 KiB

View File

@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="30mm"
height="30mm"
viewBox="0 0 30 30"
version="1.1"
id="svg8"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="clear-dimensions.svg">
<defs
id="defs2">
<inkscape:path-effect
effect="spiro"
id="path-effect831"
is_visible="true" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.979899"
inkscape:cx="63.234605"
inkscape:cy="148.69816"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="3840"
inkscape:window-height="2035"
inkscape:window-x="-13"
inkscape:window-y="-13"
inkscape:window-maximized="1"
inkscape:snap-text-baseline="false" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:creator>
<cc:Agent>
<dc:title>Jakub Melka</dc:title>
</cc:Agent>
</dc:creator>
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<g
inkscape:label="Vrstva 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-267)">
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 11.646391,283.58184 v 0 0"
id="path837"
inkscape:connector-curvature="0" />
<g
aria-label="🗑"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:22.57777786px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
id="text1421">
<path
d="m 9.9148255,278.00513 q -0.099219,-0.0882 -0.1543403,-0.13229 -0.3858507,-0.31971 -0.3858507,-0.80478 v -1.34496 q 0,-0.68351 0.5622396,-0.99219 1.5213539,-0.82682 4.8727429,-0.82682 3.362413,0 4.883768,0.82682 0.562239,0.30868 0.562239,0.99219 v 1.34496 q 0,0.48507 -0.385851,0.80478 -0.05512,0.0441 -0.15434,0.13229 v 10.55026 q 0,1.14653 -0.529167,1.51033 -1.444184,0.97014 -4.376649,0.97014 -2.921441,0 -4.365625,-0.97014 -0.5291665,-0.3638 -0.5291665,-1.51033 z m 4.9058155,-1.24575 q 2.017448,0 3.450608,-0.33073 1.444184,-0.33072 1.444184,-0.79375 0,-0.44097 -1.554427,-0.81579 -1.554427,-0.37483 -3.351389,-0.37483 -1.81901,0 -3.362413,0.38585 -1.5323785,0.37483 -1.5323785,0.8158 0,0.452 1.4441845,0.78272 1.455208,0.33073 3.461631,0.33073 z m -4.9058155,-0.4079 v 0.33073 q 0,1.84106 4.8947915,1.84106 4.905816,0 4.905816,-1.84106 v -0.33073 q -0.926042,0.47405 -2.160764,0.71658 -1.223698,0.23151 -2.745052,0.23151 -1.51033,0 -2.734028,-0.23151 -1.223698,-0.24253 -2.1607635,-0.71658 z m 0.5512155,1.94028 v 10.23056 q 0,0.98116 0.628385,1.30087 1.333941,0.67248 3.715191,0.67248 2.392274,0 3.726215,-0.67248 0.628386,-0.31971 0.628386,-1.30087 v -10.23056 q -0.374827,0.15434 -0.815799,0.29766 v 10.2967 l -0.540191,0.14332 v -10.29671 q -0.661458,0.12127 -1.631597,0.23151 v 10.30773 h -0.551215 v -10.30773 q -0.661459,0.0331 -0.815799,0.0331 -0.143316,0 -0.815798,-0.0331 v 10.30773 H 13.453628 V 278.96424 Q 12.483489,278.854 11.82203,278.73273 v 10.29671 l -0.540191,-0.14332 v -10.2967 q -0.440972,-0.14332 -0.815798,-0.29766 z"
style="stroke-width:0.26458332"
id="path1423"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@@ -0,0 +1,374 @@
// Copyright (C) 2020 Jakub Melka
//
// This file is part of Pdf4Qt.
//
// Pdf4Qt is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Pdf4Qt is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with Pdf4Qt. If not, see <https://www.gnu.org/licenses/>.
#include "dimensionsplugin.h"
#include "pdfdrawwidget.h"
#include "pdfwidgetutils.h"
#include "settingsdialog.h"
#include <QPainter>
#include <QFontMetricsF>
namespace pdfplugin
{
DimensionsPlugin::DimensionsPlugin() :
pdf::PDFPlugin(nullptr),
m_dimensionTools(),
m_showDimensionsAction(nullptr),
m_clearDimensionsAction(nullptr),
m_settingsAction(nullptr)
{
}
void DimensionsPlugin::setWidget(pdf::PDFWidget* widget)
{
Q_ASSERT(!m_widget);
BaseClass::setWidget(widget);
QAction* horizontalDimensionAction = new QAction(QIcon(":/pdfplugins/dimensiontool/linear-horizontal.svg"), tr("Horizontal Dimension"), this);
QAction* verticalDimensionAction = new QAction(QIcon(":/pdfplugins/dimensiontool/linear-vertical.svg"), tr("Vertical Dimension"), this);
QAction* linearDimensionAction = new QAction(QIcon(":/pdfplugins/dimensiontool/linear.svg"), tr("Linear Dimension"), this);
QAction* perimeterDimensionAction = new QAction(QIcon(":/pdfplugins/dimensiontool/perimeter.svg"), tr("Perimeter"), this);
QAction* rectanglePerimeterDimensionAction = new QAction(QIcon(":/pdfplugins/dimensiontool/rectangle-perimeter.svg"), tr("Rectangle Perimeter"), this);
QAction* areaDimensionAction = new QAction(QIcon(":/pdfplugins/dimensiontool/area.svg"), tr("Area"), this);
QAction* rectangleAreaDimensionAction = new QAction(QIcon(":/pdfplugins/dimensiontool/rectangle-area.svg"), tr("Rectangle Area"), this);
QAction* angleAction = new QAction(QIcon(":/pdfplugins/dimensiontool/angle.svg"), tr("Angle"), this);
horizontalDimensionAction->setObjectName("dimensiontool_LinearHorizontalAction");
verticalDimensionAction->setObjectName("dimensiontool_LinearVerticalAction");
linearDimensionAction->setObjectName("dimensiontool_LinearAction");
perimeterDimensionAction->setObjectName("dimensiontool_PerimeterAction");
rectanglePerimeterDimensionAction->setObjectName("dimensiontool_RectanglePerimeterAction");
areaDimensionAction->setObjectName("dimensiontool_AreaAction");
rectangleAreaDimensionAction->setObjectName("dimensiontool_RectangleAreaAction");
angleAction->setObjectName("dimensiontool_AngleAction");
horizontalDimensionAction->setCheckable(true);
verticalDimensionAction->setCheckable(true);
linearDimensionAction->setCheckable(true);
perimeterDimensionAction->setCheckable(true);
rectanglePerimeterDimensionAction->setCheckable(true);
areaDimensionAction->setCheckable(true);
rectangleAreaDimensionAction->setCheckable(true);
angleAction->setCheckable(true);
m_dimensionTools[DimensionTool::LinearHorizontal] = new DimensionTool(DimensionTool::LinearHorizontal, widget->getDrawWidgetProxy(), horizontalDimensionAction, this);
m_dimensionTools[DimensionTool::LinearVertical] = new DimensionTool(DimensionTool::LinearVertical, widget->getDrawWidgetProxy(), verticalDimensionAction, this);
m_dimensionTools[DimensionTool::Linear] = new DimensionTool(DimensionTool::Linear, widget->getDrawWidgetProxy(), linearDimensionAction, this);
m_dimensionTools[DimensionTool::Perimeter] = new DimensionTool(DimensionTool::Perimeter, widget->getDrawWidgetProxy(), perimeterDimensionAction, this);
m_dimensionTools[DimensionTool::RectanglePerimeter] = new DimensionTool(DimensionTool::RectanglePerimeter, widget->getDrawWidgetProxy(), rectanglePerimeterDimensionAction, this);
m_dimensionTools[DimensionTool::Area] = new DimensionTool(DimensionTool::Area, widget->getDrawWidgetProxy(), areaDimensionAction, this);
m_dimensionTools[DimensionTool::RectangleArea] = new DimensionTool(DimensionTool::RectangleArea, widget->getDrawWidgetProxy(), rectangleAreaDimensionAction, this);
m_dimensionTools[DimensionTool::Angle] = new DimensionTool(DimensionTool::Angle, widget->getDrawWidgetProxy(), angleAction, this);
pdf::PDFToolManager* toolManager = widget->getToolManager();
for (DimensionTool* tool : m_dimensionTools)
{
toolManager->addTool(tool);
connect(tool, &DimensionTool::dimensionCreated, this, &DimensionsPlugin::onDimensionCreated);
}
m_showDimensionsAction = new QAction(QIcon(":/pdfplugins/dimensiontool/show-dimensions.svg"), tr("Show Dimensions"), this);
m_clearDimensionsAction = new QAction(QIcon(":/pdfplugins/dimensiontool/clear-dimensions.svg"), tr("Clear Dimensions"), this);
m_settingsAction = new QAction(QIcon(":/pdfplugins/dimensiontool/settings.svg"), tr("Settings"), this);
m_showDimensionsAction->setCheckable(true);
m_showDimensionsAction->setChecked(true);
connect(m_showDimensionsAction, &QAction::triggered, this, &DimensionsPlugin::onShowDimensionsTriggered);
connect(m_clearDimensionsAction, &QAction::triggered, this, &DimensionsPlugin::onClearDimensionsTriggered);
connect(m_settingsAction, &QAction::triggered, this, &DimensionsPlugin::onSettingsTriggered);
m_lengthUnit = DimensionUnit::getLengthUnits().front();
m_areaUnit = DimensionUnit::getAreaUnits().front();
m_angleUnit = DimensionUnit::getAngleUnits().front();
m_widget->getDrawWidgetProxy()->registerDrawInterface(this);
updateActions();
}
void DimensionsPlugin::setDocument(const pdf::PDFModifiedDocument& document)
{
BaseClass::setDocument(document);
if (document.hasReset())
{
m_dimensions.clear();
updateActions();
}
}
std::vector<QAction*> DimensionsPlugin::getActions() const
{
std::vector<QAction*> result;
for (DimensionTool* tool : m_dimensionTools)
{
if (tool)
{
result.push_back(tool->getAction());
}
}
if (!result.empty())
{
result.push_back(nullptr);
result.push_back(m_showDimensionsAction);
result.push_back(m_clearDimensionsAction);
result.push_back(m_settingsAction);
}
return result;
}
void DimensionsPlugin::drawPage(QPainter* painter,
pdf::PDFInteger pageIndex,
const pdf::PDFPrecompiledPage* compiledPage,
pdf::PDFTextLayoutGetter& layoutGetter,
const QMatrix& pagePointToDevicePointMatrix,
QList<pdf::PDFRenderError>& errors) const
{
Q_UNUSED(compiledPage);
Q_UNUSED(layoutGetter);
Q_UNUSED(errors);
if (!m_showDimensionsAction || !m_showDimensionsAction->isChecked() || m_dimensions.empty())
{
// Nothing to draw
return;
}
QLocale locale;
painter->setRenderHint(QPainter::Antialiasing, true);
for (const Dimension& dimension : m_dimensions)
{
if (pageIndex != dimension.getPageIndex())
{
continue;
}
switch (dimension.getType())
{
case Dimension::Linear:
{
QPointF p1 = pagePointToDevicePointMatrix.map(dimension.getPolygon().front());
QPointF p2 = pagePointToDevicePointMatrix.map(dimension.getPolygon().back());
// Swap so p1 is to the left of the page, before p2 (for correct determination of angle)
if (p1.x() > p2.x())
{
qSwap(p1, p2);
}
QLineF line(p1, p2);
if (qFuzzyIsNull(line.length()))
{
// If we have zero line, then do nothing
continue;
}
QLineF unitVectorLine = line.normalVector().unitVector();
QPointF unitVector = unitVectorLine.p2() - unitVectorLine.p1();
qreal extensionLineSize = pdf::PDFWidgetUtils::scaleDPI_y(painter->device(), 5);
painter->setPen(Qt::black);
painter->drawLine(line);
QLineF extensionLineLeft(p1 - unitVector * extensionLineSize, p1 + unitVector * extensionLineSize);
QLineF extensionLineRight(p2 - unitVector * extensionLineSize, p2 + unitVector * extensionLineSize);
painter->drawLine(extensionLineLeft);
painter->drawLine(extensionLineRight);
QPointF textPoint = line.center();
qreal angle = line.angle();
QFontMetricsF fontMetrics(painter->font());
QRectF textRect(-line.length() * 0.5, -fontMetrics.lineSpacing(), line.length(), fontMetrics.lineSpacing());
QString text = QString("%1 %2").arg(locale.toString(dimension.getMeasuredValue() * m_lengthUnit.scale, 'f', 2), m_lengthUnit.symbol);
painter->save();
painter->translate(textPoint);
painter->rotate(-angle);
painter->drawText(textRect, Qt::AlignCenter | Qt::TextDontClip, text);
painter->restore();
break;
}
case Dimension::Perimeter:
case Dimension::Area:
{
const bool isArea = dimension.getType() == Dimension::Type::Area;
const std::vector<QPointF>& polygon = dimension.getPolygon();
qreal lineSize = pdf::PDFWidgetUtils::scaleDPI_x(painter->device(), 1);
qreal pointSize = pdf::PDFWidgetUtils::scaleDPI_x(painter->device(), 5);
painter->save();
QPen pen(Qt::black);
pen.setWidthF(lineSize);
pen.setCosmetic(true);
QColor brushColor = Qt::black;
brushColor.setAlphaF(0.1);
painter->setPen(qMove(pen));
painter->setBrush(QBrush(brushColor, isArea ? Qt::SolidPattern : Qt::DiagCrossPattern));
painter->setMatrix(pagePointToDevicePointMatrix, true);
painter->drawPolygon(polygon.data(), int(polygon.size()), Qt::OddEvenFill);
painter->restore();
QPen penPoint(Qt::black);
penPoint.setCapStyle(Qt::RoundCap);
penPoint.setWidthF(pointSize);
painter->setPen(penPoint);
QPointF centerPoint(0, 0);
for (const QPointF& point : polygon)
{
QPointF mappedPoint = pagePointToDevicePointMatrix.map(point);
centerPoint += mappedPoint;
painter->drawPoint(mappedPoint);
}
centerPoint *= 1.0 / qreal(polygon.size());
QString text;
if (isArea)
{
text = tr("A = %1 %2").arg(locale.toString(dimension.getMeasuredValue() * m_areaUnit.scale, 'f', 2), m_areaUnit.symbol);
}
else
{
text = tr("p = %1 %2").arg(locale.toString(dimension.getMeasuredValue() * m_lengthUnit.scale, 'f', 2), m_lengthUnit.symbol);
}
painter->drawText(centerPoint, text);
break;
}
case Dimension::Angular:
{
const std::vector<QPointF>& polygon = dimension.getPolygon();
QLineF line1(pagePointToDevicePointMatrix.map(polygon[1]), pagePointToDevicePointMatrix.map(polygon.front()));
QLineF line2(pagePointToDevicePointMatrix.map(polygon[1]), pagePointToDevicePointMatrix.map(polygon.back()));
qreal lineSize = pdf::PDFWidgetUtils::scaleDPI_x(painter->device(), 1);
qreal pointSize = pdf::PDFWidgetUtils::scaleDPI_x(painter->device(), 5);
qreal maxLength = qMax(line1.length(), line2.length());
line1.setLength(maxLength);
line2.setLength(maxLength);
QPen pen(Qt::black);
pen.setWidthF(lineSize);
painter->setPen(qMove(pen));
painter->drawLine(line1);
painter->drawLine(line2);
qreal startAngle = line1.angle() * 16;
qreal angleLength = dimension.getMeasuredValue() * 16;
QRectF rect(-maxLength * 0.5, -maxLength * 0.5, maxLength, maxLength);
rect.translate(line1.p1());
painter->drawArc(rect, startAngle - angleLength, angleLength);
QPen penPoint(Qt::black);
penPoint.setCapStyle(Qt::RoundCap);
penPoint.setWidthF(pointSize);
painter->setPen(penPoint);
painter->drawPoint(line1.p1());
painter->drawPoint(line1.p2());
painter->drawPoint(line2.p2());
QMatrix textMatrix;
textMatrix.translate(line1.x1(), line1.y1());
textMatrix.rotate(-line1.angle() + dimension.getMeasuredValue() * 0.5);
QPointF textPoint = textMatrix.map(QPointF(maxLength * 0.25, 0.0));
QString text = QString("%1 %2").arg(locale.toString(dimension.getMeasuredValue() * m_angleUnit.scale, 'f', 2), m_angleUnit.symbol);
painter->drawText(textPoint, text);
break;
}
default:
Q_ASSERT(false);
break;
}
}
}
void DimensionsPlugin::onShowDimensionsTriggered()
{
updateGraphics();
}
void DimensionsPlugin::onClearDimensionsTriggered()
{
m_dimensions.clear();
updateActions();
updateGraphics();
}
void DimensionsPlugin::onSettingsTriggered()
{
SettingsDialog dialog(m_widget, m_lengthUnit, m_areaUnit, m_angleUnit);
dialog.exec();
updateGraphics();
}
void DimensionsPlugin::onDimensionCreated(Dimension dimension)
{
m_dimensions.emplace_back(qMove(dimension));
updateActions();
updateGraphics();
}
void DimensionsPlugin::updateActions()
{
if (m_showDimensionsAction)
{
m_showDimensionsAction->setEnabled(!m_dimensions.empty());
}
if (m_clearDimensionsAction)
{
m_clearDimensionsAction->setEnabled(!m_dimensions.empty());
}
}
void DimensionsPlugin::updateGraphics()
{
if (m_widget)
{
m_widget->getDrawWidget()->getWidget()->update();
}
}
}

View File

@@ -0,0 +1,73 @@
// Copyright (C) 2020 Jakub Melka
//
// This file is part of Pdf4Qt.
//
// Pdf4Qt is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Pdf4Qt is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with Pdf4Qt. If not, see <https://www.gnu.org/licenses/>.
#ifndef DIMENSIONSPLUGIN_H
#define DIMENSIONSPLUGIN_H
#include "pdfplugin.h"
#include "dimensiontool.h"
#include <QObject>
namespace pdfplugin
{
class DimensionsPlugin : public pdf::PDFPlugin, public pdf::IDocumentDrawInterface
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "Pdf4Qt.DimensionsPlugin" FILE "DimensionsPlugin.json")
private:
using BaseClass = pdf::PDFPlugin;
public:
DimensionsPlugin();
virtual void setWidget(pdf::PDFWidget* widget) override;
virtual void setDocument(const pdf::PDFModifiedDocument& document) override;
virtual std::vector<QAction*> getActions() const override;
virtual void drawPage(QPainter* painter,
pdf::PDFInteger pageIndex,
const pdf::PDFPrecompiledPage* compiledPage,
pdf::PDFTextLayoutGetter& layoutGetter,
const QMatrix& pagePointToDevicePointMatrix,
QList<pdf::PDFRenderError>& errors) const override;
private:
void onShowDimensionsTriggered();
void onClearDimensionsTriggered();
void onSettingsTriggered();
void onDimensionCreated(Dimension dimension);
void updateActions();
void updateGraphics();
std::array<DimensionTool*, DimensionTool::LastStyle> m_dimensionTools;
std::vector<Dimension> m_dimensions;
QAction* m_showDimensionsAction;
QAction* m_clearDimensionsAction;
QAction* m_settingsAction;
DimensionUnit m_lengthUnit;
DimensionUnit m_areaUnit;
DimensionUnit m_angleUnit;
};
} // namespace pdfplugin
#endif // DIMENSIONSPLUGIN_H

View File

@@ -0,0 +1,309 @@
// Copyright (C) 2020 Jakub Melka
//
// This file is part of Pdf4Qt.
//
// Pdf4Qt is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Pdf4Qt is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with Pdf4Qt. If not, see <https://www.gnu.org/licenses/>.
#include "dimensiontool.h"
#include "pdfwidgetutils.h"
#include "pdfdrawwidget.h"
#include <QPainter>
DimensionTool::DimensionTool(Style style, pdf::PDFDrawWidgetProxy* proxy, QAction* action, QObject* parent) :
BaseClass(proxy, action, parent),
m_style(style),
m_previewPointPixelSize(0),
m_pickTool(nullptr)
{
const bool isRectanglePicking = style == RectanglePerimeter || style == RectangleArea;
const pdf::PDFPickTool::Mode pickingMode = isRectanglePicking ? pdf::PDFPickTool::Mode::Rectangles : pdf::PDFPickTool::Mode::Points;
m_pickTool = new pdf::PDFPickTool(proxy, pickingMode, this);
addTool(m_pickTool);
connect(m_pickTool, &pdf::PDFPickTool::pointPicked, this, &DimensionTool::onPointPicked);
connect(m_pickTool, &pdf::PDFPickTool::rectanglePicked, this, &DimensionTool::onRectanglePicked);
m_previewPointPixelSize = pdf::PDFWidgetUtils::scaleDPI_x(proxy->getWidget(), 5);
}
void DimensionTool::drawPage(QPainter* painter,
pdf::PDFInteger pageIndex,
const pdf::PDFPrecompiledPage* compiledPage,
pdf::PDFTextLayoutGetter& layoutGetter,
const QMatrix& pagePointToDevicePointMatrix,
QList<pdf::PDFRenderError>& errors) const
{
Q_UNUSED(compiledPage);
Q_UNUSED(layoutGetter);
Q_UNUSED(errors);
if (m_pickTool->getPageIndex() != pageIndex)
{
// Other page, nothing to draw
return;
}
if (m_style == RectanglePerimeter || m_style == RectangleArea)
{
// Nothing to draw, picking tool is already drawing picked rectangle
return;
}
painter->setPen(Qt::black);
const std::vector<QPointF>& points = m_pickTool->getPickedPoints();
for (size_t i = 1; i < points.size(); ++i)
{
painter->drawLine(pagePointToDevicePointMatrix.map(points[i - 1]), pagePointToDevicePointMatrix.map(points[i]));
}
if (!points.empty())
{
QMatrix inverted = pagePointToDevicePointMatrix.inverted();
QPointF adjustedPoint = adjustPagePoint(inverted.map(m_pickTool->getSnappedPoint()));
painter->drawLine(pagePointToDevicePointMatrix.map(points.back()), pagePointToDevicePointMatrix.map(adjustedPoint));
}
QPen pen = painter->pen();
pen.setWidth(m_previewPointPixelSize);
pen.setCapStyle(Qt::RoundCap);
painter->setPen(pen);
for (size_t i = 0; i < points.size(); ++i)
{
painter->drawPoint(pagePointToDevicePointMatrix.map(points[i]));
}
}
void DimensionTool::onPointPicked(pdf::PDFInteger pageIndex, QPointF pagePoint)
{
Q_UNUSED(pagePoint);
if (Dimension::isComplete(getDimensionType(), m_pickTool->getPickedPoints()))
{
// Create a new dimension...
std::vector<QPointF> points = m_pickTool->getPickedPoints();
for (QPointF& point : points)
{
point = adjustPagePoint(point);
}
pdf::PDFReal measuredValue = getMeasuredValue(pageIndex, points);
emit dimensionCreated(Dimension(getDimensionType(), pageIndex, measuredValue, qMove(points)));
m_pickTool->resetTool();
}
if ((m_style == Perimeter || m_style == Area) && m_pickTool->getPickedPoints().size() == 1)
{
m_pickTool->setCustomSnapPoints(pageIndex, m_pickTool->getPickedPoints());
}
}
void DimensionTool::onRectanglePicked(pdf::PDFInteger pageIndex, QRectF pageRectangle)
{
if (pageRectangle.isEmpty())
{
return;
}
std::vector<QPointF> points = { pageRectangle.topLeft(), pageRectangle.topRight(), pageRectangle.bottomRight(), pageRectangle.bottomLeft(), pageRectangle.topLeft() };
Q_ASSERT(Dimension::isComplete(getDimensionType(), points));
pdf::PDFReal measuredValue = getMeasuredValue(pageIndex, points);
emit dimensionCreated(Dimension(getDimensionType(), pageIndex, measuredValue, qMove(points)));
}
QPointF DimensionTool::adjustPagePoint(QPointF pagePoint) const
{
switch (m_style)
{
case Style::LinearHorizontal:
{
const std::vector<QPointF>& pickedPoints = m_pickTool->getPickedPoints();
if (!pickedPoints.empty())
{
const pdf::PDFPage* page = getDocument()->getCatalog()->getPage(m_pickTool->getPageIndex());
const bool rotated = page->getPageRotation() == pdf::PageRotation::Rotate90 || page->getPageRotation() == pdf::PageRotation::Rotate270;
if (rotated)
{
pagePoint.setX(pickedPoints.front().x());
}
else
{
pagePoint.setY(pickedPoints.front().y());
}
}
break;
}
case Style::LinearVertical:
{
const std::vector<QPointF>& pickedPoints = m_pickTool->getPickedPoints();
if (!pickedPoints.empty())
{
const pdf::PDFPage* page = getDocument()->getCatalog()->getPage(m_pickTool->getPageIndex());
const bool rotated = page->getPageRotation() == pdf::PageRotation::Rotate90 || page->getPageRotation() == pdf::PageRotation::Rotate270;
if (!rotated)
{
pagePoint.setX(pickedPoints.front().x());
}
else
{
pagePoint.setY(pickedPoints.front().y());
}
}
break;
}
default:
break;
}
return pagePoint;
}
Dimension::Type DimensionTool::getDimensionType() const
{
switch (m_style)
{
case DimensionTool::LinearHorizontal:
case DimensionTool::LinearVertical:
case DimensionTool::Linear:
return Dimension::Type::Linear;
case DimensionTool::Perimeter:
case DimensionTool::RectanglePerimeter:
return Dimension::Type::Perimeter;
case DimensionTool::Area:
case DimensionTool::RectangleArea:
return Dimension::Type::Area;
case DimensionTool::Angle:
return Dimension::Type::Angular;
}
Q_ASSERT(false);
return Dimension::Type::Linear;
}
pdf::PDFReal DimensionTool::getMeasuredValue(pdf::PDFInteger pageIndex, const std::vector<QPointF>& pickedPoints) const
{
const pdf::PDFPage* page = getDocument()->getCatalog()->getPage(pageIndex);
Q_ASSERT(page);
switch (getDimensionType())
{
case Dimension::Linear:
case Dimension::Perimeter:
{
pdf::PDFReal length = 0.0;
for (size_t i = 1; i < pickedPoints.size(); ++i)
{
QPointF vector = pickedPoints[i] - pickedPoints[i - 1];
length += qSqrt(QPointF::dotProduct(vector, vector));
}
return length * page->getUserUnit();
}
case Dimension::Area:
{
pdf::PDFReal area = 0.0;
// We calculate the area using standard formula for polygons.
// We determine integral over perimeter (for each edge of the polygon).
for (size_t i = 1; i < pickedPoints.size(); ++i)
{
const QPointF& p1 = pickedPoints[i - 1];
const QPointF& p2 = pickedPoints[i];
area += p1.x() * p2.y() - p1.y() * p2.x();
}
area = qAbs(area) * 0.5;
return area * page->getUserUnit() * page->getUserUnit();
}
case Dimension::Angular:
{
Q_ASSERT(pickedPoints.size() == 3);
QLineF line1(pickedPoints[1], pickedPoints.front());
QLineF line2(pickedPoints[1], pickedPoints.back());
return line1.angleTo(line2);
}
default:
Q_ASSERT(false);
break;
}
return 0.0;
}
bool Dimension::isComplete(Type type, const std::vector<QPointF>& polygon)
{
switch (type)
{
case Dimension::Linear:
return polygon.size() == 2;
case Dimension::Perimeter:
case Dimension::Area:
return polygon.size() > 2 && polygon.front() == polygon.back();
case Dimension::Angular:
return polygon.size() == 3;
default:
Q_ASSERT(false);
break;
}
return false;
}
DimensionUnits DimensionUnit::getLengthUnits()
{
DimensionUnits units;
units.emplace_back(1.0, DimensionTool::tr("pt"));
units.emplace_back(pdf::PDF_POINT_TO_INCH, DimensionTool::tr("in"));
units.emplace_back(pdf::PDF_POINT_TO_MM, DimensionTool::tr("mm"));
units.emplace_back(pdf::PDF_POINT_TO_MM * 0.1, DimensionTool::tr("cm"));
return units;
}
DimensionUnits DimensionUnit::getAreaUnits()
{
DimensionUnits units;
units.emplace_back(1.0, DimensionTool::tr("sq. pt"));
units.emplace_back(pdf::PDF_POINT_TO_INCH * pdf::PDF_POINT_TO_INCH, DimensionTool::tr("sq. in"));
units.emplace_back(pdf::PDF_POINT_TO_MM * pdf::PDF_POINT_TO_MM, DimensionTool::tr("sq. mm"));
units.emplace_back(pdf::PDF_POINT_TO_MM * 0.1 * pdf::PDF_POINT_TO_MM * 0.1, DimensionTool::tr("sq. cm"));
return units;
}
DimensionUnits DimensionUnit::getAngleUnits()
{
DimensionUnits units;
units.emplace_back(1.0, DimensionTool::tr("°"));
units.emplace_back(qDegreesToRadians(1.0), DimensionTool::tr("rad"));
return units;
}

View File

@@ -0,0 +1,132 @@
// Copyright (C) 2020 Jakub Melka
//
// This file is part of Pdf4Qt.
//
// Pdf4Qt is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Pdf4Qt is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with Pdf4Qt. If not, see <https://www.gnu.org/licenses/>.
#ifndef DIMENSIONTOOL_H
#define DIMENSIONTOOL_H
#include "pdfwidgettool.h"
#include <QAction>
#include <QPolygonF>
struct DimensionUnit;
using DimensionUnits = std::vector<DimensionUnit>;
struct DimensionUnit
{
explicit inline DimensionUnit() = default;
explicit inline DimensionUnit(pdf::PDFReal scale, QString symbol) :
scale(scale),
symbol(qMove(symbol))
{
}
pdf::PDFReal scale = 1.0;
QString symbol;
static DimensionUnits getLengthUnits();
static DimensionUnits getAreaUnits();
static DimensionUnits getAngleUnits();
};
class Dimension
{
public:
enum Type
{
Linear,
Perimeter,
Area,
Angular
};
inline explicit Dimension() = default;
inline explicit Dimension(Type type, pdf::PDFInteger pageIndex, pdf::PDFReal measuredValue, std::vector<QPointF> polygon) :
m_type(type),
m_pageIndex(pageIndex),
m_measuredValue(measuredValue),
m_polygon(qMove(polygon))
{
}
Type getType() const { return m_type; }
pdf::PDFInteger getPageIndex() const { return m_pageIndex; }
pdf::PDFReal getMeasuredValue() const { return m_measuredValue; }
const std::vector<QPointF>& getPolygon() const { return m_polygon; }
/// Returns true, if definition fo given type is complete
static bool isComplete(Type type, const std::vector<QPointF>& polygon);
private:
Type m_type = Linear;
pdf::PDFInteger m_pageIndex = -1;
pdf::PDFReal m_measuredValue = 0.0;
std::vector<QPointF> m_polygon;
};
class DimensionTool : public pdf::PDFWidgetTool
{
Q_OBJECT
private:
using BaseClass = pdf::PDFWidgetTool;
public:
enum Style
{
LinearHorizontal,
LinearVertical,
Linear,
Perimeter,
RectanglePerimeter,
Area,
RectangleArea,
Angle,
LastStyle
};
explicit DimensionTool(Style style, pdf::PDFDrawWidgetProxy* proxy, QAction* action, QObject* parent);
void drawPage(QPainter* painter,
pdf::PDFInteger pageIndex,
const pdf::PDFPrecompiledPage* compiledPage,
pdf::PDFTextLayoutGetter& layoutGetter,
const QMatrix& pagePointToDevicePointMatrix,
QList<pdf::PDFRenderError>& errors) const override;
signals:
void dimensionCreated(Dimension dimension);
private:
void onPointPicked(pdf::PDFInteger pageIndex, QPointF pagePoint);
void onRectanglePicked(pdf::PDFInteger pageIndex, QRectF pageRectangle);
QPointF adjustPagePoint(QPointF pagePoint) const;
Dimension::Type getDimensionType() const;
pdf::PDFReal getMeasuredValue(pdf::PDFInteger pageIndex, const std::vector<QPointF>& pickedPoints) const;
Style m_style;
int m_previewPointPixelSize;
pdf::PDFPickTool* m_pickTool;
};
#endif // DIMENSIONTOOL_H

View File

@@ -0,0 +1,15 @@
<RCC>
<qresource prefix="/pdfplugins/dimensiontool">
<file>area.svg</file>
<file>linear.svg</file>
<file>linear-horizontal.svg</file>
<file>linear-vertical.svg</file>
<file>perimeter.svg</file>
<file>clear-dimensions.svg</file>
<file>settings.svg</file>
<file>show-dimensions.svg</file>
<file>angle.svg</file>
<file>rectangle-area.svg</file>
<file>rectangle-perimeter.svg</file>
</qresource>
</RCC>

View File

@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="30mm"
height="30mm"
viewBox="0 0 30 30"
version="1.1"
id="svg8"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="linear-horizontal.svg">
<defs
id="defs2">
<inkscape:path-effect
effect="spiro"
id="path-effect831"
is_visible="true" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.979899"
inkscape:cx="189.75621"
inkscape:cy="148.69816"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="3840"
inkscape:window-height="2035"
inkscape:window-x="-13"
inkscape:window-y="-13"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:creator>
<cc:Agent>
<dc:title>Jakub Melka</dc:title>
</cc:Agent>
</dc:creator>
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<g
inkscape:label="Vrstva 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-267)">
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 11.646391,283.58184 v 0 0"
id="path837"
inkscape:connector-curvature="0" />
<path
style="opacity:1;fill:none;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 3.115571,287.49615 23.723115,-0.341"
id="path866"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1.52839077;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 3.0543087,290.85595 -0.065754,-6.96932"
id="path868"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1.528391;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 26.871563,290.55759 -0.06575,-6.96932"
id="path868-1"
inkscape:connector-curvature="0" />
<g
aria-label="x"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11.28888893px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
id="text895">
<path
d="m 17.631392,284.2886 h -1.30638 l -1.747353,-2.36471 -1.758376,2.36471 h -1.207162 l 2.403299,-3.07026 -2.38125,-3.08681 h 1.30638 l 1.736328,2.32613 1.741841,-2.32613 h 1.212673 l -2.419835,3.03168 z"
style="stroke-width:0.26458332"
id="path897"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@@ -0,0 +1,118 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="30mm"
height="30mm"
viewBox="0 0 30 30"
version="1.1"
id="svg8"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="linear-vertical.svg">
<defs
id="defs2">
<inkscape:path-effect
effect="spiro"
id="path-effect831"
is_visible="true" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.979899"
inkscape:cx="179.1496"
inkscape:cy="238.50072"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="3840"
inkscape:window-height="2035"
inkscape:window-x="-13"
inkscape:window-y="-13"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:creator>
<cc:Agent>
<dc:title>Jakub Melka</dc:title>
</cc:Agent>
</dc:creator>
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<g
inkscape:label="Vrstva 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-267)">
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 11.646391,283.58184 v 0 0"
id="path837"
inkscape:connector-curvature="0" />
<g
id="g905"
transform="rotate(90,16.252974,283.7)">
<path
inkscape:connector-curvature="0"
id="path866"
d="m 3.115571,287.49615 23.723115,-0.341"
style="opacity:1;fill:none;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path868"
d="m 3.0543087,290.85595 -0.065754,-6.96932"
style="fill:none;stroke:#000000;stroke-width:1.52839077;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path868-1"
d="m 26.871563,290.55759 -0.06575,-6.96932"
style="fill:none;stroke:#000000;stroke-width:1.528391;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<g
id="text895"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11.28888893px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
aria-label="x">
<path
inkscape:connector-curvature="0"
id="path897"
style="stroke-width:0.26458332"
d="m 17.631392,284.2886 h -1.30638 l -1.747353,-2.36471 -1.758376,2.36471 h -1.207162 l 2.403299,-3.07026 -2.38125,-3.08681 h 1.30638 l 1.736328,2.32613 1.741841,-2.32613 h 1.212673 l -2.419835,3.03168 z" />
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@@ -0,0 +1,118 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="30mm"
height="30mm"
viewBox="0 0 30 30"
version="1.1"
id="svg8"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="linear.svg">
<defs
id="defs2">
<inkscape:path-effect
effect="spiro"
id="path-effect831"
is_visible="true" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.979899"
inkscape:cx="179.1496"
inkscape:cy="238.50072"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="3840"
inkscape:window-height="2035"
inkscape:window-x="-13"
inkscape:window-y="-13"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:creator>
<cc:Agent>
<dc:title>Jakub Melka</dc:title>
</cc:Agent>
</dc:creator>
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<g
inkscape:label="Vrstva 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-267)">
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 11.646391,283.58184 v 0 0"
id="path837"
inkscape:connector-curvature="0" />
<g
id="g905"
transform="rotate(-45,9.290825,283.65821)">
<path
inkscape:connector-curvature="0"
id="path866"
d="m 3.115571,287.49615 23.723115,-0.341"
style="opacity:1;fill:none;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path868"
d="m 3.0543087,290.85595 -0.065754,-6.96932"
style="fill:none;stroke:#000000;stroke-width:1.52839077;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path868-1"
d="m 26.871563,290.55759 -0.06575,-6.96932"
style="fill:none;stroke:#000000;stroke-width:1.528391;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<g
id="text895"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11.28888893px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
aria-label="x">
<path
inkscape:connector-curvature="0"
id="path897"
style="stroke-width:0.26458332"
d="m 17.631392,284.2886 h -1.30638 l -1.747353,-2.36471 -1.758376,2.36471 h -1.207162 l 2.403299,-3.07026 -2.38125,-3.08681 h 1.30638 l 1.736328,2.32613 1.741841,-2.32613 h 1.212673 l -2.419835,3.03168 z" />
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="30mm"
height="30mm"
viewBox="0 0 30 30"
version="1.1"
id="svg8"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="perimeter.svg">
<defs
id="defs2">
<inkscape:path-effect
effect="spiro"
id="path-effect831"
is_visible="true" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="157.79444"
inkscape:cy="47.635251"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="3840"
inkscape:window-height="2035"
inkscape:window-x="-13"
inkscape:window-y="-13"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:creator>
<cc:Agent>
<dc:title>Jakub Melka</dc:title>
</cc:Agent>
</dc:creator>
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<g
inkscape:label="Vrstva 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-267)">
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 11.646391,283.58184 v 0 0"
id="path837"
inkscape:connector-curvature="0" />
<rect
style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:1.5;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="rect4611"
width="21.591888"
height="18.048363"
x="4.4790177"
y="273.08356"
rx="3.0000045"
ry="3.0000045" />
<g
aria-label="o"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11.28888893px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
id="text4615"
transform="translate(0.52916667)">
<path
d="m 17.786142,281.98022 q 0,1.50482 -0.771701,2.37574 -0.771701,0.87092 -2.067057,0.87092 -1.306381,0 -2.078082,-0.87092 -0.766189,-0.87092 -0.766189,-2.37574 0,-1.50482 0.766189,-2.37574 0.771701,-0.87643 2.078082,-0.87643 1.295356,0 2.067057,0.87643 0.771701,0.87092 0.771701,2.37574 z m -1.069357,0 q 0,-1.19614 -0.468533,-1.77491 -0.468533,-0.58429 -1.300868,-0.58429 -0.84336,0 -1.311893,0.58429 -0.463021,0.57877 -0.463021,1.77491 0,1.15755 0.468533,1.75838 0.468533,0.59531 1.306381,0.59531 0.826823,0 1.295356,-0.5898 0.474045,-0.59532 0.474045,-1.76389 z"
style="stroke-width:0.26458332"
id="path4617"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.2 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 109 KiB

View File

@@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="30mm"
height="30mm"
viewBox="0 0 30 30"
version="1.1"
id="svg8"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="rectangle-perimeter.svg">
<defs
id="defs2">
<inkscape:path-effect
effect="spiro"
id="path-effect831"
is_visible="true" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="113.0623"
inkscape:cy="47.635251"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="3840"
inkscape:window-height="2035"
inkscape:window-x="-13"
inkscape:window-y="-13"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:creator>
<cc:Agent>
<dc:title>Jakub Melka</dc:title>
</cc:Agent>
</dc:creator>
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<g
inkscape:label="Vrstva 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-267)">
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 11.646391,283.58184 v 0 0"
id="path837"
inkscape:connector-curvature="0" />
<rect
style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:1.5;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="rect4611"
width="21.591888"
height="18.048363"
x="4.4790177"
y="273.08356" />
<g
aria-label="o"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11.28888893px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
id="text4615"
transform="translate(0.52916667)">
<path
d="m 17.786142,281.98022 q 0,1.50482 -0.771701,2.37574 -0.771701,0.87092 -2.067057,0.87092 -1.306381,0 -2.078082,-0.87092 -0.766189,-0.87092 -0.766189,-2.37574 0,-1.50482 0.766189,-2.37574 0.771701,-0.87643 2.078082,-0.87643 1.295356,0 2.067057,0.87643 0.771701,0.87092 0.771701,2.37574 z m -1.069357,0 q 0,-1.19614 -0.468533,-1.77491 -0.468533,-0.58429 -1.300868,-0.58429 -0.84336,0 -1.311893,0.58429 -0.463021,0.57877 -0.463021,1.77491 0,1.15755 0.468533,1.75838 0.468533,0.59531 1.306381,0.59531 0.826823,0 1.295356,-0.5898 0.474045,-0.59532 0.474045,-1.76389 z"
style="stroke-width:0.26458332"
id="path4617"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="30mm"
height="30mm"
viewBox="0 0 30 30"
version="1.1"
id="svg8"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="settings.svg">
<defs
id="defs2">
<inkscape:path-effect
effect="spiro"
id="path-effect831"
is_visible="true" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.979899"
inkscape:cx="7.4236769"
inkscape:cy="148.69816"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="3840"
inkscape:window-height="2035"
inkscape:window-x="-13"
inkscape:window-y="-13"
inkscape:window-maximized="1"
inkscape:snap-text-baseline="false" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:creator>
<cc:Agent>
<dc:title>Jakub Melka</dc:title>
</cc:Agent>
</dc:creator>
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<g
inkscape:label="Vrstva 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-267)">
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 11.646391,283.58184 v 0 0"
id="path837"
inkscape:connector-curvature="0" />
<g
aria-label="🛠"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:22.57777786px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
id="text1428">
<path
d="m 24.477933,276.6919 q 0.110243,0.38585 0.110243,0.7717 0,1.1355 -0.79375,1.92925 -0.79375,0.79375 -1.929253,0.79375 -0.418924,0 -0.826823,-0.12126 l -2.656858,2.65685 6.030295,5.76572 -2.403298,2.40329 -5.776737,-6.03029 -2.524566,2.53559 q 0.121268,0.4079 0.121268,0.8158 0,1.14653 -0.79375,1.94028 -0.782726,0.79375 -1.929254,0.79375 -0.38585,0 -0.771701,-0.11025 l 2.094618,-2.09461 -2.061545,-2.06155 -2.0946183,2.09462 q -0.110243,-0.38585 -0.110243,-0.7717 0,-1.13551 0.79375,-1.92926 0.79375,-0.79375 1.9402773,-0.79375 0.385851,0 0.771702,0.0992 l 2.590712,-2.57969 -3.748264,-3.91362 1.89618,-1.89618 3.902605,3.74826 2.711979,-2.71198 q -0.09922,-0.37483 -0.09922,-0.76068 0,-1.15755 0.79375,-1.9513 0.79375,-0.79375 1.929253,-0.79375 0.396875,0 0.782726,0.11024 l -2.094618,2.09462 2.050521,2.06155 z m -14.033941,-1.65365 -1.8851563,1.88516 -0.3638021,-0.3638 1.8851564,-1.88516 z m 6.19566,0.30868 q -0.694532,-0.2756 -1.43316,-0.2756 -1.113455,0 -1.830035,0.70555 l -4.1230901,4.12309 0.429948,0.42995 -1.5654514,1.57648 -2.6348091,-2.63481 1.5654514,-1.56545 0.4850695,0.47404 4.1010417,-4.10104 q 0.848871,-0.83785 1.81901,-0.83785 1.631598,0 3.186025,2.10564 z"
style="stroke-width:0.26458332"
id="path1430"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@@ -0,0 +1,65 @@
// Copyright (C) 2020 Jakub Melka
//
// This file is part of Pdf4Qt.
//
// Pdf4Qt is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Pdf4Qt is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with Pdf4Qt. If not, see <https://www.gnu.org/licenses/>.
#include "settingsdialog.h"
#include "ui_settingsdialog.h"
#include "pdfwidgetutils.h"
SettingsDialog::SettingsDialog(QWidget* parent, DimensionUnit& lengthUnit, DimensionUnit& areaUnit, DimensionUnit& angleUnit) :
QDialog(parent),
ui(new Ui::SettingsDialog),
m_lengthUnit(lengthUnit),
m_areaUnit(areaUnit),
m_angleUnit(angleUnit)
{
ui->setupUi(this);
m_lengthUnits = DimensionUnit::getLengthUnits();
m_areaUnits = DimensionUnit::getAreaUnits();
m_angleUnits = DimensionUnit::getAngleUnits();
initComboBox(m_lengthUnits, m_lengthUnit, ui->lengthsComboBox);
initComboBox(m_areaUnits, m_areaUnit, ui->areasComboBox);
initComboBox(m_angleUnits, m_angleUnit, ui->anglesComboBox);
setMinimumSize(pdf::PDFWidgetUtils::scaleDPI(this, QSize(320, 160)));
}
SettingsDialog::~SettingsDialog()
{
delete ui;
}
void SettingsDialog::initComboBox(const DimensionUnits& units, const DimensionUnit& currentUnit, QComboBox* comboBox)
{
for (const DimensionUnit& unit : units)
{
comboBox->addItem(unit.symbol, unit.symbol);
}
comboBox->setCurrentIndex(comboBox->findText(currentUnit.symbol));
}
void SettingsDialog::accept()
{
m_lengthUnit = m_lengthUnits[ui->lengthsComboBox->currentIndex()];
m_areaUnit = m_areaUnits[ui->areasComboBox->currentIndex()];
m_angleUnit = m_angleUnits[ui->anglesComboBox->currentIndex()];
QDialog::accept();
}

View File

@@ -0,0 +1,58 @@
// Copyright (C) 2020 Jakub Melka
//
// This file is part of Pdf4Qt.
//
// Pdf4Qt is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Pdf4Qt is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with Pdf4Qt. If not, see <https://www.gnu.org/licenses/>.
#ifndef SETTINGSDIALOG_H
#define SETTINGSDIALOG_H
#include "dimensiontool.h"
#include <QDialog>
class QComboBox;
namespace Ui
{
class SettingsDialog;
}
class SettingsDialog : public QDialog
{
Q_OBJECT
public:
explicit SettingsDialog(QWidget* parent,
DimensionUnit& lengthUnit,
DimensionUnit& areaUnit,
DimensionUnit& angleUnit);
virtual ~SettingsDialog() override;
virtual void accept() override;
private:
Ui::SettingsDialog* ui;
void initComboBox(const DimensionUnits& units, const DimensionUnit& currentUnit, QComboBox* comboBox);
DimensionUnits m_lengthUnits;
DimensionUnits m_areaUnits;
DimensionUnits m_angleUnits;
DimensionUnit& m_lengthUnit;
DimensionUnit& m_areaUnit;
DimensionUnit& m_angleUnit;
};
#endif // SETTINGSDIALOG_H

View File

@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SettingsDialog</class>
<widget class="QDialog" name="SettingsDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>254</width>
<height>165</height>
</rect>
</property>
<property name="windowTitle">
<string>Unit Settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="unitsGroupBox">
<property name="title">
<string>Units</string>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="lengthsLabel">
<property name="text">
<string>Lengths</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="lengthsComboBox"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="areasLabel">
<property name="text">
<string>Areas</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="areasComboBox"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="anglesLabel">
<property name="text">
<string>Angles</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="anglesComboBox"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>SettingsDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>SettingsDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="30mm"
height="30mm"
viewBox="0 0 30 30"
version="1.1"
id="svg8"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="show-dimensions.svg">
<defs
id="defs2">
<inkscape:path-effect
effect="spiro"
id="path-effect831"
is_visible="true" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.979899"
inkscape:cx="7.4236769"
inkscape:cy="148.69816"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="3840"
inkscape:window-height="2035"
inkscape:window-x="-13"
inkscape:window-y="-13"
inkscape:window-maximized="1"
inkscape:snap-text-baseline="false" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:creator>
<cc:Agent>
<dc:title>Jakub Melka</dc:title>
</cc:Agent>
</dc:creator>
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<g
inkscape:label="Vrstva 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-267)">
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 11.646391,283.58184 v 0 0"
id="path837"
inkscape:connector-curvature="0" />
<g
aria-label="👁"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:33.86666489px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
id="text1414">
<path
d="m 29.186513,281.64292 q -1.273307,2.29857 -3.125391,3.91914 -4.448307,3.93568 -11.046353,3.93568 -6.5980467,0 -11.0628902,-3.93568 -1.8520832,-1.62057 -3.14192692,-3.91914 1.28984372,-2.29857 3.14192692,-3.93567 4.4648435,-3.93568 11.0628902,-3.93568 6.598046,0 11.046353,3.93568 1.852084,1.6371 3.125391,3.93567 z m -2.695443,0 q -0.810286,-1.42213 -1.967838,-2.54661 -2.778125,-2.67891 -6.846094,-3.3569 1.769401,0.76067 2.844271,2.33164 1.091406,1.62057 1.091406,3.57187 0,1.93477 -1.074869,3.52227 -1.058334,1.5875 -2.794662,2.36471 5.986198,-1.02526 8.747786,-5.88698 z m -6.250781,0 q 0,-2.11666 -1.53789,-3.62148 -1.537891,-1.50482 -3.704167,-1.50482 -1.141015,0 -2.166276,0.46302 l -0.545703,-1.24023 q -6.0027337,1.02526 -8.7808586,5.90351 0.8102865,1.42214 1.951302,2.53008 2.7615884,2.66237 6.7799476,3.3569 -1.736328,-0.77721 -2.7946613,-2.36471 -1.0583333,-1.5875 -1.0583333,-3.52227 0,-1.17409 0.4134114,-2.28203 l 1.3229162,0.41341 q -0.3638016,0.90951 -0.3638016,1.86862 0,2.13321 1.5378906,3.63802 1.53789,1.48828 3.704166,1.48828 2.166276,0 3.704167,-1.48828 1.53789,-1.50481 1.53789,-3.63802 z m -1.273307,0 q 0,1.60404 -1.174088,2.74505 -1.157552,1.14102 -2.794662,1.14102 -1.653645,0 -2.811197,-1.14102 -1.157552,-1.14101 -1.157552,-2.74505 0,-0.71107 0.248046,-1.37252 l 4.051433,1.83554 -1.901693,-4.01836 q 0.744141,-0.33072 1.570963,-0.33072 1.63711,0 2.794662,1.14101 1.174088,1.14102 1.174088,2.74505 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:33.86666489px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;stroke-width:0.26458332"
id="path1416"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.2 KiB