forked from kscience/visionforge
Merged spatial into a single project
This commit is contained in:
parent
c3a7afc6d0
commit
5cb62c8f6e
@ -1,16 +0,0 @@
|
||||
import org.openjfx.gradle.JavaFXOptions
|
||||
|
||||
plugins {
|
||||
id("scientifik.jvm")
|
||||
id("org.openjfx.javafxplugin")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":dataforge-vis-spatial"))
|
||||
implementation(project(":dataforge-vis-fx"))
|
||||
implementation("org.fxyz3d:fxyz3d:0.4.0")
|
||||
}
|
||||
|
||||
configure<JavaFXOptions> {
|
||||
modules("javafx.controls")
|
||||
}
|
@ -12,7 +12,7 @@ kotlin {
|
||||
}
|
||||
val jsMain by getting {
|
||||
dependencies {
|
||||
api(project(":dataforge-vis-spatial-js"))
|
||||
api(project(":dataforge-vis-spatial"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,21 +0,0 @@
|
||||
plugins {
|
||||
id("scientifik.js")
|
||||
//id("kotlin-dce-js")
|
||||
}
|
||||
|
||||
//val kotlinVersion: String by rootProject.extra
|
||||
|
||||
dependencies {
|
||||
api(project(":dataforge-vis-spatial"))
|
||||
api("info.laht.threekt:threejs-wrapper:0.106-npm-3")
|
||||
testCompile(kotlin("test-js"))
|
||||
}
|
||||
|
||||
kotlin{
|
||||
sourceSets["main"].dependencies{
|
||||
implementation(npm("three","0.106.2"))
|
||||
implementation(npm("@hi-level/three-csg"))
|
||||
implementation(npm("style-loader"))
|
||||
implementation(npm("element-resize-event"))
|
||||
}
|
||||
}
|
@ -1,5 +1,8 @@
|
||||
import org.openjfx.gradle.JavaFXOptions
|
||||
|
||||
plugins {
|
||||
id("scientifik.mpp")
|
||||
id("org.openjfx.javafxplugin")
|
||||
}
|
||||
|
||||
scientifik{
|
||||
@ -18,7 +21,8 @@ kotlin {
|
||||
}
|
||||
jvmMain{
|
||||
dependencies {
|
||||
|
||||
implementation(project(":dataforge-vis-fx"))
|
||||
implementation("org.fxyz3d:fxyz3d:0.4.0")
|
||||
}
|
||||
}
|
||||
jsMain{
|
||||
@ -33,3 +37,7 @@ kotlin {
|
||||
}
|
||||
}
|
||||
|
||||
configure<JavaFXOptions> {
|
||||
modules("javafx.controls")
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package hep.dataforge.vis.spatial
|
||||
package hep.dataforge.vis.spatial.fx
|
||||
|
||||
import com.sun.tools.javac.util.JCDiagnostic
|
||||
import hep.dataforge.vis.spatial.World.CAMERA_FAR_CLIP
|
||||
import hep.dataforge.vis.spatial.World.CAMERA_INITIAL_DISTANCE
|
||||
import hep.dataforge.vis.spatial.World.CAMERA_INITIAL_X_ANGLE
|
@ -1,10 +1,9 @@
|
||||
package hep.dataforge.vis.spatial
|
||||
package hep.dataforge.vis.spatial.fx
|
||||
|
||||
import hep.dataforge.meta.*
|
||||
import hep.dataforge.names.Name
|
||||
import hep.dataforge.names.toName
|
||||
import hep.dataforge.vis.common.VisualObject
|
||||
import hep.dataforge.vis.common.onChange
|
||||
import javafx.beans.binding.ObjectBinding
|
||||
import tornadofx.*
|
||||
|
||||
@ -15,7 +14,7 @@ class DisplayObjectFXListener(val obj: VisualObject) {
|
||||
private val binndings = HashMap<Name, ObjectBinding<MetaItem<*>?>>()
|
||||
|
||||
init {
|
||||
obj.onChange(this) { name, _, _ ->
|
||||
obj.onPropertyChange(this) { name, _, _ ->
|
||||
binndings[name]?.invalidate()
|
||||
}
|
||||
}
|
||||
@ -23,7 +22,7 @@ class DisplayObjectFXListener(val obj: VisualObject) {
|
||||
operator fun get(key: Name): ObjectBinding<MetaItem<*>?> {
|
||||
return binndings.getOrPut(key) {
|
||||
object : ObjectBinding<MetaItem<*>?>() {
|
||||
override fun computeValue(): MetaItem<*>? = obj.properties[key]
|
||||
override fun computeValue(): MetaItem<*>? = obj.getProperty(key)
|
||||
}
|
||||
}
|
||||
}
|
@ -1,10 +1,11 @@
|
||||
package hep.dataforge.vis.spatial
|
||||
package hep.dataforge.vis.spatial.fx
|
||||
|
||||
import hep.dataforge.context.Context
|
||||
import hep.dataforge.meta.Meta
|
||||
import hep.dataforge.output.Output
|
||||
import hep.dataforge.vis.common.VisualNode
|
||||
import hep.dataforge.vis.common.VisualObject
|
||||
import hep.dataforge.vis.spatial.Box
|
||||
import javafx.scene.Group
|
||||
import javafx.scene.Node
|
||||
import org.fxyz3d.shapes.primitives.CuboidMesh
|
@ -1,4 +1,4 @@
|
||||
package hep.dataforge.vis.spatial
|
||||
package hep.dataforge.vis.spatial.fx
|
||||
|
||||
import hep.dataforge.meta.MetaItem
|
||||
import hep.dataforge.meta.double
|
@ -1,7 +1,8 @@
|
||||
package hep.dataforge.vis.spatial
|
||||
package hep.dataforge.vis.spatial.fx
|
||||
|
||||
import hep.dataforge.context.Global
|
||||
import hep.dataforge.meta.number
|
||||
import hep.dataforge.vis.spatial.*
|
||||
import javafx.scene.Parent
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.delay
|
@ -34,9 +34,6 @@ include(
|
||||
":dataforge-vis-common",
|
||||
":dataforge-vis-fx",
|
||||
":dataforge-vis-spatial",
|
||||
":dataforge-vis-spatial-fx",
|
||||
":dataforge-vis-spatial-js",
|
||||
// ":dataforge-vis-jsroot",
|
||||
":dataforge-vis-spatial-gdml",
|
||||
":spatial-js-demo"
|
||||
)
|
||||
|
@ -4,7 +4,7 @@ plugins {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api(project(":dataforge-vis-spatial-js"))
|
||||
api(project(":dataforge-vis-spatial"))
|
||||
api("info.laht.threekt:threejs-wrapper:0.106-npm-3")
|
||||
testCompile(kotlin("test-js"))
|
||||
}
|
||||
|
@ -9,9 +9,7 @@ import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.isActive
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlin.math.PI
|
||||
import kotlin.math.cos
|
||||
import kotlin.math.sin
|
||||
import kotlin.math.*
|
||||
import kotlin.random.Random
|
||||
|
||||
|
||||
@ -94,7 +92,7 @@ private class ThreeDemoApp : ApplicationBase() {
|
||||
}
|
||||
}
|
||||
|
||||
demo("CSG", "CSG operations") {
|
||||
demo("CSG.simple", "CSG operations") {
|
||||
composite(CompositeType.UNION) {
|
||||
box(100, 100, 100) {
|
||||
z = 50
|
||||
@ -122,6 +120,12 @@ private class ThreeDemoApp : ApplicationBase() {
|
||||
color(Colors.blue)
|
||||
}
|
||||
}
|
||||
demo("CSG.custom","CSG with manually created object"){
|
||||
intersect {
|
||||
box(100,100,100)
|
||||
tube(60,10)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user