Merge remote-tracking branch 'origin/et_preview_layout' into dev

This commit is contained in:
enricoturri1966 2022-01-14 09:55:48 +01:00
commit d45e243ba4
29 changed files with 1735 additions and 67 deletions

View File

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
version="1.1"
id="Capa_1"
x="0px"
y="0px"
viewBox="0 0 348.882 348.882"
style="enable-background:new 0 0 348.882 348.882;"
xml:space="preserve"
sodipodi:docname="edit_button - Copy.svg"
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs209">
</defs><sodipodi:namedview
id="namedview207"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="2.3274346"
inkscape:cx="89.583613"
inkscape:cy="139.85355"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="3191"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" />
<path
d="m 333.988,11.758 -0.42,-0.383 C 325.538,4.04 315.129,0 304.258,0 292.071,0 280.37,5.159 272.154,14.153 L 116.803,184.231 c -1.416,1.55 -2.49,3.379 -3.154,5.37 l -18.267,54.762 c -2.112,6.331 -1.052,13.333 2.835,18.729 3.918,5.438 10.23,8.685 16.886,8.685 0,0 0.001,0 0.001,0 2.879,0 5.693,-0.592 8.362,-1.76 l 52.89,-23.138 c 1.923,-0.841 3.648,-2.076 5.063,-3.626 L 336.771,73.176 C 352.937,55.479 351.69,27.929 333.988,11.758 Z m -203.607,222.489 10.719,-32.134 0.904,-0.99 20.316,18.556 -0.904,0.99 z M 314.621,52.943 182.553,197.53 162.237,178.974 294.305,34.386 c 2.583,-2.828 6.118,-4.386 9.954,-4.386 3.365,0 6.588,1.252 9.082,3.53 l 0.419,0.383 c 5.484,5.009 5.87,13.546 0.861,19.03 z"
id="path170"
style="fill:#ed6b21;fill-opacity:1" /><path
d="m 303.85,138.388 c -8.284,0 -15,6.716 -15,15 v 127.347 c 0,21.034 -17.113,38.147 -38.147,38.147 H 68.904 c -21.035,0 -38.147,-17.113 -38.147,-38.147 V 100.413 c 0,-21.034 17.113,-38.147 38.147,-38.147 h 131.587 c 8.284,0 15,-6.716 15,-15 0,-8.284 -6.716,-15 -15,-15 H 68.904 c -37.577,0 -68.147,30.571 -68.147,68.147 v 180.321 c 0,37.576 30.571,68.147 68.147,68.147 h 181.798 c 37.576,0 68.147,-30.571 68.147,-68.147 V 153.388 c 0.001,-8.284 -6.715,-15 -14.999,-15 z"
id="path172"
style="fill:#ed6b21;fill-opacity:1" />
<g
id="g176">
</g>
<g
id="g178">
</g>
<g
id="g180">
</g>
<g
id="g182">
</g>
<g
id="g184">
</g>
<g
id="g186">
</g>
<g
id="g188">
</g>
<g
id="g190">
</g>
<g
id="g192">
</g>
<g
id="g194">
</g>
<g
id="g196">
</g>
<g
id="g198">
</g>
<g
id="g200">
</g>
<g
id="g202">
</g>
<g
id="g204">
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -0,0 +1,157 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
version="1.1"
id="Capa_1"
x="0px"
y="0px"
viewBox="0 0 348.882 348.882"
style="enable-background:new 0 0 348.882 348.882;"
xml:space="preserve"
sodipodi:docname="legend_colorchange.svg"
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs209">
</defs><sodipodi:namedview
id="namedview207"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="0.8228724"
inkscape:cx="159.80606"
inkscape:cy="209.63153"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" />
<g
id="g176">
</g>
<g
id="g178">
</g>
<g
id="g180">
</g>
<g
id="g182">
</g>
<g
id="g184">
</g>
<g
id="g186">
</g>
<g
id="g188">
</g>
<g
id="g190">
</g>
<g
id="g192">
</g>
<g
id="g194">
</g>
<g
id="g196">
</g>
<g
id="g198">
</g>
<g
id="g200">
</g>
<g
id="g202">
</g>
<g
id="g204">
</g>
<rect
style="fill:#da948b;fill-opacity:1"
id="rect4805"
width="280.72397"
height="36.457657"
x="34.634773"
y="295.91464" /><g
id="g5796"
transform="matrix(0.5,0,0,0.5,48.819638,25.122266)"><path
style="fill:#ffce47"
d="m 433.479,205.747 c 75.09,43.351 100.812,139.37 57.461,214.46 -43.351,75.09 -139.37,100.812 -214.46,57.461 -7.304,-4.21 -14.135,-8.93 -20.48,-14.074 l 31.824,-170.903 123.221,-97.645 c 7.632,2.924 15.13,6.491 22.434,10.701 z"
id="path4126" /><path
style="fill:#ff4181"
d="m 78.521,205.747 c -75.09,43.351 -100.812,139.37 -57.461,214.46 43.351,75.09 139.37,100.812 214.46,57.461 7.304,-4.21 14.135,-8.93 20.48,-14.074 L 224.176,292.691 100.955,195.046 c -7.632,2.924 -15.13,6.491 -22.434,10.701 z"
id="path4128" /><path
style="fill:#4eb9ff"
d="m 412.999,170.271 c 0,8.432 -0.667,16.707 -1.953,24.775 L 256,256.196 100.954,195.046 c -1.286,-8.068 -1.953,-16.343 -1.953,-24.775 0,-86.713 70.298,-156.999 156.999,-156.999 86.701,0 156.999,70.285 156.999,156.999 z"
id="path4130" /><path
style="fill:#ff755c"
d="M 312.09,316.957 H 199.91 c -8.7,54.525 12.023,110.943 56.09,146.637 44.066,-35.694 64.789,-92.112 56.09,-146.637 z"
id="path4132" /><path
style="fill:#85c250"
d="m 256,219.797 56.09,97.16 c 51.577,-19.74 90.086,-65.906 98.955,-121.911 C 358.098,174.724 298.865,185 256,219.797 Z"
id="path4134" /><path
style="fill:#3b8bc0"
d="m 100.954,195.046 c 8.869,56.005 47.379,102.171 98.955,121.911 l 56.09,-97.16 C 213.134,185 153.902,174.724 100.954,195.046 Z"
id="path4136" /><path
style="fill:#174461"
d="m 292.981,263.208 c 9.876,17.119 16.173,35.331 19.109,53.748 -17.423,6.661 -36.326,10.313 -56.09,10.313 -19.764,0 -38.667,-3.652 -56.09,-10.313 2.936,-18.418 9.233,-36.629 19.109,-53.749 9.876,-17.107 22.494,-31.667 36.981,-43.411 14.486,11.746 27.105,26.305 36.981,43.412 z"
id="path4138" /><use
x="0"
y="0"
xlink:href="#path4126"
id="use4251"
width="100%"
height="100%" /><use
x="0"
y="0"
xlink:href="#path4128"
id="use4253"
width="100%"
height="100%" /><use
x="0"
y="0"
xlink:href="#path4130"
id="use4255"
width="100%"
height="100%" /><use
x="0"
y="0"
xlink:href="#path4132"
id="use4257"
width="100%"
height="100%" /><use
x="0"
y="0"
xlink:href="#path4134"
id="use4259"
width="100%"
height="100%" /><use
x="0"
y="0"
xlink:href="#path4136"
id="use4261"
width="100%"
height="100%" /><use
x="0"
y="0"
xlink:href="#path4138"
id="use4263"
width="100%"
height="100%" /></g></svg>

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -0,0 +1,9 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 96 96">
<rect id="rect4805" x="11.7" y="81.8" width="73.6" height="9.56" style="fill: #e2d243"/>
<g>
<path d="M38.1,25c-5.6,5.6-3.5,15.9,3.9,18.7.8.3.9.5-.7,1.9C26.6,58.2,29.4,62,21.5,51.7c-2.5-3.3,4-4.8,3-7.1a17,17,0,0,1-1.8-4.4c-.1-.4-.2-.5-.7-.5-2.6-.1-6.5,1.1-6.6-2.9a45.7,45.7,0,0,0,0-7.4c-.1-1.8.8-3.5,2.8-3.3s4.3,1,4.8-1.2a14,14,0,0,1,1.6-3.8,1,1,0,0,0-.3-1.4c-1.4-1.6-4.9-3.6-2.5-5.9l6.1-6.1a2.1,2.1,0,0,1,3.3,0c4.8,5.1,2.6,2.3,8.1,1.1,1.4-.3,1.3-.9,1.2-1.9a18.6,18.6,0,0,1-.4-3.4c.6-2.8,3.8-1.9,5.9-2h5.3c1.7,0,2.4.7,2.5,2.5s-.8,3.7,1.8,5,3.5,2.6,4.9.8S63.9,5.5,66,7.6l6.3,6.3c.5.4.4.8-.1,1.2L59,28.3c-.7.7-.9.2-1.2-.3C55,20.8,44.2,18.6,39,24.1" style="fill: #ed6b21"/>
<path d="M78.9,18.8c1.7.1,8.5,7.4,10.1,9.2a1.7,1.7,0,0,1,0,2.4c-1.6,1.7-3.4,3.4-5.1,5.1a.7.7,0,0,1-1.1,0L72.5,25.2c-.4-.5-.3-.7.3-1.3s2.8-2.8,4.1-4.1A2.8,2.8,0,0,1,78.9,18.8Z" style="fill: #fff"/>
<path d="M45.7,73.7h0c-1.6,1.2-3.5,1.2-5.3,1.7l-5.6,1.3c-2.1.4-2.9.3-3.7-1.4a1.3,1.3,0,0,1-.1-.6c.8-3.6,1.5-7.2,2.4-10.8.5-1.8,2.2-2.7,3.4-4s.6,0,.9.2L47.8,70.3a.8.8,0,0,1,.4.9" style="fill: #fff"/>
<path d="M78.2,39.4a1.1,1.1,0,0,1,0,1.5c-7.9,8.5-16.6,16.5-24.7,24.9-.6.6-1,.7-1.6,0l-9.8-9.7a1.2,1.2,0,0,1,0-1.6c8.4-8.3,16.7-16.7,25-25,.4-.4.7-.5,1.2,0C71.5,32.8,74.9,36,78.2,39.4Z" style="fill: #fff"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
version="1.1"
id="Capa_1"
x="0px"
y="0px"
viewBox="0 0 348.882 348.882"
style="enable-background:new 0 0 348.882 348.882;"
xml:space="preserve"
sodipodi:docname="legend_deretract.svg"
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs209">
</defs><sodipodi:namedview
id="namedview207"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="1.6457448"
inkscape:cx="174.08531"
inkscape:cy="175.30057"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" />
<g
id="g176">
</g>
<g
id="g178">
</g>
<g
id="g180">
</g>
<g
id="g182">
</g>
<g
id="g184">
</g>
<g
id="g186">
</g>
<g
id="g188">
</g>
<g
id="g190">
</g>
<g
id="g192">
</g>
<g
id="g194">
</g>
<g
id="g196">
</g>
<g
id="g198">
</g>
<g
id="g200">
</g>
<g
id="g202">
</g>
<g
id="g204">
</g>
<path
d="m 168.35743,271.22732 a 7.3770678,7.3770678 0 0 0 2.35439,5.49356 7.5340268,7.5340268 0 0 0 10.98712,0 l 92.13487,-91.82095 a 7.5340268,7.5340268 0 0 0 0,-10.98712 7.5340268,7.5340268 0 0 0 -10.98712,0 l -92.13487,91.82095 a 7.3770678,7.3770678 0 0 0 -2.35439,5.49356 z"
fill="#333333"
id="path3790"
style="fill:#ed6b21;fill-opacity:1;stroke-width:4;stroke:#ed6b21;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" /><path
d="m 76.222558,179.09246 a 7.3770678,7.3770678 0 0 0 2.354394,5.80747 l 92.134868,91.82095 a 7.5340268,7.5340268 0 0 0 10.98712,0 7.5340268,7.5340268 0 0 0 0,-10.98712 L 89.564071,173.59889 a 7.5340268,7.5340268 0 0 0 -10.987119,0 7.3770678,7.3770678 0 0 0 -2.354394,5.49357 z m 92.134872,18.20723 a 8.0049033,8.0049033 0 0 0 2.35439,5.65052 7.8479445,7.8479445 0 0 0 10.98712,0 l 92.13487,-92.29183 a 7.5340268,7.5340268 0 0 0 0,-10.987123 7.5340268,7.5340268 0 0 0 -10.98712,0 l -92.13487,92.134873 a 7.6909855,7.6909855 0 0 0 -2.35439,5.49356 z"
fill="#333333"
id="path3792"
style="fill:#ed6b21;fill-opacity:1;stroke-width:4;stroke:#ed6b21;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" /><path
d="m 76.222558,105.16482 a 7.3770678,7.3770678 0 0 0 2.354394,5.49356 l 92.134868,92.29183 a 7.8479445,7.8479445 0 0 0 10.98712,0 7.8479445,7.8479445 0 0 0 0,-11.14408 L 89.564071,99.671257 a 7.8479445,7.8479445 0 0 0 -13.341513,5.493563 z m 92.134872,18.20723 a 8.0049033,8.0049033 0 0 0 2.35439,5.65052 7.8479445,7.8479445 0 0 0 10.98712,0 l 92.13487,-92.134866 a 7.8479445,7.8479445 0 0 0 0,-11.144082 7.8479445,7.8479445 0 0 0 -10.98712,0 l -92.13487,92.134868 a 7.8479445,7.8479445 0 0 0 -2.35439,5.49356 z"
fill="#333333"
id="path3794"
style="fill:#ed6b21;fill-opacity:1;stroke-width:4;stroke:#ed6b21;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" /><path
d="m 76.222558,31.237177 a 8.0049033,8.0049033 0 0 0 2.354394,5.650527 l 92.134868,92.134866 a 7.8479445,7.8479445 0 0 0 10.98712,0 7.8479445,7.8479445 0 0 0 0,-11.14408 L 89.564071,25.743622 a 7.8479445,7.8479445 0 0 0 -13.341513,5.493555 z"
fill="#333333"
id="path3796"
style="fill:#ed6b21;fill-opacity:1;stroke-width:4;stroke:#ed6b21;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" /><rect
style="fill:#49adcf;fill-opacity:1"
id="rect4805"
width="280.72397"
height="36.457657"
x="34.634773"
y="295.91464" /></svg>

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
id="Layer_1"
style="enable-background:new 0 0 96 96;"
version="1.1"
viewBox="0 0 96 96"
xml:space="preserve"
sodipodi:docname="legend_pauseprints.svg"
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs7016"><linearGradient
id="linearGradient7403"
inkscape:swatch="solid"><stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop7401" /></linearGradient></defs><sodipodi:namedview
id="namedview7014"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="4.2291667"
inkscape:cx="6.2660098"
inkscape:cy="41.73399"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" /><style
type="text/css"
id="style6991">
.st0{fill:none;stroke:#010000;stroke-width:4;stroke-linecap:round;stroke-miterlimit:10;}
.st1{fill:none;stroke:#010000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st2{fill:none;stroke:#010000;stroke-width:4;stroke-linejoin:round;stroke-miterlimit:10;}
.st3{fill:none;stroke:#010000;stroke-width:6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st4{fill:#010000;}
.st5{fill:none;stroke:#010000;stroke-width:3.8974;stroke-linejoin:round;stroke-miterlimit:10;}
.st6{fill:none;stroke:#010000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st7{fill:#010000;stroke:#010000;stroke-width:2;stroke-miterlimit:10;}
.st8{opacity:0.75;}
.st9{fill:none;stroke:#010000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:10;}
.st10{fill:none;stroke:#010000;stroke-width:6;stroke-linejoin:round;stroke-miterlimit:10;}
.st11{fill:none;stroke:#010000;stroke-width:3;stroke-linejoin:round;stroke-miterlimit:10;}
.st12{fill:none;stroke:#010000;stroke-width:3.9497;stroke-linejoin:round;stroke-miterlimit:10;}
.st13{fill:none;stroke:#010000;stroke-width:1.9008;stroke-linejoin:round;stroke-miterlimit:10;}
.st14{fill:none;stroke:#010000;stroke-width:1.9935;stroke-linejoin:round;stroke-miterlimit:10;}
.st15{fill:none;stroke:#010000;stroke-width:4;stroke-miterlimit:10;}
.st16{fill:none;stroke:#010000;stroke-width:1.9048;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st17{fill:none;stroke:#010000;stroke-width:1.934;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st18{fill:none;stroke:#010000;stroke-width:1.9684;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st19{fill:none;stroke:#010000;stroke-width:1.9343;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
</style><rect
style="fill:#52f083;fill-opacity:1;stroke-width:0.262144"
id="rect4805"
width="73.590103"
height="9.5571566"
x="11.677858"
y="81.76329" /><g
id="g7865"
transform="matrix(0.13421773,0,0,0.13421773,16.48933,9.3957966)"><path
d="m 355.507,181.955 c 8.793,-6.139 29.39,-20.519 29.39,-55.351 v -71.77 h 9.814 c 4.49,0 8.17,-3.679 8.17,-8.169 V 8.165 C 402.881,3.675 399.2,0 394.711,0 H 78.351 c -4.495,0 -8.165,3.675 -8.165,8.165 v 38.5 c 0,4.491 3.67,8.169 8.165,8.169 h 9.82 v 73.071 c 0,34.499 10.502,42.576 29.074,53.89 l 80.745,49.203 v 20.984 c -20.346,12.23 -73.465,44.242 -80.434,49.107 -8.793,6.135 -29.384,20.51 -29.384,55.352 v 61.793 h -9.82 c -4.495,0 -8.165,3.676 -8.165,8.166 v 38.498 c 0,4.49 3.67,8.17 8.165,8.17 h 316.361 c 4.49,0 8.17,-3.68 8.17,-8.17 V 426.4 c 0,-4.49 -3.681,-8.166 -8.17,-8.166 h -9.814 V 355.13 c 0,-34.493 -10.508,-42.572 -29.069,-53.885 l -80.745,-49.202 v -20.987 c 20.332,-12.225 73.452,-44.234 80.422,-49.101 z m -102.781,90.904 87.802,53.5 c 6.734,4.109 10.333,6.373 12.001,9.002 1.991,3.164 2.963,9.627 2.963,19.768 v 63.104 H 117.574 V 356.44 c 0,-19.507 9.718,-26.289 16.81,-31.242 5.551,-3.865 54.402,-33.389 85.878,-52.289 4.428,-2.658 7.135,-7.441 7.135,-12.611 v -37.563 c 0,-5.123 -2.671,-9.883 -7.053,-12.55 l -87.54,-53.339 -0.265,-0.165 c -6.741,-4.105 -10.336,-6.369 -11.998,-9.009 -1.992,-3.156 -2.968,-9.626 -2.968,-19.767 v -73.07 h 237.918 v 71.77 c 0,19.5 -9.718,26.288 -16.814,31.235 -5.546,3.872 -54.391,33.395 -85.869,52.295 -4.427,2.658 -7.134,7.442 -7.134,12.601 v 37.563 c 0.001,5.132 2.672,9.889 7.052,12.56 z"
id="path7859"
style="fill:#ffffff;fill-opacity:1" /><path
d="m 331.065,154.234 c 0,0 5.291,-4.619 -2.801,-3.299 -19.178,3.115 -53.079,15.133 -92.079,15.133 -39,0 -57,-11 -82.507,-11.303 -5.569,-0.066 -5.456,3.629 0.937,7.391 6.386,3.758 63.772,35.681 71.671,40.08 7.896,4.389 12.417,4.05 20.786,0 12.174,-5.902 83.993,-48.002 83.993,-48.002 z"
id="path7861"
style="stroke:#ed6b21;stroke-opacity:1;fill:#ed6b21;fill-opacity:1" /><path
d="m 154.311,397.564 c -6.748,6.209 -9.978,10.713 5.536,10.713 12.656,0 139.332,0 155.442,0 16.099,0 9.856,-5.453 2.311,-12.643 -14.576,-13.883 -45.416,-23.566 -82.414,-23.566 -38.754,0 -65.844,11.655 -80.875,25.496 z"
id="path7863"
style="stroke:#ed6b21;stroke-opacity:1;fill:#ed6b21;fill-opacity:1" /></g></svg>

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
version="1.1"
id="Capa_1"
x="0px"
y="0px"
viewBox="0 0 348.882 348.882"
style="enable-background:new 0 0 348.882 348.882;"
xml:space="preserve"
sodipodi:docname="legend_retract.svg"
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs209">
</defs><sodipodi:namedview
id="namedview207"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="1.6457448"
inkscape:cx="174.08531"
inkscape:cy="175.30057"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" />
<g
id="g176">
</g>
<g
id="g178">
</g>
<g
id="g180">
</g>
<g
id="g182">
</g>
<g
id="g184">
</g>
<g
id="g186">
</g>
<g
id="g188">
</g>
<g
id="g190">
</g>
<g
id="g192">
</g>
<g
id="g194">
</g>
<g
id="g196">
</g>
<g
id="g198">
</g>
<g
id="g200">
</g>
<g
id="g202">
</g>
<g
id="g204">
</g>
<g
id="g5653"
transform="matrix(1,0,0,-1,0,302.59856)"
style="stroke:#ed6b21;stroke-opacity:1;fill:#ed6b21;fill-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none"><path
d="m 168.35743,271.22732 a 7.3770678,7.3770678 0 0 0 2.35439,5.49356 7.5340268,7.5340268 0 0 0 10.98712,0 l 92.13487,-91.82095 a 7.5340268,7.5340268 0 0 0 0,-10.98712 7.5340268,7.5340268 0 0 0 -10.98712,0 l -92.13487,91.82095 a 7.3770678,7.3770678 0 0 0 -2.35439,5.49356 z"
fill="#333333"
id="path3790"
style="fill:#ed6b21;fill-opacity:1;stroke-width:4;stroke:#ed6b21;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" /><path
d="m 76.222558,179.09246 a 7.3770678,7.3770678 0 0 0 2.354394,5.80747 l 92.134868,91.82095 a 7.5340268,7.5340268 0 0 0 10.98712,0 7.5340268,7.5340268 0 0 0 0,-10.98712 L 89.564071,173.59889 a 7.5340268,7.5340268 0 0 0 -10.987119,0 7.3770678,7.3770678 0 0 0 -2.354394,5.49357 z m 92.134872,18.20723 a 8.0049033,8.0049033 0 0 0 2.35439,5.65052 7.8479445,7.8479445 0 0 0 10.98712,0 l 92.13487,-92.29183 a 7.5340268,7.5340268 0 0 0 0,-10.987123 7.5340268,7.5340268 0 0 0 -10.98712,0 l -92.13487,92.134873 a 7.6909855,7.6909855 0 0 0 -2.35439,5.49356 z"
fill="#333333"
id="path3792"
style="fill:#ed6b21;fill-opacity:1;stroke-width:4;stroke:#ed6b21;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" /><path
d="m 76.222558,105.16482 a 7.3770678,7.3770678 0 0 0 2.354394,5.49356 l 92.134868,92.29183 a 7.8479445,7.8479445 0 0 0 10.98712,0 7.8479445,7.8479445 0 0 0 0,-11.14408 L 89.564071,99.671257 a 7.8479445,7.8479445 0 0 0 -13.341513,5.493563 z m 92.134872,18.20723 a 8.0049033,8.0049033 0 0 0 2.35439,5.65052 7.8479445,7.8479445 0 0 0 10.98712,0 l 92.13487,-92.134866 a 7.8479445,7.8479445 0 0 0 0,-11.144082 7.8479445,7.8479445 0 0 0 -10.98712,0 l -92.13487,92.134868 a 7.8479445,7.8479445 0 0 0 -2.35439,5.49356 z"
fill="#333333"
id="path3794"
style="fill:#ed6b21;fill-opacity:1;stroke-width:4;stroke:#ed6b21;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" /><path
d="m 76.222558,31.237177 a 8.0049033,8.0049033 0 0 0 2.354394,5.650527 l 92.134868,92.134866 a 7.8479445,7.8479445 0 0 0 10.98712,0 7.8479445,7.8479445 0 0 0 0,-11.14408 L 89.564071,25.743622 a 7.8479445,7.8479445 0 0 0 -13.341513,5.493555 z"
fill="#333333"
id="path3796"
style="fill:#ed6b21;fill-opacity:1;stroke-width:4;stroke:#ed6b21;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" /></g><rect
style="fill:#cd22d6;fill-opacity:1"
id="rect4805"
width="280.72397"
height="36.457657"
x="34.634773"
y="295.91464" /></svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
class="svg-icon"
style="width: 1em; height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;"
viewBox="0 0 1024 1024"
version="1.1"
id="svg1878"
sodipodi:docname="legend_seams.svg"
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1882" />
<sodipodi:namedview
id="namedview1880"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="0.39648438"
inkscape:cx="361.93103"
inkscape:cy="596.49261"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="svg1878" />
<path
d="m 257.84285,390.79005 a 34.420553,34.420553 0 0 0 8.87467,-68.26667 l -60.07467,-15.01866 a 34.133334,34.133334 0 1 0 -17.74933,65.87733 l 60.07466,16.04267 a 26.624,26.624 0 0 0 8.87467,1.36533 z M 389.59752,199.98472 a 34.133334,34.133334 0 0 0 34.13333,25.25866 27.989334,27.989334 0 0 0 8.87467,0 34.133334,34.133334 0 0 0 23.89333,-41.64266 l -16.04267,-60.07467 a 34.133334,34.133334 0 1 0 -65.87733,17.74933 z m 164.864,341.33333 a 34.133334,34.133334 0 0 0 -49.49334,0 L 385.50152,662.83272 a 75.434666,75.434666 0 0 1 -104.448,0 73.386666,73.386666 0 0 1 0,-104.448 L 402.56818,438.91805 a 34.133334,34.133334 0 1 0 -48.128,-48.128 L 231.90152,509.91538 A 142.8846,142.8846 0 1 0 433.97085,711.98472 L 554.46152,591.49405 a 34.133334,34.133334 0 0 0 0,-50.176 z M 272.17885,254.25672 a 34.133334,34.133334 0 0 0 23.89333,9.89866 34.133334,34.133334 0 0 0 24.23467,-9.89866 34.133334,34.133334 0 0 0 0,-48.128 l -44.032,-44.032 a 34.133334,34.133334 0 0 0 -48.128,48.128 z m 548.864,250.19733 -60.07467,-16.04267 a 34.133334,34.133334 0 1 0 -17.06666,65.87734 l 60.07466,16.04266 h 8.87467 a 34.420552,34.420552 0 0 0 8.87467,-68.26666 z m -200.704,173.39733 a 34.133334,34.133334 0 0 0 -41.984,-23.89333 34.133334,34.133334 0 0 0 -23.89333,41.64267 l 16.04266,60.07466 a 34.133334,34.133334 0 0 0 34.13334,25.25867 39.253334,39.253334 0 0 0 8.87466,0 34.133334,34.133334 0 0 0 24.23467,-41.984 z m 117.41867,-53.58933 a 34.133334,34.133334 0 0 0 -48.128,48.128 l 44.032,44.032 a 34.133334,34.133334 0 0 0 48.128,0 34.133334,34.133334 0 0 0 0,-48.128 z m 81.23733,-356.01067 a 141.99467,141.99467 0 0 0 -243.02933,-102.4 L 455.47485,287.36605 a 34.876601,34.876601 0 1 0 49.49333,49.152 L 624.43485,215.00338 a 75.434666,75.434666 0 0 1 104.448,0 73.386666,73.386666 0 0 1 0,104.448 L 607.36818,438.91805 a 34.133334,34.133334 0 0 0 0,48.128 34.133334,34.133334 0 0 0 48.128,0 L 778.03485,367.92072 a 143.01867,143.01867 0 0 0 40.96,-99.66934 z"
id="path1876"
style="fill:#ffffff;fill-opacity:1;stroke-width:0.8" />
<rect
style="fill:#e6e6e6;fill-opacity:1;stroke-width:2.86654"
id="rect4805"
width="804.70764"
height="104.50751"
x="104.60175"
y="855.72644" />
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
version="1.1"
viewBox="0 0 457.478 457.478"
enable-background="new 0 0 457.478 457.478"
id="svg24"
sodipodi:docname="legend_shell.svg"
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs28" />
<sodipodi:namedview
id="namedview26"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="0.88747438"
inkscape:cx="-16.3385"
inkscape:cy="218.03446"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="svg24" />
<g
id="g22"
style="fill:#ffffff;fill-opacity:1">
<path
d="m423.173,110.709l-189.434-109.369c-3.094-1.786-6.906-1.786-10-3.33067e-15l-189.433,109.369c-3.094,1.786-5,5.087-5,8.66v218.739c0,3.573 1.906,6.874 5,8.66l189.434,109.37c1.547,0.893 3.273,1.34 5,1.34s3.453-0.447 5-1.34l189.434-109.37c3.094-1.786 5-5.087 5-8.66v-218.739c-0.001-3.572-1.908-6.874-5.001-8.66zm-15,206.884l-6.459-3.729c-4.781-2.762-10.898-1.123-13.66,3.66-2.762,4.783-1.123,10.899 3.66,13.661l9.226,5.327-162.201,93.647v-188.638c0.128,0.005 0.255,0.024 0.383,0.024 3.456,0 6.817-1.793 8.67-5.001 1.421-2.46 1.669-5.271 0.932-7.799l159.449-92.058v180.906zm-338.747-.069c-2.761-4.782-8.874-6.422-13.66-3.66l-6.46,3.729v-180.905l159.449,92.058c-0.737,2.527-0.488,5.338 0.932,7.798 1.853,3.208 5.213,5.001 8.67,5.001 0.127,0 0.255-0.02 0.383-0.024v188.637l-162.202-93.647 9.227-5.327c4.784-2.761 6.422-8.877 3.661-13.66zm159.314-275.941c5.522,2.84217e-14 10-4.477 10-10v-4.263l159.431,92.048-159.634,92.165c-0.931-4.559-4.964-7.989-9.797-7.989-4.834,0-8.867,3.43-9.798,7.99l-159.635-92.166 159.433-92.048v4.264c0,5.522 4.478,9.999 10,9.999z"
id="path2"
style="fill:#ffffff;fill-opacity:1" />
<path
d="m304.003,280.544l17.839,10.3c1.575,0.909 3.294,1.341 4.99,1.341 3.456,0 6.817-1.793 8.67-5.001 2.762-4.783 1.123-10.898-3.66-13.66l-17.839-10.3c-4.784-2.761-10.898-1.123-13.66,3.66s-1.123,10.898 3.66,13.66z"
id="path4"
style="fill:#ffffff;fill-opacity:1" />
<path
d="m260.147,255.224l17.84,10.299c1.575,0.91 3.294,1.341 4.99,1.341 3.456,0 6.818-1.793 8.67-5.001 2.762-4.783 1.123-10.899-3.66-13.66l-17.84-10.299c-4.784-2.763-10.899-1.123-13.66,3.66-2.762,4.783-1.123,10.899 3.66,13.66z"
id="path6"
style="fill:#ffffff;fill-opacity:1" />
<path
d="m347.857,305.864l17.84,10.3c1.575,0.909 3.294,1.341 4.99,1.341 3.456,0 6.818-1.793 8.67-5.001 2.762-4.783 1.123-10.899-3.66-13.66l-17.84-10.3c-4.784-2.762-10.9-1.123-13.66,3.66-2.762,4.783-1.123,10.899 3.66,13.66z"
id="path8"
style="fill:#ffffff;fill-opacity:1" />
<path
d="m174.501,266.865c1.696,0 3.416-0.432 4.99-1.341l17.84-10.3c4.783-2.761 6.422-8.877 3.66-13.66-2.761-4.783-8.877-6.421-13.66-3.66l-17.84,10.3c-4.783,2.761-6.422,8.877-3.66,13.66 1.852,3.209 5.213,5.001 8.67,5.001z"
id="path10"
style="fill:#ffffff;fill-opacity:1" />
<path
d="m86.791,317.505c1.696,0 3.415-0.432 4.99-1.341l17.84-10.299c4.783-2.761 6.422-8.877 3.66-13.66-2.76-4.782-8.874-6.421-13.66-3.66l-17.84,10.299c-4.783,2.761-6.422,8.877-3.66,13.66 1.852,3.208 5.213,5.001 8.67,5.001z"
id="path12"
style="fill:#ffffff;fill-opacity:1" />
<path
d="m130.646,292.185c1.696,0 3.416-0.432 4.99-1.341l17.839-10.3c4.783-2.762 6.422-8.877 3.66-13.66-2.761-4.783-8.877-6.421-13.66-3.66l-17.839,10.3c-4.783,2.762-6.422,8.877-3.66,13.66 1.853,3.208 5.213,5.001 8.67,5.001z"
id="path14"
style="fill:#ffffff;fill-opacity:1" />
<path
d="M218.74,82.223c0,5.523,4.478,10,10,10s10-4.477,10-10V61.624c0-5.523-4.478-10-10-10s-10,4.477-10,10V82.223z"
id="path16"
style="fill:#ffffff;fill-opacity:1" />
<path
d="m228.74,102.264c-5.522,0-10,4.477-10,10v20.599c0,5.523 4.478,10 10,10s10-4.477 10-10v-20.599c0-5.523-4.477-10-10-10z"
id="path18"
style="fill:#ffffff;fill-opacity:1" />
<path
d="m228.74,152.904c-5.522,0-10,4.477-10,10v20.599c0,5.523 4.478,10 10,10s10-4.477 10-10v-20.599c0-5.523-4.477-10-10-10z"
id="path20"
style="fill:#ffffff;fill-opacity:1" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -0,0 +1,10 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 96 96">
<rect id="rect4805" x="11.7" y="81.8" width="73.6" height="9.6" style="fill: #c1be63"/>
<polyline points="29.9 53.6 34.5 44.8 43.9 44.7 43.9 33.1 38.9 33.1 38.9 6.2 17 6.2 17 33.2 11.6 33.2 11.6 44.7 21 44.7 25.6 53.6" style="fill: #fff"/>
<polyline points="68 73.2 73.3 63.3 84 63.2 84 50 78.3 50 78.3 19.7 53.3 19.7 53.3 50.2 47.1 50.2 47.1 63.2 57.9 63.2 63.1 73.2" style="fill: #ed6b21"/>
<g>
<path d="M32.3,62.6c4.5,5.9,10.4,7.8,18.5,8.4" style="fill: none;stroke: #fff;stroke-miterlimit: 10;stroke-width: 2.8346456692913384px"/>
<polygon points="28.9 66.3 28.8 56.4 37.4 61.2 28.9 66.3" style="fill: #fff"/>
<polygon points="49.2 75.8 57.9 71.2 49.6 65.9 49.2 75.8" style="fill: #fff"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 844 B

View File

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 96 96">
<polyline points="50.6 92.4 57.8 78.8 72.7 78.7 72.7 60.6 64.7 60.6 64.7 2.2 30.3 2.2 30.3 60.7 21.8 60.7 21.8 78.7 36.6 78.7 43.9 92.4" style="fill: #fff"/>
</svg>

After

Width:  |  Height:  |  Size: 251 B

View File

@ -0,0 +1,163 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 24.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 512 512"
style="enable-background:new 0 0 512 512;"
xml:space="preserve"
sodipodi:docname="legend_travel.svg"
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs960" /><sodipodi:namedview
id="namedview958"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="1.5292969"
inkscape:cx="256"
inkscape:cy="256"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="g955" />
<g
id="g955">
<path
d="M113.5,451c2.3,0,4.4-1,5.8-2.8c3.2-3.9,76.7-96.1,76.7-139.7c0-45.6-36.9-82.5-82.5-82.5S31,262.9,31,308.5 c0,43.6,73.5,135.8,76.7,139.7C109.1,450,111.2,451,113.5,451z M113.5,241c37.3,0,67.5,30.2,67.5,67.5c0,29.1-44.3,92.7-67.5,122.8 C90.3,401.2,46,337.6,46,308.5C46,271.2,76.2,241,113.5,241z"
id="path893"
style="fill:#ed6b21;fill-opacity:1;stroke:#ed6b21;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M143.5,301c0-16.6-13.4-30-30-30s-30,13.4-30,30s13.4,30,30,30S143.5,317.6,143.5,301z M98.5,301c0-8.3,6.7-15,15-15 s15,6.7,15,15s-6.7,15-15,15S98.5,309.3,98.5,301z"
id="path895"
style="fill:#ed6b21;fill-opacity:1;stroke:#ed6b21;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M421,188.5c2.2,0,4.3-1,5.7-2.6c5.6-6.5,54.3-64,54.3-94.9c0-33.1-26.9-60-60-60s-60,26.9-60,60 c0,30.9,48.8,88.4,54.3,94.9C416.7,187.5,418.8,188.5,421,188.5z M421,46c24.8,0,45,20.2,45,45c0,19-28.6,58.2-45,78.3 c-16.4-20.1-45-59.2-45-78.3C376,66.2,396.2,46,421,46z"
id="path897"
style="fill:#ed6b21;fill-opacity:1;stroke:#ed6b21;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M443.5,83.5c0-12.4-10.1-22.5-22.5-22.5s-22.5,10.1-22.5,22.5S408.6,106,421,106S443.5,95.9,443.5,83.5z M413.5,83.5 c0-4.1,3.4-7.5,7.5-7.5s7.5,3.4,7.5,7.5S425.1,91,421,91S413.5,87.6,413.5,83.5z"
id="path899"
style="fill:#ed6b21;fill-opacity:1;stroke:#ed6b21;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M413.5,218.5h7.5c4.1,0,7.5-3.4,7.5-7.5s-3.4-7.5-7.5-7.5h-7.5c-4.1,0-7.5,3.4-7.5,7.5S409.4,218.5,413.5,218.5z"
id="path901"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M316,263.5h15.2c4.1,0,7.5-3.4,7.5-7.5s-3.4-7.5-7.5-7.5h-15.3c-2,0-3.9,0.8-5.3,2.2s-2.2,3.3-2.2,5.3 C308.5,260.2,311.8,263.5,316,263.5z"
id="path903"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M400.1,256c0,4.1,3.4,7.5,7.5,7.5h15.3c4.1,0,7.5-3.4,7.5-7.5s-3.4-7.5-7.5-7.5h-15.3C403.4,248.5,400.1,251.9,400.1,256z"
id="path905"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M367.7,218.5h15.3c4.1,0,7.5-3.4,7.5-7.5s-3.4-7.5-7.5-7.5h-15.3c-4.1,0-7.5,3.4-7.5,7.5S363.5,218.5,367.7,218.5z"
id="path907"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M167.6,466h-15.3c-4.1,0-7.5,3.4-7.5,7.5s3.4,7.5,7.5,7.5h15.3c4.1,0,7.5-3.4,7.5-7.5S171.8,466,167.6,466z"
id="path909"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M294,245.7c0.5,0,1-0.1,1.6-0.2c4.1-0.9,6.6-4.8,5.8-8.9c-0.2-1-0.3-2.1-0.3-3.1c0-2.4,0.6-4.7,1.6-6.8 c1.9-3.7,0.4-8.2-3.3-10.1c-3.7-1.9-8.2-0.4-10.1,3.3c-3.1,6.1-4,13.1-2.6,19.8C287.4,243.1,290.4,245.6,294,245.7z"
id="path911"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M361.8,263.5H377c4.1,0,7.5-3.4,7.5-7.5s-3.4-7.5-7.5-7.5h-15.3c-4.1,0-7.5,3.4-7.5,7.5S357.6,263.5,361.8,263.5z"
id="path913"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M321.8,218.5h15.3c4.1,0,7.5-3.4,7.5-7.5s-3.4-7.5-7.5-7.5h-15.3c-4.1,0-7.5,3.4-7.5,7.5S317.7,218.5,321.8,218.5z"
id="path915"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M247.7,348.8c0.6,0.2,1.2,0.2,1.8,0.2c3.4,0,6.4-2.4,7.3-5.7c1-3.9,2.8-7.4,5.3-10.5c1.8-2,2.4-4.9,1.4-7.5 c-0.9-2.6-3.1-4.4-5.8-4.9c-2.7-0.5-5.4,0.6-7.1,2.7c-4,4.8-6.9,10.4-8.4,16.5c-0.5,1.9-0.2,4,0.8,5.7 C244.1,347.1,245.8,348.3,247.7,348.8z"
id="path917"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M395.9,465.7c-1.6,0.2-3.2,0.3-4.9,0.3h-9.4c-4.1,0-7.5,3.4-7.5,7.5s3.4,7.5,7.5,7.5h9.4c2.3,0,4.5-0.1,6.7-0.4 c4.1-0.5,7-4.3,6.5-8.4C403.7,468.1,399.9,465.2,395.9,465.7L395.9,465.7z"
id="path919"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M406.3,378.2c-5-1.5-10.1-2.3-15.3-2.2h-2c-4.1,0-7.5,3.4-7.5,7.5s3.4,7.5,7.5,7.5h2c3.7,0,7.4,0.5,10.9,1.6 c0.7,0.2,1.4,0.3,2.2,0.3c3.7,0,6.9-2.7,7.4-6.4C412.1,382.9,409.9,379.4,406.3,378.2L406.3,378.2z"
id="path921"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M390.3,323.5c4.1,0,7.5-3.4,7.5-7.5s-3.4-7.5-7.5-7.5H375c-4.1,0-7.5,3.4-7.5,7.5s3.4,7.5,7.5,7.5H390.3z"
id="path923"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M435.1,440.1c-3.8-1.7-8.2,0-9.9,3.8c-1.7,3.9-4.1,7.4-7.1,10.5c-1.9,1.9-2.7,4.7-1.9,7.3c0.7,2.6,2.8,4.6,5.5,5.3 c2.6,0.6,5.4-0.2,7.3-2.2c4.1-4.3,7.5-9.3,9.9-14.7C440.6,446.3,438.9,441.8,435.1,440.1z"
id="path925"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M474.4,287.3c-1.9-0.6-4-0.3-5.7,0.6c-1.7,1-3,2.6-3.6,4.5c-1.1,3.7-3.1,7-5.9,9.7c-3,2.9-3,7.7-0.1,10.6s7.7,3,10.6,0.1 c4.6-4.5,7.9-10,9.7-16.2c0.6-1.9,0.3-4-0.6-5.7C477.9,289.2,476.3,287.9,474.4,287.3z"
id="path927"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M465.8,273.5c3,0,5.6-1.7,6.9-4.4c1.2-2.7,0.7-5.9-1.3-8.1c-4.3-4.8-9.7-8.4-15.8-10.4c-3.9-1.3-8.2,0.7-9.5,4.7 s0.7,8.2,4.7,9.5c3.6,1.2,6.9,3.4,9.4,6.3C461.7,272.6,463.7,273.5,465.8,273.5z"
id="path929"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M358.5,376h-15.3c-4.1,0-7.5,3.4-7.5,7.5s3.4,7.5,7.5,7.5h15.3c4.1,0,7.5-3.4,7.5-7.5S362.6,376,358.5,376z"
id="path931"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M436.2,308.5h-15.3c-4.1,0-7.5,3.4-7.5,7.5s3.4,7.5,7.5,7.5h15.3c4.1,0,7.5-3.4,7.5-7.5S440.3,308.5,436.2,308.5z"
id="path933"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M213.5,466h-15.3c-4.1,0-7.5,3.4-7.5,7.5s3.4,7.5,7.5,7.5h15.3c4.1,0,7.5-3.4,7.5-7.5S217.6,466,213.5,466z"
id="path935"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M434.4,399c-2.3-3.4-7-4.3-10.4-2c-3.4,2.3-4.3,7-2,10.4c2.4,3.5,4.2,7.4,5.2,11.5c0.6,2.7,2.6,4.8,5.2,5.6 c2.6,0.8,5.5,0,7.4-1.9c1.9-1.9,2.6-4.8,1.9-7.4C440.3,409.5,437.8,404,434.4,399z"
id="path937"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M270.6,373.3c-3.6-1.8-6.7-4.3-9.1-7.5c-2.5-3.3-7.3-3.9-10.5-1.3c-3.3,2.5-3.9,7.3-1.3,10.5c3.8,4.9,8.7,8.9,14.3,11.7 c3.7,1.7,8.1,0.2,9.9-3.5C275.7,379.6,274.3,375.2,270.6,373.3z"
id="path939"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M259.3,466H244c-4.1,0-7.5,3.4-7.5,7.5s3.4,7.5,7.5,7.5h15.3c4.1,0,7.5-3.4,7.5-7.5S263.4,466,259.3,466z"
id="path941"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M351,466h-15.3c-4.1,0-7.5,3.4-7.5,7.5s3.4,7.5,7.5,7.5H351c4.1,0,7.5-3.4,7.5-7.5S355.1,466,351,466z"
id="path943"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M298.6,323.5c4.1,0,7.5-3.4,7.5-7.5s-3.4-7.5-7.5-7.5h-15.3c-4.1,0-7.5,3.4-7.5,7.5s3.4,7.5,7.5,7.5H298.6z"
id="path945"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M344.5,323.5c4.1,0,7.5-3.4,7.5-7.5s-3.4-7.5-7.5-7.5h-15.3c-4.1,0-7.5,3.4-7.5,7.5s3.4,7.5,7.5,7.5H344.5z"
id="path947"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M312.6,376h-15.3c-4.1,0-7.5,3.4-7.5,7.5s3.4,7.5,7.5,7.5h15.3c4.1,0,7.5-3.4,7.5-7.5S316.8,376,312.6,376z"
id="path949"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M305.2,466h-15.3c-4.1,0-7.5,3.4-7.5,7.5s3.4,7.5,7.5,7.5h15.3c4.1,0,7.5-3.4,7.5-7.5S309.3,466,305.2,466z"
id="path951"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M121,466h-7.5c-4.1,0-7.5,3.4-7.5,7.5s3.4,7.5,7.5,7.5h7.5c4.1,0,7.5-3.4,7.5-7.5S125.1,466,121,466z"
id="path953"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generator: Adobe Illustrator 25.4.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg enable-background="new 0 0 1000 1000" version="1.1" viewBox="0 0 1e3 1e3" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<rect id="path6995" width="1e3" height="1e3" style="display:none;stroke:#FFFFFF;stroke-miterlimit:10"/>
<g transform="translate(1.7416 41.799)">
<path id="path6997"
d="m969.8 495.7c-10.7 22.2-16.2 30.3-35.8 53-47.1 54.8-64.5 95.5-83.8 195.8-12.6 65.9-21.5 86.8-45.2 103.8-1.8 1.3-4 1.9-6.2 1.9l-172.4-3.4c-6.6-0.1-11.4-6.4-9.7-12.8 21.1-79.3 66.6-153.2 57.1-240.5 0-0.3-0.1-0.6-0.1-0.9l-0.7-66.3c0-0.7-0.1-1.3-0.2-2-16.4-78.2 46.5-267.9-73-265.6-4.2 0.1-8-2.3-9.6-6.1-16.3-37.2-32.6-71.2-82.7-62.5-3.4 0.6-6.8-0.5-9.2-3-34.4-36.2-88.1-55.1-121.6-1.8-1.5 2.5-7.1 4.6-9.9 3.8-121.5-16.5-81.4 135.5-86.4 221.7-0.5 8.5-10.5 12.7-16.9 7.1-51.8-45.3-132.7-6.5-100.3 71.4l0.5 1.3c0.1 0.3 0.3 0.9 0.2 0.9 42.3 94.2 69.4 198.2 143.9 274.4 0.3 0.3 0.7 0.7 1.1 0.9 6.5 5 11.8 10.6 16.1 16.5 17.3 24-0.4 57.4-29.9 56.9l-190.5-3.7c-20.4-0.4-40-8.7-54.3-23.2-9.6-9.7-18.1-20.1-22-27.5-13.5-25.5-18.6-58.7-14.4-92.5 3.2-27.3 9.9-53 26.7-104.2 18.2-55.6 21.2-69.8 21.4-98.9 0-30.2-4-49-20.6-100.3-30.8-93.9-37.9-147.9-25.8-195.6 6.3-24.7 14.4-39.3 31.4-56.3 25.1-24.9 56-37 107-41.5 28.5-2.6 55-1.4 99.9 4.3 36.6 4.7 63.5 4.2 89.2-2 22.2-5.5 27.5-7.5 77.9-32 45.3-22 61.5-27.7 90-31.2 63.7-7.9 129.5 6.3 163.8 35.6 5.1 4.3 17.8 20 28.1 34.4 43.7 61.5 80.7 86.4 149.5 100.7 36.2 7.5 52.8 16.2 76.9 40.5 25.9 26.1 42.1 55 52.4 93.2 14.4 53.8 10 110-11.9 155.7z"
style="fill:#FFFFFF" />
<path id="path6999"
d="m233.1 455.1c-87.3-66.3 66.2 239.8 88.3 256.3 31.3 39.1 55.6 123.7 81.2 151.8s123.2 38.4 158.4 6.5 76.5-180 66.4-269.3c-0.4-90.4-5-180.8-1.4-271.3 2.4-33.2-42.1-34-40.7-0.7-0.5 33.3-0.9 66.7-1.5 100-0.3 16.5-9.6 26.6-23.6 26.2-60.5-8.5 17.7-210.7-40-219.9-56.8 10 14.9 211.2-46 218.1-62.2-6.3 18.3-243.8-39.2-255.1-60.1 9.3 16 247.1-47.7 253.9-14-0.4-22.4-11.1-22.2-28.6-8.9-41.8 25.5-179.1-17.6-190.7-47.3 20-11.8 217.8-24.3 275.7-16.5 80.6-69.8-29.1-90.1-52.9z"
style="fill:#ED6B21" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -155,6 +155,18 @@ namespace ImGui
const wchar_t ClippyMarker = 0x2602; const wchar_t ClippyMarker = 0x2602;
const wchar_t InfoMarker = 0x2603; const wchar_t InfoMarker = 0x2603;
const wchar_t SliderFloatEditBtnIcon = 0x2604; const wchar_t SliderFloatEditBtnIcon = 0x2604;
const wchar_t SliderFloatEditBtnPressedIcon = 0x2605;
const wchar_t LegendTravel = 0x2606;
const wchar_t LegendWipe = 0x2607;
const wchar_t LegendRetract = 0x2608;
const wchar_t LegendDeretract = 0x2609;
const wchar_t LegendSeams = 0x2610;
const wchar_t LegendToolChanges = 0x2611;
const wchar_t LegendColorChanges = 0x2612;
const wchar_t LegendPausePrints = 0x2613;
const wchar_t LegendCustomGCodes = 0x2614;
const wchar_t LegendShells = 0x2615;
const wchar_t LegendToolMarker = 0x2616;
// void MyFunction(const char* name, const MyMatrix44& v); // void MyFunction(const char* name, const MyMatrix44& v);
} }

View File

@ -189,6 +189,9 @@ void GCodeProcessor::TimeMachine::reset()
max_travel_acceleration = 0.0f; max_travel_acceleration = 0.0f;
extrude_factor_override_percentage = 1.0f; extrude_factor_override_percentage = 1.0f;
time = 0.0f; time = 0.0f;
#if ENABLE_TRAVEL_TIME
travel_time = 0.0f;
#endif // ENABLE_TRAVEL_TIME
stop_times = std::vector<StopTime>(); stop_times = std::vector<StopTime>();
curr.reset(); curr.reset();
prev.reset(); prev.reset();
@ -304,9 +307,17 @@ void GCodeProcessor::TimeMachine::calculate_time(size_t keep_last_n_blocks, floa
block_time += additional_time; block_time += additional_time;
time += block_time; time += block_time;
#if ENABLE_TRAVEL_TIME
if (block.move_type == EMoveType::Travel)
travel_time += block_time;
else
roles_time[static_cast<size_t>(block.role)] += block_time;
#endif // ENABLE_TRAVEL_TIME
gcode_time.cache += block_time; gcode_time.cache += block_time;
moves_time[static_cast<size_t>(block.move_type)] += block_time; moves_time[static_cast<size_t>(block.move_type)] += block_time;
#if !ENABLE_TRAVEL_TIME
roles_time[static_cast<size_t>(block.role)] += block_time; roles_time[static_cast<size_t>(block.role)] += block_time;
#endif // !ENABLE_TRAVEL_TIME
if (block.layer_id >= layers_time.size()) { if (block.layer_id >= layers_time.size()) {
const size_t curr_size = layers_time.size(); const size_t curr_size = layers_time.size();
layers_time.resize(block.layer_id); layers_time.resize(block.layer_id);
@ -1363,6 +1374,18 @@ std::string GCodeProcessor::get_time_dhm(PrintEstimatedStatistics::ETimeMode mod
return (mode < PrintEstimatedStatistics::ETimeMode::Count) ? short_time(get_time_dhms(m_time_processor.machines[static_cast<size_t>(mode)].time)) : std::string("N/A"); return (mode < PrintEstimatedStatistics::ETimeMode::Count) ? short_time(get_time_dhms(m_time_processor.machines[static_cast<size_t>(mode)].time)) : std::string("N/A");
} }
#if ENABLE_TRAVEL_TIME
float GCodeProcessor::get_travel_time(PrintEstimatedStatistics::ETimeMode mode) const
{
return (mode < PrintEstimatedStatistics::ETimeMode::Count) ? m_time_processor.machines[static_cast<size_t>(mode)].travel_time : 0.0f;
}
std::string GCodeProcessor::get_travel_time_dhm(PrintEstimatedStatistics::ETimeMode mode) const
{
return (mode < PrintEstimatedStatistics::ETimeMode::Count) ? short_time(get_time_dhms(m_time_processor.machines[static_cast<size_t>(mode)].travel_time)) : std::string("N/A");
}
#endif // ENABLE_TRAVEL_TIME
std::vector<std::pair<CustomGCode::Type, std::pair<float, float>>> GCodeProcessor::get_custom_gcode_times(PrintEstimatedStatistics::ETimeMode mode, bool include_remaining) const std::vector<std::pair<CustomGCode::Type, std::pair<float, float>>> GCodeProcessor::get_custom_gcode_times(PrintEstimatedStatistics::ETimeMode mode, bool include_remaining) const
{ {
std::vector<std::pair<CustomGCode::Type, std::pair<float, float>>> ret; std::vector<std::pair<CustomGCode::Type, std::pair<float, float>>> ret;
@ -3372,6 +3395,9 @@ void GCodeProcessor::update_estimated_times_stats()
auto update_mode = [this](PrintEstimatedStatistics::ETimeMode mode) { auto update_mode = [this](PrintEstimatedStatistics::ETimeMode mode) {
PrintEstimatedStatistics::Mode& data = m_result.print_statistics.modes[static_cast<size_t>(mode)]; PrintEstimatedStatistics::Mode& data = m_result.print_statistics.modes[static_cast<size_t>(mode)];
data.time = get_time(mode); data.time = get_time(mode);
#if ENABLE_TRAVEL_TIME
data.travel_time = get_travel_time(mode);
#endif // ENABLE_TRAVEL_TIME
data.custom_gcode_times = get_custom_gcode_times(mode, true); data.custom_gcode_times = get_custom_gcode_times(mode, true);
data.moves_times = get_moves_time(mode); data.moves_times = get_moves_time(mode);
data.roles_times = get_roles_time(mode); data.roles_times = get_roles_time(mode);

View File

@ -44,6 +44,9 @@ namespace Slic3r {
struct Mode struct Mode
{ {
float time; float time;
#if ENABLE_TRAVEL_TIME
float travel_time;
#endif // ENABLE_TRAVEL_TIME
std::vector<std::pair<CustomGCode::Type, std::pair<float, float>>> custom_gcode_times; std::vector<std::pair<CustomGCode::Type, std::pair<float, float>>> custom_gcode_times;
std::vector<std::pair<EMoveType, float>> moves_times; std::vector<std::pair<EMoveType, float>> moves_times;
std::vector<std::pair<ExtrusionRole, float>> roles_times; std::vector<std::pair<ExtrusionRole, float>> roles_times;
@ -51,6 +54,9 @@ namespace Slic3r {
void reset() { void reset() {
time = 0.0f; time = 0.0f;
#if ENABLE_TRAVEL_TIME
travel_time = 0.0f;
#endif // ENABLE_TRAVEL_TIME
custom_gcode_times.clear(); custom_gcode_times.clear();
moves_times.clear(); moves_times.clear();
roles_times.clear(); roles_times.clear();
@ -290,6 +296,9 @@ namespace Slic3r {
float max_travel_acceleration; // mm/s^2 float max_travel_acceleration; // mm/s^2
float extrude_factor_override_percentage; float extrude_factor_override_percentage;
float time; // s float time; // s
#if ENABLE_TRAVEL_TIME
float travel_time; // s
#endif // ENABLE_TRAVEL_TIME
struct StopTime struct StopTime
{ {
unsigned int g1_line_id; unsigned int g1_line_id;
@ -596,6 +605,10 @@ namespace Slic3r {
float get_time(PrintEstimatedStatistics::ETimeMode mode) const; float get_time(PrintEstimatedStatistics::ETimeMode mode) const;
std::string get_time_dhm(PrintEstimatedStatistics::ETimeMode mode) const; std::string get_time_dhm(PrintEstimatedStatistics::ETimeMode mode) const;
#if ENABLE_TRAVEL_TIME
float get_travel_time(PrintEstimatedStatistics::ETimeMode mode) const;
std::string get_travel_time_dhm(PrintEstimatedStatistics::ETimeMode mode) const;
#endif // ENABLE_TRAVEL_TIME
std::vector<std::pair<CustomGCode::Type, std::pair<float, float>>> get_custom_gcode_times(PrintEstimatedStatistics::ETimeMode mode, bool include_remaining) const; std::vector<std::pair<CustomGCode::Type, std::pair<float, float>>> get_custom_gcode_times(PrintEstimatedStatistics::ETimeMode mode, bool include_remaining) const;
std::vector<std::pair<EMoveType, float>> get_moves_time(PrintEstimatedStatistics::ETimeMode mode) const; std::vector<std::pair<EMoveType, float>> get_moves_time(PrintEstimatedStatistics::ETimeMode mode) const;

View File

@ -45,4 +45,19 @@
#define ENABLE_SPIRAL_VASE_LAYERS (1 && ENABLE_2_4_1_RC) #define ENABLE_SPIRAL_VASE_LAYERS (1 && ENABLE_2_4_1_RC)
//====================
// 2.5.0.alpha1 techs
//====================
#define ENABLE_2_5_0_ALPHA1 1
// Enable changes in preview layout
#define ENABLE_PREVIEW_LAYOUT (1 && ENABLE_2_5_0_ALPHA1)
// Enable drawing the items in legend toolbar using icons
#define ENABLE_LEGEND_TOOLBAR_ICONS (1 && ENABLE_PREVIEW_LAYOUT)
// Enable coloring of toolpaths in preview by layer time
#define ENABLE_PREVIEW_LAYER_TIME (1 && ENABLE_2_5_0_ALPHA1)
// Enable showing time estimate for travel moves in legend
#define ENABLE_TRAVEL_TIME (1 && ENABLE_2_5_0_ALPHA1)
#endif // _prusaslicer_technologies_h_ #endif // _prusaslicer_technologies_h_

View File

@ -6,6 +6,7 @@
#include <functional> #include <functional>
#include <type_traits> #include <type_traits>
#include <system_error> #include <system_error>
#include <cmath>
#include <boost/system/error_code.hpp> #include <boost/system/error_code.hpp>
@ -360,7 +361,7 @@ inline std::string get_time_dhms(float time_in_secs)
else if (minutes > 0) else if (minutes > 0)
::sprintf(buffer, "%dm %ds", minutes, (int)time_in_secs); ::sprintf(buffer, "%dm %ds", minutes, (int)time_in_secs);
else else
::sprintf(buffer, "%ds", (int)time_in_secs); ::sprintf(buffer, "%ds", (int)std::round(time_in_secs));
return buffer; return buffer;
} }

View File

@ -160,16 +160,43 @@ void GCodeViewer::TBuffer::add_path(const GCodeProcessorResult::MoveVertex& move
move.volumetric_rate(), move.extruder_id, move.cp_color_id, { { endpoint, endpoint } } }); move.volumetric_rate(), move.extruder_id, move.cp_color_id, { { endpoint, endpoint } } });
} }
#if ENABLE_PREVIEW_LAYER_TIME
float GCodeViewer::Extrusions::Range::step_size(EType type) const
{
switch (type)
{
default:
case EType::Linear: { return (max > min) ? (max - min) / (static_cast<float>(Range_Colors.size()) - 1.0f) : 0.0f; }
case EType::Logarithmic: { return (max > min && min > 0.0f) ? ::log(max / min) / (static_cast<float>(Range_Colors.size()) - 1.0f) : 0.0f; }
}
}
ColorRGBA GCodeViewer::Extrusions::Range::get_color_at(float value, EType type) const
#else
ColorRGBA GCodeViewer::Extrusions::Range::get_color_at(float value) const ColorRGBA GCodeViewer::Extrusions::Range::get_color_at(float value) const
#endif // ENABLE_PREVIEW_LAYER_TIME
{ {
// Input value scaled to the colors range // Input value scaled to the colors range
#if ENABLE_PREVIEW_LAYER_TIME
float global_t = 0.0f;
const float step = step_size(type);
if (step > 0.0f) {
switch (type)
{
default:
case EType::Linear: { global_t = (value > min) ? (value - min) / step : 0.0f; break; }
case EType::Logarithmic: { global_t = (value > min && min > 0.0f) ? ::log(value / min) / step : 0.0f; break; }
}
}
#else
const float step = step_size(); const float step = step_size();
const float global_t = (step != 0.0f) ? std::max(0.0f, value - min) / step : 0.0f; // lower limit of 0.0f const float global_t = (step != 0.0f) ? std::max(0.0f, value - min) / step : 0.0f; // lower limit of 0.0f
#endif // ENABLE_PREVIEW_LAYER_TIME
const size_t color_max_idx = Range_Colors.size() - 1; const size_t color_max_idx = Range_Colors.size() - 1;
// Compute the two colors just below (low) and above (high) the input value // Compute the two colors just below (low) and above (high) the input value
const size_t color_low_idx = std::clamp<size_t>(static_cast<size_t>(global_t), 0, color_max_idx); const size_t color_low_idx = std::clamp<size_t>(static_cast<size_t>(global_t), 0, color_max_idx);
const size_t color_high_idx = std::clamp<size_t>(color_low_idx + 1, 0, color_max_idx); const size_t color_high_idx = std::clamp<size_t>(color_low_idx + 1, 0, color_max_idx);
// Interpolate between the low and high colors to find exactly which color the input value should get // Interpolate between the low and high colors to find exactly which color the input value should get
@ -740,19 +767,37 @@ void GCodeViewer::refresh(const GCodeProcessorResult& gcode_result, const std::v
} }
} }
#if ENABLE_PREVIEW_LAYER_TIME
for (size_t i = 0; i < gcode_result.print_statistics.modes.size(); ++i) {
m_layers_times[i] = gcode_result.print_statistics.modes[i].layers_times;
}
for (size_t i = 0; i < m_layers_times.size(); ++i) {
for (float time : m_layers_times[i]) {
m_extrusions.ranges.layer_time[i].update_from(time);
}
}
#endif // ENABLE_PREVIEW_LAYER_TIME
#if ENABLE_GCODE_VIEWER_STATISTICS #if ENABLE_GCODE_VIEWER_STATISTICS
m_statistics.refresh_time = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now() - start_time).count(); m_statistics.refresh_time = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now() - start_time).count();
#endif // ENABLE_GCODE_VIEWER_STATISTICS #endif // ENABLE_GCODE_VIEWER_STATISTICS
// update buffers' render paths // update buffers' render paths
#if ENABLE_PREVIEW_LAYOUT
refresh_render_paths(false, false);
#else
refresh_render_paths(); refresh_render_paths();
#endif // ENABLE_PREVIEW_LAYOUT
log_memory_used("Refreshed G-code extrusion paths, "); log_memory_used("Refreshed G-code extrusion paths, ");
} }
#if !ENABLE_PREVIEW_LAYOUT
void GCodeViewer::refresh_render_paths() void GCodeViewer::refresh_render_paths()
{ {
refresh_render_paths(false, false); refresh_render_paths(false, false);
} }
#endif // !ENABLE_PREVIEW_LAYOUT
void GCodeViewer::update_shells_color_by_extruder(const DynamicPrintConfig* config) void GCodeViewer::update_shells_color_by_extruder(const DynamicPrintConfig* config)
{ {
@ -781,12 +826,20 @@ void GCodeViewer::reset()
m_layers_z_range = { 0, 0 }; m_layers_z_range = { 0, 0 };
m_roles = std::vector<ExtrusionRole>(); m_roles = std::vector<ExtrusionRole>();
m_print_statistics.reset(); m_print_statistics.reset();
#if ENABLE_PREVIEW_LAYER_TIME
for (size_t i = 0; i < static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Count); ++i) {
m_layers_times[i] = std::vector<float>();
}
#endif // ENABLE_PREVIEW_LAYER_TIME
m_custom_gcode_per_print_z = std::vector<CustomGCode::Item>(); m_custom_gcode_per_print_z = std::vector<CustomGCode::Item>();
m_sequential_view.gcode_window.reset(); m_sequential_view.gcode_window.reset();
#if ENABLE_GCODE_VIEWER_STATISTICS #if ENABLE_GCODE_VIEWER_STATISTICS
m_statistics.reset_all(); m_statistics.reset_all();
#endif // ENABLE_GCODE_VIEWER_STATISTICS #endif // ENABLE_GCODE_VIEWER_STATISTICS
m_contained_in_bed = true; m_contained_in_bed = true;
#if ENABLE_PREVIEW_LAYOUT
m_legend_resizer.reset();
#endif // ENABLE_PREVIEW_LAYOUT
} }
void GCodeViewer::render() void GCodeViewer::render()
@ -896,7 +949,9 @@ unsigned int GCodeViewer::get_options_visibility_flags() const
flags = set_flag(flags, static_cast<unsigned int>(Preview::OptionType::CustomGCodes), is_toolpath_move_type_visible(EMoveType::Custom_GCode)); flags = set_flag(flags, static_cast<unsigned int>(Preview::OptionType::CustomGCodes), is_toolpath_move_type_visible(EMoveType::Custom_GCode));
flags = set_flag(flags, static_cast<unsigned int>(Preview::OptionType::Shells), m_shells.visible); flags = set_flag(flags, static_cast<unsigned int>(Preview::OptionType::Shells), m_shells.visible);
flags = set_flag(flags, static_cast<unsigned int>(Preview::OptionType::ToolMarker), m_sequential_view.marker.is_visible()); flags = set_flag(flags, static_cast<unsigned int>(Preview::OptionType::ToolMarker), m_sequential_view.marker.is_visible());
#if !ENABLE_PREVIEW_LAYOUT
flags = set_flag(flags, static_cast<unsigned int>(Preview::OptionType::Legend), is_legend_enabled()); flags = set_flag(flags, static_cast<unsigned int>(Preview::OptionType::Legend), is_legend_enabled());
#endif // !ENABLE_PREVIEW_LAYOUT
return flags; return flags;
} }
@ -917,7 +972,9 @@ void GCodeViewer::set_options_visibility_from_flags(unsigned int flags)
set_toolpath_move_type_visible(EMoveType::Custom_GCode, is_flag_set(static_cast<unsigned int>(Preview::OptionType::CustomGCodes))); set_toolpath_move_type_visible(EMoveType::Custom_GCode, is_flag_set(static_cast<unsigned int>(Preview::OptionType::CustomGCodes)));
m_shells.visible = is_flag_set(static_cast<unsigned int>(Preview::OptionType::Shells)); m_shells.visible = is_flag_set(static_cast<unsigned int>(Preview::OptionType::Shells));
m_sequential_view.marker.set_visible(is_flag_set(static_cast<unsigned int>(Preview::OptionType::ToolMarker))); m_sequential_view.marker.set_visible(is_flag_set(static_cast<unsigned int>(Preview::OptionType::ToolMarker)));
#if !ENABLE_PREVIEW_LAYOUT
enable_legend(is_flag_set(static_cast<unsigned int>(Preview::OptionType::Legend))); enable_legend(is_flag_set(static_cast<unsigned int>(Preview::OptionType::Legend)));
#endif // !ENABLE_PREVIEW_LAYOUT
} }
void GCodeViewer::set_layers_z_range(const std::array<unsigned int, 2>& layers_z_range) void GCodeViewer::set_layers_z_range(const std::array<unsigned int, 2>& layers_z_range)
@ -1982,7 +2039,7 @@ void GCodeViewer::load_toolpaths(const GCodeProcessorResult& gcode_result)
if (last_z == nullptr || z < *last_z - EPSILON || *last_z + EPSILON < z) if (last_z == nullptr || z < *last_z - EPSILON || *last_z + EPSILON < z)
m_layers.append(z, { last_travel_s_id, move_id }); m_layers.append(z, { last_travel_s_id, move_id });
else else
m_layers.get_endpoints().back().last = move_id; m_layers.get_ranges().back().last = move_id;
// extruder ids // extruder ids
m_extruder_ids.emplace_back(move.extruder_id); m_extruder_ids.emplace_back(move.extruder_id);
// roles // roles
@ -1991,7 +2048,7 @@ void GCodeViewer::load_toolpaths(const GCodeProcessorResult& gcode_result)
} }
else if (move.type == EMoveType::Travel) { else if (move.type == EMoveType::Travel) {
if (move_id - last_travel_s_id > 1 && !m_layers.empty()) if (move_id - last_travel_s_id > 1 && !m_layers.empty())
m_layers.get_endpoints().back().last = move_id; m_layers.get_ranges().back().last = move_id;
last_travel_s_id = move_id; last_travel_s_id = move_id;
} }
@ -2118,6 +2175,26 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool
case EViewType::Feedrate: { color = m_extrusions.ranges.feedrate.get_color_at(path.feedrate); break; } case EViewType::Feedrate: { color = m_extrusions.ranges.feedrate.get_color_at(path.feedrate); break; }
case EViewType::FanSpeed: { color = m_extrusions.ranges.fan_speed.get_color_at(path.fan_speed); break; } case EViewType::FanSpeed: { color = m_extrusions.ranges.fan_speed.get_color_at(path.fan_speed); break; }
case EViewType::Temperature: { color = m_extrusions.ranges.temperature.get_color_at(path.temperature); break; } case EViewType::Temperature: { color = m_extrusions.ranges.temperature.get_color_at(path.temperature); break; }
#if ENABLE_PREVIEW_LAYER_TIME
case EViewType::LayerTimeLinear:
case EViewType::LayerTimeLogarithmic: {
const Path::Sub_Path& sub_path = path.sub_paths.front();
double z = static_cast<double>(sub_path.first.position.z());
const std::vector<double>& zs = m_layers.get_zs();
const std::vector<Layers::Range>& ranges = m_layers.get_ranges();
size_t time_mode_id = static_cast<size_t>(m_time_estimate_mode);
for (size_t i = 0; i < zs.size(); ++i) {
if (std::abs(zs[i] - z) < EPSILON) {
if (ranges[i].contains(sub_path.first.s_id)) {
color = m_extrusions.ranges.layer_time[time_mode_id].get_color_at(m_layers_times[time_mode_id][i],
(m_view_type == EViewType::LayerTimeLinear) ? Extrusions::Range::EType::Linear : Extrusions::Range::EType::Logarithmic);
break;
}
}
}
break;
}
#endif // ENABLE_PREVIEW_LAYER_TIME
case EViewType::VolumetricRate: { color = m_extrusions.ranges.volumetric_rate.get_color_at(path.volumetric_rate); break; } case EViewType::VolumetricRate: { color = m_extrusions.ranges.volumetric_rate.get_color_at(path.volumetric_rate); break; }
case EViewType::Tool: { color = m_tool_colors[path.extruder_id]; break; } case EViewType::Tool: { color = m_tool_colors[path.extruder_id]; break; }
case EViewType::ColorPrint: { case EViewType::ColorPrint: {
@ -2142,7 +2219,7 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool
auto is_in_layers_range = [this](const Path& path, size_t min_id, size_t max_id) { auto is_in_layers_range = [this](const Path& path, size_t min_id, size_t max_id) {
auto in_layers_range = [this, min_id, max_id](size_t id) { auto in_layers_range = [this, min_id, max_id](size_t id) {
return m_layers.get_endpoints_at(min_id).first <= id && id <= m_layers.get_endpoints_at(max_id).last; return m_layers.get_range_at(min_id).first <= id && id <= m_layers.get_range_at(max_id).last;
}; };
return in_layers_range(path.sub_paths.front().first.s_id) && in_layers_range(path.sub_paths.back().last.s_id); return in_layers_range(path.sub_paths.front().first.s_id) && in_layers_range(path.sub_paths.back().last.s_id);
@ -2167,8 +2244,8 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool
path.sub_paths.back().last = buffer.paths[last].sub_paths.back().last; path.sub_paths.back().last = buffer.paths[last].sub_paths.back().last;
} }
const size_t min_s_id = m_layers.get_endpoints_at(min_id).first; const size_t min_s_id = m_layers.get_range_at(min_id).first;
const size_t max_s_id = m_layers.get_endpoints_at(max_id).last; const size_t max_s_id = m_layers.get_range_at(max_id).last;
return (min_s_id <= path.sub_paths.front().first.s_id && path.sub_paths.front().first.s_id <= max_s_id) || return (min_s_id <= path.sub_paths.front().first.s_id && path.sub_paths.front().first.s_id <= max_s_id) ||
(min_s_id <= path.sub_paths.back().last.s_id && path.sub_paths.back().last.s_id <= max_s_id); (min_s_id <= path.sub_paths.back().last.s_id && path.sub_paths.back().last.s_id <= max_s_id);
@ -2201,14 +2278,14 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool
if (buffer.render_primitive_type == TBuffer::ERenderPrimitiveType::InstancedModel || if (buffer.render_primitive_type == TBuffer::ERenderPrimitiveType::InstancedModel ||
buffer.render_primitive_type == TBuffer::ERenderPrimitiveType::BatchedModel) { buffer.render_primitive_type == TBuffer::ERenderPrimitiveType::BatchedModel) {
for (size_t id : buffer.model.instances.s_ids) { for (size_t id : buffer.model.instances.s_ids) {
if (id < m_layers.get_endpoints_at(m_layers_z_range[0]).first || m_layers.get_endpoints_at(m_layers_z_range[1]).last < id) if (id < m_layers.get_range_at(m_layers_z_range[0]).first || m_layers.get_range_at(m_layers_z_range[1]).last < id)
continue; continue;
global_endpoints.first = std::min(global_endpoints.first, id); global_endpoints.first = std::min(global_endpoints.first, id);
global_endpoints.last = std::max(global_endpoints.last, id); global_endpoints.last = std::max(global_endpoints.last, id);
if (top_layer_only) { if (top_layer_only) {
if (id < m_layers.get_endpoints_at(m_layers_z_range[1]).first || m_layers.get_endpoints_at(m_layers_z_range[1]).last < id) if (id < m_layers.get_range_at(m_layers_z_range[1]).first || m_layers.get_range_at(m_layers_z_range[1]).last < id)
continue; continue;
top_layer_endpoints.first = std::min(top_layer_endpoints.first, id); top_layer_endpoints.first = std::min(top_layer_endpoints.first, id);
@ -2950,7 +3027,11 @@ void GCodeViewer::render_legend(float& legend_height)
const float max_height = 0.75f * static_cast<float>(cnv_size.get_height()); const float max_height = 0.75f * static_cast<float>(cnv_size.get_height());
const float child_height = 0.3333f * max_height; const float child_height = 0.3333f * max_height;
ImGui::SetNextWindowSizeConstraints({ 0.0f, 0.0f }, { -1.0f, max_height }); ImGui::SetNextWindowSizeConstraints({ 0.0f, 0.0f }, { -1.0f, max_height });
#if ENABLE_PREVIEW_LAYOUT
imgui.begin(std::string("Legend"), ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove);
#else
imgui.begin(std::string("Legend"), ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoMove); imgui.begin(std::string("Legend"), ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoMove);
#endif // ENABLE_PREVIEW_LAYOUT
enum class EItemType : unsigned char enum class EItemType : unsigned char
{ {
@ -2961,8 +3042,14 @@ void GCodeViewer::render_legend(float& legend_height)
}; };
const PrintEstimatedStatistics::Mode& time_mode = m_print_statistics.modes[static_cast<size_t>(m_time_estimate_mode)]; const PrintEstimatedStatistics::Mode& time_mode = m_print_statistics.modes[static_cast<size_t>(m_time_estimate_mode)];
#if ENABLE_PREVIEW_LAYER_TIME
bool show_estimated_time = time_mode.time > 0.0f && (m_view_type == EViewType::FeatureType ||
m_view_type == EViewType::LayerTimeLinear || m_view_type == EViewType::LayerTimeLogarithmic ||
(m_view_type == EViewType::ColorPrint && !time_mode.custom_gcode_times.empty()));
#else
bool show_estimated_time = time_mode.time > 0.0f && (m_view_type == EViewType::FeatureType || bool show_estimated_time = time_mode.time > 0.0f && (m_view_type == EViewType::FeatureType ||
(m_view_type == EViewType::ColorPrint && !time_mode.custom_gcode_times.empty())); (m_view_type == EViewType::ColorPrint && !time_mode.custom_gcode_times.empty()));
#endif // ENABLE_PREVIEW_LAYER_TIME
const float icon_size = ImGui::GetTextLineHeight(); const float icon_size = ImGui::GetTextLineHeight();
const float percent_bar_size = 2.0f * ImGui::GetTextLineHeight(); const float percent_bar_size = 2.0f * ImGui::GetTextLineHeight();
@ -3048,7 +3135,25 @@ void GCodeViewer::render_legend(float& legend_height)
} }
else { else {
imgui.text(label); imgui.text(label);
#if ENABLE_TRAVEL_TIME
if (!time.empty()) {
ImGui::SameLine(offsets[0]);
imgui.text(time);
ImGui::SameLine(offsets[1]);
pos = ImGui::GetCursorScreenPos();
const float width = std::max(1.0f, percent_bar_size * percent / max_percent);
draw_list->AddRectFilled({ pos.x, pos.y + 2.0f }, { pos.x + width, pos.y + icon_size - 2.0f },
ImGui::GetColorU32(ImGuiWrapper::COL_ORANGE_LIGHT));
ImGui::Dummy({ percent_bar_size, icon_size });
ImGui::SameLine();
char buf[64];
::sprintf(buf, "%.1f%%", 100.0f * percent);
ImGui::TextUnformatted((percent > 0.0f) ? buf : "");
}
else if (used_filament_m > 0.0) {
#else
if (used_filament_m > 0.0) { if (used_filament_m > 0.0) {
#endif // ENABLE_TRAVEL_TIME
char buf[64]; char buf[64];
ImGui::SameLine(offsets[0]); ImGui::SameLine(offsets[0]);
::sprintf(buf, imperial_units ? "%.2f in" : "%.2f m", used_filament_m); ::sprintf(buf, imperial_units ? "%.2f in" : "%.2f m", used_filament_m);
@ -3074,6 +3179,7 @@ void GCodeViewer::render_legend(float& legend_height)
// single item use case // single item use case
append_range_item(0, range.min, decimals); append_range_item(0, range.min, decimals);
else if (range.count == 2) { else if (range.count == 2) {
// two items use case
append_range_item(static_cast<int>(Range_Colors.size()) - 1, range.max, decimals); append_range_item(static_cast<int>(Range_Colors.size()) - 1, range.max, decimals);
append_range_item(0, range.min, decimals); append_range_item(0, range.min, decimals);
} }
@ -3085,6 +3191,39 @@ void GCodeViewer::render_legend(float& legend_height)
} }
}; };
#if ENABLE_PREVIEW_LAYER_TIME
auto append_time_range = [append_item](const Extrusions::Range& range, Extrusions::Range::EType type) {
auto append_range_item = [append_item](int i, float value) {
std::string str_value = get_time_dhms(value);
if (str_value == "0s")
str_value = "< 1s";
append_item(EItemType::Rect, Range_Colors[i], str_value);
};
if (range.count == 1)
// single item use case
append_range_item(0, range.min);
else if (range.count == 2) {
// two items use case
append_range_item(static_cast<int>(Range_Colors.size()) - 1, range.max);
append_range_item(0, range.min);
}
else {
float step_size = range.step_size(type);
for (int i = static_cast<int>(Range_Colors.size()) - 1; i >= 0; --i) {
float value = 0.0f;
switch (type)
{
default:
case Extrusions::Range::EType::Linear: { value = range.min + static_cast<float>(i) * step_size; break; }
case Extrusions::Range::EType::Logarithmic: { value = ::exp(::log(range.min) + static_cast<float>(i) * step_size); break; }
}
append_range_item(i, value);
}
}
};
#endif // ENABLE_PREVIEW_LAYER_TIME
auto append_headers = [&imgui](const std::array<std::string, 5>& texts, const std::array<float, 4>& offsets) { auto append_headers = [&imgui](const std::array<std::string, 5>& texts, const std::array<float, 4>& offsets) {
size_t i = 0; size_t i = 0;
for (; i < offsets.size(); i++) { for (; i < offsets.size(); i++) {
@ -3184,7 +3323,7 @@ void GCodeViewer::render_legend(float& legend_height)
std::vector<float> percents; std::vector<float> percents;
std::vector<double> used_filaments_m; std::vector<double> used_filaments_m;
std::vector<double> used_filaments_g; std::vector<double> used_filaments_g;
float max_percent = 0.0f; float max_time_percent = 0.0f;
if (m_view_type == EViewType::FeatureType) { if (m_view_type == EViewType::FeatureType) {
// calculate offsets to align time/percentage data // calculate offsets to align time/percentage data
@ -3195,7 +3334,7 @@ void GCodeViewer::render_legend(float& legend_height)
auto [time, percent] = role_time_and_percent(role); auto [time, percent] = role_time_and_percent(role);
times.push_back((time > 0.0f) ? short_time(get_time_dhms(time)) : ""); times.push_back((time > 0.0f) ? short_time(get_time_dhms(time)) : "");
percents.push_back(percent); percents.push_back(percent);
max_percent = std::max(max_percent, percent); max_time_percent = std::max(max_time_percent, percent);
auto [used_filament_m, used_filament_g] = used_filament_per_role(role); auto [used_filament_m, used_filament_g] = used_filament_per_role(role);
used_filaments_m.push_back(used_filament_m); used_filaments_m.push_back(used_filament_m);
used_filaments_g.push_back(used_filament_g); used_filaments_g.push_back(used_filament_g);
@ -3255,6 +3394,47 @@ void GCodeViewer::render_legend(float& legend_height)
offsets = calculate_offsets(labels, times, { "Extruder NNN", longest_used_filament_string }, icon_size); offsets = calculate_offsets(labels, times, { "Extruder NNN", longest_used_filament_string }, icon_size);
} }
#if ENABLE_PREVIEW_LAYOUT
// selection section
bool view_type_changed = false;
int old_view_type = static_cast<int>(get_view_type());
int view_type = old_view_type;
if (!m_legend_resizer.dirty)
ImGui::SetNextItemWidth(-1.0f);
ImGui::PushStyleColor(ImGuiCol_FrameBg, { 0.1f, 0.1f, 0.1f, 0.8f });
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, { 0.2f, 0.2f, 0.2f, 0.8f });
imgui.combo("", { _u8L("Feature type"),
_u8L("Height (mm)"),
_u8L("Width (mm)"),
_u8L("Speed (mm/s)"),
_u8L("Fan speed (%)"),
_u8L("Temperature (°C)"),
_u8L("Volumetric flow rate (mm³/s)"),
#if ENABLE_PREVIEW_LAYER_TIME
_u8L("Layer time (linear)"),
_u8L("Layer time (logarithmic)"),
#endif // ENABLE_PREVIEW_LAYER_TIME
_u8L("Tool"),
_u8L("Color Print") }, view_type, ImGuiComboFlags_HeightLargest);
ImGui::PopStyleColor(2);
if (old_view_type != view_type) {
set_view_type(static_cast<EViewType>(view_type));
wxGetApp().plater()->set_keep_current_preview_type(true);
wxGetApp().plater()->refresh_print();
view_type_changed = true;
}
// extrusion paths section -> title
if (m_view_type == EViewType::FeatureType)
append_headers({ _u8L(""), _u8L("Time"), _u8L("Percentage"), _u8L("Used filament") }, offsets);
else if (m_view_type == EViewType::Tool)
append_headers({ _u8L(""), _u8L("Used filament"), _u8L(""), _u8L("") }, offsets);
else
ImGui::Separator();
#else
// extrusion paths section -> title // extrusion paths section -> title
switch (m_view_type) switch (m_view_type)
{ {
@ -3263,58 +3443,81 @@ void GCodeViewer::render_legend(float& legend_height)
append_headers({ _u8L("Feature type"), _u8L("Time"), _u8L("Percentage"), _u8L("Used filament") }, offsets); append_headers({ _u8L("Feature type"), _u8L("Time"), _u8L("Percentage"), _u8L("Used filament") }, offsets);
break; break;
} }
case EViewType::Height: { imgui.title(_u8L("Height (mm)")); break; } case EViewType::Height: { imgui.title(_u8L("Height (mm)")); break; }
case EViewType::Width: { imgui.title(_u8L("Width (mm)")); break; } case EViewType::Width: { imgui.title(_u8L("Width (mm)")); break; }
case EViewType::Feedrate: { imgui.title(_u8L("Speed (mm/s)")); break; } case EViewType::Feedrate: { imgui.title(_u8L("Speed (mm/s)")); break; }
case EViewType::FanSpeed: { imgui.title(_u8L("Fan Speed (%)")); break; } case EViewType::FanSpeed: { imgui.title(_u8L("Fan Speed (%)")); break; }
case EViewType::Temperature: { imgui.title(_u8L("Temperature (°C)")); break; } case EViewType::Temperature: { imgui.title(_u8L("Temperature (°C)")); break; }
case EViewType::VolumetricRate: { imgui.title(_u8L("Volumetric flow rate (mm³/s)")); break; } case EViewType::VolumetricRate: { imgui.title(_u8L("Volumetric flow rate (mm³/s)")); break; }
case EViewType::Tool: #if ENABLE_PREVIEW_LAYER_TIME
{ case EViewType::LayerTimeLinear: { imgui.title(_u8L("Layer time (linear)")); break; }
case EViewType::LayerTimeLogarithmic: { imgui.title(_u8L("Layer time (logarithmic)")); break; }
#endif // ENABLE_PREVIEW_LAYER_TIME
case EViewType::Tool: {
append_headers({ _u8L("Tool"), _u8L("Used filament") }, offsets); append_headers({ _u8L("Tool"), _u8L("Used filament") }, offsets);
break; break;
} }
case EViewType::ColorPrint: { imgui.title(_u8L("Color Print")); break; } case EViewType::ColorPrint: { imgui.title(_u8L("Color Print")); break; }
default: { break; } default: { break; }
} }
#endif // ENABLE_PREVIEW_LAYOUT
#if ENABLE_PREVIEW_LAYOUT
if (!view_type_changed) {
#endif // ENABLE_PREVIEW_LAYOUT
// extrusion paths section -> items // extrusion paths section -> items
switch (m_view_type) switch (m_view_type)
{ {
case EViewType::FeatureType: case EViewType::FeatureType:
{ {
#if ENABLE_TRAVEL_TIME
max_time_percent = std::max(max_time_percent, time_mode.travel_time / time_mode.time);
#endif // ENABLE_TRAVEL_TIME
for (size_t i = 0; i < m_roles.size(); ++i) { for (size_t i = 0; i < m_roles.size(); ++i) {
ExtrusionRole role = m_roles[i]; ExtrusionRole role = m_roles[i];
if (role >= erCount) if (role >= erCount)
continue; continue;
const bool visible = is_visible(role); const bool visible = is_visible(role);
append_item(EItemType::Rect, Extrusion_Role_Colors[static_cast<unsigned int>(role)], labels[i], append_item(EItemType::Rect, Extrusion_Role_Colors[static_cast<unsigned int>(role)], labels[i],
visible, times[i], percents[i], max_percent, offsets, used_filaments_m[i], used_filaments_g[i], [this, role, visible]() { visible, times[i], percents[i], max_time_percent, offsets, used_filaments_m[i], used_filaments_g[i], [this, role, visible]() {
m_extrusions.role_visibility_flags = visible ? m_extrusions.role_visibility_flags & ~(1 << role) : m_extrusions.role_visibility_flags | (1 << role); m_extrusions.role_visibility_flags = visible ? m_extrusions.role_visibility_flags & ~(1 << role) : m_extrusions.role_visibility_flags | (1 << role);
// update buffers' render paths // update buffers' render paths
refresh_render_paths(false, false); refresh_render_paths(false, false);
wxGetApp().plater()->update_preview_moves_slider(); wxGetApp().plater()->update_preview_moves_slider();
wxGetApp().plater()->get_current_canvas3D()->set_as_dirty(); wxGetApp().plater()->get_current_canvas3D()->set_as_dirty();
#if !ENABLE_PREVIEW_LAYOUT
wxGetApp().plater()->update_preview_bottom_toolbar(); wxGetApp().plater()->update_preview_bottom_toolbar();
#endif // !ENABLE_PREVIEW_LAYOUT
} }
); );
} }
#if ENABLE_TRAVEL_TIME
if (m_buffers[buffer_id(EMoveType::Travel)].visible)
append_item(EItemType::Line, Travel_Colors[0], _u8L("Travel"), true, short_time(get_time_dhms(time_mode.travel_time)),
time_mode.travel_time / time_mode.time, max_time_percent, offsets, 0.0f, 0.0f);
#endif // ENABLE_TRAVEL_TIME
break; break;
} }
case EViewType::Height: { append_range(m_extrusions.ranges.height, 3); break; } case EViewType::Height: { append_range(m_extrusions.ranges.height, 3); break; }
case EViewType::Width: { append_range(m_extrusions.ranges.width, 3); break; } case EViewType::Width: { append_range(m_extrusions.ranges.width, 3); break; }
case EViewType::Feedrate: { append_range(m_extrusions.ranges.feedrate, 1); break; } case EViewType::Feedrate: { append_range(m_extrusions.ranges.feedrate, 1); break; }
case EViewType::FanSpeed: { append_range(m_extrusions.ranges.fan_speed, 0); break; } case EViewType::FanSpeed: { append_range(m_extrusions.ranges.fan_speed, 0); break; }
case EViewType::Temperature: { append_range(m_extrusions.ranges.temperature, 0); break; } case EViewType::Temperature: { append_range(m_extrusions.ranges.temperature, 0); break; }
case EViewType::VolumetricRate: { append_range(m_extrusions.ranges.volumetric_rate, 3); break; } case EViewType::VolumetricRate: { append_range(m_extrusions.ranges.volumetric_rate, 3); break; }
case EViewType::Tool: #if ENABLE_PREVIEW_LAYER_TIME
{ case EViewType::LayerTimeLinear: { append_time_range(m_extrusions.ranges.layer_time[static_cast<size_t>(m_time_estimate_mode)], Extrusions::Range::EType::Linear); break; }
case EViewType::LayerTimeLogarithmic: { append_time_range(m_extrusions.ranges.layer_time[static_cast<size_t>(m_time_estimate_mode)], Extrusions::Range::EType::Logarithmic); break; }
#endif // ENABLE_PREVIEW_LAYER_TIME
case EViewType::Tool: {
// shows only extruders actually used // shows only extruders actually used
size_t i = 0; size_t i = 0;
for (unsigned char extruder_id : m_extruder_ids) { for (unsigned char extruder_id : m_extruder_ids) {
append_item(EItemType::Rect, m_tool_colors[extruder_id], _u8L("Extruder") + " " + std::to_string(extruder_id + 1), append_item(EItemType::Rect, m_tool_colors[extruder_id], _u8L("Extruder") + " " + std::to_string(extruder_id + 1),
true, "", 0.0f, 0.0f, offsets, used_filaments_m[i], used_filaments_g[i]); true, "", 0.0f, 0.0f, offsets, used_filaments_m[i], used_filaments_g[i]);
i++; ++i;
} }
break; break;
} }
@ -3326,7 +3529,7 @@ void GCodeViewer::render_legend(float& legend_height)
total_items += color_print_ranges(i, custom_gcode_per_print_z).size(); total_items += color_print_ranges(i, custom_gcode_per_print_z).size();
} }
const bool need_scrollable = static_cast<float>(total_items) * (icon_size + ImGui::GetStyle().ItemSpacing.y) > child_height; const bool need_scrollable = static_cast<float>(total_items) * icon_size + (static_cast<float>(total_items) - 1.0f) * ImGui::GetStyle().ItemSpacing.y > child_height;
// add scrollable region, if needed // add scrollable region, if needed
if (need_scrollable) if (need_scrollable)
@ -3387,6 +3590,9 @@ void GCodeViewer::render_legend(float& legend_height)
} }
default: { break; } default: { break; }
} }
#if ENABLE_PREVIEW_LAYOUT
}
#endif // ENABLE_PREVIEW_LAYOUT
// partial estimated printing time section // partial estimated printing time section
if (m_view_type == EViewType::ColorPrint) { if (m_view_type == EViewType::ColorPrint) {
@ -3534,7 +3740,7 @@ void GCodeViewer::render_legend(float& legend_height)
ImGui::Spacing(); ImGui::Spacing();
append_headers({ _u8L("Event"), _u8L("Remaining time"), _u8L("Duration"), _u8L("Used filament") }, offsets); append_headers({ _u8L("Event"), _u8L("Remaining time"), _u8L("Duration"), _u8L("Used filament") }, offsets);
const bool need_scrollable = static_cast<float>(partial_times.size()) * (icon_size + ImGui::GetStyle().ItemSpacing.y) > child_height; const bool need_scrollable = static_cast<float>(partial_times.size()) * icon_size + (static_cast<float>(partial_times.size()) - 1.0f) * ImGui::GetStyle().ItemSpacing.y > child_height;
if (need_scrollable) if (need_scrollable)
// add scrollable region // add scrollable region
ImGui::BeginChild("events", { -1.0f, child_height }, false); ImGui::BeginChild("events", { -1.0f, child_height }, false);
@ -3564,6 +3770,7 @@ void GCodeViewer::render_legend(float& legend_height)
} }
} }
#if !ENABLE_PREVIEW_LAYOUT
// travel paths section // travel paths section
if (m_buffers[buffer_id(EMoveType::Travel)].visible) { if (m_buffers[buffer_id(EMoveType::Travel)].visible) {
switch (m_view_type) switch (m_view_type)
@ -3644,6 +3851,7 @@ void GCodeViewer::render_legend(float& legend_height)
add_option(EMoveType::Pause_Print, EOptionsColors::PausePrints, _u8L("Print pauses")); add_option(EMoveType::Pause_Print, EOptionsColors::PausePrints, _u8L("Print pauses"));
add_option(EMoveType::Custom_GCode, EOptionsColors::CustomGCodes, _u8L("Custom G-codes")); add_option(EMoveType::Custom_GCode, EOptionsColors::CustomGCodes, _u8L("Custom G-codes"));
} }
#endif // !ENABLE_PREVIEW_LAYOUT
// settings section // settings section
bool has_settings = false; bool has_settings = false;
@ -3725,7 +3933,7 @@ void GCodeViewer::render_legend(float& legend_height)
if (can_show_mode_button(m_time_estimate_mode)) { if (can_show_mode_button(m_time_estimate_mode)) {
switch (m_time_estimate_mode) switch (m_time_estimate_mode)
{ {
case PrintEstimatedStatistics::ETimeMode::Normal: { time_title += " [" + _u8L("Normal mode") + "]"; break; } case PrintEstimatedStatistics::ETimeMode::Normal: { time_title += " [" + _u8L("Normal mode") + "]"; break; }
case PrintEstimatedStatistics::ETimeMode::Stealth: { time_title += " [" + _u8L("Stealth mode") + "]"; break; } case PrintEstimatedStatistics::ETimeMode::Stealth: { time_title += " [" + _u8L("Stealth mode") + "]"; break; }
default: { assert(false); break; } default: { assert(false); break; }
} }
@ -3756,6 +3964,10 @@ void GCodeViewer::render_legend(float& legend_height)
if (can_show_mode_button(mode)) { if (can_show_mode_button(mode)) {
if (imgui.button(label)) { if (imgui.button(label)) {
m_time_estimate_mode = mode; m_time_estimate_mode = mode;
#if ENABLE_PREVIEW_LAYER_TIME
if (m_view_type == EViewType::LayerTimeLinear || m_view_type == EViewType::LayerTimeLogarithmic)
refresh_render_paths(false, false);
#endif // ENABLE_PREVIEW_LAYER_TIME
imgui.set_requires_extra_frame(); imgui.set_requires_extra_frame();
} }
} }
@ -3763,18 +3975,216 @@ void GCodeViewer::render_legend(float& legend_height)
switch (m_time_estimate_mode) { switch (m_time_estimate_mode) {
case PrintEstimatedStatistics::ETimeMode::Normal: { case PrintEstimatedStatistics::ETimeMode::Normal: {
show_mode_button(_L("Show stealth mode"), PrintEstimatedStatistics::ETimeMode::Stealth); show_mode_button(_u8L("Show stealth mode"), PrintEstimatedStatistics::ETimeMode::Stealth);
break; break;
} }
case PrintEstimatedStatistics::ETimeMode::Stealth: { case PrintEstimatedStatistics::ETimeMode::Stealth: {
show_mode_button(_L("Show normal mode"), PrintEstimatedStatistics::ETimeMode::Normal); show_mode_button(_u8L("Show normal mode"), PrintEstimatedStatistics::ETimeMode::Normal);
break; break;
} }
default : { assert(false); break; } default : { assert(false); break; }
} }
} }
legend_height = ImGui::GetCurrentWindow()->Size.y; #if ENABLE_PREVIEW_LAYOUT
// toolbar section
auto toggle_button = [this, &imgui, icon_size](Preview::OptionType type, const std::string& name,
std::function<void(ImGuiWindow& window, const ImVec2& pos, float size)> draw_callback) {
auto is_flag_set = [](unsigned int flags, unsigned int flag) {
return (flags & (1 << flag)) != 0;
};
auto set_flag = [](unsigned int flags, unsigned int flag, bool active) {
return active ? (flags | (1 << flag)) : (flags & ~(1 << flag));
};
unsigned int flags = get_options_visibility_flags();
unsigned int flag = static_cast<unsigned int>(type);
bool active = is_flag_set(flags, flag);
if (imgui.draw_radio_button(name, 1.5f * icon_size, active, draw_callback)) {
unsigned int new_flags = set_flag(flags, flag, !active);
set_options_visibility_from_flags(new_flags);
const unsigned int diff_flags = flags ^ new_flags;
if (m_view_type == GCodeViewer::EViewType::Feedrate && is_flag_set(diff_flags, static_cast<unsigned int>(Preview::OptionType::Travel)))
wxGetApp().plater()->refresh_print();
else {
bool keep_first = m_sequential_view.current.first != m_sequential_view.global.first;
bool keep_last = m_sequential_view.current.last != m_sequential_view.global.last;
wxGetApp().plater()->get_current_canvas3D()->refresh_gcode_preview_render_paths(keep_first, keep_last);
}
wxGetApp().plater()->update_preview_moves_slider();
}
if (ImGui::IsItemHovered()) {
ImGui::PushStyleColor(ImGuiCol_PopupBg, ImGuiWrapper::COL_WINDOW_BACKGROUND);
ImGui::BeginTooltip();
imgui.text(name);
ImGui::EndTooltip();
ImGui::PopStyleColor();
}
};
#if ENABLE_LEGEND_TOOLBAR_ICONS
// auto circle_icon = [](ImGuiWindow& window, const ImVec2& pos, float size, const Color& color) {
// const float margin = 3.0f;
// const ImVec2 center(0.5f * (pos.x + pos.x + size), 0.5f * (pos.y + pos.y + size));
// window.DrawList->AddCircleFilled(center, 0.5f * (size - 2.0f * margin), ImGui::GetColorU32({ color[0], color[1], color[2], 1.0f }), 16);
// };
// auto line_icon = [](ImGuiWindow& window, const ImVec2& pos, float size, const Color& color) {
// const float margin = 3.0f;
// window.DrawList->AddLine({ pos.x + margin, pos.y + size - margin }, { pos.x + size - margin, pos.y + margin }, ImGui::GetColorU32({ color[0], color[1], color[2], 1.0f }), 3.0f);
// };
auto image_icon = [&imgui](ImGuiWindow& window, const ImVec2& pos, float size, const wchar_t& icon_id) {
ImGuiIO& io = ImGui::GetIO();
const ImTextureID tex_id = io.Fonts->TexID;
const float tex_w = static_cast<float>(io.Fonts->TexWidth);
const float tex_h = static_cast<float>(io.Fonts->TexHeight);
const ImFontAtlas::CustomRect* const rect = imgui.GetTextureCustomRect(icon_id);
const ImVec2 uv0 = { static_cast<float>(rect->X) / tex_w, static_cast<float>(rect->Y) / tex_h };
const ImVec2 uv1 = { static_cast<float>(rect->X + rect->Width) / tex_w, static_cast<float>(rect->Y + rect->Height) / tex_h };
window.DrawList->AddImage(tex_id, pos, { pos.x + size, pos.y + size }, uv0, uv1, ImGui::GetColorU32({ 1.0f, 1.0f, 1.0f, 1.0f }));
};
#else
auto circle_icon = [](ImGuiWindow& window, const ImVec2& pos, float size, const Color& color) {
const float margin = 3.0f;
const ImVec2 center(0.5f * (pos.x + pos.x + size), 0.5f * (pos.y + pos.y + size));
window.DrawList->AddCircleFilled(center, 0.5f * (size - 2.0f * margin), ImGui::GetColorU32({ color[0], color[1], color[2], 1.0f }), 16);
};
auto line_icon = [](ImGuiWindow& window, const ImVec2& pos, float size, const Color& color) {
const float margin = 3.0f;
window.DrawList->AddLine({ pos.x + margin, pos.y + size - margin }, { pos.x + size - margin, pos.y + margin }, ImGui::GetColorU32({ color[0], color[1], color[2], 1.0f }), 3.0f);
};
#endif // ENABLE_LEGEND_TOOLBAR_ICONS
ImGui::Spacing();
ImGui::Separator();
ImGui::Spacing();
ImGui::Spacing();
#if ENABLE_LEGEND_TOOLBAR_ICONS
toggle_button(Preview::OptionType::Travel, _u8L("Travel"), [image_icon](ImGuiWindow& window, const ImVec2& pos, float size) {
image_icon(window, pos, size, ImGui::LegendTravel);
#else
toggle_button(Preview::OptionType::Travel, _u8L("Travel"), [line_icon](ImGuiWindow& window, const ImVec2& pos, float size) {
line_icon(window, pos, size, Travel_Colors[0]);
#endif // ENABLE_LEGEND_TOOLBAR_ICONS
});
ImGui::SameLine();
#if ENABLE_LEGEND_TOOLBAR_ICONS
toggle_button(Preview::OptionType::Wipe, _u8L("Wipe"), [image_icon](ImGuiWindow& window, const ImVec2& pos, float size) {
image_icon(window, pos, size, ImGui::LegendWipe);
#else
toggle_button(Preview::OptionType::Wipe, _u8L("Wipe"), [line_icon](ImGuiWindow& window, const ImVec2& pos, float size) {
line_icon(window, pos, size, Wipe_Color);
#endif // ENABLE_LEGEND_TOOLBAR_ICONS
});
ImGui::SameLine();
#if ENABLE_LEGEND_TOOLBAR_ICONS
toggle_button(Preview::OptionType::Retractions, _u8L("Retractions"), [image_icon](ImGuiWindow& window, const ImVec2& pos, float size) {
image_icon(window, pos, size, ImGui::LegendRetract);
#else
toggle_button(Preview::OptionType::Retractions, _u8L("Retractions"), [circle_icon](ImGuiWindow& window, const ImVec2& pos, float size) {
circle_icon(window, pos, size, Options_Colors[static_cast<unsigned int>(EOptionsColors::Retractions)]);
#endif // ENABLE_LEGEND_TOOLBAR_ICONS
});
ImGui::SameLine();
#if ENABLE_LEGEND_TOOLBAR_ICONS
toggle_button(Preview::OptionType::Unretractions, _u8L("Deretractions"), [image_icon](ImGuiWindow& window, const ImVec2& pos, float size) {
image_icon(window, pos, size, ImGui::LegendDeretract);
#else
toggle_button(Preview::OptionType::Unretractions, _u8L("Deretractions"), [circle_icon](ImGuiWindow& window, const ImVec2& pos, float size) {
circle_icon(window, pos, size, Options_Colors[static_cast<unsigned int>(EOptionsColors::Unretractions)]);
#endif // ENABLE_LEGEND_TOOLBAR_ICONS
});
ImGui::SameLine();
#if ENABLE_LEGEND_TOOLBAR_ICONS
toggle_button(Preview::OptionType::Seams, _u8L("Seams"), [image_icon](ImGuiWindow& window, const ImVec2& pos, float size) {
image_icon(window, pos, size, ImGui::LegendSeams);
#else
toggle_button(Preview::OptionType::Seams, _u8L("Seams"), [circle_icon](ImGuiWindow& window, const ImVec2& pos, float size) {
circle_icon(window, pos, size, Options_Colors[static_cast<unsigned int>(EOptionsColors::Seams)]);
#endif // ENABLE_LEGEND_TOOLBAR_ICONS
});
ImGui::SameLine();
#if ENABLE_LEGEND_TOOLBAR_ICONS
toggle_button(Preview::OptionType::ToolChanges, _u8L("Tool changes"), [image_icon](ImGuiWindow& window, const ImVec2& pos, float size) {
image_icon(window, pos, size, ImGui::LegendToolChanges);
#else
toggle_button(Preview::OptionType::ToolChanges, _u8L("Tool changes"), [circle_icon](ImGuiWindow& window, const ImVec2& pos, float size) {
circle_icon(window, pos, size, Options_Colors[static_cast<unsigned int>(EOptionsColors::ToolChanges)]);
#endif // ENABLE_LEGEND_TOOLBAR_ICONS
});
ImGui::SameLine();
#if ENABLE_LEGEND_TOOLBAR_ICONS
toggle_button(Preview::OptionType::ColorChanges, _u8L("Color changes"), [image_icon](ImGuiWindow& window, const ImVec2& pos, float size) {
image_icon(window, pos, size, ImGui::LegendColorChanges);
#else
toggle_button(Preview::OptionType::ColorChanges, _u8L("Color changes"), [circle_icon](ImGuiWindow& window, const ImVec2& pos, float size) {
circle_icon(window, pos, size, Options_Colors[static_cast<unsigned int>(EOptionsColors::ColorChanges)]);
#endif // ENABLE_LEGEND_TOOLBAR_ICONS
});
ImGui::SameLine();
#if ENABLE_LEGEND_TOOLBAR_ICONS
toggle_button(Preview::OptionType::PausePrints, _u8L("Print pauses"), [image_icon](ImGuiWindow& window, const ImVec2& pos, float size) {
image_icon(window, pos, size, ImGui::LegendPausePrints);
#else
toggle_button(Preview::OptionType::PausePrints, _u8L("Print pauses"), [circle_icon](ImGuiWindow& window, const ImVec2& pos, float size) {
circle_icon(window, pos, size, Options_Colors[static_cast<unsigned int>(EOptionsColors::PausePrints)]);
#endif // ENABLE_LEGEND_TOOLBAR_ICONS
});
ImGui::SameLine();
#if ENABLE_LEGEND_TOOLBAR_ICONS
toggle_button(Preview::OptionType::CustomGCodes, _u8L("Custom G-codes"), [image_icon](ImGuiWindow& window, const ImVec2& pos, float size) {
image_icon(window, pos, size, ImGui::LegendCustomGCodes);
#else
toggle_button(Preview::OptionType::CustomGCodes, _u8L("Custom G-codes"), [circle_icon](ImGuiWindow& window, const ImVec2& pos, float size) {
circle_icon(window, pos, size, Options_Colors[static_cast<unsigned int>(EOptionsColors::CustomGCodes)]);
#endif // ENABLE_LEGEND_TOOLBAR_ICONS
});
ImGui::SameLine();
#if ENABLE_LEGEND_TOOLBAR_ICONS
toggle_button(Preview::OptionType::Shells, _u8L("Shells"), [image_icon](ImGuiWindow& window, const ImVec2& pos, float size) {
image_icon(window, pos, size, ImGui::LegendShells);
#else
toggle_button(Preview::OptionType::Shells, _u8L("Shells"), [](ImGuiWindow& window, const ImVec2& pos, float size) {
const ImU32 color = ImGui::GetColorU32({ 1.0f, 1.0f, 1.0f, 1.0f });
const float margin = 3.0f;
const float proj = 0.25f * size;
window.DrawList->AddRect({ pos.x + margin, pos.y + size - margin }, { pos.x + size - margin - proj, pos.y + margin + proj }, color);
window.DrawList->AddLine({ pos.x + margin, pos.y + margin + proj }, { pos.x + margin + proj, pos.y + margin }, color);
window.DrawList->AddLine({ pos.x + size - margin - proj, pos.y + margin + proj }, { pos.x + size - margin, pos.y + margin }, color);
window.DrawList->AddLine({ pos.x + size - margin - proj, pos.y + size - margin }, { pos.x + size - margin, pos.y + size - margin - proj }, color);
window.DrawList->AddLine({ pos.x + margin + proj, pos.y + margin }, { pos.x + size - margin, pos.y + margin }, color);
window.DrawList->AddLine({ pos.x + size - margin, pos.y + margin }, { pos.x + size - margin, pos.y + size - margin - proj }, color);
#endif // ENABLE_LEGEND_TOOLBAR_ICONS
});
ImGui::SameLine();
#if ENABLE_LEGEND_TOOLBAR_ICONS
toggle_button(Preview::OptionType::ToolMarker, _u8L("Tool marker"), [image_icon](ImGuiWindow& window, const ImVec2& pos, float size) {
image_icon(window, pos, size, ImGui::LegendToolMarker);
#else
toggle_button(Preview::OptionType::ToolMarker, _u8L("Tool marker"), [](ImGuiWindow& window, const ImVec2& pos, float size) {
const ImU32 color = ImGui::GetColorU32({ 1.0f, 1.0f, 1.0f, 0.8f });
const float margin = 3.0f;
const ImVec2 p1(0.5f * (pos.x + pos.x + size), pos.y + size - margin);
const ImVec2 p2 = ImVec2(p1.x + 0.25f * size, p1.y - 0.25f * size);
const ImVec2 p3 = ImVec2(p1.x - 0.25f * size, p1.y - 0.25f * size);
window.DrawList->AddTriangleFilled(p1, p2, p3, color);
const float mid_x = 0.5f * (pos.x + pos.x + size);
window.DrawList->AddRectFilled({ mid_x - 0.09375f * size, p1.y - 0.25f * size }, { mid_x + 0.09375f * size, pos.y + margin }, color);
#endif // ENABLE_LEGEND_TOOLBAR_ICONS
});
bool size_dirty = !ImGui::GetCurrentWindow()->ScrollbarY && ImGui::CalcWindowNextAutoFitSize(ImGui::GetCurrentWindow()).x != ImGui::GetWindowWidth();
if (m_legend_resizer.dirty || size_dirty != m_legend_resizer.dirty) {
wxGetApp().plater()->get_current_canvas3D()->set_as_dirty();
wxGetApp().plater()->get_current_canvas3D()->request_extra_frame();
}
m_legend_resizer.dirty = size_dirty;
#endif // ENABLE_PREVIEW_LAYOUT
legend_height = ImGui::GetWindowHeight();
imgui.end(); imgui.end();
ImGui::PopStyleVar(); ImGui::PopStyleVar();
@ -3896,7 +4306,7 @@ void GCodeViewer::log_memory_used(const std::string& label, int64_t additional)
} }
} }
int64_t layers_size = SLIC3R_STDVEC_MEMSIZE(m_layers.get_zs(), double); int64_t layers_size = SLIC3R_STDVEC_MEMSIZE(m_layers.get_zs(), double);
layers_size += SLIC3R_STDVEC_MEMSIZE(m_layers.get_endpoints(), Layers::Endpoints); layers_size += SLIC3R_STDVEC_MEMSIZE(m_layers.get_ranges(), Layers::Range);
BOOST_LOG_TRIVIAL(trace) << label BOOST_LOG_TRIVIAL(trace) << label
<< "(" << format_memsize_MB(additional + paths_size + render_paths_size + layers_size) << ");" << "(" << format_memsize_MB(additional + paths_size + render_paths_size + layers_size) << ");"
<< log_memory_info(); << log_memory_info();

View File

@ -381,6 +381,14 @@ class GCodeViewer
{ {
struct Range struct Range
{ {
#if ENABLE_PREVIEW_LAYER_TIME
enum class EType : unsigned char
{
Linear,
Logarithmic
};
#endif // ENABLE_PREVIEW_LAYER_TIME
float min; float min;
float max; float max;
unsigned int count; unsigned int count;
@ -395,8 +403,13 @@ class GCodeViewer
} }
void reset() { min = FLT_MAX; max = -FLT_MAX; count = 0; } void reset() { min = FLT_MAX; max = -FLT_MAX; count = 0; }
#if ENABLE_PREVIEW_LAYER_TIME
float step_size(EType type = EType::Linear) const;
ColorRGBA get_color_at(float value, EType type = EType::Linear) const;
#else
float step_size() const { return (max - min) / (static_cast<float>(Range_Colors.size()) - 1.0f); } float step_size() const { return (max - min) / (static_cast<float>(Range_Colors.size()) - 1.0f); }
ColorRGBA get_color_at(float value) const; ColorRGBA get_color_at(float value) const;
#endif // ENABLE_PREVIEW_LAYER_TIME
}; };
struct Ranges struct Ranges
@ -413,6 +426,10 @@ class GCodeViewer
Range volumetric_rate; Range volumetric_rate;
// Color mapping by extrusion temperature. // Color mapping by extrusion temperature.
Range temperature; Range temperature;
#if ENABLE_PREVIEW_LAYER_TIME
// Color mapping by layer time.
std::array<Range, static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Count)> layer_time;
#endif // ENABLE_PREVIEW_LAYER_TIME
void reset() { void reset() {
height.reset(); height.reset();
@ -421,6 +438,11 @@ class GCodeViewer
fan_speed.reset(); fan_speed.reset();
volumetric_rate.reset(); volumetric_rate.reset();
temperature.reset(); temperature.reset();
#if ENABLE_PREVIEW_LAYER_TIME
for (auto& range : layer_time) {
range.reset();
}
#endif // ENABLE_PREVIEW_LAYER_TIME
} }
}; };
@ -440,42 +462,43 @@ class GCodeViewer
class Layers class Layers
{ {
public: public:
struct Endpoints struct Range
{ {
size_t first{ 0 }; size_t first{ 0 };
size_t last{ 0 }; size_t last{ 0 };
bool operator == (const Endpoints& other) const { return first == other.first && last == other.last; } bool operator == (const Range& other) const { return first == other.first && last == other.last; }
bool operator != (const Endpoints& other) const { return !operator==(other); } bool operator != (const Range& other) const { return !operator==(other); }
bool contains(size_t id) const { return first <= id && id <= last; }
}; };
private: private:
std::vector<double> m_zs; std::vector<double> m_zs;
std::vector<Endpoints> m_endpoints; std::vector<Range> m_ranges;
public: public:
void append(double z, Endpoints endpoints) { void append(double z, const Range& range) {
m_zs.emplace_back(z); m_zs.emplace_back(z);
m_endpoints.emplace_back(endpoints); m_ranges.emplace_back(range);
} }
void reset() { void reset() {
m_zs = std::vector<double>(); m_zs = std::vector<double>();
m_endpoints = std::vector<Endpoints>(); m_ranges = std::vector<Range>();
} }
size_t size() const { return m_zs.size(); } size_t size() const { return m_zs.size(); }
bool empty() const { return m_zs.empty(); } bool empty() const { return m_zs.empty(); }
const std::vector<double>& get_zs() const { return m_zs; } const std::vector<double>& get_zs() const { return m_zs; }
const std::vector<Endpoints>& get_endpoints() const { return m_endpoints; } const std::vector<Range>& get_ranges() const { return m_ranges; }
std::vector<Endpoints>& get_endpoints() { return m_endpoints; } std::vector<Range>& get_ranges() { return m_ranges; }
double get_z_at(unsigned int id) const { return (id < m_zs.size()) ? m_zs[id] : 0.0; } double get_z_at(unsigned int id) const { return (id < m_zs.size()) ? m_zs[id] : 0.0; }
Endpoints get_endpoints_at(unsigned int id) const { return (id < m_endpoints.size()) ? m_endpoints[id] : Endpoints(); } Range get_range_at(unsigned int id) const { return (id < m_ranges.size()) ? m_ranges[id] : Range(); }
bool operator != (const Layers& other) const { bool operator != (const Layers& other) const {
if (m_zs != other.m_zs) if (m_zs != other.m_zs)
return true; return true;
if (m_endpoints != other.m_endpoints) if (m_ranges != other.m_ranges)
return true; return true;
return false; return false;
} }
@ -677,6 +700,10 @@ public:
FanSpeed, FanSpeed,
Temperature, Temperature,
VolumetricRate, VolumetricRate,
#if ENABLE_PREVIEW_LAYER_TIME
LayerTimeLinear,
LayerTimeLogarithmic,
#endif // ENABLE_PREVIEW_LAYER_TIME
Tool, Tool,
ColorPrint, ColorPrint,
Count Count
@ -705,6 +732,14 @@ private:
Shells m_shells; Shells m_shells;
EViewType m_view_type{ EViewType::FeatureType }; EViewType m_view_type{ EViewType::FeatureType };
bool m_legend_enabled{ true }; bool m_legend_enabled{ true };
#if ENABLE_PREVIEW_LAYOUT
struct LegendResizer
{
bool dirty{ true };
void reset() { dirty = true; }
};
LegendResizer m_legend_resizer;
#endif // ENABLE_PREVIEW_LAYOUT
PrintEstimatedStatistics m_print_statistics; PrintEstimatedStatistics m_print_statistics;
PrintEstimatedStatistics::ETimeMode m_time_estimate_mode{ PrintEstimatedStatistics::ETimeMode::Normal }; PrintEstimatedStatistics::ETimeMode m_time_estimate_mode{ PrintEstimatedStatistics::ETimeMode::Normal };
#if ENABLE_GCODE_VIEWER_STATISTICS #if ENABLE_GCODE_VIEWER_STATISTICS
@ -713,6 +748,9 @@ private:
std::array<float, 2> m_detected_point_sizes = { 0.0f, 0.0f }; std::array<float, 2> m_detected_point_sizes = { 0.0f, 0.0f };
GCodeProcessorResult::SettingsIds m_settings_ids; GCodeProcessorResult::SettingsIds m_settings_ids;
std::array<SequentialRangeCap, 2> m_sequential_range_caps; std::array<SequentialRangeCap, 2> m_sequential_range_caps;
#if ENABLE_PREVIEW_LAYER_TIME
std::array<std::vector<float>, static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Count)> m_layers_times;
#endif // ENABLE_PREVIEW_LAYER_TIME
std::vector<CustomGCode::Item> m_custom_gcode_per_print_z; std::vector<CustomGCode::Item> m_custom_gcode_per_print_z;
@ -728,7 +766,11 @@ public:
void load(const GCodeProcessorResult& gcode_result, const Print& print, bool initialized); void load(const GCodeProcessorResult& gcode_result, const Print& print, bool initialized);
// recalculate ranges in dependence of what is visible and sets tool/print colors // recalculate ranges in dependence of what is visible and sets tool/print colors
void refresh(const GCodeProcessorResult& gcode_result, const std::vector<std::string>& str_tool_colors); void refresh(const GCodeProcessorResult& gcode_result, const std::vector<std::string>& str_tool_colors);
#if ENABLE_PREVIEW_LAYOUT
void refresh_render_paths(bool keep_sequential_current_first, bool keep_sequential_current_last) const;
#else
void refresh_render_paths(); void refresh_render_paths();
#endif // ENABLE_PREVIEW_LAYOUT
void update_shells_color_by_extruder(const DynamicPrintConfig* config); void update_shells_color_by_extruder(const DynamicPrintConfig* config);
void reset(); void reset();
@ -772,10 +814,16 @@ public:
std::vector<CustomGCode::Item>& get_custom_gcode_per_print_z() { return m_custom_gcode_per_print_z; } std::vector<CustomGCode::Item>& get_custom_gcode_per_print_z() { return m_custom_gcode_per_print_z; }
size_t get_extruders_count() { return m_extruders_count; } size_t get_extruders_count() { return m_extruders_count; }
#if ENABLE_PREVIEW_LAYOUT
void invalidate_legend() { m_legend_resizer.reset(); }
#endif // ENABLE_PREVIEW_LAYOUT
private: private:
void load_toolpaths(const GCodeProcessorResult& gcode_result); void load_toolpaths(const GCodeProcessorResult& gcode_result);
void load_shells(const Print& print, bool initialized); void load_shells(const Print& print, bool initialized);
#if !ENABLE_PREVIEW_LAYOUT
void refresh_render_paths(bool keep_sequential_current_first, bool keep_sequential_current_last) const; void refresh_render_paths(bool keep_sequential_current_first, bool keep_sequential_current_last) const;
#endif // !ENABLE_PREVIEW_LAYOUT
void render_toolpaths(); void render_toolpaths();
void render_shells(); void render_shells();
void render_legend(float& legend_height); void render_legend(float& legend_height);

View File

@ -2110,12 +2110,21 @@ void GLCanvas3D::load_gcode_preview(const GCodeProcessorResult& gcode_result, co
request_extra_frame(); request_extra_frame();
} }
#if ENABLE_PREVIEW_LAYOUT
void GLCanvas3D::refresh_gcode_preview_render_paths(bool keep_sequential_current_first, bool keep_sequential_current_last)
{
m_gcode_viewer.refresh_render_paths(keep_sequential_current_first, keep_sequential_current_last);
set_as_dirty();
request_extra_frame();
}
#else
void GLCanvas3D::refresh_gcode_preview_render_paths() void GLCanvas3D::refresh_gcode_preview_render_paths()
{ {
m_gcode_viewer.refresh_render_paths(); m_gcode_viewer.refresh_render_paths();
set_as_dirty(); set_as_dirty();
request_extra_frame(); request_extra_frame();
} }
#endif // ENABLE_PREVIEW_LAYOUT
void GLCanvas3D::load_sla_preview() void GLCanvas3D::load_sla_preview()
{ {
@ -2419,12 +2428,16 @@ void GLCanvas3D::on_char(wxKeyEvent& evt)
case 'i': { _update_camera_zoom(1.0); break; } case 'i': { _update_camera_zoom(1.0); break; }
case 'K': case 'K':
case 'k': { wxGetApp().plater()->get_camera().select_next_type(); m_dirty = true; break; } case 'k': { wxGetApp().plater()->get_camera().select_next_type(); m_dirty = true; break; }
case 'L': case 'L':
case 'l': { case 'l': {
if (!m_main_toolbar.is_enabled()) { if (!m_main_toolbar.is_enabled()) {
#if ENABLE_PREVIEW_LAYOUT
show_legend(!is_legend_shown());
#else
m_gcode_viewer.enable_legend(!m_gcode_viewer.is_legend_enabled()); m_gcode_viewer.enable_legend(!m_gcode_viewer.is_legend_enabled());
m_dirty = true; m_dirty = true;
wxGetApp().plater()->update_preview_bottom_toolbar(); wxGetApp().plater()->update_preview_bottom_toolbar();
#endif // ENABLE_PREVIEW_LAYOUT
} }
break; break;
} }
@ -3751,6 +3764,9 @@ void GLCanvas3D::set_cursor(ECursorType type)
void GLCanvas3D::msw_rescale() void GLCanvas3D::msw_rescale()
{ {
#if ENABLE_PREVIEW_LAYOUT
m_gcode_viewer.invalidate_legend();
#endif // ENABLE_PREVIEW_LAYOUT
} }
void GLCanvas3D::update_tooltip_for_settings_item_in_main_toolbar() void GLCanvas3D::update_tooltip_for_settings_item_in_main_toolbar()

View File

@ -731,7 +731,11 @@ public:
void reload_scene(bool refresh_immediately, bool force_full_scene_refresh = false); void reload_scene(bool refresh_immediately, bool force_full_scene_refresh = false);
void load_gcode_preview(const GCodeProcessorResult& gcode_result, const std::vector<std::string>& str_tool_colors); void load_gcode_preview(const GCodeProcessorResult& gcode_result, const std::vector<std::string>& str_tool_colors);
#if ENABLE_PREVIEW_LAYOUT
void refresh_gcode_preview_render_paths(bool keep_sequential_current_first, bool keep_sequential_current_last);
#else
void refresh_gcode_preview_render_paths(); void refresh_gcode_preview_render_paths();
#endif // ENABLE_PREVIEW_LAYOUT
void set_gcode_view_preview_type(GCodeViewer::EViewType type) { return m_gcode_viewer.set_view_type(type); } void set_gcode_view_preview_type(GCodeViewer::EViewType type) { return m_gcode_viewer.set_view_type(type); }
GCodeViewer::EViewType get_gcode_view_preview_type() const { return m_gcode_viewer.get_view_type(); } GCodeViewer::EViewType get_gcode_view_preview_type() const { return m_gcode_viewer.get_view_type(); }
void load_sla_preview(); void load_sla_preview();
@ -824,6 +828,11 @@ public:
bool are_labels_shown() const { return m_labels.is_shown(); } bool are_labels_shown() const { return m_labels.is_shown(); }
void show_labels(bool show) { m_labels.show(show); } void show_labels(bool show) { m_labels.show(show); }
#if ENABLE_PREVIEW_LAYOUT
bool is_legend_shown() const { return m_gcode_viewer.is_legend_enabled(); }
void show_legend(bool show) { m_gcode_viewer.enable_legend(show); m_dirty = true; }
#endif // ENABLE_PREVIEW_LAYOUT
bool is_using_slope() const { return m_slope.is_used(); } bool is_using_slope() const { return m_slope.is_used(); }
void use_slope(bool use) { m_slope.use(use); } void use_slope(bool use) { m_slope.use(use); }
void set_slope_normal_angle(float angle_in_deg) { m_slope.set_normal_angle(angle_in_deg); } void set_slope_normal_angle(float angle_in_deg) { m_slope.set_normal_angle(angle_in_deg); }

View File

@ -208,6 +208,7 @@ bool Preview::init(wxWindow* parent, Bed3D& bed, Model* model)
m_layers_slider_sizer = create_layers_slider_sizer(); m_layers_slider_sizer = create_layers_slider_sizer();
wxGetApp().UpdateDarkUI(m_bottom_toolbar_panel = new wxPanel(this)); wxGetApp().UpdateDarkUI(m_bottom_toolbar_panel = new wxPanel(this));
#if !ENABLE_PREVIEW_LAYOUT
m_label_view_type = new wxStaticText(m_bottom_toolbar_panel, wxID_ANY, _L("View")); m_label_view_type = new wxStaticText(m_bottom_toolbar_panel, wxID_ANY, _L("View"));
#ifdef _WIN32 #ifdef _WIN32
wxGetApp().UpdateDarkUI(m_choice_view_type = new BitmapComboBox(m_bottom_toolbar_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY)); wxGetApp().UpdateDarkUI(m_choice_view_type = new BitmapComboBox(m_bottom_toolbar_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY));
@ -221,6 +222,10 @@ bool Preview::init(wxWindow* parent, Bed3D& bed, Model* model)
m_choice_view_type->Append(_L("Fan speed")); m_choice_view_type->Append(_L("Fan speed"));
m_choice_view_type->Append(_L("Temperature")); m_choice_view_type->Append(_L("Temperature"));
m_choice_view_type->Append(_L("Volumetric flow rate")); m_choice_view_type->Append(_L("Volumetric flow rate"));
#if ENABLE_PREVIEW_LAYER_TIME
m_choice_view_type->Append(_L("Layer time (linear)"));
m_choice_view_type->Append(_L("Layer time (logarithmic)"));
#endif // ENABLE_PREVIEW_LAYER_TIME
m_choice_view_type->Append(_L("Tool")); m_choice_view_type->Append(_L("Tool"));
m_choice_view_type->Append(_L("Color Print")); m_choice_view_type->Append(_L("Color Print"));
m_choice_view_type->SetSelection(0); m_choice_view_type->SetSelection(0);
@ -232,6 +237,7 @@ bool Preview::init(wxWindow* parent, Bed3D& bed, Model* model)
#else #else
long combo_style = wxCB_READONLY; long combo_style = wxCB_READONLY;
#endif #endif
m_combochecklist_features = new wxComboCtrl(); m_combochecklist_features = new wxComboCtrl();
m_combochecklist_features->Create(m_bottom_toolbar_panel, wxID_ANY, _L("Feature types"), wxDefaultPosition, wxDefaultSize, combo_style); m_combochecklist_features->Create(m_bottom_toolbar_panel, wxID_ANY, _L("Feature types"), wxDefaultPosition, wxDefaultSize, combo_style);
std::string feature_items = GUI::into_u8( std::string feature_items = GUI::into_u8(
@ -270,6 +276,7 @@ bool Preview::init(wxWindow* parent, Bed3D& bed, Model* model)
get_option_type_string(OptionType::Legend) + "|1" get_option_type_string(OptionType::Legend) + "|1"
); );
Slic3r::GUI::create_combochecklist(m_combochecklist_options, GUI::into_u8(_L("Options")), options_items); Slic3r::GUI::create_combochecklist(m_combochecklist_options, GUI::into_u8(_L("Options")), options_items);
#endif // !ENABLE_PREVIEW_LAYOUT
m_left_sizer = new wxBoxSizer(wxVERTICAL); m_left_sizer = new wxBoxSizer(wxVERTICAL);
m_left_sizer->Add(m_canvas_widget, 1, wxALL | wxEXPAND, 0); m_left_sizer->Add(m_canvas_widget, 1, wxALL | wxEXPAND, 0);
@ -281,6 +288,7 @@ bool Preview::init(wxWindow* parent, Bed3D& bed, Model* model)
m_moves_slider->SetDrawMode(DoubleSlider::dmSequentialGCodeView); m_moves_slider->SetDrawMode(DoubleSlider::dmSequentialGCodeView);
wxBoxSizer* bottom_toolbar_sizer = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* bottom_toolbar_sizer = new wxBoxSizer(wxHORIZONTAL);
#if !ENABLE_PREVIEW_LAYOUT
bottom_toolbar_sizer->AddSpacer(5); bottom_toolbar_sizer->AddSpacer(5);
bottom_toolbar_sizer->Add(m_label_view_type, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5); bottom_toolbar_sizer->Add(m_label_view_type, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
bottom_toolbar_sizer->Add(m_choice_view_type, 0, wxALIGN_CENTER_VERTICAL, 0); bottom_toolbar_sizer->Add(m_choice_view_type, 0, wxALIGN_CENTER_VERTICAL, 0);
@ -292,6 +300,7 @@ bool Preview::init(wxWindow* parent, Bed3D& bed, Model* model)
bottom_toolbar_sizer->Add(m_combochecklist_features, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 5); bottom_toolbar_sizer->Add(m_combochecklist_features, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 5);
bottom_toolbar_sizer->Hide(m_combochecklist_features); bottom_toolbar_sizer->Hide(m_combochecklist_features);
bottom_toolbar_sizer->AddSpacer(5); bottom_toolbar_sizer->AddSpacer(5);
#endif // !ENABLE_PREVIEW_LAYOUT
bottom_toolbar_sizer->Add(m_moves_slider, 1, wxALL | wxEXPAND, 0); bottom_toolbar_sizer->Add(m_moves_slider, 1, wxALL | wxEXPAND, 0);
m_bottom_toolbar_panel->SetSizer(bottom_toolbar_sizer); m_bottom_toolbar_panel->SetSizer(bottom_toolbar_sizer);
@ -353,7 +362,9 @@ void Preview::load_print(bool keep_z_range)
else if (tech == ptSLA) else if (tech == ptSLA)
load_print_as_sla(); load_print_as_sla();
#if !ENABLE_PREVIEW_LAYOUT
update_bottom_toolbar(); update_bottom_toolbar();
#endif // !ENABLE_PREVIEW_LAYOUT
Layout(); Layout();
} }
@ -396,10 +407,12 @@ void Preview::refresh_print()
void Preview::msw_rescale() void Preview::msw_rescale()
{ {
#if !ENABLE_PREVIEW_LAYOUT
#ifdef _WIN32 #ifdef _WIN32
m_choice_view_type->Rescale(); m_choice_view_type->Rescale();
m_choice_view_type->SetMinSize(m_choice_view_type->GetSize()); m_choice_view_type->SetMinSize(m_choice_view_type->GetSize());
#endif #endif
#endif // !ENABLE_PREVIEW_LAYOUT
// rescale slider // rescale slider
if (m_layers_slider != nullptr) m_layers_slider->msw_rescale(); if (m_layers_slider != nullptr) m_layers_slider->msw_rescale();
if (m_moves_slider != nullptr) m_moves_slider->msw_rescale(); if (m_moves_slider != nullptr) m_moves_slider->msw_rescale();
@ -417,11 +430,13 @@ void Preview::sys_color_changed()
wxWindowUpdateLocker noUpdates(this); wxWindowUpdateLocker noUpdates(this);
wxGetApp().UpdateAllStaticTextDarkUI(m_bottom_toolbar_panel); wxGetApp().UpdateAllStaticTextDarkUI(m_bottom_toolbar_panel);
#if !ENABLE_PREVIEW_LAYOUT
wxGetApp().UpdateDarkUI(m_choice_view_type); wxGetApp().UpdateDarkUI(m_choice_view_type);
wxGetApp().UpdateDarkUI(m_combochecklist_features); wxGetApp().UpdateDarkUI(m_combochecklist_features);
wxGetApp().UpdateDarkUI(static_cast<wxCheckListBoxComboPopup*>(m_combochecklist_features->GetPopupControl())); wxGetApp().UpdateDarkUI(static_cast<wxCheckListBoxComboPopup*>(m_combochecklist_features->GetPopupControl()));
wxGetApp().UpdateDarkUI(m_combochecklist_options); wxGetApp().UpdateDarkUI(m_combochecklist_options);
wxGetApp().UpdateDarkUI(static_cast<wxCheckListBoxComboPopup*>(m_combochecklist_options->GetPopupControl())); wxGetApp().UpdateDarkUI(static_cast<wxCheckListBoxComboPopup*>(m_combochecklist_options->GetPopupControl()));
#endif // !ENABLE_PREVIEW_LAYOUT
#endif #endif
if (m_layers_slider != nullptr) if (m_layers_slider != nullptr)
@ -445,19 +460,23 @@ void Preview::edit_layers_slider(wxKeyEvent& evt)
void Preview::bind_event_handlers() void Preview::bind_event_handlers()
{ {
this->Bind(wxEVT_SIZE, &Preview::on_size, this); Bind(wxEVT_SIZE, &Preview::on_size, this);
#if !ENABLE_PREVIEW_LAYOUT
m_choice_view_type->Bind(wxEVT_COMBOBOX, &Preview::on_choice_view_type, this); m_choice_view_type->Bind(wxEVT_COMBOBOX, &Preview::on_choice_view_type, this);
m_combochecklist_features->Bind(wxEVT_CHECKLISTBOX, &Preview::on_combochecklist_features, this); m_combochecklist_features->Bind(wxEVT_CHECKLISTBOX, &Preview::on_combochecklist_features, this);
m_combochecklist_options->Bind(wxEVT_CHECKLISTBOX, &Preview::on_combochecklist_options, this); m_combochecklist_options->Bind(wxEVT_CHECKLISTBOX, &Preview::on_combochecklist_options, this);
#endif // !ENABLE_PREVIEW_LAYOUT
m_moves_slider->Bind(wxEVT_SCROLL_CHANGED, &Preview::on_moves_slider_scroll_changed, this); m_moves_slider->Bind(wxEVT_SCROLL_CHANGED, &Preview::on_moves_slider_scroll_changed, this);
} }
void Preview::unbind_event_handlers() void Preview::unbind_event_handlers()
{ {
this->Unbind(wxEVT_SIZE, &Preview::on_size, this); Unbind(wxEVT_SIZE, &Preview::on_size, this);
#if !ENABLE_PREVIEW_LAYOUT
m_choice_view_type->Unbind(wxEVT_COMBOBOX, &Preview::on_choice_view_type, this); m_choice_view_type->Unbind(wxEVT_COMBOBOX, &Preview::on_choice_view_type, this);
m_combochecklist_features->Unbind(wxEVT_CHECKLISTBOX, &Preview::on_combochecklist_features, this); m_combochecklist_features->Unbind(wxEVT_CHECKLISTBOX, &Preview::on_combochecklist_features, this);
m_combochecklist_options->Unbind(wxEVT_CHECKLISTBOX, &Preview::on_combochecklist_options, this); m_combochecklist_options->Unbind(wxEVT_CHECKLISTBOX, &Preview::on_combochecklist_options, this);
#endif // !ENABLE_PREVIEW_LAYOUT
m_moves_slider->Unbind(wxEVT_SCROLL_CHANGED, &Preview::on_moves_slider_scroll_changed, this); m_moves_slider->Unbind(wxEVT_SCROLL_CHANGED, &Preview::on_moves_slider_scroll_changed, this);
} }
@ -478,6 +497,7 @@ void Preview::on_size(wxSizeEvent& evt)
Refresh(); Refresh();
} }
#if !ENABLE_PREVIEW_LAYOUT
void Preview::on_choice_view_type(wxCommandEvent& evt) void Preview::on_choice_view_type(wxCommandEvent& evt)
{ {
int selection = m_choice_view_type->GetCurrentSelection(); int selection = m_choice_view_type->GetCurrentSelection();
@ -544,6 +564,7 @@ void Preview::update_bottom_toolbar()
} }
} }
} }
#endif // !ENABLE_PREVIEW_LAYOUT
wxBoxSizer* Preview::create_layers_slider_sizer() wxBoxSizer* Preview::create_layers_slider_sizer()
{ {
@ -953,10 +974,20 @@ void Preview::load_print_as_fff(bool keep_z_range)
std::vector<Item> gcodes = wxGetApp().is_editor() ? std::vector<Item> gcodes = wxGetApp().is_editor() ?
wxGetApp().plater()->model().custom_gcode_per_print_z.gcodes : wxGetApp().plater()->model().custom_gcode_per_print_z.gcodes :
m_canvas->get_custom_gcode_per_print_z(); m_canvas->get_custom_gcode_per_print_z();
#if ENABLE_PREVIEW_LAYOUT
const GCodeViewer::EViewType choice = !gcodes.empty() ?
GCodeViewer::EViewType::ColorPrint :
(number_extruders > 1) ? GCodeViewer::EViewType::Tool : GCodeViewer::EViewType::FeatureType;
if (choice != gcode_view_type) {
m_canvas->set_gcode_view_preview_type(choice);
if (wxGetApp().is_gcode_viewer())
m_keep_current_preview_type = true;
refresh_print();
}
#else
const wxString choice = !gcodes.empty() ? const wxString choice = !gcodes.empty() ?
_L("Color Print") : _L("Color Print") :
(number_extruders > 1) ? _L("Tool") : _L("Feature type"); (number_extruders > 1) ? _L("Tool") : _L("Feature type");
int type = m_choice_view_type->FindString(choice); int type = m_choice_view_type->FindString(choice);
if (m_choice_view_type->GetSelection() != type) { if (m_choice_view_type->GetSelection() != type) {
if (0 <= type && type < static_cast<int>(GCodeViewer::EViewType::Count)) { if (0 <= type && type < static_cast<int>(GCodeViewer::EViewType::Count)) {
@ -967,6 +998,7 @@ void Preview::load_print_as_fff(bool keep_z_range)
refresh_print(); refresh_print();
} }
} }
#endif // ENABLE_PREVIEW_LAYOUT
} }
if (zs.empty()) { if (zs.empty()) {
@ -1042,6 +1074,7 @@ void Preview::on_moves_slider_scroll_changed(wxCommandEvent& event)
m_canvas->render(); m_canvas->render();
} }
#if !ENABLE_PREVIEW_LAYOUT
wxString Preview::get_option_type_string(OptionType type) const wxString Preview::get_option_type_string(OptionType type) const
{ {
switch (type) switch (type)
@ -1061,6 +1094,7 @@ wxString Preview::get_option_type_string(OptionType type) const
default: { return ""; } default: { return ""; }
} }
} }
#endif // !ENABLE_PREVIEW_LAYOUT
} // namespace GUI } // namespace GUI
} // namespace Slic3r } // namespace Slic3r

View File

@ -80,16 +80,18 @@ class Preview : public wxPanel
wxBoxSizer* m_left_sizer { nullptr }; wxBoxSizer* m_left_sizer { nullptr };
wxBoxSizer* m_layers_slider_sizer { nullptr }; wxBoxSizer* m_layers_slider_sizer { nullptr };
wxPanel* m_bottom_toolbar_panel { nullptr }; wxPanel* m_bottom_toolbar_panel { nullptr };
#if !ENABLE_PREVIEW_LAYOUT
wxStaticText* m_label_view_type { nullptr }; wxStaticText* m_label_view_type { nullptr };
#ifdef _WIN32 #ifdef _WIN32
BitmapComboBox* m_choice_view_type { nullptr }; BitmapComboBox* m_choice_view_type { nullptr };
#else #else
wxComboBox* m_choice_view_type { nullptr }; wxComboBox* m_choice_view_type { nullptr };
#endif #endif
wxStaticText* m_label_show { nullptr }; wxStaticText* m_label_show{ nullptr };
wxComboCtrl* m_combochecklist_features { nullptr }; wxComboCtrl* m_combochecklist_features { nullptr };
size_t m_combochecklist_features_pos { 0 }; size_t m_combochecklist_features_pos { 0 };
wxComboCtrl* m_combochecklist_options { nullptr }; wxComboCtrl* m_combochecklist_options { nullptr };
#endif // !ENABLE_PREVIEW_LAYOUT
DynamicPrintConfig* m_config; DynamicPrintConfig* m_config;
BackgroundSlicingProcess* m_process; BackgroundSlicingProcess* m_process;
@ -126,7 +128,9 @@ public:
CustomGCodes, CustomGCodes,
Shells, Shells,
ToolMarker, ToolMarker,
#if !ENABLE_PREVIEW_LAYOUT
Legend Legend
#endif // !ENABLE_PREVIEW_LAYOUT
}; };
Preview(wxWindow* parent, Bed3D& bed, Model* model, DynamicPrintConfig* config, BackgroundSlicingProcess* process, Preview(wxWindow* parent, Bed3D& bed, Model* model, DynamicPrintConfig* config, BackgroundSlicingProcess* process,
@ -154,12 +158,18 @@ public:
bool is_loaded() const { return m_loaded; } bool is_loaded() const { return m_loaded; }
#if !ENABLE_PREVIEW_LAYOUT
void update_bottom_toolbar(); void update_bottom_toolbar();
#endif // !ENABLE_PREVIEW_LAYOUT
void update_moves_slider(); void update_moves_slider();
void enable_moves_slider(bool enable); void enable_moves_slider(bool enable);
void move_moves_slider(wxKeyEvent& evt); void move_moves_slider(wxKeyEvent& evt);
void hide_layers_slider(); void hide_layers_slider();
#if ENABLE_PREVIEW_LAYOUT
void set_keep_current_preview_type(bool value) { m_keep_current_preview_type = value; }
#endif // ENABLE_PREVIEW_LAYOUT
private: private:
bool init(wxWindow* parent, Bed3D& bed, Model* model); bool init(wxWindow* parent, Bed3D& bed, Model* model);
@ -167,9 +177,11 @@ private:
void unbind_event_handlers(); void unbind_event_handlers();
void on_size(wxSizeEvent& evt); void on_size(wxSizeEvent& evt);
#if !ENABLE_PREVIEW_LAYOUT
void on_choice_view_type(wxCommandEvent& evt); void on_choice_view_type(wxCommandEvent& evt);
void on_combochecklist_features(wxCommandEvent& evt); void on_combochecklist_features(wxCommandEvent& evt);
void on_combochecklist_options(wxCommandEvent& evt); void on_combochecklist_options(wxCommandEvent& evt);
#endif // !ENABLE_PREVIEW_LAYOUT
// Create/Update/Reset double slider on 3dPreview // Create/Update/Reset double slider on 3dPreview
wxBoxSizer* create_layers_slider_sizer(); wxBoxSizer* create_layers_slider_sizer();
@ -186,7 +198,9 @@ private:
void on_layers_slider_scroll_changed(wxCommandEvent& event); void on_layers_slider_scroll_changed(wxCommandEvent& event);
void on_moves_slider_scroll_changed(wxCommandEvent& event); void on_moves_slider_scroll_changed(wxCommandEvent& event);
#if !ENABLE_PREVIEW_LAYOUT
wxString get_option_type_string(OptionType type) const; wxString get_option_type_string(OptionType type) const;
#endif // !ENABLE_PREVIEW_LAYOUT
}; };
} // namespace GUI } // namespace GUI

View File

@ -53,7 +53,22 @@ static const std::map<const wchar_t, std::string> font_icons = {
{ImGui::PreferencesButton , "notification_preferences" }, {ImGui::PreferencesButton , "notification_preferences" },
{ImGui::PreferencesHoverButton, "notification_preferences_hover"}, {ImGui::PreferencesHoverButton, "notification_preferences_hover"},
{ImGui::SliderFloatEditBtnIcon, "edit_button" }, {ImGui::SliderFloatEditBtnIcon, "edit_button" },
{ImGui::SliderFloatEditBtnPressedIcon, "edit_button_pressed" },
#if ENABLE_LEGEND_TOOLBAR_ICONS
{ImGui::LegendTravel , "legend_travel" },
{ImGui::LegendWipe , "legend_wipe" },
{ImGui::LegendRetract , "legend_retract" },
{ImGui::LegendDeretract , "legend_deretract" },
{ImGui::LegendSeams , "legend_seams" },
{ImGui::LegendToolChanges , "legend_toolchanges" },
{ImGui::LegendColorChanges , "legend_colorchanges" },
{ImGui::LegendPausePrints , "legend_pauseprints" },
{ImGui::LegendCustomGCodes , "legend_customgcodes" },
{ImGui::LegendShells , "legend_shells" },
{ImGui::LegendToolMarker , "legend_toolmarker" },
#endif // ENABLE_LEGEND_TOOLBAR_ICONS
}; };
static const std::map<const wchar_t, std::string> font_icons_large = { static const std::map<const wchar_t, std::string> font_icons_large = {
{ImGui::CloseNotifButton , "notification_close" }, {ImGui::CloseNotifButton , "notification_close" },
{ImGui::CloseNotifHoverButton , "notification_close_hover" }, {ImGui::CloseNotifHoverButton , "notification_close_hover" },
@ -371,10 +386,41 @@ bool ImGuiWrapper::radio_button(const wxString &label, bool active)
return ImGui::RadioButton(label_utf8.c_str(), active); return ImGui::RadioButton(label_utf8.c_str(), active);
} }
bool ImGuiWrapper::image_button() #if ENABLE_PREVIEW_LAYOUT
bool ImGuiWrapper::draw_radio_button(const std::string& name, float size, bool active,
std::function<void(ImGuiWindow& window, const ImVec2& pos, float size)> draw_callback)
{ {
return false; ImGuiWindow& window = *ImGui::GetCurrentWindow();
if (window.SkipItems)
return false;
ImGuiContext& g = *GImGui;
const ImGuiStyle& style = g.Style;
const ImGuiID id = window.GetID(name.c_str());
const ImVec2 pos = window.DC.CursorPos;
const ImRect total_bb(pos, pos + ImVec2(size, size + style.FramePadding.y * 2.0f));
ImGui::ItemSize(total_bb, style.FramePadding.y);
if (!ImGui::ItemAdd(total_bb, id))
return false;
bool hovered, held;
bool pressed = ImGui::ButtonBehavior(total_bb, id, &hovered, &held);
if (pressed)
ImGui::MarkItemEdited(id);
if (hovered)
window.DrawList->AddRect({ pos.x - 1.0f, pos.y - 1.0f }, { pos.x + size + 1.0f, pos.y + size + 1.0f }, ImGui::GetColorU32(ImGuiCol_CheckMark));
if (active)
window.DrawList->AddRect(pos, { pos.x + size, pos.y + size }, ImGui::GetColorU32(ImGuiCol_CheckMark));
draw_callback(window, pos, size);
IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window.DC.LastItemStatusFlags);
return pressed;
} }
#endif // ENABLE_PREVIEW_LAYOUT
bool ImGuiWrapper::input_double(const std::string &label, const double &value, const std::string &format) bool ImGuiWrapper::input_double(const std::string &label, const double &value, const std::string &format)
{ {
@ -498,6 +544,9 @@ bool ImGuiWrapper::slider_float(const char* label, float* v, float v_min, float
if (pos != std::string::npos) if (pos != std::string::npos)
str_label = str_label.substr(0, pos) + str_label.substr(pos + 2); str_label = str_label.substr(0, pos) + str_label.substr(pos + 2);
// the current slider edit state needs to be detected here before calling SliderFloat()
bool slider_editing = ImGui::GetCurrentWindow()->GetID(str_label.c_str()) == ImGui::GetActiveID();
bool ret = ImGui::SliderFloat(str_label.c_str(), v, v_min, v_max, format, power); bool ret = ImGui::SliderFloat(str_label.c_str(), v, v_min, v_max, format, power);
m_last_slider_status.hovered = ImGui::IsItemHovered(); m_last_slider_status.hovered = ImGui::IsItemHovered();
@ -515,15 +564,42 @@ bool ImGuiWrapper::slider_float(const char* label, float* v, float v_min, float
if (show_edit_btn) { if (show_edit_btn) {
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, { 1, style.ItemSpacing.y }); ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, { 1, style.ItemSpacing.y });
ImGui::SameLine(); ImGui::SameLine();
std::wstring btn_name = ImGui::SliderFloatEditBtnIcon + boost::nowide::widen(str_label);
#if ENABLE_LEGEND_TOOLBAR_ICONS
ImGuiIO& io = ImGui::GetIO();
assert(io.Fonts->TexWidth > 0 && io.Fonts->TexHeight > 0);
float inv_tex_w = 1.0f / float(io.Fonts->TexWidth);
float inv_tex_h = 1.0f / float(io.Fonts->TexHeight);
const ImFontAtlasCustomRect* const rect = GetTextureCustomRect(slider_editing ? ImGui::SliderFloatEditBtnPressedIcon : ImGui::SliderFloatEditBtnIcon);
const ImVec2 size = { float(rect->Width), float(rect->Height) };
const ImVec2 uv0 = ImVec2(float(rect->X) * inv_tex_w, float(rect->Y) * inv_tex_h);
const ImVec2 uv1 = ImVec2(float(rect->X + rect->Width) * inv_tex_w, float(rect->Y + rect->Height) * inv_tex_h);
#endif // ENABLE_LEGEND_TOOLBAR_ICONS
ImGui::PushStyleColor(ImGuiCol_Button, { 0.25f, 0.25f, 0.25f, 0.0f }); ImGui::PushStyleColor(ImGuiCol_Button, { 0.25f, 0.25f, 0.25f, 0.0f });
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0.5f, 0.5f, 0.5f, 1.0f }); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0.4f, 0.4f, 0.4f, 1.0f });
ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0.5f, 0.5f, 0.5f, 1.0f }); ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0.4f, 0.4f, 0.4f, 1.0f });
#if ENABLE_LEGEND_TOOLBAR_ICONS
const ImTextureID tex_id = io.Fonts->TexID;
if (image_button(tex_id, size, uv0, uv1, -1, ImVec4(0.0, 0.0, 0.0, 0.0), ImVec4(1.0, 1.0, 1.0, 1.0), ImGuiButtonFlags_PressedOnClick)) {
if (!slider_editing)
ImGui::SetKeyboardFocusHere(-1);
else
ImGui::ClearActiveID();
this->set_requires_extra_frame();
}
#else
std::wstring btn_name = ImGui::SliderFloatEditBtnIcon + boost::nowide::widen(str_label);
if (ImGui::Button(into_u8(btn_name).c_str())) { if (ImGui::Button(into_u8(btn_name).c_str())) {
ImGui::SetKeyboardFocusHere(-1); ImGui::SetKeyboardFocusHere(-1);
this->set_requires_extra_frame(); this->set_requires_extra_frame();
} }
#endif // ENABLE_LEGEND_TOOLBAR_ICONS
ImGui::PopStyleColor(3); ImGui::PopStyleColor(3);
if (ImGui::IsItemHovered()) if (ImGui::IsItemHovered())
this->tooltip(into_u8(_L("Edit")).c_str(), max_tooltip_width); this->tooltip(into_u8(_L("Edit")).c_str(), max_tooltip_width);
@ -557,17 +633,65 @@ bool ImGuiWrapper::slider_float(const wxString& label, float* v, float v_min, fl
return this->slider_float(label_utf8.c_str(), v, v_min, v_max, format, power, clamp, tooltip, show_edit_btn); return this->slider_float(label_utf8.c_str(), v, v_min, v_max, format, power, clamp, tooltip, show_edit_btn);
} }
bool ImGuiWrapper::combo(const wxString& label, const std::vector<std::string>& options, int& selection) static bool image_button_ex(ImGuiID id, ImTextureID texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec2& padding, const ImVec4& bg_col, const ImVec4& tint_col, ImGuiButtonFlags flags)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = ImGui::GetCurrentWindow();
if (window->SkipItems)
return false;
const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size + padding * 2);
ImGui::ItemSize(bb);
if (!ImGui::ItemAdd(bb, id))
return false;
bool hovered, held;
bool pressed = ImGui::ButtonBehavior(bb, id, &hovered, &held, flags);
// Render
const ImU32 col = ImGui::GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button);
ImGui::RenderNavHighlight(bb, id);
ImGui::RenderFrame(bb.Min, bb.Max, col, true, ImClamp((float)ImMin(padding.x, padding.y), 0.0f, g.Style.FrameRounding));
if (bg_col.w > 0.0f)
window->DrawList->AddRectFilled(bb.Min + padding, bb.Max - padding, ImGui::GetColorU32(bg_col));
window->DrawList->AddImage(texture_id, bb.Min + padding, bb.Max - padding, uv0, uv1, ImGui::GetColorU32(tint_col));
return pressed;
}
bool ImGuiWrapper::image_button(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, int frame_padding, const ImVec4& bg_col, const ImVec4& tint_col, ImGuiButtonFlags flags)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
if (window->SkipItems)
return false;
// Default to using texture ID as ID. User can still push string/integer prefixes.
ImGui::PushID((void*)(intptr_t)user_texture_id);
const ImGuiID id = window->GetID("#image");
ImGui::PopID();
const ImVec2 padding = (frame_padding >= 0) ? ImVec2((float)frame_padding, (float)frame_padding) : g.Style.FramePadding;
return image_button_ex(id, user_texture_id, size, uv0, uv1, padding, bg_col, tint_col, flags);
}
bool ImGuiWrapper::combo(const wxString& label, const std::vector<std::string>& options, int& selection, ImGuiComboFlags flags)
{ {
// this is to force the label to the left of the widget: // this is to force the label to the left of the widget:
text(label); #if ENABLE_PREVIEW_LAYOUT
ImGui::SameLine(); if (!label.empty()) {
#endif // ENABLE_PREVIEW_LAYOUT
text(label);
ImGui::SameLine();
#if ENABLE_PREVIEW_LAYOUT
}
#endif // ENABLE_PREVIEW_LAYOUT
int selection_out = selection; int selection_out = selection;
bool res = false; bool res = false;
const char *selection_str = selection < int(options.size()) && selection >= 0 ? options[selection].c_str() : ""; const char *selection_str = selection < int(options.size()) && selection >= 0 ? options[selection].c_str() : "";
if (ImGui::BeginCombo("", selection_str)) { if (ImGui::BeginCombo("", selection_str, flags)) {
for (int i = 0; i < (int)options.size(); i++) { for (int i = 0; i < (int)options.size(); i++) {
if (ImGui::Selectable(options[i].c_str(), i == selection)) { if (ImGui::Selectable(options[i].c_str(), i == selection)) {
selection_out = i; selection_out = i;
@ -1011,6 +1135,14 @@ bool ImGuiWrapper::want_any_input() const
return io.WantCaptureMouse || io.WantCaptureKeyboard || io.WantTextInput; return io.WantCaptureMouse || io.WantCaptureKeyboard || io.WantTextInput;
} }
#if ENABLE_LEGEND_TOOLBAR_ICONS
ImFontAtlasCustomRect* ImGuiWrapper::GetTextureCustomRect(const wchar_t& tex_id)
{
auto item = m_custom_glyph_rects_ids.find(tex_id);
return (item != m_custom_glyph_rects_ids.end()) ? ImGui::GetIO().Fonts->GetCustomRectByIndex(m_custom_glyph_rects_ids[tex_id]) : nullptr;
}
#endif // ENABLE_LEGEND_TOOLBAR_ICONS
ImU32 ImGuiWrapper::to_ImU32(const ColorRGBA& color) ImU32 ImGuiWrapper::to_ImU32(const ColorRGBA& color)
{ {
return ImGui::GetColorU32({ color.r(), color.g(), color.b(), color.a() }); return ImGui::GetColorU32({ color.r(), color.g(), color.b(), color.a() });
@ -1119,12 +1251,27 @@ void ImGuiWrapper::init_font(bool compress)
int rect_id = io.Fonts->CustomRects.Size; // id of the rectangle added next int rect_id = io.Fonts->CustomRects.Size; // id of the rectangle added next
// add rectangles for the icons to the font atlas // add rectangles for the icons to the font atlas
#if ENABLE_LEGEND_TOOLBAR_ICONS
for (auto& icon : font_icons) {
m_custom_glyph_rects_ids[icon.first] =
io.Fonts->AddCustomRectFontGlyph(font, icon.first, icon_sz, icon_sz, 3.0 * font_scale + icon_sz);
}
for (auto& icon : font_icons_large) {
m_custom_glyph_rects_ids[icon.first] =
io.Fonts->AddCustomRectFontGlyph(font, icon.first, icon_sz * 2, icon_sz * 2, 3.0 * font_scale + icon_sz * 2);
}
for (auto& icon : font_icons_extra_large) {
m_custom_glyph_rects_ids[icon.first] =
io.Fonts->AddCustomRectFontGlyph(font, icon.first, icon_sz * 4, icon_sz * 4, 3.0 * font_scale + icon_sz * 4);
}
#else
for (auto& icon : font_icons) for (auto& icon : font_icons)
io.Fonts->AddCustomRectFontGlyph(font, icon.first, icon_sz, icon_sz, 3.0 * font_scale + icon_sz); io.Fonts->AddCustomRectFontGlyph(font, icon.first, icon_sz, icon_sz, 3.0 * font_scale + icon_sz);
for (auto& icon : font_icons_large) for (auto& icon : font_icons_large)
io.Fonts->AddCustomRectFontGlyph(font, icon.first, icon_sz * 2, icon_sz * 2, 3.0 * font_scale + icon_sz * 2); io.Fonts->AddCustomRectFontGlyph(font, icon.first, icon_sz * 2, icon_sz * 2, 3.0 * font_scale + icon_sz * 2);
for (auto& icon : font_icons_extra_large) for (auto& icon : font_icons_extra_large)
io.Fonts->AddCustomRectFontGlyph(font, icon.first, icon_sz * 4, icon_sz * 4, 3.0 * font_scale + icon_sz * 4); io.Fonts->AddCustomRectFontGlyph(font, icon.first, icon_sz * 4, icon_sz * 4, 3.0 * font_scale + icon_sz * 4);
#endif // ENABLE_LEGEND_TOOLBAR_ICONS
// Build texture atlas // Build texture atlas
unsigned char* pixels; unsigned char* pixels;

View File

@ -21,6 +21,9 @@ class wxString;
class wxMouseEvent; class wxMouseEvent;
class wxKeyEvent; class wxKeyEvent;
#if ENABLE_PREVIEW_LAYOUT
struct IMGUI_API ImGuiWindow;
#endif // ENABLE_PREVIEW_LAYOUT
namespace Slic3r { namespace Slic3r {
namespace GUI { namespace GUI {
@ -37,6 +40,9 @@ class ImGuiWrapper
bool m_disabled{ false }; bool m_disabled{ false };
bool m_new_frame_open{ false }; bool m_new_frame_open{ false };
bool m_requires_extra_frame{ false }; bool m_requires_extra_frame{ false };
#if ENABLE_LEGEND_TOOLBAR_ICONS
std::map<wchar_t, int> m_custom_glyph_rects_ids;
#endif // ENABLE_LEGEND_TOOLBAR_ICONS
std::string m_clipboard_text; std::string m_clipboard_text;
public: public:
@ -86,7 +92,9 @@ public:
bool button(const wxString &label); bool button(const wxString &label);
bool button(const wxString& label, float width, float height); bool button(const wxString& label, float width, float height);
bool radio_button(const wxString &label, bool active); bool radio_button(const wxString &label, bool active);
bool image_button(); #if ENABLE_PREVIEW_LAYOUT
bool draw_radio_button(const std::string& name, float size, bool active, std::function<void(ImGuiWindow& window, const ImVec2& pos, float size)> draw_callback);
#endif // ENABLE_PREVIEW_LAYOUT
bool input_double(const std::string &label, const double &value, const std::string &format = "%.3f"); bool input_double(const std::string &label, const double &value, const std::string &format = "%.3f");
bool input_double(const wxString &label, const double &value, const std::string &format = "%.3f"); bool input_double(const wxString &label, const double &value, const std::string &format = "%.3f");
bool input_vec3(const std::string &label, const Vec3d &value, float width, const std::string &format = "%.3f"); bool input_vec3(const std::string &label, const Vec3d &value, float width, const std::string &format = "%.3f");
@ -109,7 +117,10 @@ public:
bool slider_float(const std::string& label, float* v, float v_min, float v_max, const char* format = "%.3f", float power = 1.0f, bool clamp = true, const wxString& tooltip = {}, bool show_edit_btn = true); bool slider_float(const std::string& label, float* v, float v_min, float v_max, const char* format = "%.3f", float power = 1.0f, bool clamp = true, const wxString& tooltip = {}, bool show_edit_btn = true);
bool slider_float(const wxString& label, float* v, float v_min, float v_max, const char* format = "%.3f", float power = 1.0f, bool clamp = true, const wxString& tooltip = {}, bool show_edit_btn = true); bool slider_float(const wxString& label, float* v, float v_min, float v_max, const char* format = "%.3f", float power = 1.0f, bool clamp = true, const wxString& tooltip = {}, bool show_edit_btn = true);
bool combo(const wxString& label, const std::vector<std::string>& options, int& selection); // Use -1 to not mark any option as selected bool image_button(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0.0, 0.0), const ImVec2& uv1 = ImVec2(1.0, 1.0), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0.0, 0.0, 0.0, 0.0), const ImVec4& tint_col = ImVec4(1.0, 1.0, 1.0, 1.0), ImGuiButtonFlags flags = 0);
// Use selection = -1 to not mark any option as selected
bool combo(const wxString& label, const std::vector<std::string>& options, int& selection, ImGuiComboFlags flags = 0);
bool undo_redo_list(const ImVec2& size, const bool is_undo, bool (*items_getter)(const bool, int, const char**), int& hovered, int& selected, int& mouse_wheel); bool undo_redo_list(const ImVec2& size, const bool is_undo, bool (*items_getter)(const bool, int, const char**), int& hovered, int& selected, int& mouse_wheel);
void search_list(const ImVec2& size, bool (*items_getter)(int, const char** label, const char** tooltip), char* search_str, void search_list(const ImVec2& size, bool (*items_getter)(int, const char** label, const char** tooltip), char* search_str,
Search::OptionViewParameters& view_params, int& selected, bool& edited, int& mouse_wheel, bool is_localized); Search::OptionViewParameters& view_params, int& selected, bool& edited, int& mouse_wheel, bool is_localized);
@ -132,6 +143,10 @@ public:
static ColorRGBA from_ImU32(const ImU32& color); static ColorRGBA from_ImU32(const ImU32& color);
static ColorRGBA from_ImVec4(const ImVec4& color); static ColorRGBA from_ImVec4(const ImVec4& color);
#if ENABLE_LEGEND_TOOLBAR_ICONS
ImFontAtlasCustomRect* GetTextureCustomRect(const wchar_t& tex_id);
#endif // ENABLE_LEGEND_TOOLBAR_ICONS
static const ImVec4 COL_GREY_DARK; static const ImVec4 COL_GREY_DARK;
static const ImVec4 COL_GREY_LIGHT; static const ImVec4 COL_GREY_LIGHT;
static const ImVec4 COL_ORANGE_DARK; static const ImVec4 COL_ORANGE_DARK;

View File

@ -223,7 +223,7 @@ void KBShortcutsDialog::fill_shortcuts()
{ "A", L("Horizontal slider - Move active thumb Left") }, { "A", L("Horizontal slider - Move active thumb Left") },
{ "D", L("Horizontal slider - Move active thumb Right") }, { "D", L("Horizontal slider - Move active thumb Right") },
{ "X", L("On/Off one layer mode of the vertical slider") }, { "X", L("On/Off one layer mode of the vertical slider") },
{ "L", L("Show/Hide Legend and Estimated printing time") }, { "L", L("Show/Hide legend") },
{ "C", L("Show/Hide G-code window") }, { "C", L("Show/Hide G-code window") },
}; };

View File

@ -1430,6 +1430,11 @@ void MainFrame::init_menubar_as_editor()
append_menu_check_item(viewMenu, wxID_ANY, _L("Show &Labels") + sep + "E", _L("Show object/instance labels in 3D scene"), append_menu_check_item(viewMenu, wxID_ANY, _L("Show &Labels") + sep + "E", _L("Show object/instance labels in 3D scene"),
[this](wxCommandEvent&) { m_plater->show_view3D_labels(!m_plater->are_view3D_labels_shown()); }, this, [this](wxCommandEvent&) { m_plater->show_view3D_labels(!m_plater->are_view3D_labels_shown()); }, this,
[this]() { return m_plater->is_view3D_shown(); }, [this]() { return m_plater->are_view3D_labels_shown(); }, this); [this]() { return m_plater->is_view3D_shown(); }, [this]() { return m_plater->are_view3D_labels_shown(); }, this);
#if ENABLE_PREVIEW_LAYOUT
append_menu_check_item(viewMenu, wxID_ANY, _L("Show Legen&d") + sep + "L", _L("Show legend in preview"),
[this](wxCommandEvent&) { m_plater->show_legend(!m_plater->is_legend_shown()); }, this,
[this]() { return m_plater->is_preview_shown(); }, [this]() { return m_plater->is_legend_shown(); }, this);
#endif // ENABLE_PREVIEW_LAYOUT
append_menu_check_item(viewMenu, wxID_ANY, _L("&Collapse Sidebar") + sep + "Shift+" + sep_space + "Tab", _L("Collapse sidebar"), append_menu_check_item(viewMenu, wxID_ANY, _L("&Collapse Sidebar") + sep + "Shift+" + sep_space + "Tab", _L("Collapse sidebar"),
[this](wxCommandEvent&) { m_plater->collapse_sidebar(!m_plater->is_sidebar_collapsed()); }, this, [this](wxCommandEvent&) { m_plater->collapse_sidebar(!m_plater->is_sidebar_collapsed()); }, this,
[]() { return true; }, [this]() { return m_plater->is_sidebar_collapsed(); }, this); []() { return true; }, [this]() { return m_plater->is_sidebar_collapsed(); }, this);
@ -1547,6 +1552,12 @@ void MainFrame::init_menubar_as_gcodeviewer()
if (m_plater != nullptr) { if (m_plater != nullptr) {
viewMenu = new wxMenu(); viewMenu = new wxMenu();
add_common_view_menu_items(viewMenu, this, std::bind(&MainFrame::can_change_view, this)); add_common_view_menu_items(viewMenu, this, std::bind(&MainFrame::can_change_view, this));
#if ENABLE_PREVIEW_LAYOUT
viewMenu->AppendSeparator();
append_menu_check_item(viewMenu, wxID_ANY, _L("Show legen&d") + sep + "L", _L("Show legend"),
[this](wxCommandEvent&) { m_plater->show_legend(!m_plater->is_legend_shown()); }, this,
[this]() { return m_plater->is_preview_shown(); }, [this]() { return m_plater->is_legend_shown(); }, this);
#endif // ENABLE_PREVIEW_LAYOUT
} }
// helpmenu // helpmenu

View File

@ -1739,6 +1739,11 @@ struct Plater::priv
bool are_view3D_labels_shown() const { return (current_panel == view3D) && view3D->get_canvas3d()->are_labels_shown(); } bool are_view3D_labels_shown() const { return (current_panel == view3D) && view3D->get_canvas3d()->are_labels_shown(); }
void show_view3D_labels(bool show) { if (current_panel == view3D) view3D->get_canvas3d()->show_labels(show); } void show_view3D_labels(bool show) { if (current_panel == view3D) view3D->get_canvas3d()->show_labels(show); }
#if ENABLE_PREVIEW_LAYOUT
bool is_legend_shown() const { return (current_panel == preview) && preview->get_canvas3d()->is_legend_shown(); }
void show_legend(bool show) { if (current_panel == preview) preview->get_canvas3d()->show_legend(show); }
#endif // ENABLE_PREVIEW_LAYOUT
bool is_sidebar_collapsed() const { return sidebar->is_collapsed(); } bool is_sidebar_collapsed() const { return sidebar->is_collapsed(); }
void collapse_sidebar(bool collapse); void collapse_sidebar(bool collapse);
@ -1752,7 +1757,9 @@ struct Plater::priv
bool init_view_toolbar(); bool init_view_toolbar();
bool init_collapse_toolbar(); bool init_collapse_toolbar();
#if !ENABLE_PREVIEW_LAYOUT
void update_preview_bottom_toolbar(); void update_preview_bottom_toolbar();
#endif // !ENABLE_PREVIEW_LAYOUT
void update_preview_moves_slider(); void update_preview_moves_slider();
void enable_preview_moves_slider(bool enable); void enable_preview_moves_slider(bool enable);
@ -4461,10 +4468,12 @@ bool Plater::priv::init_collapse_toolbar()
return true; return true;
} }
#if !ENABLE_PREVIEW_LAYOUT
void Plater::priv::update_preview_bottom_toolbar() void Plater::priv::update_preview_bottom_toolbar()
{ {
preview->update_bottom_toolbar(); preview->update_bottom_toolbar();
} }
#endif // !ENABLE_PREVIEW_LAYOUT
void Plater::priv::update_preview_moves_slider() void Plater::priv::update_preview_moves_slider()
{ {
@ -5408,6 +5417,11 @@ bool Plater::is_view3D_shown() const { return p->is_view3D_shown(); }
bool Plater::are_view3D_labels_shown() const { return p->are_view3D_labels_shown(); } bool Plater::are_view3D_labels_shown() const { return p->are_view3D_labels_shown(); }
void Plater::show_view3D_labels(bool show) { p->show_view3D_labels(show); } void Plater::show_view3D_labels(bool show) { p->show_view3D_labels(show); }
#if ENABLE_PREVIEW_LAYOUT
bool Plater::is_legend_shown() const { return p->is_legend_shown(); }
void Plater::show_legend(bool show) { p->show_legend(show); }
#endif // ENABLE_PREVIEW_LAYOUT
bool Plater::is_sidebar_collapsed() const { return p->is_sidebar_collapsed(); } bool Plater::is_sidebar_collapsed() const { return p->is_sidebar_collapsed(); }
void Plater::collapse_sidebar(bool show) { p->collapse_sidebar(show); } void Plater::collapse_sidebar(bool show) { p->collapse_sidebar(show); }
@ -6736,10 +6750,12 @@ GLToolbar& Plater::get_collapse_toolbar()
return p->collapse_toolbar; return p->collapse_toolbar;
} }
#if !ENABLE_PREVIEW_LAYOUT
void Plater::update_preview_bottom_toolbar() void Plater::update_preview_bottom_toolbar()
{ {
p->update_preview_bottom_toolbar(); p->update_preview_bottom_toolbar();
} }
#endif // !ENABLE_PREVIEW_LAYOUT
void Plater::update_preview_moves_slider() void Plater::update_preview_moves_slider()
{ {
@ -6849,6 +6865,12 @@ bool Plater::is_render_statistic_dialog_visible() const
return p->show_render_statistic_dialog; return p->show_render_statistic_dialog;
} }
#if ENABLE_PREVIEW_LAYOUT
void Plater::set_keep_current_preview_type(bool value)
{
p->preview->set_keep_current_preview_type(value);
}
#endif // ENABLE_PREVIEW_LAYOUT
Plater::TakeSnapshot::TakeSnapshot(Plater *plater, const std::string &snapshot_name) Plater::TakeSnapshot::TakeSnapshot(Plater *plater, const std::string &snapshot_name)
: TakeSnapshot(plater, from_u8(snapshot_name)) {} : TakeSnapshot(plater, from_u8(snapshot_name)) {}

View File

@ -223,6 +223,11 @@ public:
bool are_view3D_labels_shown() const; bool are_view3D_labels_shown() const;
void show_view3D_labels(bool show); void show_view3D_labels(bool show);
#if ENABLE_PREVIEW_LAYOUT
bool is_legend_shown() const;
void show_legend(bool show);
#endif // ENABLE_PREVIEW_LAYOUT
bool is_sidebar_collapsed() const; bool is_sidebar_collapsed() const;
void collapse_sidebar(bool show); void collapse_sidebar(bool show);
@ -382,7 +387,9 @@ public:
const GLToolbar& get_collapse_toolbar() const; const GLToolbar& get_collapse_toolbar() const;
GLToolbar& get_collapse_toolbar(); GLToolbar& get_collapse_toolbar();
#if !ENABLE_PREVIEW_LAYOUT
void update_preview_bottom_toolbar(); void update_preview_bottom_toolbar();
#endif // !ENABLE_PREVIEW_LAYOUT
void update_preview_moves_slider(); void update_preview_moves_slider();
void enable_preview_moves_slider(bool enable); void enable_preview_moves_slider(bool enable);
@ -448,6 +455,10 @@ public:
void toggle_render_statistic_dialog(); void toggle_render_statistic_dialog();
bool is_render_statistic_dialog_visible() const; bool is_render_statistic_dialog_visible() const;
#if ENABLE_PREVIEW_LAYOUT
void set_keep_current_preview_type(bool value);
#endif // ENABLE_PREVIEW_LAYOUT
// Wrapper around wxWindow::PopupMenu to suppress error messages popping out while tracking the popup menu. // Wrapper around wxWindow::PopupMenu to suppress error messages popping out while tracking the popup menu.
bool PopupMenu(wxMenu *menu, const wxPoint& pos = wxDefaultPosition); bool PopupMenu(wxMenu *menu, const wxPoint& pos = wxDefaultPosition);
bool PopupMenu(wxMenu *menu, int x, int y) { return this->PopupMenu(menu, wxPoint(x, y)); } bool PopupMenu(wxMenu *menu, int x, int y) { return this->PopupMenu(menu, wxPoint(x, y)); }