Fix serializer module

This commit is contained in:
Alexander Nozik 2020-10-06 18:45:58 +03:00
parent f72d626b0b
commit 072b036fa2
2 changed files with 15 additions and 4 deletions

View File

@ -1,9 +1,9 @@
package hep.dataforge.vision.gdml
import hep.dataforge.vision.solid.encodeToString
import kscience.gdml.GDML
import nl.adaptivity.xmlutil.StAXReader
import org.junit.jupiter.api.Test
import kscience.gdml.GDML
class TestConvertor {

View File

@ -12,9 +12,7 @@ import hep.dataforge.vision.Vision
import hep.dataforge.vision.VisionForm
import hep.dataforge.vision.VisionManager
import hep.dataforge.vision.VisionManager.Companion.VISION_SERIAL_MODULE_TARGET
import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.KSerializer
import kotlinx.serialization.*
import kotlinx.serialization.json.Json
import kotlinx.serialization.modules.*
import kotlin.reflect.KClass
@ -114,6 +112,19 @@ public class SolidManager(meta: Meta) : AbstractPlugin(meta) {
subclass(SolidLabel.serializer())
subclass(Sphere.serializer())
}
polymorphic(Solid::class) {
subclass(SolidGroup.serializer())
subclass(Proxy.serializer())
subclass(Composite.serializer())
subclass(Tube.serializer())
subclass(Box.serializer())
subclass(Convex.serializer())
subclass(Extruded.serializer())
subclass(PolyLine.serializer())
subclass(SolidLabel.serializer())
subclass(Sphere.serializer())
}
}
val jsonForSolids = Json {