diff --git a/dataforge-vis-spatial-fx/build.gradle.kts b/dataforge-vis-spatial-fx/build.gradle.kts index 5ed73278..03fd4813 100644 --- a/dataforge-vis-spatial-fx/build.gradle.kts +++ b/dataforge-vis-spatial-fx/build.gradle.kts @@ -1,3 +1,4 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.openjfx.gradle.JavaFXOptions plugins { @@ -13,4 +14,10 @@ dependencies { configure { modules("javafx.controls") +} + +tasks.withType { + kotlinOptions{ + jvmTarget = "1.8" + } } \ No newline at end of file diff --git a/dataforge-vis-spatial-js/src/main/kotlin/hep/dataforge/vis/spatial/ThreeOutput.kt b/dataforge-vis-spatial-js/src/main/kotlin/hep/dataforge/vis/spatial/ThreeOutput.kt index 2945daa8..c9d2592e 100644 --- a/dataforge-vis-spatial-js/src/main/kotlin/hep/dataforge/vis/spatial/ThreeOutput.kt +++ b/dataforge-vis-spatial-js/src/main/kotlin/hep/dataforge/vis/spatial/ThreeOutput.kt @@ -1,7 +1,7 @@ package hep.dataforge.vis.spatial import hep.dataforge.context.Context -import hep.dataforge.context.members +import hep.dataforge.context.content import hep.dataforge.meta.* import hep.dataforge.output.Output import hep.dataforge.vis.DisplayGroup @@ -75,7 +75,7 @@ class ThreeOutput(override val context: Context, val meta: Meta = EmptyMeta) : O } private fun findFactory(type: KClass): ThreeFactory? { - return context.members>(ThreeFactory.TYPE).find { it.type == type } as? ThreeFactory? + return context.content>(ThreeFactory.TYPE).values.find { it.type == type } as? ThreeFactory? } override fun render(obj: DisplayObject, meta: Meta) { diff --git a/dataforge-vis-spatial-js/src/main/kotlin/hep/dataforge/vis/spatial/ThreePlugin.kt b/dataforge-vis-spatial-js/src/main/kotlin/hep/dataforge/vis/spatial/ThreePlugin.kt index 67836113..267da2d4 100644 --- a/dataforge-vis-spatial-js/src/main/kotlin/hep/dataforge/vis/spatial/ThreePlugin.kt +++ b/dataforge-vis-spatial-js/src/main/kotlin/hep/dataforge/vis/spatial/ThreePlugin.kt @@ -3,6 +3,7 @@ package hep.dataforge.vis.spatial import hep.dataforge.context.AbstractPlugin import hep.dataforge.context.PluginFactory import hep.dataforge.context.PluginTag +import hep.dataforge.meta.Meta import hep.dataforge.names.Name import hep.dataforge.names.toName @@ -16,10 +17,12 @@ class ThreePlugin : AbstractPlugin() { factories["convex".toName()] = ThreeConvexFactory } - override fun listTop(target: String): Sequence { + + + override fun listNames(target: String): Sequence { return when (target) { ThreeFactory.TYPE -> factories.keys.asSequence() - else -> return super.listTop(target) + else -> return super.listNames(target) } } @@ -33,6 +36,6 @@ class ThreePlugin : AbstractPlugin() { companion object : PluginFactory { override val tag = PluginTag("vis.three", "hep.dataforge") override val type = ThreePlugin::class - override fun invoke() = ThreePlugin() + override fun invoke(meta: Meta) = ThreePlugin() } } \ No newline at end of file diff --git a/dataforge-vis-spatial-js/src/main/kotlin/hep/dataforge/vis/spatial/gdml/GDMLNodes.kt b/dataforge-vis-spatial-js/src/main/kotlin/hep/dataforge/vis/spatial/gdml/GDMLNodes.kt index 70fb8842..40747435 100644 --- a/dataforge-vis-spatial-js/src/main/kotlin/hep/dataforge/vis/spatial/gdml/GDMLNodes.kt +++ b/dataforge-vis-spatial-js/src/main/kotlin/hep/dataforge/vis/spatial/gdml/GDMLNodes.kt @@ -4,7 +4,7 @@ import hep.dataforge.meta.* import kotlin.properties.ReadWriteProperty import kotlin.reflect.KProperty -sealed class GDMLNode(override val config: Config) : Specification { +sealed class GDMLNode(override val config: Config) : Specific { var pName by string() } @@ -16,7 +16,7 @@ class GDMLPosition(config: Config) : GDMLDefine(config) { var z by number(0f).float var unit by string("cm") - companion object : SpecificationCompanion { + companion object : Specification { override fun wrap(config: Config) = GDMLPosition(config) } } @@ -27,7 +27,7 @@ class GDMLRotation(config: Config) : GDMLDefine(config) { var z by number(0f).float var unit by string("deg") - companion object : SpecificationCompanion { + companion object : Specification { override fun wrap(config: Config) = GDMLRotation(config) } } @@ -43,7 +43,7 @@ class GDMLBox(config: Config) : GDMLSolid(config) { var pDy by number().double var pDz by number().double - companion object : SpecificationCompanion { + companion object : Specification { override fun wrap(config: Config): GDMLBox = GDMLBox(config) } } @@ -57,7 +57,7 @@ class GDMLTube(config: Config) : GDMLSolid(config) { var pSPhi by number().double var pDPhi by number().double - companion object : SpecificationCompanion { + companion object : Specification { override fun wrap(config: Config): GDMLTube = GDMLTube(config) } } @@ -67,14 +67,14 @@ class GDMLXtru(config: Config) : GDMLSolid(config) { class TwoDimVertex(val x: Double, val y: Double) - class Section(override val config: Config) : Specification { + class Section(override val config: Config) : Specific { var zOrder by number().int var zPosition by number().double var xOffsset by number(0.0).double var yOffset by number(0.0).double var scalingFactor by number(1.0).double - companion object : SpecificationCompanion
{ + companion object : Specification
{ override fun wrap(config: Config): Section = Section(config) } } @@ -96,7 +96,7 @@ class GDMLXtru(config: Config) : GDMLSolid(config) { config["section[$index]"] = Section.build(block).apply { zOrder = index; zPosition = z } } - companion object : SpecificationCompanion { + companion object : Specification { override fun wrap(config: Config): GDMLXtru = GDMLXtru(config) } } @@ -160,7 +160,7 @@ sealed class GDMLBoolSolid(config: Config, var root: GDML? = null) : GDMLSolid(c class GDMLUnion(config: Config) : GDMLBoolSolid(config) { override val type: String = "union" - companion object : SpecificationCompanion { + companion object : Specification { override fun wrap(config: Config): GDMLUnion = GDMLUnion(config) } } @@ -168,7 +168,7 @@ class GDMLUnion(config: Config) : GDMLBoolSolid(config) { class GDMLSubtraction(config: Config) : GDMLBoolSolid(config) { override val type: String = "subtraction" - companion object : SpecificationCompanion { + companion object : Specification { override fun wrap(config: Config) = GDMLUnion(config) } } @@ -176,7 +176,7 @@ class GDMLSubtraction(config: Config) : GDMLBoolSolid(config) { class GDMLIntersection(config: Config) : GDMLBoolSolid(config) { override val type: String = "intersection" - companion object : SpecificationCompanion { + companion object : Specification { override fun wrap(config: Config) = GDMLIntersection(config) } } \ No newline at end of file diff --git a/dataforge-vis-spatial-js/src/main/kotlin/hep/dataforge/vis/spatial/gdml/GDMLPlugin.kt b/dataforge-vis-spatial-js/src/main/kotlin/hep/dataforge/vis/spatial/gdml/GDMLPlugin.kt index 56bb72d4..6445755a 100644 --- a/dataforge-vis-spatial-js/src/main/kotlin/hep/dataforge/vis/spatial/gdml/GDMLPlugin.kt +++ b/dataforge-vis-spatial-js/src/main/kotlin/hep/dataforge/vis/spatial/gdml/GDMLPlugin.kt @@ -4,6 +4,7 @@ import hep.dataforge.context.AbstractPlugin import hep.dataforge.context.Context import hep.dataforge.context.PluginFactory import hep.dataforge.context.PluginTag +import hep.dataforge.meta.Meta import hep.dataforge.names.toName import hep.dataforge.vis.spatial.ThreePlugin @@ -30,6 +31,6 @@ class GDMLPlugin : AbstractPlugin() { companion object : PluginFactory { override val tag = PluginTag("vis.gdml", "hep.dataforge") override val type = GDMLPlugin::class - override fun invoke() = GDMLPlugin() + override fun invoke(meta: Meta) = GDMLPlugin() } } \ No newline at end of file diff --git a/dataforge-vis-spatial-js/src/main/kotlin/hep/dataforge/vis/spatial/jsroot/JSRootPlugin.kt b/dataforge-vis-spatial-js/src/main/kotlin/hep/dataforge/vis/spatial/jsroot/JSRootPlugin.kt index 7a31f2bd..46bd0f24 100644 --- a/dataforge-vis-spatial-js/src/main/kotlin/hep/dataforge/vis/spatial/jsroot/JSRootPlugin.kt +++ b/dataforge-vis-spatial-js/src/main/kotlin/hep/dataforge/vis/spatial/jsroot/JSRootPlugin.kt @@ -4,6 +4,7 @@ import hep.dataforge.context.AbstractPlugin import hep.dataforge.context.Context import hep.dataforge.context.PluginFactory import hep.dataforge.context.PluginTag +import hep.dataforge.meta.Meta import hep.dataforge.names.toName import hep.dataforge.vis.spatial.ThreePlugin @@ -31,6 +32,6 @@ class JSRootPlugin : AbstractPlugin() { companion object: PluginFactory { override val tag = PluginTag("vis.jsroot", "hep.dataforge") override val type = JSRootPlugin::class - override fun invoke() = JSRootPlugin() + override fun invoke(meta: Meta) = JSRootPlugin() } } \ No newline at end of file