Skip to content
Snippets Groups Projects
Commit 3504530f authored by Egli Adrian (IT-SCI-API-PFI)'s avatar Egli Adrian (IT-SCI-API-PFI)
Browse files

new element (rendering) added and test scene added

parent 86f5eb73
No related branches found
No related tags found
No related merge requests found
No preview for this file type
...@@ -392,7 +392,9 @@ class PILSVG(PILGL): ...@@ -392,7 +392,9 @@ class PILSVG(PILGL):
"NN SS EN SW": "Weiche_vertikal_oben_links.svg", "NN SS EN SW": "Weiche_vertikal_oben_links.svg",
"NN SS SE WN": "Weiche_vertikal_oben_rechts.svg", "NN SS SE WN": "Weiche_vertikal_oben_rechts.svg",
"NN SS NW ES": "Weiche_vertikal_unten_links.svg", "NN SS NW ES": "Weiche_vertikal_unten_links.svg",
"NN SS NE WS": "Weiche_vertikal_unten_rechts.svg"} "NN SS NE WS": "Weiche_vertikal_unten_rechts.svg",
"NE NW ES WS SS NN WW EE": "Weiche_Symetrical_gerade.svg"
}
dTargetFiles = { dTargetFiles = {
"EW": "Bahnhof_#d50000_Deadend_links.svg", "EW": "Bahnhof_#d50000_Deadend_links.svg",
......
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
# Railway Scene Editor # Railway Scene Editor
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
from IPython.core.display import display, HTML from IPython.core.display import display, HTML
display(HTML("<style>.container { width:95% !important; }</style>")) display(HTML("<style>.container { width:95% !important; }</style>"))
``` ```
%% Output
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
from flatland.utils.editor import EditorMVC from flatland.utils.editor import EditorMVC
mvc = EditorMVC(sGL="PILSVG" ) mvc = EditorMVC(sGL="PILSVG" )
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## Instructions ## Instructions
- Drag to draw (improved dead-ends) - Drag to draw (improved dead-ends)
- ctrl-click to add agent or select agent - ctrl-click to add agent or select agent
- if agent is selected: - if agent is selected:
- ctrl-click to move agent position - ctrl-click to move agent position
- use rotate agent to rotate 90° - use rotate agent to rotate 90°
- ctrl-shift-click to set target for selected agent - ctrl-shift-click to set target for selected agent
- target can be moved by repeating - target can be moved by repeating
- to Resize the env (cannot preserve work): - to Resize the env (cannot preserve work):
- select "Regen" tab, set regen size slider, click regenerate. - select "Regen" tab, set regen size slider, click regenerate.
- alt-click remove all rails from cell - alt-click remove all rails from cell
Demo Scene: complex_scene.pkl Demo Scene: complex_scene.pkl
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
mvc.view.display() mvc.view.display()
``` ```
%% Output %% Output
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
``` ```
......
No preview for this file type
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 23.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Ebene_1"
x="0px"
y="0px"
viewBox="0 0 240 240"
style="enable-background:new 0 0 240 240;"
xml:space="preserve"
sodipodi:docname="Weiche_Symetrical_gerade.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"><metadata
id="metadata41"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs39" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1137"
id="namedview37"
showgrid="false"
inkscape:zoom="0.98333333"
inkscape:cx="135.25424"
inkscape:cy="120"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="Ebene_1" />
<style
type="text/css"
id="style2">
.st0{fill:#978679;}
.st1{fill:#3D3D3D;}
.st2{fill:none;}
</style>
<g
transform="translate(-1,0.5)"
id="g20"
style="fill:#978679;fill-opacity:1"><rect
x="70.5"
y="10"
class="st1"
width="100"
height="20"
id="rect8"
style="fill:#978679;fill-opacity:1" /><rect
x="70.5"
y="210"
class="st1"
width="100"
height="20"
id="rect10"
style="fill:#978679;fill-opacity:1" /><rect
x="70.5"
y="170"
class="st1"
width="100"
height="20"
id="rect12-4"
style="fill:#978679;fill-opacity:1" /><rect
x="70.5"
y="130"
class="st1"
width="100"
height="20"
id="rect14-7"
style="fill:#978679;fill-opacity:1" /><rect
x="70.5"
y="90"
class="st1"
width="100"
height="20"
id="rect16"
style="fill:#978679;fill-opacity:1" /><rect
x="70.5"
y="50"
class="st1"
width="100"
height="20"
id="rect18"
style="fill:#978679;fill-opacity:1" /></g><g
id="g10">
<rect
x="69.5"
y="210.5"
class="st0"
width="100"
height="20"
id="rect4" />
<rect
x="210"
y="70"
class="st0"
width="20"
height="100"
id="rect6" />
<polygon
class="st0"
points="81.34,181.24 87.45,162.2 177.54,191.12 108.02,131.57 121.03,116.38 190.57,175.94 152.04,92.74 170.19,84.33 212.21,175.08 195.99,182.59 183.97,196.62 181.97,194.91 176.55,211.8 "
id="polygon8" />
</g>
<g
id="g18">
<rect
x="70.5"
y="210.5"
class="st0"
width="100"
height="20"
id="rect12" />
<rect
x="10"
y="70"
class="st0"
width="20"
height="100"
id="rect14" />
<polygon
class="st0"
points="158.66,181.24 152.55,162.2 62.46,191.12 131.98,131.57 118.97,116.38 49.43,175.94 87.96,92.74 69.81,84.33 27.79,175.08 44.01,182.59 56.03,196.62 58.03,194.91 63.45,211.8 "
id="polygon16" />
</g>
<g
id="g24">
<path
class="st1"
d="M151,239.5c0-48.8,39.7-88.5,88.5-88.5c0.17,0,0.33,0.01,0.5,0.01v10.01c-0.17,0-0.33-0.01-0.5-0.01 c-43.29,0-78.5,35.21-78.5,78.5c0,0.17,0.01,0.33,0.01,0.5h-10.01C151.01,239.83,151,239.67,151,239.5z"
id="path20" />
<path
class="st1"
d="M240,79v10c-83.26,0-151,67.74-151,151H79C79,151.22,151.22,79,240,79z"
id="path22" />
</g>
<g
id="g30">
<path
class="st1"
d="M89,239.5C89,190.7,49.3,151,0.5,151c-0.17,0-0.33,0.01-0.5,0.01v10.01c0.17,0,0.33-0.01,0.5-0.01 c43.29,0,78.5,35.21,78.5,78.5c0,0.17-0.01,0.33-0.01,0.5h10.01C88.99,239.83,89,239.67,89,239.5z"
id="path26" />
<path
class="st1"
d="M0,79v10c83.26,0,151,67.74,151,151h10C161,151.22,88.78,79,0,79z"
id="path28" />
</g>
<g
id="g34">
<rect
x="0"
class="st2"
width="240"
height="240"
id="rect32" />
</g>
<g
transform="translate(-0.49000549,0.01)"
id="g26"
style="fill:#3d3d3d;fill-opacity:1"><rect
y="0"
x="79.510002"
class="st2"
width="9.9799995"
height="240"
id="rect22"
style="fill:#3d3d3d;fill-opacity:1" /><rect
y="0"
x="151.50999"
class="st2"
width="9.9799995"
height="240"
id="rect24"
style="fill:#3d3d3d;fill-opacity:1" /></g></svg>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment