diff --git a/visionforge-gdml/src/jvmTest/kotlin/hep/dataforge/vision/gdml/TestConvertor.kt b/visionforge-gdml/src/jvmTest/kotlin/hep/dataforge/vision/gdml/TestConvertor.kt index cf9fb7b4..2dac5a76 100644 --- a/visionforge-gdml/src/jvmTest/kotlin/hep/dataforge/vision/gdml/TestConvertor.kt +++ b/visionforge-gdml/src/jvmTest/kotlin/hep/dataforge/vision/gdml/TestConvertor.kt @@ -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 { diff --git a/visionforge-solid/src/commonMain/kotlin/hep/dataforge/vision/solid/SolidManager.kt b/visionforge-solid/src/commonMain/kotlin/hep/dataforge/vision/solid/SolidManager.kt index 5cc3948c..676ee9ba 100644 --- a/visionforge-solid/src/commonMain/kotlin/hep/dataforge/vision/solid/SolidManager.kt +++ b/visionforge-solid/src/commonMain/kotlin/hep/dataforge/vision/solid/SolidManager.kt @@ -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 {