Moved FX to a separate module

This commit is contained in:
Alexander Nozik 2020-11-21 10:56:07 +03:00
parent d1607459a1
commit 698f74adaa
33 changed files with 68 additions and 58 deletions

View File

@ -1,5 +1,3 @@
import ru.mipt.npm.gradle.useFx
plugins {
id("ru.mipt.npm.project")
}
@ -32,7 +30,6 @@ subprojects {
afterEvaluate {
extensions.findByType<ru.mipt.npm.gradle.KScienceExtension>()?.run {
useSerialization()
useFx(ru.mipt.npm.gradle.FXModule.CONTROLS, version = fxVersion)
}
}
}

View File

@ -24,6 +24,11 @@ kotlin {
implementation(project(":visionforge-gdml"))
}
}
jvmMain{
dependencies{
implementation(project(":visionforge-fx"))
}
}
jsMain {
dependencies {
implementation(project(":ui:bootstrap"))

View File

@ -5,10 +5,10 @@ import hep.dataforge.vision.VisionManager
import hep.dataforge.vision.editor.VisualObjectEditorFragment
import hep.dataforge.vision.editor.VisualObjectTreeFragment
import hep.dataforge.vision.gdml.toVision
import hep.dataforge.vision.solid.FX3DPlugin
import hep.dataforge.vision.solid.FXCanvas3D
import hep.dataforge.vision.solid.Solid
import hep.dataforge.vision.solid.SolidMaterial
import hep.dataforge.vision.solid.fx.FX3DPlugin
import hep.dataforge.vision.solid.fx.FXCanvas3D
import javafx.geometry.Orientation
import javafx.scene.Parent
import javafx.stage.FileChooser

View File

@ -29,6 +29,11 @@ kotlin {
implementation(project(":visionforge-gdml"))
}
}
jvmMain{
dependencies{
implementation(project(":visionforge-fx"))
}
}
jsMain{
dependencies {
implementation("org.jetbrains:kotlin-css:1.0.0-pre.129-kotlin-1.4.10")

View File

@ -5,9 +5,9 @@ import hep.dataforge.meta.Meta
import hep.dataforge.names.Name
import hep.dataforge.vision.layout.Output
import hep.dataforge.vision.layout.Page
import hep.dataforge.vision.solid.FX3DPlugin
import hep.dataforge.vision.solid.FXCanvas3D
import hep.dataforge.vision.solid.Solid
import hep.dataforge.vision.solid.fx.FX3DPlugin
import hep.dataforge.vision.solid.fx.FXCanvas3D
import javafx.collections.FXCollections
import javafx.scene.Parent
import javafx.scene.control.Tab

View File

@ -38,6 +38,7 @@ include(
":ui:bootstrap",
":visionforge-core",
":visionforge-solid",
":visionforge-fx",
":visionforge-gdml",
":visionforge-server",
":demo:spatial-showcase",

View File

@ -15,18 +15,6 @@ kotlin {
api("org.jetbrains.kotlinx:kotlinx-html:$htmlVersion")
}
}
jvmMain {
dependencies {
api("no.tornado:tornadofx:1.7.20")
//api("no.tornado:tornadofx-controlsfx:0.1.1")
api("de.jensd:fontawesomefx-fontawesome:4.7.0-11") {
exclude(group = "org.openjfx")
}
api("de.jensd:fontawesomefx-commons:11.0") {
exclude(group = "org.openjfx")
}
}
}
jsMain {
dependencies {
api("org.jetbrains:kotlin-extensions:1.0.1-$kotlinWrappersVersion")

View File

@ -4,7 +4,7 @@ import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.collect
import java.util.concurrent.atomic.AtomicInteger
suspend fun <T, K> Flow<T>.countDistinctBy(selector: (T) -> K): Map<K, Int> {
public suspend fun <T, K> Flow<T>.countDistinctBy(selector: (T) -> K): Map<K, Int> {
val counter = LinkedHashMap<K, AtomicInteger>()
collect {
val key = selector(it)
@ -13,4 +13,4 @@ suspend fun <T, K> Flow<T>.countDistinctBy(selector: (T) -> K): Map<K, Int> {
return counter.mapValues { it.value.toInt() }
}
suspend fun <T> Flow<T>.countDistinct(): Map<T, Int> = countDistinctBy { it }
public suspend fun <T> Flow<T>.countDistinct(): Map<T, Int> = countDistinctBy { it }

View File

@ -0,0 +1,37 @@
import ru.mipt.npm.gradle.useFx
plugins {
id("ru.mipt.npm.jvm")
}
val dataforgeVersion: String by rootProject.extra
val kotlinWrappersVersion: String by rootProject.extra
val htmlVersion: String by rootProject.extra
val fxVersion: String by rootProject.extra
kscience{
useFx(ru.mipt.npm.gradle.FXModule.CONTROLS, version = fxVersion)
}
dependencies {
api(project(":visionforge-solid"))
api("no.tornado:tornadofx:1.7.20")
api("de.jensd:fontawesomefx-fontawesome:4.7.0-11") {
exclude(group = "org.openjfx")
}
api("de.jensd:fontawesomefx-commons:11.0") {
exclude(group = "org.openjfx")
}
api("org.fxyz3d:fxyz3d:0.5.2") {
exclude(module = "slf4j-simple")
}
api("org.jetbrains.kotlinx:kotlinx-coroutines-javafx:${ru.mipt.npm.gradle.KScienceVersions.coroutinesVersion}")
implementation("eu.mihosoft.vrl.jcsg:jcsg:0.5.7") {
exclude(module = "slf4j-simple")
}
}

View File

@ -1,13 +1,12 @@
package hep.dataforge.vision.solid.fx
package hep.dataforge.vision.solid
import hep.dataforge.context.*
import hep.dataforge.meta.Meta
import hep.dataforge.meta.boolean
import hep.dataforge.provider.Type
import hep.dataforge.vision.solid.*
import hep.dataforge.vision.solid.FX3DFactory.Companion.TYPE
import hep.dataforge.vision.solid.SolidMaterial.Companion.MATERIAL_KEY
import hep.dataforge.vision.solid.SolidMaterial.Companion.MATERIAL_WIREFRAME_KEY
import hep.dataforge.vision.solid.fx.FX3DFactory.Companion.TYPE
import javafx.scene.Group
import javafx.scene.Node
import javafx.scene.shape.CullFace

View File

@ -1,10 +1,9 @@
package hep.dataforge.vision.solid.fx
package hep.dataforge.vision.solid
import hep.dataforge.context.Context
import hep.dataforge.context.ContextAware
import hep.dataforge.meta.empty
import hep.dataforge.vision.layout.Output
import hep.dataforge.vision.solid.Solid
import hep.dataforge.vision.solid.specifications.Canvas3DOptions
import javafx.application.Platform
import javafx.beans.property.ObjectProperty

View File

@ -1,10 +1,8 @@
package hep.dataforge.vision.solid.fx
package hep.dataforge.vision.solid
import eu.mihosoft.jcsg.CSG
import eu.mihosoft.jcsg.Polygon
import eu.mihosoft.vvecmath.Vector3d
import hep.dataforge.vision.solid.Composite
import hep.dataforge.vision.solid.CompositeType
import javafx.scene.Group
import javafx.scene.Node
import javafx.scene.shape.MeshView

View File

@ -1,9 +1,8 @@
package hep.dataforge.vision.solid.fx
package hep.dataforge.vision.solid
import eu.mihosoft.jcsg.PropertyStorage
import eu.mihosoft.jcsg.ext.quickhull3d.HullUtil
import eu.mihosoft.vvecmath.Vector3d
import hep.dataforge.vision.solid.Convex
import javafx.scene.Node
import kotlin.reflect.KClass

View File

@ -1,4 +1,4 @@
package hep.dataforge.vision.solid.fx
package hep.dataforge.vision.solid
import hep.dataforge.meta.MetaItem
import hep.dataforge.meta.double
@ -6,7 +6,6 @@ import hep.dataforge.meta.get
import hep.dataforge.meta.int
import hep.dataforge.values.ValueType
import hep.dataforge.vision.Colors
import hep.dataforge.vision.solid.SolidMaterial
import javafx.scene.paint.Color
import javafx.scene.paint.Material
import javafx.scene.paint.PhongMaterial

View File

@ -1,8 +1,7 @@
package hep.dataforge.vision.solid.fx
package hep.dataforge.vision.solid
import hep.dataforge.names.*
import hep.dataforge.vision.Vision
import hep.dataforge.vision.solid.SolidReference
import javafx.scene.Group
import javafx.scene.Node
import kotlin.reflect.KClass

View File

@ -1,9 +1,6 @@
package hep.dataforge.vision.solid.fx
package hep.dataforge.vision.solid
import hep.dataforge.meta.Meta
import hep.dataforge.vision.solid.GeometryBuilder
import hep.dataforge.vision.solid.GeometrySolid
import hep.dataforge.vision.solid.Point3D
import javafx.scene.shape.Mesh
import javafx.scene.shape.MeshView
import javafx.scene.shape.TriangleMesh

View File

@ -1,4 +1,4 @@
package hep.dataforge.vision.solid.fx
package hep.dataforge.vision.solid
import javafx.beans.InvalidationListener
import javafx.beans.property.SimpleDoubleProperty

View File

@ -1,4 +1,4 @@
package hep.dataforge.vision.solid.fx
package hep.dataforge.vision.solid
import hep.dataforge.meta.*
import hep.dataforge.names.Name

View File

@ -1,5 +1,3 @@
import ru.mipt.npm.gradle.KScienceVersions.coroutinesVersion
plugins {
id("ru.mipt.npm.mpp")
}
@ -16,17 +14,6 @@ kotlin {
api(project(":visionforge-core"))
}
}
jvmMain {
dependencies {
api("org.fxyz3d:fxyz3d:0.5.2") {
exclude(module = "slf4j-simple")
}
api("org.jetbrains.kotlinx:kotlinx-coroutines-javafx:${coroutinesVersion}")
implementation("eu.mihosoft.vrl.jcsg:jcsg:0.5.7") {
exclude(module = "slf4j-simple")
}
}
}
jsMain {
dependencies {
implementation(npm("three", "0.122.0"))

View File

@ -40,13 +40,13 @@ public class SolidMaterial : Scheme() {
public companion object : SchemeSpec<SolidMaterial>(::SolidMaterial) {
public val MATERIAL_KEY: Name = "material".asName()
internal val COLOR_KEY = "color".asName()
public val COLOR_KEY: Name = "color".asName()
public val MATERIAL_COLOR_KEY: Name = MATERIAL_KEY + COLOR_KEY
internal val SPECULAR_COLOR_KEY = "specularColor".asName()
public val SPECULAR_COLOR_KEY: Name = "specularColor".asName()
public val MATERIAL_SPECULAR_COLOR_KEY: Name = MATERIAL_KEY + SPECULAR_COLOR_KEY
internal val OPACITY_KEY = "opacity".asName()
public val OPACITY_KEY: Name = "opacity".asName()
public val MATERIAL_OPACITY_KEY: Name = MATERIAL_KEY + OPACITY_KEY
internal val WIREFRAME_KEY = "wireframe".asName()
public val WIREFRAME_KEY: Name = "wireframe".asName()
public val MATERIAL_WIREFRAME_KEY: Name = MATERIAL_KEY + WIREFRAME_KEY
public override val descriptor: NodeDescriptor by lazy {