Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Flatland
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pranjal_dhole
Flatland
Commits
e7d921e6
Commit
e7d921e6
authored
5 years ago
by
Egli Adrian (IT-SCI-API-PFI)
Browse files
Options
Downloads
Patches
Plain Diff
cairo support windows solved
parent
851b52b0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
flatland/utils/graphics_layer.py
+0
-12
0 additions, 12 deletions
flatland/utils/graphics_layer.py
flatland/utils/graphics_pil.py
+15
-2
15 additions, 2 deletions
flatland/utils/graphics_pil.py
flatland/utils/rendertools.py
+1
-0
1 addition, 0 deletions
flatland/utils/rendertools.py
with
16 additions
and
14 deletions
flatland/utils/graphics_layer.py
+
0
−
12
View file @
e7d921e6
...
...
@@ -2,18 +2,6 @@
import
matplotlib.pyplot
as
plt
from
numpy
import
array
import
os
if
os
.
name
==
'
nt
'
:
import
site
import
ctypes.util
default_os_path
=
os
.
environ
[
'
PATH
'
]
os
.
environ
[
'
PATH
'
]
=
''
for
s
in
site
.
getsitepackages
():
os
.
environ
[
'
PATH
'
]
=
os
.
environ
[
'
PATH
'
]
+
'
;
'
+
s
+
'
\\
cairo
'
os
.
environ
[
'
PATH
'
]
=
os
.
environ
[
'
PATH
'
]
+
'
;
'
+
default_os_path
if
ctypes
.
util
.
find_library
(
'
cairo
'
)
is
not
None
:
print
(
"
cairo installed: OK
"
)
class
GraphicsLayer
(
object
):
def
__init__
(
self
):
pass
...
...
This diff is collapsed.
Click to expand it.
flatland/utils/graphics_pil.py
+
15
−
2
View file @
e7d921e6
...
...
@@ -6,8 +6,21 @@ import numpy as np
# from flatland.utils.svg import Track, Zug
import
time
import
io
import
os
def
enable_windows_cairo_support
():
if
os
.
name
==
'
nt
'
:
import
site
import
ctypes.util
default_os_path
=
os
.
environ
[
'
PATH
'
]
os
.
environ
[
'
PATH
'
]
=
''
for
s
in
site
.
getsitepackages
():
os
.
environ
[
'
PATH
'
]
=
os
.
environ
[
'
PATH
'
]
+
'
;
'
+
s
+
'
\\
cairo
'
os
.
environ
[
'
PATH
'
]
=
os
.
environ
[
'
PATH
'
]
+
'
;
'
+
default_os_path
if
ctypes
.
util
.
find_library
(
'
cairo
'
)
is
not
None
:
print
(
"
cairo installed: OK
"
)
enable_windows_cairo_support
()
from
cairosvg
import
svg2png
from
IPython.display
import
SVG
...
...
This diff is collapsed.
Click to expand it.
flatland/utils/rendertools.py
+
1
−
0
View file @
e7d921e6
...
...
@@ -12,6 +12,7 @@ import numpy as np
# TODO: suggested renaming to RailEnvRenderTool, as it will only work with RailEnv!
import
os
class
MPLGL
(
GraphicsLayer
):
def
__init__
(
self
,
width
,
height
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment