Skip to content

Commit

Permalink
Merge pull request #47 from mipt-npm/dev
Browse files Browse the repository at this point in the history
v0.2.0-dev-22
  • Loading branch information
altavir authored Jul 17, 2021
2 parents 62a6eaf + e50e266 commit f6459ec
Show file tree
Hide file tree
Showing 518 changed files with 14,104 additions and 9,449 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ out/
.gradle
build/


!gradle-wrapper.jar
gradle.properties
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Changelog

## [Unreleased]
### Added
- Server module
- Change collector
- Customizable accessors for colors
- SphereLayer solid
- Hexagon interface and GenericHexagon implementation (Box inherits Hexagon)
- Increased the default detail level for spheres and cones to 32
- Simple clipping for Solids in ThreeJs

### Changed
- Vision does not implement ItemProvider anymore. Property changes are done via `getProperty`/`setProperty` and `property` delegate.
- Point3D and Point2D are made separate classes instead of expect/actual (to split up different engines.
- JavaFX support moved to a separate module
- Threejs support moved to a separate module
- \[Format breaking change!\] Stylesheets are moved into properties under `@stylesheet` key
- VisionGroup builder accepts `null` as name for statics instead of `""`
- gdml sphere is rendered as a SphereLayer instead of Sphere (#35)
- Tube is replaced by more general ConeSurface
- position, rotation and size moved to properties
- prototypes moved to children
- Immutable Solid instances
- Property listeners are not triggered if there are no changes.
- Feedback websocket connection in the client.

### Deprecated

### Removed
- Primary modules dependencies on UI

### Fixed
- Version conflicts

### Security
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@

![Gradle build](https://github.com/mipt-npm/visionforge/workflows/Gradle%20build/badge.svg)

[![Slack](https://img.shields.io/badge/slack-channel-green?logo=slack)](https://kotlinlang.slack.com/archives/CEXV2QWNM)

# DataForge Visualization Platform

## Table of Contents

* [Introduction](#introduction)
* [Requirements](#requirements)
* [Features](#features)
* [About DataForge](#about-dataforge)
* [Modules contained in this repository](#modules-contained-in-this-repository)
Expand All @@ -32,6 +35,9 @@ Other applications including 2D plots are planned for the future.
The project is developed as a [Kotlin multiplatform](https://kotlinlang.org/docs/reference/multiplatform.html)
application, currently targeting browser JavaScript and JVM.

## Requirements

JVM backend requires JDK 11 or later

## Features

Expand Down Expand Up @@ -67,7 +73,7 @@ The `visionforge-core` module also includes configuration editors for JS (in `js

**Class diagram:**

![](doc/resources/class-diag-core.png)
![](docs/images/class-diag-core.png)


### visionforge-solid
Expand All @@ -76,7 +82,7 @@ Includes common classes and serializers for 3D visualization, as well as Three.j

**Class diagram:**

![](doc/resources/class-diag-solid.png)
![](docs/images/class-diag-solid.png)

##### Prototypes

Expand All @@ -85,7 +91,7 @@ also referred to as templates). The idea is that prototype geometry can be rende
for multiple objects. This helps to significantly decrease memory usage.

The `prototypes` property tree is defined in `SolidGroup` class via `PrototypeHolder` interface, and
`Proxy` class helps to reuse a template object.
`SolidReference` class helps to reuse a template object.

##### Styles

Expand Down Expand Up @@ -121,7 +127,7 @@ Some shapes will also periodically change their color and visibility.

**Example view:**

![](doc/resources/spatial-showcase.png)
![](docs/images/spatial-showcase.png)


### Full-Stack Application Example - Muon Monitor Visualization
Expand All @@ -133,7 +139,7 @@ A full-stack application example, showing the

**Example view:**

![](doc/resources/muon-monitor.png)
![](docs/images/muon-monitor.png)


### GDML Example
Expand All @@ -144,7 +150,7 @@ Visualization example for geometry defined as GDML file.

##### Example view:

![](doc/resources/gdml-demo.png)
![](docs/images/gdml-demo.png)


## Thanks and references
Expand Down
52 changes: 29 additions & 23 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@
import scientifik.useFx
import scientifik.useSerialization

val dataforgeVersion by extra("0.1.8")

plugins {
id("scientifik.mpp") apply false
id("scientifik.jvm") apply false
id("scientifik.js") apply false
id("scientifik.publish") apply false
id("org.jetbrains.changelog") version "0.4.0"
id("ru.mipt.npm.gradle.project")

//Override kotlin version
// val kotlinVersion = "1.5.20-RC"
// kotlin("multiplatform") version(kotlinVersion) apply false
// kotlin("jvm") version(kotlinVersion) apply false
// kotlin("js") version(kotlinVersion) apply false
}

val dataforgeVersion by extra("0.4.3")
val fxVersion by extra("11")

allprojects {
repositories {
mavenLocal()
maven("https://dl.bintray.com/pdvrieze/maven")
maven("http://maven.jzy3d.org/releases")
mavenCentral()
jcenter()
maven("https://repo.kotlin.link")
maven("https://maven.jzy3d.org/releases")
}

group = "hep.dataforge"
version = "0.1.5-dev"
group = "space.kscience"
version = "0.2.0-dev-22"
}

val githubProject by extra("visionforge")
val bintrayRepo by extra("dataforge")
val fxVersion by extra("14")

subprojects {
if(name.startsWith("visionforge")) {
apply(plugin = "scientifik.publish")
if (name.startsWith("visionforge")) {
plugins.apply("maven-publish")
}
useSerialization()
useFx(scientifik.FXModule.CONTROLS, version = fxVersion)
}

ksciencePublish{
github("visionforge")
space()
sonatype()
}

apiValidation {
validationDisabled = true
ignoredPackages.add("info.laht.threekt")
}
Empty file removed demo/build.gradle.kts
Empty file.
2 changes: 1 addition & 1 deletion demo/gdml/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ drag-and-drop GDML file to the window to see visualization. For an example file,

##### Example view:

![](../../doc/resources/gdml-demo.png)
![](../../docs/images/gdml-demo.png)
40 changes: 25 additions & 15 deletions demo/gdml/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,47 +1,57 @@
import scientifik.DependencyConfiguration
import scientifik.FXModule
import scientifik.useFx
import ru.mipt.npm.gradle.DependencyConfiguration
import ru.mipt.npm.gradle.FXModule

plugins {
id("scientifik.mpp")
id("application")
id("ru.mipt.npm.gradle.mpp")
application
}

val fxVersion: String by rootProject.extra
useFx(FXModule.CONTROLS, version = fxVersion, configuration = DependencyConfiguration.IMPLEMENTATION)
kscience {
val fxVersion: String by rootProject.extra
useFx(FXModule.CONTROLS, version = fxVersion, configuration = DependencyConfiguration.IMPLEMENTATION)
application()
}

kotlin {

jvm {
withJava()
}

js {
js{
useCommonJs()
browser {
commonWebpackConfig {
cssSupport.enabled = false
}
}
}

sourceSets {
commonMain {
dependencies {
implementation(project(":visionforge-solid"))
implementation(project(":visionforge-gdml"))
}
}
jsMain{
jvmMain {
dependencies {
implementation(project(":visionforge-fx"))
}
}
jsMain {
dependencies {
implementation(project(":ui:bootstrap"))
implementation(project(":ui:ring"))
implementation(project(":visionforge-threejs"))
implementation(npm("react-file-drop", "3.0.6"))
}
}
}
}

application {
mainClassName = "hep.dataforge.vision.gdml.demo.GDMLDemoAppKt"
mainClass.set("space.kscience.visionforge.gdml.demo.GdmlFxDemoAppKt")
}

val convertGdmlToJson by tasks.creating(JavaExec::class) {
group = "application"
classpath = sourceSets["main"].runtimeClasspath
main = "hep.dataforge.vis.spatial.gdml.demo.SaveToJsonKt"
main = "space.kscience.dataforge.vis.spatial.gdml.demo.SaveToJsonKt"
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package space.kscience.visionforge.gdml

import space.kscience.dataforge.meta.string
import space.kscience.dataforge.names.toName
import space.kscience.dataforge.values.asValue
import space.kscience.gdml.GdmlShowCase
import space.kscience.visionforge.setProperty
import space.kscience.visionforge.solid.SolidMaterial
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertNotNull

class GDMLVisionTest {

// @Test
// fun testCubesStyles(){
// val cubes = gdml.toVision()
// val segment = cubes["composite000.segment_0".toName()] as Solid
// println(segment.styles)
// println(segment.material)
// }


@Test
fun testPrototypeProperty() {
val vision = GdmlShowCase.cubes().toVision()
val child = vision["composite-000.segment-0".toName()]
assertNotNull(child)
child.setProperty(SolidMaterial.MATERIAL_COLOR_KEY, "red".asValue())
assertEquals("red", child.getProperty(SolidMaterial.MATERIAL_COLOR_KEY).string)
}
}
4 changes: 3 additions & 1 deletion demo/gdml/src/jsMain/kotlin/drop/FileDrop.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ package drop

import org.w3c.dom.DragEvent
import org.w3c.files.FileList
import react.*
import react.Component
import react.RProps
import react.RState

external enum class DropEffects {
copy,
Expand Down
Loading

0 comments on commit f6459ec

Please sign in to comment.