forked from kscience/visionforge
Fix gdml demo file loader
This commit is contained in:
parent
9b4105b300
commit
ef42327cc5
@ -135,12 +135,13 @@ private class GDMLDemoApp : Application {
|
|||||||
val action: (name: String, data: String) -> Unit = { name, data ->
|
val action: (name: String, data: String) -> Unit = { name, data ->
|
||||||
canvasElement.clear()
|
canvasElement.clear()
|
||||||
spinner(true)
|
spinner(true)
|
||||||
|
val visual: VisualObject3D = when {
|
||||||
|
name.endsWith(".gdml") || name.endsWith(".xml") -> {
|
||||||
message("Loading GDML")
|
message("Loading GDML")
|
||||||
val gdml = GDML.format.parse(GDML.serializer(), data)
|
val gdml = GDML.format.parse(GDML.serializer(), data)
|
||||||
message("Converting GDML into DF-VIS format")
|
message("Converting GDML into DF-VIS format")
|
||||||
|
gdml.toVisual(gdmlConfiguration)
|
||||||
val visual: VisualObject3D = when {
|
}
|
||||||
name.endsWith(".gdml") || name.endsWith(".xml") -> gdml.toVisual(gdmlConfiguration)
|
|
||||||
name.endsWith(".json") -> VisualGroup3D.fromJson(data)
|
name.endsWith(".json") -> VisualGroup3D.fromJson(data)
|
||||||
else -> {
|
else -> {
|
||||||
window.alert("File extension is not recognized: $name")
|
window.alert("File extension is not recognized: $name")
|
||||||
|
Loading…
Reference in New Issue
Block a user