diff --git a/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Composite.kt b/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Composite.kt index a1f5df12..a7b3c774 100644 --- a/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Composite.kt +++ b/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Composite.kt @@ -7,6 +7,7 @@ import hep.dataforge.meta.Config import hep.dataforge.meta.update import hep.dataforge.vis.common.AbstractVisualObject import hep.dataforge.vis.common.set +import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import kotlinx.serialization.UseSerializers @@ -17,6 +18,7 @@ enum class CompositeType { } @Serializable +@SerialName("3d.composite") class Composite( val compositeType: CompositeType, val first: VisualObject3D, diff --git a/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/ConeSegment.kt b/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/ConeSegment.kt index 9d1c94d7..f373a8de 100644 --- a/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/ConeSegment.kt +++ b/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/ConeSegment.kt @@ -6,6 +6,7 @@ import hep.dataforge.io.serialization.ConfigSerializer import hep.dataforge.meta.Config import hep.dataforge.vis.common.AbstractVisualObject import hep.dataforge.vis.common.set +import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import kotlinx.serialization.UseSerializers import kotlin.math.cos @@ -15,6 +16,7 @@ import kotlin.math.sin * A cylinder or cut cone segment */ @Serializable +@SerialName("3d.cone") class ConeSegment( var radius: Float, var height: Float, diff --git a/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Convex.kt b/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Convex.kt index eac4d39f..e4168ed6 100644 --- a/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Convex.kt +++ b/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Convex.kt @@ -6,10 +6,12 @@ import hep.dataforge.io.serialization.ConfigSerializer import hep.dataforge.meta.Config import hep.dataforge.vis.common.AbstractVisualObject import hep.dataforge.vis.common.set +import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import kotlinx.serialization.UseSerializers @Serializable +@SerialName("3d.convex") class Convex(val points: List) : AbstractVisualObject(), VisualObject3D { @Serializable(ConfigSerializer::class) diff --git a/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Extruded.kt b/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Extruded.kt index 54577af6..ae81eace 100644 --- a/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Extruded.kt +++ b/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Extruded.kt @@ -5,6 +5,7 @@ import hep.dataforge.io.serialization.ConfigSerializer import hep.dataforge.meta.Config import hep.dataforge.vis.common.AbstractVisualObject import hep.dataforge.vis.common.set +import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import kotlinx.serialization.UseSerializers import kotlin.math.PI @@ -38,6 +39,7 @@ fun Shape2DBuilder.polygon(vertices: Int, radius: Number) { data class Layer(var x: Float, var y: Float, var z: Float, var scale: Float) @Serializable +@SerialName("3d.extrude") class Extruded( var shape: List = ArrayList(), var layers: MutableList = ArrayList() diff --git a/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Label3D.kt b/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Label3D.kt index 97ac5adf..906b03de 100644 --- a/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Label3D.kt +++ b/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Label3D.kt @@ -6,10 +6,12 @@ import hep.dataforge.io.serialization.ConfigSerializer import hep.dataforge.meta.Config import hep.dataforge.vis.common.AbstractVisualObject import hep.dataforge.vis.common.set +import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import kotlinx.serialization.UseSerializers @Serializable +@SerialName("3d.label") class Label3D(var text: String, var fontSize: Double, var fontFamily: String) : AbstractVisualObject(), VisualObject3D { @Serializable(ConfigSerializer::class) diff --git a/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/PolyLine.kt b/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/PolyLine.kt index d028c81e..24f5a3b9 100644 --- a/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/PolyLine.kt +++ b/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/PolyLine.kt @@ -9,10 +9,12 @@ import hep.dataforge.names.asName import hep.dataforge.names.plus import hep.dataforge.vis.common.AbstractVisualObject import hep.dataforge.vis.common.set +import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import kotlinx.serialization.UseSerializers @Serializable +@SerialName("3d.line") class PolyLine(var points: List) : AbstractVisualObject(), VisualObject3D { @Serializable(ConfigSerializer::class) override var properties: Config? = null diff --git a/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Sphere.kt b/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Sphere.kt index 43c2cdb2..b29af3c8 100644 --- a/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Sphere.kt +++ b/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Sphere.kt @@ -6,6 +6,7 @@ import hep.dataforge.io.serialization.ConfigSerializer import hep.dataforge.meta.Config import hep.dataforge.vis.common.AbstractVisualObject import hep.dataforge.vis.common.set +import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import kotlinx.serialization.UseSerializers import kotlin.math.PI @@ -13,6 +14,7 @@ import kotlin.math.cos import kotlin.math.sin @Serializable +@SerialName("3d.sphere") class Sphere( var radius: Float, var phiStart: Float = 0f, diff --git a/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Tube.kt b/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Tube.kt index c3b8f113..d97ccce6 100644 --- a/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Tube.kt +++ b/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/Tube.kt @@ -5,6 +5,7 @@ import hep.dataforge.io.serialization.ConfigSerializer import hep.dataforge.meta.Config import hep.dataforge.vis.common.AbstractVisualObject import hep.dataforge.vis.common.set +import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import kotlinx.serialization.UseSerializers import kotlin.math.PI @@ -15,6 +16,7 @@ import kotlin.math.sin * Straight tube segment */ @Serializable +@SerialName("3d.tube") class Tube( var radius: Float, var height: Float,