Add text infos to the tiles

This commit is contained in:
Ronan Le Tiec 2020-11-16 20:22:38 +01:00
parent db4bd0d616
commit 97351b58dd
3 changed files with 45 additions and 7 deletions

View File

@ -34,16 +34,16 @@
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1845"
inkscape:window-height="1016"
inkscape:window-width="1510"
inkscape:window-height="773"
id="namedview9"
showgrid="false"
inkscape:zoom="4"
inkscape:cx="-13.069473"
inkscape:cy="57.804097"
inkscape:window-x="75"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:window-x="285"
inkscape:window-y="105"
inkscape:window-maximized="0"
inkscape:current-layer="g4593"
inkscape:document-rotation="0"
units="mm" />
@ -70,7 +70,7 @@
<path
d="m 35.464624,949.91014 c 0.230465,0.52643 0.870608,0.69376 1.398007,0.64716 l 3.304293,-0.26293 c 0.731614,0.72349 1.628019,0.83334 1.561751,1.06451 -0.0518,0.18068 -0.206363,0.0935 -0.316383,0.57109 -0.105643,0.45854 0.270125,0.92791 0.724333,1.02609 0.445128,0.1305 1.005282,-0.0787 1.144322,-0.54876 0.169277,-0.46512 -0.103509,-1.02036 -0.566757,-1.18679 -0.529488,-0.2409 -1.605018,-0.18663 -1.828451,-1.14178 0.523391,-0.5334 1.131267,-0.36105 1.671359,-0.172 0.448397,0.15694 1.033456,0.18325 1.379387,-0.20254 0.333251,-0.36924 0.302424,-1.0396 -0.142367,-1.30936 -0.435692,-0.31827 -1.169106,-0.28414 -1.445396,0.24254 -0.212966,0.40597 0.03447,0.69635 -0.127746,0.81938 -0.122393,0.0928 -0.664876,-0.13679 -1.795242,0.0259 l -1.329919,-0.94598 c -0.313891,0.0425 -0.891164,0.12806 -1.114904,0.15904 l 1.174988,0.87587 -3.691276,0.33854 z m 6.453633,2.59727 c -0.395055,-0.39744 -0.15243,-1.09881 0.375877,-1.09666 0.486113,-0.0272 0.927723,0.56435 0.649487,1.00299 -0.195206,0.3694 -0.754918,0.36575 -1.025364,0.0937 z m 0.814577,-2.91872 c -0.438826,-0.32194 -0.11744,-1.12844 0.413631,-1.09697 0.363954,-0.02 0.789772,0.28097 0.711461,0.68053 -0.0714,0.49265 -0.751419,0.7613 -1.125092,0.41644 z"
id="path4599"
style="fill:#c8c8c8;fill-opacity:1;stroke-width:0.377953;marker-start:none"
style="fill:#b4b4b4;fill-opacity:1;stroke-width:0.377953;marker-start:none"
sodipodi:nodetypes="cccscccccccccccccccccccccccc" />
</g>
</g>

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -70,7 +70,7 @@
<path
d="m 36.184207,948.95114 c 0.569876,0.0741 0.909488,0.64195 1.012188,1.16134 l 0.671333,3.24604 c 0.899184,0.50018 1.255261,1.33013 1.458678,1.20188 0.158999,-0.10024 0.0321,-0.22428 0.459871,-0.46343 0.410725,-0.22962 0.966427,-6e-5 1.187683,0.40859 0.249732,0.3909 0.205467,0.9872 -0.206972,1.25211 -0.399242,0.29256 -1.008607,0.18588 -1.297908,-0.21237 -0.379329,-0.44103 -0.627899,-1.48884 -1.60743,-1.43634 -0.365808,0.65165 -0.03037,1.1871 0.302112,1.65281 0.276041,0.38663 0.464872,0.94101 0.191168,1.381 -0.261348,0.42319 -0.913595,0.58101 -1.296949,0.22937 -0.427389,-0.32934 -0.599659,-1.04305 -0.171218,-1.45557 0.330248,-0.31797 0.678218,-0.16158 0.751001,-0.35173 0.05492,-0.14347 -0.317221,-0.60012 -0.476999,-1.7309 l -1.280073,-1.01242 c -0.04695,-0.31326 -0.126182,-0.89144 -0.158987,-1.11492 l 1.169432,0.88327 -0.706915,-3.63873 z m 4.297937,5.47019 c -0.492034,-0.26819 -1.097611,0.16084 -0.947845,0.66748 0.109774,0.47433 0.80121,0.73295 1.144574,0.34318 0.300097,-0.29069 0.140107,-0.82706 -0.196729,-1.01066 z m -2.57461,1.59808 c -0.431781,-0.33133 -1.116275,0.20272 -0.937591,0.70381 0.08252,0.35505 0.490562,0.67973 0.8523,0.49284 0.453046,-0.20628 0.52087,-0.93429 0.08529,-1.19665 z"
id="path4599"
style="fill:#c8c8c8;fill-opacity:1;stroke-width:0.377954;marker-start:none"
style="fill:#b4b4b4;fill-opacity:1;stroke-width:0.377954;marker-start:none"
sodipodi:nodetypes="cccscccccccccccccccccccccccc" />
</g>
</g>

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -954,6 +954,44 @@ void VPMainWindow::generateTiledPdf(QString fileName)
painter.setPen(penTileDrawing);
m_graphicsView->GetScene()->render(&painter, target, source, Qt::IgnoreAspectRatio);
QTextDocument td;
td.documentLayout()->setPaintDevice(printer);
td.setPageSize(QSizeF(tilesDrawingAreaWidth - UnitConvertor(2, Unit::Cm, Unit::Px), tilesDrawingAreaHeight));
const QString grid = tr("Grid ( %1 , %2 )").arg(row+1).arg(col+1);
const QString page = tr("Page %1 of %2").arg(row*nbCol+col+1).arg(nbCol*nbRow);
td.setHtml(QString("<table width='100%' style='color:rgb(180,180,180);'>"
"<tr>"
"<td align='center'>%1</td>"
"</tr>"
"</table>")
.arg(grid));
painter.setPen(penTileInfos);
painter.save();
painter.translate(QPointF(tilesMargins.left()+ UnitConvertor(1, Unit::Cm, Unit::Px),
tilesDrawingAreaHeight + tilesMargins.top()
));
td.drawContents(&painter);
painter.restore();
td.setPageSize(QSizeF(tilesDrawingAreaHeight - UnitConvertor(2, Unit::Cm, Unit::Px), tilesDrawingAreaWidth));
td.setHtml(QString("<table width='100%' style='color:rgb(180,180,180);'>"
"<tr>"
"<td align='center'>%1 - %2</td>"
"</tr>"
"</table>")
.arg(page).arg(m_layout->GetFocusedSheet()->GetName()));
painter.save();
painter.rotate(-90);
painter.translate(QPointF(-(tilesDrawingAreaHeight+tilesMargins.top()) + UnitConvertor(1, Unit::Cm, Unit::Px),
tilesDrawingAreaWidth + tilesMargins.left()
));
td.drawContents(&painter);
painter.restore();
}
}