diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
deleted file mode 100644
index 8c73f7d9..00000000
--- a/.github/workflows/build.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-name: Gradle build
-
-on:
- push:
- branches: [ dev, master ]
- pull_request:
-
-jobs:
- build:
- runs-on: ubuntu-latest
- timeout-minutes: 40
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 11
- uses: actions/setup-java@v2.5.0
- with:
- java-version: 11
- distribution: liberica
- - name: execute build
- uses: gradle/gradle-build-action@v2
- with:
- arguments: build
diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml
new file mode 100644
index 00000000..15ef5105
--- /dev/null
+++ b/.github/workflows/gradle.yml
@@ -0,0 +1,19 @@
+name: Gradle build
+
+on: [push]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v1
+ - name: Set up JDK 11
+ uses: actions/setup-java@v1
+ with:
+ java-version: 11
+ - name: Make gradlew executable
+ run: chmod +x ./gradlew
+ - name: Build with Gradle
+ run: ./gradlew build
diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml
deleted file mode 100644
index aee354f6..00000000
--- a/.github/workflows/pages.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-name: Dokka publication
-
-on:
- push:
- branches: [ master ]
-
-jobs:
- build:
- runs-on: ubuntu-latest
- timeout-minutes: 40
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 11
- uses: actions/setup-java@v2.5.0
- with:
- java-version: 11
- distribution: liberica
- - name: execute build
- uses: gradle/gradle-build-action@v2
- with:
- arguments: dokkaHtmlMultiModule
- - uses: JamesIves/github-pages-deploy-action@4.1.0
- with:
- branch: gh-pages
- folder: build/dokka/htmlMultiModule
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
deleted file mode 100644
index 99355168..00000000
--- a/.github/workflows/publish.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-name: Gradle publish
-
-on:
- workflow_dispatch:
- release:
- types: [ created ]
-
-jobs:
- publish:
- environment:
- name: publish
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 11
- uses: actions/setup-java@v2.5.0
- with:
- java-version: 11
- distribution: liberica
- - name: execute build
- uses: gradle/gradle-build-action@v2
- - name: Publish
- shell: bash
- run: >
- ./gradlew release --no-daemon --build-cache -Ppublishing.enabled=true
- -Ppublishing.space.user=${{ secrets.SPACE_APP_ID }}
- -Ppublishing.space.token=${{ secrets.SPACE_APP_SECRET }}
diff --git a/.gitignore b/.gitignore
index 7fab40d3..89cc712a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,7 @@
out/
.gradle
build/
-data/
+
!gradle-wrapper.jar
+gradle.properties
\ No newline at end of file
diff --git a/.space.kts b/.space.kts
deleted file mode 100644
index 45b2ed53..00000000
--- a/.space.kts
+++ /dev/null
@@ -1,4 +0,0 @@
-job("Build") {
- gradlew("openjdk:11", "build")
-}
-
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2ffcb3c9..e69de29b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,56 +0,0 @@
-# Changelog
-
-## [Unreleased]
-### Added
-
-### Changed
-
-### Deprecated
-
-### Removed
-
-### Fixed
-
-### Security
-
-## [0.2.0]
-### 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
-- Markdown module
-- Tables module
-
-
-### 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
-
diff --git a/README.md b/README.md
index eeeaab9e..45cd88af 100644
--- a/README.md
+++ b/README.md
@@ -3,38 +3,35 @@
![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)
-* [Visualization for External Systems](#visualization-for-external-systems)
+ * [visionforge-core](#visionforge-core)
+ * [visionforge-solid](#visionforge-solid)
+ * [visionforge-gdml](#visionforge-gdml)
+* [Visualization for External Systems](#visualization-for-external-systems)
* [Demonstrations](#demonstrations)
- * [Simple Example - Solid Showcase](#simple-example---solid-showcase)
+ * [Simple Example - Spatial Showcase](#simple-example---spatial-showcase)
* [Full-Stack Application Example - Muon Monitor](#full-stack-application-example---muon-monitor-visualization)
* [GDML Example](#gdml-example)
## Introduction
-This repository contains a [DataForge](#about-dataforge)\-based framework
-used for visualization in various scientific applications.
+This repository contains a [DataForge](#about-dataforge)\-based framework
+used for visualization in various scientific applications.
-The main framework's use case for now is 3D visualization for particle physics experiments.
+The main framework's use case for now is 3D visualization for particle physics experiments.
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)
+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
@@ -54,193 +51,60 @@ Platform uses some of the concepts and modules of DataForge, including: `Meta`,
`Provider`, and some others.
To learn more about DataForge, please consult the following URLs:
-* [Kotlin multiplatform implementation of DataForge](https://github.com/mipt-npm/dataforge-core)
-* [DataForge documentation](http://npm.mipt.ru/dataforge/)
-* [Original implementation of DataForge](https://bitbucket.org/Altavir/dataforge/src/default/)
+ * [Kotlin multiplatform implementation of DataForge](https://github.com/mipt-npm/dataforge-core)
+ * [DataForge documentation](http://npm.mipt.ru/dataforge/)
+ * [Original implementation of DataForge](https://bitbucket.org/Altavir/dataforge/src/default/)
## Modules contained in this repository
-
+### visionforge-core
-* ### [cern-root-loader](cern-root-loader)
->
->
-> **Maturity**: EXPERIMENTAL
-
-
-* ### [demo](demo)
->
->
-> **Maturity**: EXPERIMENTAL
-
-
-* ### [jupyter](jupyter)
->
->
-> **Maturity**: EXPERIMENTAL
-
-
-* ### [ui](ui)
->
->
-> **Maturity**: EXPERIMENTAL
-
-
-* ### [visionforge-core](visionforge-core)
->
->
-> **Maturity**: DEVELOPMENT
-
-
-* ### [visionforge-fx](visionforge-fx)
->
->
-> **Maturity**: PROTOTYPE
-
-
-* ### [visionforge-gdml](visionforge-gdml)
->
->
-> **Maturity**: EXPERIMENTAL
-
-
-* ### [visionforge-markdown](visionforge-markdown)
->
->
-> **Maturity**: EXPERIMENTAL
-
-
-* ### [visionforge-plotly](visionforge-plotly)
->
->
-> **Maturity**: EXPERIMENTAL
-
-
-* ### [visionforge-server](visionforge-server)
->
->
-> **Maturity**: EXPERIMENTAL
-
-
-* ### [visionforge-solid](visionforge-solid)
->
->
-> **Maturity**: DEVELOPMENT
-
-
-* ### [visionforge-tables](visionforge-tables)
->
->
-> **Maturity**: PROTOTYPE
-
-
-* ### [visionforge-threejs](visionforge-threejs)
->
->
-> **Maturity**: EXPERIMENTAL
-
-
-* ### [gdml](demo/gdml)
->
->
-> **Maturity**: EXPERIMENTAL
-
-
-* ### [js-playground](demo/js-playground)
->
->
-> **Maturity**: EXPERIMENTAL
-
-
-* ### [muon-monitor](demo/muon-monitor)
->
->
-> **Maturity**: EXPERIMENTAL
-
-
-* ### [playground](demo/playground)
->
->
-> **Maturity**: EXPERIMENTAL
-
-
-* ### [plotly-fx](demo/plotly-fx)
->
->
-> **Maturity**: EXPERIMENTAL
-
-
-* ### [sat-demo](demo/sat-demo)
->
->
-> **Maturity**: EXPERIMENTAL
-
-
-* ### [solid-showcase](demo/solid-showcase)
->
->
-> **Maturity**: EXPERIMENTAL
-
-
-* ### [visionforge-jupyter-gdml](jupyter/visionforge-jupyter-gdml)
->
->
-> **Maturity**: EXPERIMENTAL
-
-
-* ### [bootstrap](ui/bootstrap)
->
->
-> **Maturity**: EXPERIMENTAL
-
-
-* ### [react](ui/react)
->
->
-> **Maturity**: EXPERIMENTAL
-
-
-* ### [ring](ui/ring)
->
->
-> **Maturity**: EXPERIMENTAL
-
-
-* ### [visionforge-threejs-server](visionforge-threejs/visionforge-threejs-server)
->
->
-> **Maturity**: EXPERIMENTAL
-
+Contains a general hierarchy of classes and interfaces useful for visualization.
+This module is not specific to 3D-visualization.
+The `visionforge-core` module also includes configuration editors for JS (in `jsMain`) and JVM (in `jvmMain`).
**Class diagram:**
-![](docs/images/class-diag-solid.png)
+![](doc/resources/class-diag-core.png)
+
+
+### visionforge-solid
+
+Includes common classes and serializers for 3D visualization, as well as Three.js and JavaFX implementations.
+
+**Class diagram:**
+
+![](doc/resources/class-diag-solid.png)
##### Prototypes
One of the important features of the framework is support for 3D object prototypes (sometimes
-also referred to as templates). The idea is that prototype geometry can be rendered once and reused
+also referred to as templates). The idea is that prototype geometry can be rendered once and reused
for multiple objects. This helps to significantly decrease memory usage.
-The `prototypes` property tree is defined in `SolidGroup` class via `PrototypeHolder` interface, and
-`SolidReference` class helps to reuse a template object.
+The `prototypes` property tree is defined in `SolidGroup` class via `PrototypeHolder` interface, and
+`Proxy` class helps to reuse a template object.
##### Styles
-`VisionGroup` has a `styleSheet` property that can optionally define styles at the Group's
-level. Styles are applied to child (descendant) objects using `Vision.styles: List` property.
+`SolidGroup` has a `styleSheet` property that can optionally define styles at the Group's
+level. Styles are applied to child (descendant) objects using `Vision.styles: List` property.
-### visionforge-threejs
-## Visualization for External Systems
+### visionforge-gdml
+
+GDML bindings for 3D visualization (to be moved to gdml project).
+
+
+## Visualization for External Systems
The `visionforge` framework can be used to visualize geometry and events from external,
non-Kotlin based systems, such as ROOT. This will require a plugin to convert data model
of the external system to that of `visionforge`. Performing such integration is a work
currently in progress.
-
+
## Demonstrations
@@ -248,42 +112,42 @@ The `demo` module contains several example projects (demonstrations) of using th
They are briefly described in this section, for more details please consult the corresponding per-project
README file.
-### Simple Example - Solid Showcase
+### Simple Example - Spatial Showcase
Contains a simple demonstration with a grid including a few shapes that you can rotate, move camera, and so on.
Some shapes will also periodically change their color and visibility.
-[More details](demo/solid-showcase/README.md)
+[More details](demo/spatial-showcase/README.md)
**Example view:**
-![](docs/images/solid-showcase.png)
+![](doc/resources/spatial-showcase.png)
### Full-Stack Application Example - Muon Monitor Visualization
-A full-stack application example, showing the
+A full-stack application example, showing the
[Muon Monitor](http://npm.mipt.ru/en/projects/physics#mounMonitor) experiment set-up.
[More details](demo/muon-monitor/README.md)
**Example view:**
-![](docs/images/muon-monitor.png)
+![](doc/resources/muon-monitor.png)
### GDML Example
-Visualization example for geometry defined as GDML file.
+Visualization example for geometry defined as GDML file.
[More details](demo/gdml/README.md)
##### Example view:
-![](docs/images/gdml-demo.png)
+![](doc/resources/gdml-demo.png)
## Thanks and references
The original three.js bindings were made by [Lars Ivar Hatledal](https://github.com/markaren), but the project is discontinued right now.
-All other libraries are explicitly shown as dependencies. We would like to express specific thanks to JetBrains Kotlin-JS team for consulting us during the work.
+All other libraries are explicitly shown as dependencies. We would like to express specific thanks to JetBrains Kotlin-JS team for consulting us during the work.
\ No newline at end of file
diff --git a/build.gradle.kts b/build.gradle.kts
index 0f892c76..56f0b451 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,34 +1,35 @@
+import scientifik.useFx
+import scientifik.useSerialization
+
+val dataforgeVersion by extra("0.1.8")
+
plugins {
- id("ru.mipt.npm.gradle.project")
- id("org.jetbrains.kotlinx.kover") version "0.5.0-RC"
+ 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"
}
-val dataforgeVersion by extra("0.5.2")
-val fxVersion by extra("11")
+allprojects {
+ repositories {
+ mavenLocal()
+ maven("https://dl.bintray.com/pdvrieze/maven")
+ maven("http://maven.jzy3d.org/releases")
+ }
-allprojects{
- group = "space.kscience"
- version = "0.2.0"
+ group = "hep.dataforge"
+ version = "0.1.5-dev"
}
+val githubProject by extra("visionforge")
+val bintrayRepo by extra("dataforge")
+val fxVersion by extra("14")
+
subprojects {
- if (name.startsWith("visionforge")) apply()
-
- repositories {
- maven("https://repo.kotlin.link")
- mavenCentral()
- maven("https://maven.jzy3d.org/releases")
+ if(name.startsWith("visionforge")) {
+ apply(plugin = "scientifik.publish")
}
-}
-
-ksciencePublish {
- github("visionforge")
- space()
- sonatype()
-}
-
-apiValidation {
- ignoredPackages.add("info.laht.threekt")
-}
-
-readme.readmeTemplate = file("docs/templates/README-TEMPLATE.md")
\ No newline at end of file
+ useSerialization()
+ useFx(scientifik.FXModule.CONTROLS, version = fxVersion)
+}
\ No newline at end of file
diff --git a/cern-root-loader/README.md b/cern-root-loader/README.md
deleted file mode 100644
index b032852d..00000000
--- a/cern-root-loader/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# Module cern-root-loader
-
-
-
diff --git a/cern-root-loader/api/cern-root-loader.api b/cern-root-loader/api/cern-root-loader.api
deleted file mode 100644
index 2788976b..00000000
--- a/cern-root-loader/api/cern-root-loader.api
+++ /dev/null
@@ -1,926 +0,0 @@
-public final class ru/mipt/npm/root/DGeoBoolNode : ru/mipt/npm/root/DObject {
- public fun (Lspace/kscience/dataforge/meta/Meta;Lru/mipt/npm/root/DObjectCache;)V
- public final fun getFLeft ()Lru/mipt/npm/root/DGeoShape;
- public final fun getFLeftMat ()Lru/mipt/npm/root/DGeoMatrix;
- public final fun getFRight ()Lru/mipt/npm/root/DGeoShape;
- public final fun getFRightMat ()Lru/mipt/npm/root/DGeoMatrix;
-}
-
-public final class ru/mipt/npm/root/DGeoManager : ru/mipt/npm/root/DNamed {
- public static final field Companion Lru/mipt/npm/root/DGeoManager$Companion;
- public fun (Lspace/kscience/dataforge/meta/Meta;Lru/mipt/npm/root/DObjectCache;)V
- public final fun getFMatrices ()Ljava/util/List;
- public final fun getFNodes ()Ljava/util/List;
- public final fun getFShapes ()Ljava/util/List;
- public final fun getFVolumes ()Ljava/util/List;
-}
-
-public final class ru/mipt/npm/root/DGeoManager$Companion {
- public final fun parse (Ljava/lang/String;)Lru/mipt/npm/root/DGeoManager;
-}
-
-public final class ru/mipt/npm/root/DGeoMaterial : ru/mipt/npm/root/DNamed {
- public fun (Lspace/kscience/dataforge/meta/Meta;Lru/mipt/npm/root/DObjectCache;)V
-}
-
-public class ru/mipt/npm/root/DGeoMatrix : ru/mipt/npm/root/DNamed {
- public fun (Lspace/kscience/dataforge/meta/Meta;Lru/mipt/npm/root/DObjectCache;)V
-}
-
-public final class ru/mipt/npm/root/DGeoMedium : ru/mipt/npm/root/DNamed {
- public fun (Lspace/kscience/dataforge/meta/Meta;Lru/mipt/npm/root/DObjectCache;)V
- public final fun getFMaterial ()Lru/mipt/npm/root/DGeoMaterial;
- public final fun getFParams ()[D
-}
-
-public final class ru/mipt/npm/root/DGeoNode : ru/mipt/npm/root/DNamed {
- public fun (Lspace/kscience/dataforge/meta/Meta;Lru/mipt/npm/root/DObjectCache;)V
- public final fun getFVolume ()Lru/mipt/npm/root/DGeoVolume;
-}
-
-public class ru/mipt/npm/root/DGeoScale : ru/mipt/npm/root/DGeoMatrix {
- public fun (Lspace/kscience/dataforge/meta/Meta;Lru/mipt/npm/root/DObjectCache;)V
- public final fun getFScale ()[D
- public final fun getX ()D
- public final fun getY ()D
- public final fun getZ ()D
-}
-
-public final class ru/mipt/npm/root/DGeoShape : ru/mipt/npm/root/DNamed {
- public fun (Lspace/kscience/dataforge/meta/Meta;Lru/mipt/npm/root/DObjectCache;)V
- public final fun getFDX ()D
- public final fun getFDY ()D
- public final fun getFDZ ()D
-}
-
-public final class ru/mipt/npm/root/DGeoVolume : ru/mipt/npm/root/DNamed, space/kscience/dataforge/misc/Named {
- public fun (Lspace/kscience/dataforge/meta/Meta;Lru/mipt/npm/root/DObjectCache;)V
- public final fun getFFillColor ()Ljava/lang/Integer;
- public final fun getFMedium ()Lru/mipt/npm/root/DGeoMedium;
- public final fun getFNodes ()Ljava/util/List;
- public final fun getFShape ()Lru/mipt/npm/root/DGeoShape;
- public fun getName ()Lspace/kscience/dataforge/names/Name;
-}
-
-public class ru/mipt/npm/root/DNamed : ru/mipt/npm/root/DObject {
- public fun (Lspace/kscience/dataforge/meta/Meta;Lru/mipt/npm/root/DObjectCache;)V
- public final fun getFName ()Ljava/lang/String;
- public final fun getFTitle ()Ljava/lang/String;
-}
-
-public class ru/mipt/npm/root/DObject {
- public fun (Lspace/kscience/dataforge/meta/Meta;Lru/mipt/npm/root/DObjectCache;)V
- public final fun getMeta ()Lspace/kscience/dataforge/meta/Meta;
- public final fun getRefCache ()Lru/mipt/npm/root/DObjectCache;
- public final fun getTypename ()Ljava/lang/String;
-}
-
-public final class ru/mipt/npm/root/DObjectCache {
- public static final field Companion Lru/mipt/npm/root/DObjectCache$Companion;
- public fun (Ljava/util/List;Ljava/util/List;)V
- public synthetic fun (Ljava/util/List;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
- public final fun get (I)Lspace/kscience/dataforge/meta/Meta;
- public final fun getRefStack ()Ljava/util/List;
- public final fun stack (I)Lru/mipt/npm/root/DObjectCache;
-}
-
-public final class ru/mipt/npm/root/DObjectCache$Companion {
- public final fun getEmpty ()Lru/mipt/npm/root/DObjectCache;
-}
-
-public final class ru/mipt/npm/root/DObjectKt {
- public static final fun doubleArray (Lspace/kscience/dataforge/meta/MetaProvider;[DLspace/kscience/dataforge/names/Name;)Lkotlin/properties/ReadOnlyProperty;
- public static synthetic fun doubleArray$default (Lspace/kscience/dataforge/meta/MetaProvider;[DLspace/kscience/dataforge/names/Name;ILjava/lang/Object;)Lkotlin/properties/ReadOnlyProperty;
-}
-
-public final class ru/mipt/npm/root/DRootToSolidKt {
- public static final fun toSolid (Lru/mipt/npm/root/DGeoManager;)Lspace/kscience/visionforge/solid/SolidGroup;
-}
-
-public final class ru/mipt/npm/root/RootColors {
- public static final field INSTANCE Lru/mipt/npm/root/RootColors;
- public final fun get (I)Ljava/lang/String;
-}
-
-public final class ru/mipt/npm/root/serialization/JsonToRootKt {
- public static final fun decodeFromJson (Lru/mipt/npm/root/serialization/TObject;Lkotlinx/serialization/KSerializer;Lkotlinx/serialization/json/JsonElement;)Lru/mipt/npm/root/serialization/TObject;
- public static final fun decodeFromString (Lru/mipt/npm/root/serialization/TObject;Lkotlinx/serialization/KSerializer;Ljava/lang/String;)Lru/mipt/npm/root/serialization/TObject;
-}
-
-public final class ru/mipt/npm/root/serialization/RootToSolidKt {
- public static final fun toSolid (Lru/mipt/npm/root/serialization/TGeoManager;)Lspace/kscience/visionforge/solid/SolidGroup;
-}
-
-public class ru/mipt/npm/root/serialization/TGeoBBox : ru/mipt/npm/root/serialization/TGeoShape {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoBBox$Companion;
- public fun ()V
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;Lkotlin/UInt;IDDD[DLkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public final fun getFDX ()D
- public final fun getFDY ()D
- public final fun getFDZ ()D
- public final fun getFOrigin ()[D
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoBBox;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoBBox$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoBBox$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoBBox;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoBBox;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoBBox$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public abstract class ru/mipt/npm/root/serialization/TGeoBoolNode : ru/mipt/npm/root/serialization/TObject {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoBoolNode$Companion;
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Lru/mipt/npm/root/serialization/TGeoMatrix;Lru/mipt/npm/root/serialization/TGeoMatrix;Lkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public abstract fun getFLeft ()Lru/mipt/npm/root/serialization/TGeoShape;
- public final fun getFLeftMat ()Lru/mipt/npm/root/serialization/TGeoMatrix;
- public abstract fun getFRight ()Lru/mipt/npm/root/serialization/TGeoShape;
- public final fun getFRightMat ()Lru/mipt/npm/root/serialization/TGeoMatrix;
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoBoolNode;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoBoolNode$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoCombiTrans : ru/mipt/npm/root/serialization/TGeoMatrix {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoCombiTrans$Companion;
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;[DLru/mipt/npm/root/serialization/TGeoRotation;Lkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public fun ([DLru/mipt/npm/root/serialization/TGeoRotation;)V
- public synthetic fun ([DLru/mipt/npm/root/serialization/TGeoRotation;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
- public final fun getFRotation ()Lru/mipt/npm/root/serialization/TGeoRotation;
- public final fun getFTranslation ()[D
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoCombiTrans;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoCombiTrans$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoCombiTrans$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoCombiTrans;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoCombiTrans;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoCombiTrans$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoCompositeShape : ru/mipt/npm/root/serialization/TGeoBBox {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoCompositeShape$Companion;
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;Lkotlin/UInt;IDDD[DLru/mipt/npm/root/serialization/TGeoBoolNode;Lkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public fun (Lru/mipt/npm/root/serialization/TGeoBoolNode;)V
- public final fun getFNode ()Lru/mipt/npm/root/serialization/TGeoBoolNode;
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoCompositeShape;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoCompositeShape$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoCompositeShape$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoCompositeShape;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoCompositeShape;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoCompositeShape$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoHMatrix : ru/mipt/npm/root/serialization/TGeoMatrix {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoHMatrix$Companion;
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;[D[D[DLkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public fun ([D[D[D)V
- public final fun getFRotationMatrix ()[D
- public final fun getFScale ()[D
- public final fun getFTranslation ()[D
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoHMatrix;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoHMatrix$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoHMatrix$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoHMatrix;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoHMatrix;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoHMatrix$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoIdentity : ru/mipt/npm/root/serialization/TGeoMatrix {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoIdentity$Companion;
- public fun ()V
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;Lkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoIdentity;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoIdentity$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoIdentity$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoIdentity;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoIdentity;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoIdentity$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoIntersection : ru/mipt/npm/root/serialization/TGeoBoolNode {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoIntersection$Companion;
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Lru/mipt/npm/root/serialization/TGeoMatrix;Lru/mipt/npm/root/serialization/TGeoMatrix;Lru/mipt/npm/root/serialization/TGeoShape;Lru/mipt/npm/root/serialization/TGeoShape;Lkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public fun (Lru/mipt/npm/root/serialization/TGeoShape;Lru/mipt/npm/root/serialization/TGeoShape;)V
- public fun getFLeft ()Lru/mipt/npm/root/serialization/TGeoShape;
- public fun getFRight ()Lru/mipt/npm/root/serialization/TGeoShape;
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoIntersection;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoIntersection$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoIntersection$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoIntersection;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoIntersection;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoIntersection$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoManager : ru/mipt/npm/root/serialization/TNamed {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoManager$Companion;
- public fun ()V
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;Lru/mipt/npm/root/serialization/TObjArray;Lru/mipt/npm/root/serialization/TObjArray;Lru/mipt/npm/root/serialization/TObjArray;Lru/mipt/npm/root/serialization/TObjArray;Lkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public final fun getFMatrices ()Lru/mipt/npm/root/serialization/TObjArray;
- public final fun getFNodes ()Lru/mipt/npm/root/serialization/TObjArray;
- public final fun getFShapes ()Lru/mipt/npm/root/serialization/TObjArray;
- public final fun getFVolumes ()Lru/mipt/npm/root/serialization/TObjArray;
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoManager;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoManager$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoManager$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoManager;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoManager;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoManager$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public class ru/mipt/npm/root/serialization/TGeoMaterial : ru/mipt/npm/root/serialization/TNamed {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoMaterial$Companion;
- public fun ()V
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;Lkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoMaterial;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoMaterial$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoMaterial$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoMaterial;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoMaterial;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoMaterial$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public abstract class ru/mipt/npm/root/serialization/TGeoMatrix : ru/mipt/npm/root/serialization/TNamed {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoMatrix$Companion;
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;Lkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoMatrix;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoMatrix$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoMedium : ru/mipt/npm/root/serialization/TNamed {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoMedium$Companion;
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;ILru/mipt/npm/root/serialization/TGeoMaterial;[DLkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public fun (ILru/mipt/npm/root/serialization/TGeoMaterial;[D)V
- public final fun getFId ()I
- public final fun getFMaterial ()Lru/mipt/npm/root/serialization/TGeoMaterial;
- public final fun getFParams ()[D
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoMedium;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoMedium$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoMedium$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoMedium;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoMedium;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoMedium$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoMixture : ru/mipt/npm/root/serialization/TGeoMaterial {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoMixture$Companion;
- public fun ()V
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;Lkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoMixture;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoMixture$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoMixture$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoMixture;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoMixture;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoMixture$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public class ru/mipt/npm/root/serialization/TGeoNode : ru/mipt/npm/root/serialization/TNamed {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoNode$Companion;
- public fun ()V
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;Lkotlin/UInt;Lru/mipt/npm/root/serialization/TGeoVolume;II[ILkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public final fun getFGeoAtt-pVg5ArA ()I
- public final fun getFNovlp ()I
- public final fun getFNumber ()I
- public final fun getFOverlaps ()[I
- public final fun getFVolume ()Lru/mipt/npm/root/serialization/TGeoVolume;
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoNode;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoNode$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoNode$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoNode;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoNode;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoNode$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoNodeMatrix : ru/mipt/npm/root/serialization/TGeoNode {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoNodeMatrix$Companion;
- public fun ()V
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;Lkotlin/UInt;Lru/mipt/npm/root/serialization/TGeoVolume;II[ILru/mipt/npm/root/serialization/TGeoMatrix;Lkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public final fun getFMatrix ()Lru/mipt/npm/root/serialization/TGeoMatrix;
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoNodeMatrix;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoNodeMatrix$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoNodeMatrix$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoNodeMatrix;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoNodeMatrix;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoNodeMatrix$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoNodeOffset : ru/mipt/npm/root/serialization/TGeoNode {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoNodeOffset$Companion;
- public fun ()V
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;Lkotlin/UInt;Lru/mipt/npm/root/serialization/TGeoVolume;II[IDLkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public final fun getFOffset ()D
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoNodeOffset;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoNodeOffset$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoNodeOffset$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoNodeOffset;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoNodeOffset;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoNodeOffset$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public class ru/mipt/npm/root/serialization/TGeoPcon : ru/mipt/npm/root/serialization/TGeoBBox {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoPcon$Companion;
- public fun ()V
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;Lkotlin/UInt;IDDD[DIDD[D[D[DLkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public final fun getFDphi ()D
- public final fun getFNz ()I
- public final fun getFPhi1 ()D
- public final fun getFRmax ()[D
- public final fun getFRmin ()[D
- public final fun getFZ ()[D
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoPcon;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoPcon$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoPcon$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoPcon;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoPcon;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoPcon$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public class ru/mipt/npm/root/serialization/TGeoPgon : ru/mipt/npm/root/serialization/TGeoPcon {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoPgon$Companion;
- public fun ()V
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;Lkotlin/UInt;IDDD[DIDD[D[D[DILkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public final fun getFNedges ()I
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoPgon;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoPgon$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoPgon$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoPgon;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoPgon;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoPgon$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoRotation : ru/mipt/npm/root/serialization/TGeoMatrix {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoRotation$Companion;
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;[DLkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public fun ([D)V
- public final fun getFRotationMatrix ()[D
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoRotation;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoRotation$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoRotation$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoRotation;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoRotation;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoRotation$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public abstract class ru/mipt/npm/root/serialization/TGeoShape : ru/mipt/npm/root/serialization/TNamed {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoShape$Companion;
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;Lkotlin/UInt;ILkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public final fun getFShapeBits-pVg5ArA ()I
- public final fun getFShapeId ()I
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoShape;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoShape$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoShapeAssembly : ru/mipt/npm/root/serialization/TGeoBBox {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoShapeAssembly$Companion;
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;Lkotlin/UInt;IDDD[DLru/mipt/npm/root/serialization/TGeoVolumeAssembly;ZLkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public fun (Lru/mipt/npm/root/serialization/TGeoVolumeAssembly;Z)V
- public synthetic fun (Lru/mipt/npm/root/serialization/TGeoVolumeAssembly;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V
- public final fun getFBBoxOK ()Z
- public final fun getFVolume ()Lru/mipt/npm/root/serialization/TGeoVolumeAssembly;
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoShapeAssembly;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoShapeAssembly$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoShapeAssembly$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoShapeAssembly;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoShapeAssembly;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoShapeAssembly$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoShapeRef : ru/mipt/npm/root/serialization/TGeoShape {
- public fun (Lkotlin/jvm/functions/Function0;)V
- public final fun getValue ()Lru/mipt/npm/root/serialization/TGeoShape;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoSubtraction : ru/mipt/npm/root/serialization/TGeoBoolNode {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoSubtraction$Companion;
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Lru/mipt/npm/root/serialization/TGeoMatrix;Lru/mipt/npm/root/serialization/TGeoMatrix;Lru/mipt/npm/root/serialization/TGeoShape;Lru/mipt/npm/root/serialization/TGeoShape;Lkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public fun (Lru/mipt/npm/root/serialization/TGeoShape;Lru/mipt/npm/root/serialization/TGeoShape;)V
- public fun getFLeft ()Lru/mipt/npm/root/serialization/TGeoShape;
- public fun getFRight ()Lru/mipt/npm/root/serialization/TGeoShape;
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoSubtraction;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoSubtraction$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoSubtraction$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoSubtraction;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoSubtraction;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoSubtraction$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoTranslation : ru/mipt/npm/root/serialization/TGeoMatrix {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoTranslation$Companion;
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;[DLkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public fun ([D)V
- public final fun getFTranslation ()[D
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoTranslation;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoTranslation$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoTranslation$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoTranslation;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoTranslation;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoTranslation$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public class ru/mipt/npm/root/serialization/TGeoTube : ru/mipt/npm/root/serialization/TGeoBBox {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoTube$Companion;
- public fun ()V
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;Lkotlin/UInt;IDDD[DDDDLkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public final fun getFDz ()D
- public final fun getFRmax ()D
- public final fun getFRmin ()D
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoTube;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoTube$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoTube$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoTube;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoTube;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoTube$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoTubeSeg : ru/mipt/npm/root/serialization/TGeoTube {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoTubeSeg$Companion;
- public fun (DDDDDDDDD)V
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;Lkotlin/UInt;IDDD[DDDDDDDDDDDDDLkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public final fun getFC1 ()D
- public final fun getFC2 ()D
- public final fun getFCdfi ()D
- public final fun getFCm ()D
- public final fun getFPhi1 ()D
- public final fun getFPhi2 ()D
- public final fun getFS1 ()D
- public final fun getFS2 ()D
- public final fun getFSm ()D
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoTubeSeg;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoTubeSeg$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoTubeSeg$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoTubeSeg;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoTubeSeg;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoTubeSeg$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoUnion : ru/mipt/npm/root/serialization/TGeoBoolNode {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoUnion$Companion;
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Lru/mipt/npm/root/serialization/TGeoMatrix;Lru/mipt/npm/root/serialization/TGeoMatrix;Lru/mipt/npm/root/serialization/TGeoShape;Lru/mipt/npm/root/serialization/TGeoShape;Lkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public fun (Lru/mipt/npm/root/serialization/TGeoShape;Lru/mipt/npm/root/serialization/TGeoShape;)V
- public fun getFLeft ()Lru/mipt/npm/root/serialization/TGeoShape;
- public fun getFRight ()Lru/mipt/npm/root/serialization/TGeoShape;
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoUnion;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoUnion$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoUnion$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoUnion;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoUnion;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoUnion$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public class ru/mipt/npm/root/serialization/TGeoVolume : ru/mipt/npm/root/serialization/TNamed {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoVolume$Companion;
- public fun ()V
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;Lkotlin/UInt;ILjava/lang/Integer;Lkotlin/UInt;Ljava/lang/Integer;Ljava/lang/Integer;Lru/mipt/npm/root/serialization/TObjArray;Lru/mipt/npm/root/serialization/TGeoShape;Lru/mipt/npm/root/serialization/TGeoMedium;IIILkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public final fun getFFillColor ()Ljava/lang/Integer;
- public final fun getFFillStyle ()Ljava/lang/Integer;
- public final fun getFGeoAtt-pVg5ArA ()I
- public final fun getFLineColor ()I
- public final fun getFLineStyle ()Ljava/lang/Integer;
- public final fun getFLineWidth-pVg5ArA ()I
- public final fun getFMedium ()Lru/mipt/npm/root/serialization/TGeoMedium;
- public final fun getFNodes ()Lru/mipt/npm/root/serialization/TObjArray;
- public final fun getFNtotal ()I
- public final fun getFNumber ()I
- public final fun getFRefCount ()I
- public final fun getFShape ()Lru/mipt/npm/root/serialization/TGeoShape;
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoVolume;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoVolume$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoVolume$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoVolume;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoVolume;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoVolume$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public class ru/mipt/npm/root/serialization/TGeoVolumeAssembly : ru/mipt/npm/root/serialization/TGeoVolume {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoVolumeAssembly$Companion;
- public fun ()V
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;Lkotlin/UInt;ILjava/lang/Integer;Lkotlin/UInt;Ljava/lang/Integer;Ljava/lang/Integer;Lru/mipt/npm/root/serialization/TObjArray;Lru/mipt/npm/root/serialization/TGeoShape;Lru/mipt/npm/root/serialization/TGeoMedium;IIILkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoVolumeAssembly;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoVolumeAssembly$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoVolumeAssembly$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoVolumeAssembly;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoVolumeAssembly;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoVolumeAssembly$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoVolumeAssemblyRef : ru/mipt/npm/root/serialization/TGeoVolumeAssembly {
- public fun (Lkotlin/jvm/functions/Function0;)V
- public final fun getValue ()Lru/mipt/npm/root/serialization/TGeoVolumeAssembly;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoVolumeRef : ru/mipt/npm/root/serialization/TGeoVolume {
- public fun (Lkotlin/jvm/functions/Function0;)V
- public final fun getValue ()Lru/mipt/npm/root/serialization/TGeoVolume;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoXtru : ru/mipt/npm/root/serialization/TGeoBBox {
- public static final field Companion Lru/mipt/npm/root/serialization/TGeoXtru$Companion;
- public fun (IID[D[D[D[D[D[D)V
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;Lkotlin/UInt;IDDD[DIID[D[D[D[D[D[DLkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public final fun getFNvert ()I
- public final fun getFNz ()I
- public final fun getFScale ()[D
- public final fun getFX ()[D
- public final fun getFX0 ()[D
- public final fun getFY ()[D
- public final fun getFY0 ()[D
- public final fun getFZ ()[D
- public final fun getFZcurrent ()D
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TGeoXtru;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoXtru$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TGeoXtru$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoXtru;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoXtru;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TGeoXtru$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/THashList : ru/mipt/npm/root/serialization/TObject {
- public static final field Companion Lru/mipt/npm/root/serialization/THashList$Companion;
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/util/List;Lkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public fun (Ljava/util/List;)V
- public final fun getArr ()Ljava/util/List;
- public static final fun write$Self (Lru/mipt/npm/root/serialization/THashList;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/THashList$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/THashList$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/THashList;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/THashList;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/THashList$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TList : ru/mipt/npm/root/serialization/TObject {
- public static final field Companion Lru/mipt/npm/root/serialization/TList$Companion;
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/util/List;Lkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public fun (Ljava/util/List;)V
- public final fun getArr ()Ljava/util/List;
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TList;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TList$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TList$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TList;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TList;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TList$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public class ru/mipt/npm/root/serialization/TNamed : ru/mipt/npm/root/serialization/TObject {
- public static final field Companion Lru/mipt/npm/root/serialization/TNamed$Companion;
- public fun ()V
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;Lkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public final fun getFName ()Ljava/lang/String;
- public final fun getFTitle ()Ljava/lang/String;
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TNamed;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TNamed$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/root/serialization/TNamed$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TNamed;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TNamed;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TNamed$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TObjArray : ru/mipt/npm/root/serialization/TObject {
- public static final field Companion Lru/mipt/npm/root/serialization/TObjArray$Companion;
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Ljava/util/List;Lkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public fun (Ljava/util/List;)V
- public final fun getArr ()Ljava/util/List;
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TObjArray;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;Lkotlinx/serialization/KSerializer;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TObjArray$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun (Lkotlinx/serialization/KSerializer;)V
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TObjArray;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TObjArray;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/root/serialization/TObjArray$Companion {
- public final fun getEmpty ()Lru/mipt/npm/root/serialization/TObjArray;
- public final fun serializer (Lkotlinx/serialization/KSerializer;)Lkotlinx/serialization/KSerializer;
-}
-
-public abstract class ru/mipt/npm/root/serialization/TObject {
- public static final field Companion Lru/mipt/npm/root/serialization/TObject$Companion;
- public fun ()V
- public synthetic fun (ILkotlin/UInt;Lkotlin/UInt;Lkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public final fun getFBits-pVg5ArA ()I
- public final fun getFUniqueID-pVg5ArA ()I
- public static final fun write$Self (Lru/mipt/npm/root/serialization/TObject;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/root/serialization/TObject$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
diff --git a/cern-root-loader/build.gradle.kts b/cern-root-loader/build.gradle.kts
deleted file mode 100644
index fa26fab5..00000000
--- a/cern-root-loader/build.gradle.kts
+++ /dev/null
@@ -1,19 +0,0 @@
-plugins {
- id("ru.mipt.npm.gradle.mpp")
-}
-
-kscience{
- useSerialization {
- json()
- }
-}
-
-kotlin {
- sourceSets {
- val commonMain by getting {
- dependencies {
- api(project(":visionforge-solid"))
- }
- }
- }
-}
\ No newline at end of file
diff --git a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/DObject.kt b/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/DObject.kt
deleted file mode 100644
index 5af50c3f..00000000
--- a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/DObject.kt
+++ /dev/null
@@ -1,145 +0,0 @@
-package ru.mipt.npm.root
-
-import kotlinx.serialization.json.Json
-import space.kscience.dataforge.meta.*
-import space.kscience.dataforge.misc.Named
-import space.kscience.dataforge.names.Name
-import space.kscience.dataforge.names.asName
-import space.kscience.dataforge.values.doubleArray
-import kotlin.properties.ReadOnlyProperty
-
-public fun MetaProvider.doubleArray(
- vararg default: Double,
- key: Name? = null,
-): ReadOnlyProperty = value(key) {
- it?.doubleArray ?: doubleArrayOf(*default)
-}
-
-public class DObjectCache(private val cache: List, public val refStack: List = emptyList()) {
- public operator fun get(index: Int): Meta = cache[index]
-
- public fun stack(ref: Int): DObjectCache = DObjectCache(cache, refStack + ref)
-
- public companion object {
- public val empty: DObjectCache = DObjectCache(emptyList(), emptyList())
- }
-}
-
-public open class DObject(public val meta: Meta, public val refCache: DObjectCache) {
-
- public val typename: String by meta.string(key = "_typename".asName()) {
- error("Type is not defined")
- }
-
- private fun resolve(builder: (Meta, DObjectCache) -> T, meta: Meta): T? {
- meta["\$ref"]?.int?.let { refId ->
- if (refCache.refStack.contains(refId)) {
- println("Circular reference $refId in stack ${refCache.refStack}")
- return null
- }
- return builder(refCache[refId], refCache.stack(refId))
- }
- return builder(meta, refCache)
- }
-
- internal fun tObjectArray(
- builder: (Meta, DObjectCache) -> T
- ): ReadOnlyProperty> = ReadOnlyProperty { _, property ->
- meta.getIndexed(Name.of(property.name, "arr")).values.mapNotNull {
- resolve(builder, it)
- }
- }
-
- internal fun dObject(
- builder: (Meta, DObjectCache) -> T,
- key: Name? = null
- ): ReadOnlyProperty = ReadOnlyProperty { _, property ->
- meta[key ?: property.name.asName()]?.let { resolve(builder, it) }
- }
-}
-
-public open class DNamed(meta: Meta, refCache: DObjectCache) : DObject(meta, refCache) {
- public val fName: String by meta.string("")
- public val fTitle: String by meta.string("")
-}
-
-public class DGeoMaterial(meta: Meta, refCache: DObjectCache) : DNamed(meta, refCache) {
-}
-
-public class DGeoMedium(meta: Meta, refCache: DObjectCache) : DNamed(meta, refCache) {
- public val fMaterial: DGeoMaterial? by dObject(::DGeoMaterial)
- public val fParams: DoubleArray by meta.doubleArray()
-}
-
-public class DGeoShape(meta: Meta, refCache: DObjectCache) : DNamed(meta, refCache) {
- public val fDX: Double by meta.double(0.0)
- public val fDY: Double by meta.double(0.0)
- public val fDZ: Double by meta.double(0.0)
-}
-
-public class DGeoVolume(meta: Meta, refCache: DObjectCache) : DNamed(meta, refCache), Named {
- public val fNodes: List by tObjectArray(::DGeoNode)
- public val fShape: DGeoShape? by dObject(::DGeoShape)
- public val fMedium: DGeoMedium? by dObject(::DGeoMedium)
-
- public val fFillColor: Int? by meta.int()
-
- override val name: Name by lazy { Name.parse(fName.ifEmpty { "volume[${meta.hashCode().toUInt()}]" }) }
-}
-
-public class DGeoNode(meta: Meta, refCache: DObjectCache) : DNamed(meta, refCache) {
- public val fVolume: DGeoVolume? by dObject(::DGeoVolume)
-}
-
-public open class DGeoMatrix(meta: Meta, refCache: DObjectCache) : DNamed(meta, refCache)
-
-public open class DGeoScale(meta: Meta, refCache: DObjectCache) : DGeoMatrix(meta, refCache) {
- public val fScale: DoubleArray by meta.doubleArray(1.0, 1.0, 1.0)
- public val x: Double get() = fScale[0]
- public val y: Double get() = fScale[1]
- public val z: Double get() = fScale[2]
-}
-
-
-public class DGeoBoolNode(meta: Meta, refCache: DObjectCache) : DObject(meta, refCache) {
- public val fLeft: DGeoShape? by dObject(::DGeoShape)
- public val fLeftMat: DGeoMatrix? by dObject(::DGeoMatrix)
-
- public val fRight: DGeoShape? by dObject(::DGeoShape)
- public val fRightMat: DGeoMatrix? by dObject(::DGeoMatrix)
-}
-
-
-public class DGeoManager(meta: Meta, refCache: DObjectCache) : DNamed(meta, refCache) {
- public val fMatrices: List by tObjectArray(::DGeoMatrix)
-
- public val fShapes: List by tObjectArray(::DGeoShape)
-
- public val fVolumes: List by tObjectArray(::DGeoVolume)
-
- public val fNodes: List by tObjectArray(::DGeoNode)
-
- public companion object {
-
- public fun parse(string: String): DGeoManager {
- val meta = Json.decodeFromString(MetaSerializer, string)
- val res = ArrayList(4096)
-
- fun fillCache(element: Meta) {
- if (element["\$ref"] == null) {
- res.add(element)
- element.items.values.forEach {
- if (!it.isLeaf) {
- fillCache(it)
- }
- }
- }
- }
-
- fillCache(meta)
-
- val refCache = DObjectCache(res)
- return DGeoManager(meta, refCache)
- }
- }
-}
diff --git a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/dRootToSolid.kt b/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/dRootToSolid.kt
deleted file mode 100644
index 7c345dd4..00000000
--- a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/dRootToSolid.kt
+++ /dev/null
@@ -1,362 +0,0 @@
-package ru.mipt.npm.root
-
-import space.kscience.dataforge.meta.*
-import space.kscience.dataforge.names.Name
-import space.kscience.dataforge.names.plus
-import space.kscience.dataforge.values.doubleArray
-import space.kscience.visionforge.isEmpty
-import space.kscience.visionforge.solid.*
-import space.kscience.visionforge.solid.SolidMaterial.Companion.MATERIAL_COLOR_KEY
-import kotlin.math.*
-
-private val volumesName = Name.EMPTY //"volumes".asName()
-
-private operator fun Number.times(d: Double) = toDouble() * d
-
-private operator fun Number.times(f: Float) = toFloat() * f
-
-private fun degToRad(d: Double) = d * PI / 180.0
-
-private data class RootToSolidContext(
- val prototypeHolder: PrototypeHolder,
- val currentLayer: Int = 0,
- val maxLayer: Int = 5
-)
-
-// converting to XYZ to Tait–Bryan angles according to https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix
-private fun Solid.rotate(rot: DoubleArray) {
- val xAngle = atan2(-rot[5], rot[8])
- val yAngle = atan2(rot[2], sqrt(1.0 - rot[2].pow(2)))
- val zAngle = atan2(-rot[1], rot[0])
- rotation = Point3D(xAngle, yAngle, zAngle)
-}
-
-private fun Solid.translate(trans: DoubleArray) {
- val (x, y, z) = trans
- position = Point3D(x, y, z)
-}
-
-private fun Solid.useMatrix(matrix: DGeoMatrix?) {
- if (matrix == null) return
- when (matrix.typename) {
- "TGeoIdentity" -> {
- //do nothing
- }
- "TGeoTranslation" -> {
- val fTranslation by matrix.meta.doubleArray()
- translate(fTranslation)
- }
- "TGeoRotation" -> {
- val fRotationMatrix by matrix.meta.doubleArray()
- rotate(fRotationMatrix)
- }
- "TGeoCombiTrans" -> {
- val fTranslation by matrix.meta.doubleArray()
-
- translate(fTranslation)
- matrix.meta["fRotation.fRotationMatrix"]?.value?.let {
- rotate(it.doubleArray)
- }
- }
- "TGeoHMatrix" -> {
- val fTranslation by matrix.meta.doubleArray()
- val fRotationMatrix by matrix.meta.doubleArray()
- val fScale by matrix.meta.doubleArray()
- translate(fTranslation)
- rotate(fRotationMatrix)
- scale = Point3D(fScale[0], fScale[1], fScale[2])
- }
- }
-}
-
-private fun SolidGroup.addShape(
- shape: DGeoShape,
- context: RootToSolidContext,
- name: String? = shape.fName.ifEmpty { null },
- block: Solid.() -> Unit = {}
-) {
- when (shape.typename) {
- "TGeoCompositeShape" -> {
- val fNode: DGeoBoolNode? by shape.dObject(::DGeoBoolNode)
- val node = fNode ?: error("Composite shape node not resolved")
- val compositeType = when (node.typename) {
- "TGeoIntersection" -> CompositeType.INTERSECT
- "TGeoSubtraction" -> CompositeType.SUBTRACT
- "TGeoUnion" -> CompositeType.GROUP
- else -> error("Unknown bool node type ${node.typename}")
- }
- smartComposite(compositeType, name = name) {
- addShape(node.fLeft!!, context, null) {
- this.useMatrix(node.fLeftMat)
- }
- addShape(node.fRight!!, context, null) {
- this.useMatrix(node.fRightMat)
- }
- }.apply(block)
- }
- "TGeoXtru" -> {
- val fNvert by shape.meta.int(0)
- val fX by shape.meta.doubleArray()
- val fY by shape.meta.doubleArray()
- val fNz by shape.meta.int(0)
- val fZ by shape.meta.doubleArray()
- val fX0 by shape.meta.doubleArray()
- val fY0 by shape.meta.doubleArray()
- val fScale by shape.meta.doubleArray()
-
- extruded(name = name) {
- (0 until fNvert).forEach { index ->
- shape {
- point(fX[index], fY[index])
- }
- }
-
- (0 until fNz).forEach { index ->
- layer(
- fZ[index],
- fX0[index],
- fY0[index],
- fScale[index]
- )
- }
- }.apply(block)
- }
- "TGeoTube" -> {
- val fRmax by shape.meta.double(0.0)
- val fDz by shape.meta.double(0.0)
- val fRmin by shape.meta.double(0.0)
-
- tube(
- radius = fRmax,
- height = fDz * 2,
- innerRadius = fRmin,
- name = name,
- block = block
- )
- }
- "TGeoTubeSeg" -> {
- val fRmax by shape.meta.double(0.0)
- val fDz by shape.meta.double(0.0)
- val fRmin by shape.meta.double(0.0)
- val fPhi1 by shape.meta.double(0.0)
- val fPhi2 by shape.meta.double(0.0)
-
- tube(
- radius = fRmax,
- height = fDz * 2,
- innerRadius = fRmin,
- startAngle = degToRad(fPhi1),
- angle = degToRad(fPhi2 - fPhi1),
- name = name,
- block = block
- )
- }
- "TGeoPcon" -> {
- val fDphi by shape.meta.double(0.0)
- val fNz by shape.meta.int(2)
- val fPhi1 by shape.meta.double(360.0)
- val fRmax by shape.meta.doubleArray()
- val fRmin by shape.meta.doubleArray()
- val fZ by shape.meta.doubleArray()
- if (fNz == 2) {
- coneSurface(
- bottomOuterRadius = fRmax[0],
- bottomInnerRadius = fRmin[0],
- height = fZ[1] - fZ[0],
- topOuterRadius = fRmax[1],
- topInnerRadius = fRmin[1],
- startAngle = degToRad(fPhi1),
- angle = degToRad(fDphi),
- name = name,
- ) {
- z = (fZ[1] + fZ[0]) / 2
-
- }.apply(block)
- } else {
- TODO()
- }
- }
- "TGeoPgon" -> {
- //TODO add a inner polygone layer
- val fDphi by shape.meta.double(0.0)
- val fNz by shape.meta.int(2)
- val fPhi1 by shape.meta.double(360.0)
- val fRmax by shape.meta.doubleArray()
- val fRmin by shape.meta.doubleArray()
- val fZ by shape.meta.doubleArray()
-
- val fNedges by shape.meta.int(1)
-
- val startphi = degToRad(fPhi1)
- val deltaphi = degToRad(fDphi)
-
- extruded(name) {
- //getting the radius of first
- require(fNz > 1) { "The polyhedron geometry requires at least two planes" }
- val baseRadius = fRmax[0]
- shape {
- (0..fNedges).forEach {
- val phi = deltaphi * fNedges * it + startphi
- (baseRadius * cos(phi) to baseRadius * sin(phi))
- }
- }
- (0 until fNz).forEach { index ->
- //scaling all radii relative to first layer radius
- layer(fZ[index], scale = fRmax[index] / baseRadius)
- }
- }.apply(block)
- }
- "TGeoShapeAssembly" -> {
- val fVolume by shape.dObject(::DGeoVolume)
- fVolume?.let { volume ->
- addRootVolume(volume, context, block = block)
- }
- }
- "TGeoBBox" -> {
- box(shape.fDX * 2, shape.fDY * 2, shape.fDZ * 2, name = name, block = block)
- }
- "TGeoTrap" -> {
- val fTheta by shape.meta.double(0.0)
- val fPhi by shape.meta.double(0.0)
- val fAlpha1 by shape.meta.double(0.0)
- val fAlpha2 by shape.meta.double(0.0)
- if (fAlpha1 != 0.0 || fAlpha2 != 0.0 || fTheta != 0.0 || fPhi != 0.0) {
- TODO("Angled trapezoid not implemented")
- }
- val fH1 by shape.meta.double(0.0)
- val fBl1 by shape.meta.double(0.0)
- val fTl1 by shape.meta.double(0.0)
- val fH2 by shape.meta.double(0.0)
- val fBl2 by shape.meta.double(0.0)
- val fTl2 by shape.meta.double(0.0)
-
- val fDz by shape.meta.double(0.0)
- //TODO check proper node order
- val node1 = Point3D(-fBl1, -fH1, -fDz)
- val node2 = Point3D(fBl1, -fH1, -fDz)
- val node3 = Point3D(fTl1, fH1, -fDz)
- val node4 = Point3D(-fTl1, fH1, -fDz)
- val node5 = Point3D(-fBl2, -fH2, fDz)
- val node6 = Point3D(fBl2, -fH2, fDz)
- val node7 = Point3D(fTl2, fH2, fDz)
- val node8 = Point3D(-fTl2, fH2, fDz)
- hexagon(node1, node2, node3, node4, node5, node6, node7, node8, name)
- }
- "TGeoScaledShape" -> {
- val fShape by shape.dObject(::DGeoShape)
- val fScale by shape.dObject(::DGeoScale)
- fShape?.let { scaledShape ->
- group(name?.let { Name.parse(it) }) {
- scale = Point3D(fScale?.x ?: 1.0, fScale?.y ?: 1.0, fScale?.z ?: 1.0)
- addShape(scaledShape, context)
- apply(block)
- }
- }
- }
- else -> {
- TODO("A shape with type ${shape.typename} not implemented")
- }
- }
-}
-
-private fun SolidGroup.addRootNode(obj: DGeoNode, context: RootToSolidContext) {
- val volume = obj.fVolume ?: return
- addRootVolume(volume, context, obj.fName) {
- when (obj.typename) {
- "TGeoNodeMatrix" -> {
- val fMatrix by obj.dObject(::DGeoMatrix)
- this.useMatrix(fMatrix)
- }
- "TGeoNodeOffset" -> {
- val fOffset by obj.meta.double(0.0)
- x = fOffset
- }
- }
- }
-}
-
-private fun buildVolume(volume: DGeoVolume, context: RootToSolidContext): Solid? {
- val group = SolidGroup {
- //set current layer
- layer = context.currentLayer
- val nodes = volume.fNodes
-
- if (nodes.isEmpty() || context.currentLayer >= context.maxLayer) {
- //TODO add smart filter
- volume.fShape?.let { shape ->
- addShape(shape, context)
- }
- } else {
- val newLayer = if (nodes.size <= 2) {
- context.currentLayer
- } else if (nodes.size > 10) {
- context.currentLayer + 2
- } else {
- context.currentLayer + 1
- }
- val newContext = context.copy(currentLayer = newLayer)
- nodes.forEach { node ->
- //add children to the next layer
- addRootNode(node, newContext)
- }
- }
- }
- return if (group.isEmpty()) {
- null
- } else if (group.children.size == 1 && group.meta.isEmpty()) {
- (group.children.values.first() as Solid).apply { parent = null }
- } else {
- group
- }
-}
-
-//private val SolidGroup.rootPrototypes: SolidGroup get() = (parent as? SolidGroup)?.rootPrototypes ?: this
-
-private fun SolidGroup.addRootVolume(
- volume: DGeoVolume,
- context: RootToSolidContext,
- name: String? = null,
- cache: Boolean = true,
- block: Solid.() -> Unit = {}
-) {
- val combinedName = if (volume.fName.isEmpty()) {
- name
- } else if (name == null) {
- volume.fName
- } else {
- "${name}_${volume.fName}"
- }
-
- if (!cache) {
- val group = buildVolume(volume, context)?.apply {
- volume.fFillColor?.let {
- meta[MATERIAL_COLOR_KEY] = RootColors[it]
- }
- block()
- }
- set(combinedName?.let { Name.parse(it) }, group)
- } else {
- val templateName = volumesName + volume.name
- val existing = getPrototype(templateName)
- if (existing == null) {
- context.prototypeHolder.prototypes {
- val group = buildVolume(volume, context)
- set(templateName, group)
- }
- }
-
- ref(templateName, name).apply {
- volume.fFillColor?.let {
- meta[MATERIAL_COLOR_KEY] = RootColors[it]
- }
- block()
- }
- }
-}
-
-public fun DGeoManager.toSolid(): SolidGroup = SolidGroup {
- val context = RootToSolidContext(this)
- fNodes.forEach { node ->
- addRootNode(node, context)
- }
-}
\ No newline at end of file
diff --git a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/rootColor.kt b/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/rootColor.kt
deleted file mode 100644
index 9ea9c040..00000000
--- a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/rootColor.kt
+++ /dev/null
@@ -1,42 +0,0 @@
-package ru.mipt.npm.root
-
-public object RootColors {
- private val colorMap = Array(924) { "white" }
-
- //colorMap[110] = "white"
-
- private val moreCol = listOf(
- 11 to "c1b7ad4d4d4d6666668080809a9a9ab3b3b3cdcdcde6e6e6f3f3f3cdc8accdc8acc3c0a9bbb6a4b3a697b8a49cae9a8d9c8f83886657b1cfc885c3a48aa9a1839f8daebdc87b8f9a768a926983976e7b857d9ad280809caca6c0d4cf88dfbb88bd9f83c89a7dc08378cf5f61ac8f94a6787b946971d45a549300ff7b00ff6300ff4b00ff3300ff1b00ff0300ff0014ff002cff0044ff005cff0074ff008cff00a4ff00bcff00d4ff00ecff00fffd00ffe500ffcd00ffb500ff9d00ff8500ff6d00ff5500ff3d00ff2600ff0e0aff0022ff003aff0052ff006aff0082ff009aff00b1ff00c9ff00e1ff00f9ff00ffef00ffd700ffbf00ffa700ff8f00ff7700ff6000ff4800ff3000ff1800ff0000",
- 201 to "5c5c5c7b7b7bb8b8b8d7d7d78a0f0fb81414ec4848f176760f8a0f14b81448ec4876f1760f0f8a1414b84848ec7676f18a8a0fb8b814ecec48f1f1768a0f8ab814b8ec48ecf176f10f8a8a14b8b848ecec76f1f1",
- 390 to "ffffcdffff9acdcd9affff66cdcd669a9a66ffff33cdcd339a9a33666633ffff00cdcd009a9a00666600333300",
- 406 to "cdffcd9aff9a9acd9a66ff6666cd66669a6633ff3333cd33339a3333663300ff0000cd00009a00006600003300",
- 422 to "cdffff9affff9acdcd66ffff66cdcd669a9a33ffff33cdcd339a9a33666600ffff00cdcd009a9a006666003333",
- 590 to "cdcdff9a9aff9a9acd6666ff6666cd66669a3333ff3333cd33339a3333660000ff0000cd00009a000066000033",
- 606 to "ffcdffff9affcd9acdff66ffcd66cd9a669aff33ffcd33cd9a339a663366ff00ffcd00cd9a009a660066330033",
- 622 to "ffcdcdff9a9acd9a9aff6666cd66669a6666ff3333cd33339a3333663333ff0000cd00009a0000660000330000",
- 791 to "ffcd9acd9a669a66339a6600cd9a33ffcd66ff9a00ffcd33cd9a00ffcd00ff9a33cd66006633009a3300cd6633ff9a66ff6600ff6633cd3300ff33009aff3366cd00336600339a0066cd339aff6666ff0066ff3333cd0033ff00cdff9a9acd66669a33669a009acd33cdff669aff00cdff339acd00cdff009affcd66cd9a339a66009a6633cd9a66ffcd00ff6633ffcd00cd9a00ffcd33ff9a00cd66006633009a3333cd6666ff9a00ff9a33ff6600cd3300ff339acdff669acd33669a00339a3366cd669aff0066ff3366ff0033cd0033ff339aff0066cd00336600669a339acd66cdff009aff33cdff009acd00cdffcd9aff9a66cd66339a66009a9a33cdcd66ff9a00ffcd33ff9a00cdcd00ff9a33ff6600cd33006633009a6633cd9a66ff6600ff6633ff3300cd3300ffff339acd00666600339a0033cd3366ff669aff0066ff3366cd0033ff0033ff9acdcd669a9a33669a0066cd339aff66cdff009acd009aff33cdff009a",
- 920 to "cdcdcd9a9a9a666666333333"
- )
-
- init {
- colorMap[0] = "white"
- colorMap[1] = "black"
- colorMap[2] = "red"
- colorMap[3] = "green"
- colorMap[4] = "blue"
- colorMap[5] = "yellow"
- colorMap[6] = "magenta"
- colorMap[7] = "cyan"
- colorMap[8] = "rgb(89,212,84)"
- colorMap[9] = "rgb(89,84,217)"
- colorMap[10] = "white"
-
- moreCol.forEach { (n, s) ->
- for (i in 0 until (s.length / 6)) {
- colorMap[n + i] = "#" + s.substring(i * 6, (i + 1) * 6)
- }
- }
- }
-
- public operator fun get(index: Int): String = colorMap[index]
-}
\ No newline at end of file
diff --git a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TGeoManager.kt b/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TGeoManager.kt
deleted file mode 100644
index 59957364..00000000
--- a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TGeoManager.kt
+++ /dev/null
@@ -1,17 +0,0 @@
-package ru.mipt.npm.root.serialization
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-@SerialName("TGeoManager")
-public class TGeoManager : TNamed() {
-
- public val fMatrices: TObjArray = TObjArray.getEmpty()
-
- public val fShapes: TObjArray = TObjArray.getEmpty()
-
- public val fVolumes: TObjArray = TObjArray.getEmpty()
-
- public val fNodes: TObjArray = TObjArray.getEmpty()
-}
diff --git a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TGeoMaterial.kt b/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TGeoMaterial.kt
deleted file mode 100644
index e13d30b4..00000000
--- a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TGeoMaterial.kt
+++ /dev/null
@@ -1,12 +0,0 @@
-package ru.mipt.npm.root.serialization
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-@SerialName("TGeoMaterial")
-public open class TGeoMaterial: TNamed()
-
-@Serializable
-@SerialName("TGeoMixture")
-public class TGeoMixture: TGeoMaterial()
\ No newline at end of file
diff --git a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TGeoMatrix.kt b/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TGeoMatrix.kt
deleted file mode 100644
index 63ee38a7..00000000
--- a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TGeoMatrix.kt
+++ /dev/null
@@ -1,42 +0,0 @@
-package ru.mipt.npm.root.serialization
-
-import kotlinx.serialization.Contextual
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-
-@Serializable
-@SerialName("TGeoMatrix")
-public sealed class TGeoMatrix : TNamed()
-
-@Serializable
-@SerialName("TGeoIdentity")
-public class TGeoIdentity : TGeoMatrix()
-
-@Serializable
-@SerialName("TGeoHMatrix")
-public class TGeoHMatrix(
- public val fTranslation: DoubleArray,
- public val fRotationMatrix: DoubleArray,
- public val fScale: DoubleArray
-) : TGeoMatrix()
-
-@Serializable
-@SerialName("TGeoTranslation")
-public class TGeoTranslation(
- public val fTranslation: DoubleArray
-) : TGeoMatrix()
-
-@Serializable
-@SerialName("TGeoRotation")
-public class TGeoRotation(
- public val fRotationMatrix: DoubleArray
-) : TGeoMatrix()
-
-@Serializable
-@SerialName("TGeoCombiTrans")
-public class TGeoCombiTrans(
- public val fTranslation: DoubleArray,
- @Contextual
- public val fRotation: TGeoRotation? = null,
-) : TGeoMatrix()
\ No newline at end of file
diff --git a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TGeoMedium.kt b/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TGeoMedium.kt
deleted file mode 100644
index 630826e8..00000000
--- a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TGeoMedium.kt
+++ /dev/null
@@ -1,14 +0,0 @@
-package ru.mipt.npm.root.serialization
-
-import kotlinx.serialization.Contextual
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-@SerialName("TGeoMedium")
-public class TGeoMedium(
- public val fId: Int,
- @Contextual
- public val fMaterial: TGeoMaterial,
- public val fParams: DoubleArray
-) : TNamed()
\ No newline at end of file
diff --git a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TGeoNode.kt b/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TGeoNode.kt
deleted file mode 100644
index 1babbbfc..00000000
--- a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TGeoNode.kt
+++ /dev/null
@@ -1,34 +0,0 @@
-package ru.mipt.npm.root.serialization
-
-import kotlinx.serialization.Contextual
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-@SerialName("TGeoNode")
-public open class TGeoNode : TNamed() {
- public val fGeoAtt: UInt = 0u
-
- @Contextual
- public val fVolume: TGeoVolume? = null
-
-// @Contextual
-// public val fMother: TGeoVolume? = null
-
- public val fNumber: Int = 0
- public val fNovlp: Int = 0
- public val fOverlaps: IntArray = intArrayOf()
-}
-
-@Serializable
-@SerialName("TGeoNodeMatrix")
-public class TGeoNodeMatrix : TGeoNode() {
- @Contextual
- public val fMatrix: TGeoMatrix? = null
-}
-
-@Serializable
-@SerialName("TGeoNodeOffset")
-public class TGeoNodeOffset : TGeoNode() {
- public val fOffset: Double = 0.0
-}
\ No newline at end of file
diff --git a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TGeoShape.kt b/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TGeoShape.kt
deleted file mode 100644
index faf47121..00000000
--- a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TGeoShape.kt
+++ /dev/null
@@ -1,136 +0,0 @@
-package ru.mipt.npm.root.serialization
-
-import kotlinx.serialization.Contextual
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-import kotlin.math.PI
-
-@Serializable
-@SerialName("TGeoShape")
-public sealed class TGeoShape : TNamed() {
- public val fShapeBits: UInt = 0u
- public val fShapeId: Int = 0
-}
-
-@Serializable
-@SerialName("TGeoBBox")
-public open class TGeoBBox : TGeoShape() {
- public val fDX: Double = 0.0
- public val fDY: Double = 0.0
- public val fDZ: Double = 0.0
- public val fOrigin: DoubleArray = doubleArrayOf(0.0, 0.0, 0.0)
-}
-
-@Serializable
-@SerialName("TGeoBoolNode")
-public sealed class TGeoBoolNode : TObject() {
- @Contextual
- public abstract val fLeft: TGeoShape
-
- @Contextual
- public val fLeftMat: TGeoMatrix? = null
-
- @Contextual
- public abstract val fRight: TGeoShape
-
- @Contextual
- public val fRightMat: TGeoMatrix? = null
-}
-
-@Serializable
-@SerialName("TGeoUnion")
-public class TGeoUnion(
- @Contextual
- override val fLeft: TGeoShape,
- @Contextual
- override val fRight: TGeoShape,
-) : TGeoBoolNode()
-
-@Serializable
-@SerialName("TGeoSubtraction")
-public class TGeoSubtraction(
- @Contextual
- override val fLeft: TGeoShape,
- @Contextual
- override val fRight: TGeoShape,
-) : TGeoBoolNode()
-
-@Serializable
-@SerialName("TGeoIntersection")
-public class TGeoIntersection(
- @Contextual
- override val fLeft: TGeoShape,
- @Contextual
- override val fRight: TGeoShape,
-) : TGeoBoolNode()
-
-
-@Serializable
-@SerialName("TGeoCompositeShape")
-public class TGeoCompositeShape(public val fNode: TGeoBoolNode) : TGeoBBox()
-
-@Serializable
-@SerialName("TGeoXtru")
-public class TGeoXtru(
- public val fNvert: Int,
- public val fNz: Int,
- public val fZcurrent: Double,
- public val fX: DoubleArray,
- public val fY: DoubleArray,
- public val fZ: DoubleArray,
- public val fScale: DoubleArray,
- public val fX0: DoubleArray,
- public val fY0: DoubleArray
-) : TGeoBBox()
-
-
-@Serializable
-@SerialName("TGeoTube")
-public open class TGeoTube : TGeoBBox() {
- public val fRmin: Double = 0.0
- public val fRmax: Double = 0.0
- public val fDz: Double = 0.0
-}
-
-@Serializable
-@SerialName("TGeoTubeSeg")
-public class TGeoTubeSeg(
- public val fPhi1: Double,
- public val fPhi2: Double,
- public val fS1: Double,
- public val fC1: Double,
- public val fS2: Double,
- public val fC2: Double,
- public val fSm: Double,
- public val fCm: Double,
- public val fCdfi: Double,
-) : TGeoTube()
-
-@Serializable
-@SerialName("TGeoPcon")
-public open class TGeoPcon : TGeoBBox() {
- public val fNz: Int = 0 // number of z planes (at least two)
- public val fPhi1: Double = 0.0 // lower phi limit (converted to [0,2*pi)
- public val fDphi: Double = PI * 2 // phi range
- public val fRmin: DoubleArray = doubleArrayOf() //[fNz] pointer to array of inner radii
- public val fRmax: DoubleArray = doubleArrayOf() //[fNz] pointer to array of outer radii
- public val fZ: DoubleArray = doubleArrayOf() //[fNz] pointer to array of Z planes positions
-}
-
-@Serializable
-@SerialName("TGeoPgon")
-public open class TGeoPgon : TGeoPcon() {
- public val fNedges: Int = 0
-}
-
-@Serializable
-@SerialName("TGeoShapeAssembly")
-public class TGeoShapeAssembly(
- @Contextual
- public val fVolume: TGeoVolumeAssembly,
- public val fBBoxOK: Boolean = true
-) : TGeoBBox()
-
-public class TGeoShapeRef(provider: () -> TGeoShape) : TGeoShape() {
- public val value: TGeoShape by lazy(provider)
-}
\ No newline at end of file
diff --git a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TGeoVolume.kt b/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TGeoVolume.kt
deleted file mode 100644
index 77c99e54..00000000
--- a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TGeoVolume.kt
+++ /dev/null
@@ -1,41 +0,0 @@
-package ru.mipt.npm.root.serialization
-
-import kotlinx.serialization.Contextual
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-@SerialName("TGeoVolume")
-public open class TGeoVolume : TNamed() {
- public val fGeoAtt: UInt = 0u
- public val fLineColor: Int = 2
- public val fLineStyle: Int? = null
- public val fLineWidth: UInt = 1u
- public val fFillColor: Int? = null
- public val fFillStyle: Int? = null
-
- @Contextual
- public val fNodes: TObjArray<@Contextual TGeoNode>? = null
-
- @Contextual
- public val fShape: TGeoShape? = null
-
- @Contextual
- public val fMedium: TGeoMedium? = null
-
- public val fNumber: Int = 1
- public val fNtotal: Int = 1
- public val fRefCount: Int = 1
-}
-
-public class TGeoVolumeRef(provider: () -> TGeoVolume) : TGeoVolume() {
- public val value: TGeoVolume by lazy(provider)
-}
-
-@Serializable
-@SerialName("TGeoVolumeAssembly")
-public open class TGeoVolumeAssembly : TGeoVolume()
-
-public class TGeoVolumeAssemblyRef(provider: () -> TGeoVolumeAssembly) : TGeoVolumeAssembly() {
- public val value: TGeoVolumeAssembly by lazy(provider)
-}
\ No newline at end of file
diff --git a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TObject.kt b/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TObject.kt
deleted file mode 100644
index 644c05a4..00000000
--- a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/TObject.kt
+++ /dev/null
@@ -1,34 +0,0 @@
-package ru.mipt.npm.root.serialization
-
-import kotlinx.serialization.Contextual
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-public abstract class TObject {
- public val fUniqueID: UInt = 0u
- public val fBits: UInt = 0u
-}
-
-@Serializable
-public open class TNamed : TObject() {
- public val fName: String = ""
- public val fTitle: String = ""
-}
-
-
-@Serializable
-@SerialName("TObjArray")
-public class TObjArray(public val arr: List<@Contextual T>): TObject() {
- public companion object{
- public fun getEmpty(): TObjArray = TObjArray(emptyList())
- }
-}
-
-@Serializable
-@SerialName("TList")
-public class TList(public val arr: List<@Contextual TObject>): TObject()
-
-@Serializable
-@SerialName("THashList")
-public class THashList(public val arr: List<@Contextual TObject>): TObject()
\ No newline at end of file
diff --git a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/jsonToRoot.kt b/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/jsonToRoot.kt
deleted file mode 100644
index 5d338394..00000000
--- a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/jsonToRoot.kt
+++ /dev/null
@@ -1,236 +0,0 @@
-package ru.mipt.npm.root.serialization
-
-import kotlinx.serialization.DeserializationStrategy
-import kotlinx.serialization.ExperimentalSerializationApi
-import kotlinx.serialization.KSerializer
-import kotlinx.serialization.descriptors.SerialDescriptor
-import kotlinx.serialization.encoding.Decoder
-import kotlinx.serialization.json.*
-import kotlinx.serialization.modules.SerializersModule
-import kotlinx.serialization.modules.contextual
-import kotlinx.serialization.modules.polymorphic
-import kotlinx.serialization.modules.subclass
-
-
-private fun jsonRootDeserializer(
- tSerializer: KSerializer,
- builder: (JsonElement) -> T
-): DeserializationStrategy = object :
- DeserializationStrategy {
- private val jsonElementSerializer = JsonElement.serializer()
-
- override val descriptor: SerialDescriptor
- get() = jsonElementSerializer.descriptor
-
- override fun deserialize(decoder: Decoder): T {
- val json = decoder.decodeSerializableValue(jsonElementSerializer)
- return builder(json)
- }
-}
-
-/**
- * Load Json encoded TObject
- */
-public fun TObject.decodeFromJson(serializer: KSerializer, jsonElement: JsonElement): T =
- RootDecoder.decode(serializer, jsonElement)
-
-public fun TObject.decodeFromString(serializer: KSerializer, string: String): T {
- val json = Json.parseToJsonElement(string)
- return RootDecoder.decode(serializer, json)
-}
-
-private object RootDecoder {
-
- private class RootUnrefSerializer(
- private val tSerializer: KSerializer,
- private val refCache: List,
- ) : KSerializer by tSerializer {
-
- @Suppress("UNCHECKED_CAST")
- override fun deserialize(decoder: Decoder): T {
- val input = decoder as JsonDecoder
- val element = input.decodeJsonElement()
- val refId = (element as? JsonObject)?.get("\$ref")?.jsonPrimitive?.int
- val ref = if (refId != null) {
- println("Substituting ${tSerializer.descriptor.serialName} ref $refId")
- //Forward ref for shapes
- when (tSerializer.descriptor.serialName) {
- "TGeoShape" -> return TGeoShapeRef {
- refCache[refId].getOrPutValue {
- input.json.decodeFromJsonElement(tSerializer, it) as TGeoShape
- }
- } as T
-
- "TGeoVolumeAssembly" -> return TGeoVolumeAssemblyRef {
- refCache[refId].getOrPutValue {
- input.json.decodeFromJsonElement(tSerializer, it) as TGeoVolumeAssembly
- }
- } as T
-
- "TGeoVolume" -> return TGeoVolumeRef {
- refCache[refId].getOrPutValue {
- input.json.decodeFromJsonElement(tSerializer, it) as TGeoVolume
- }
- } as T
-
- //Do unref
- else -> refCache[refId]
- }
- } else {
- refCache.find { it.element == element } ?: error("Element '$element' not found in the cache")
- }
-
- return ref.getOrPutValue {
-// println("Decoding $it")
- val actualTypeName = it.jsonObject["_typename"]?.jsonPrimitive?.content
- input.json.decodeFromJsonElement(tSerializer, it)
- }
- }
- }
-
- private fun KSerializer.unref(refCache: List): KSerializer = RootUnrefSerializer(this, refCache)
-
- @OptIn(ExperimentalSerializationApi::class)
- fun unrefSerializersModule(
- refCache: List
- ): SerializersModule = SerializersModule {
-
- contextual(TObjArray::class) {
- TObjArray.serializer(it[0]).unref(refCache)
- }
-
- contextual(TGeoMedium.serializer().unref(refCache))
-
- polymorphic(TGeoBoolNode::class) {
- subclass(TGeoIntersection.serializer().unref(refCache))
- subclass(TGeoUnion.serializer().unref(refCache))
- subclass(TGeoSubtraction.serializer().unref(refCache))
- }
-
- polymorphic(TGeoShape::class) {
- subclass(TGeoBBox.serializer())
- subclass(TGeoXtru.serializer())
- subclass(TGeoTube.serializer())
- subclass(TGeoTubeSeg.serializer())
- subclass(TGeoPcon.serializer())
- subclass(TGeoPgon.serializer())
-
- subclass(TGeoCompositeShape.serializer().unref(refCache))
- subclass(TGeoShapeAssembly.serializer().unref(refCache))
-
- default {
- if (it == null) {
- TGeoShape.serializer().unref(refCache)
- } else {
- error("Unrecognized shape $it")
- }
- }
- }
-
- polymorphic(TGeoMatrix::class) {
- subclass(TGeoIdentity.serializer())
- subclass(TGeoHMatrix.serializer().unref(refCache))
- subclass(TGeoTranslation.serializer())
- subclass(TGeoRotation.serializer())
- subclass(TGeoCombiTrans.serializer().unref(refCache))
-
-
- val unrefed = TGeoMatrix.serializer().unref(refCache)
- default {
- if (it == null) {
- unrefed
- } else {
- error("Unrecognized matrix $it")
- }
- }
- }
-
- polymorphic(TGeoVolume::class, TGeoVolume.serializer().unref(refCache)) {
- subclass(TGeoVolumeAssembly.serializer().unref(refCache))
-
- val unrefed = TGeoVolume.serializer().unref(refCache)
- default {
- if (it == null) {
- unrefed
- } else {
- error("Unrecognized volume $it")
- }
- }
- }
-
- polymorphic(TGeoNode::class, TGeoNode.serializer().unref(refCache)) {
- subclass(TGeoNodeMatrix.serializer().unref(refCache))
- subclass(TGeoNodeOffset.serializer().unref(refCache))
-
- val unrefed = TGeoNode.serializer().unref(refCache)
- default {
- if (it == null) {
- unrefed
- } else {
- error("Unrecognized node $it")
- }
- }
- }
- }
-
- /**
- * Create an instance of Json with unfolding Root references. This instance could not be reused because of the cache.
- */
- private fun unrefJson(refCache: MutableList): Json = Json {
- encodeDefaults = true
- ignoreUnknownKeys = true
- classDiscriminator = "_typename"
- serializersModule = unrefSerializersModule(refCache)
- }
-
-
- fun decode(sourceDeserializer: KSerializer, source: JsonElement): T {
- val refCache = ArrayList()
-
- fun fillCache(element: JsonElement) {
- when (element) {
- is JsonObject -> {
- if (element["_typename"] != null) {
- refCache.add(RefEntry(element))
- }
- element.values.forEach {
- fillCache(it)
- }
- }
- is JsonArray -> {
- element.forEach {
- fillCache(it)
- }
- }
- else -> {
- //ignore primitives
- }
- }
- }
- fillCache(source)
-
- return unrefJson(refCache).decodeFromJsonElement(sourceDeserializer.unref(refCache), source)
- }
-
- class RefEntry(val element: JsonElement) {
-
- var value: Any? = null
-
- fun getOrPutValue(builder: (JsonElement) -> T): T {
- if (value == null) {
- value = builder(element)
- }
- return value as T
- }
-
- override fun toString(): String = element.toString()
- }
-
-// val json = Json {
-// encodeDefaults = true
-// ignoreUnknownKeys = true
-// classDiscriminator = "_typename"
-// serializersModule = this@RootDecoder.serializersModule
-// }
-
-}
\ No newline at end of file
diff --git a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/rootToSolid.kt b/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/rootToSolid.kt
deleted file mode 100644
index 117e51b3..00000000
--- a/cern-root-loader/src/commonMain/kotlin/ru/mipt/npm/root/serialization/rootToSolid.kt
+++ /dev/null
@@ -1,187 +0,0 @@
-package ru.mipt.npm.root.serialization
-
-import space.kscience.dataforge.names.Name
-import space.kscience.dataforge.names.asName
-import space.kscience.dataforge.names.plus
-import space.kscience.visionforge.solid.*
-import kotlin.math.PI
-import kotlin.math.atan2
-import kotlin.math.pow
-import kotlin.math.sqrt
-
-
-private val solidsName = "solids".asName()
-private val volumesName = "volumes".asName()
-
-private operator fun Number.times(d: Double) = toDouble() * d
-
-private operator fun Number.times(f: Float) = toFloat() * f
-
-private fun degToRad(d: Double) = d * PI / 180.0
-
-// converting to XYZ to Tait–Bryan angles according to https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix
-private fun Solid.rotate(rot: DoubleArray) {
- val xAngle = atan2(-rot[5], rot[8])
- val yAngle = atan2(rot[2], sqrt(1.0 - rot[2].pow(2)))
- val zAngle = atan2(-rot[1], rot[0])
- rotation = Point3D(xAngle, yAngle, zAngle)
-}
-
-private fun Solid.translate(trans: DoubleArray) {
- val (x, y, z) = trans
- position = Point3D(x, y, z)
-}
-
-private fun Solid.useMatrix(matrix: TGeoMatrix?) {
- when (matrix) {
- null, is TGeoIdentity -> {
- //do nothing
- }
- is TGeoTranslation -> {
- translate(matrix.fTranslation)
- }
- is TGeoRotation -> {
- rotate(matrix.fRotationMatrix)
- }
- is TGeoCombiTrans -> {
- translate(matrix.fTranslation)
- matrix.fRotation?.let { rotate(it.fRotationMatrix) }
- }
- is TGeoHMatrix -> {
- translate(matrix.fTranslation)
- rotate(matrix.fRotationMatrix)
- val (xScale, yScale, zScale) = matrix.fScale
- scale = Point3D(xScale, yScale, zScale)
- }
- }
-}
-
-private fun SolidGroup.addShape(shape: TGeoShape) {
- when (shape) {
- is TGeoShapeRef -> addShape(shape.value)
- is TGeoCompositeShape -> {
- val bool: TGeoBoolNode = shape.fNode
- val compositeType = when (bool) {
- is TGeoIntersection -> CompositeType.INTERSECT
- is TGeoSubtraction -> CompositeType.SUBTRACT
- is TGeoUnion -> CompositeType.UNION
- }
- composite(compositeType, name = shape.fName) {
- addShape(bool.fLeft).apply {
- useMatrix(bool.fLeftMat)
- }
- addShape(bool.fRight).apply {
- useMatrix(bool.fRightMat)
- }
- }
- }
- is TGeoXtru -> extruded(name = shape.fName) {
-
- (0 until shape.fNvert).forEach { index ->
- shape {
- point(shape.fX[index], shape.fY[index])
- }
- }
-
- (0 until shape.fNz).forEach { index ->
- layer(
- shape.fZ[index],
- shape.fX0[index],
- shape.fY0[index],
- shape.fScale[index]
- )
- }
- }
- is TGeoTube -> tube(
- radius = shape.fRmax,
- height = shape.fDz * 2,
- innerRadius = shape.fRmin,
- name = shape.fName
- )
- is TGeoTubeSeg -> tube(
- radius = shape.fRmax,
- height = shape.fDz * 2,
- innerRadius = shape.fRmin,
- startAngle = degToRad(shape.fPhi1),
- angle = degToRad(shape.fPhi2 - shape.fPhi1),
- name = shape.fName
- )
- is TGeoPcon -> TODO()
- is TGeoPgon -> TODO()
- is TGeoShapeAssembly -> volume(shape.fVolume)
- is TGeoBBox -> box(shape.fDX * 2, shape.fDY * 2, shape.fDZ * 2, name = shape.fName)
- }
-}
-
-private fun SolidGroup.node(obj: TGeoNode) {
- if (obj.fVolume != null) {
- volume(obj.fVolume, obj.fName).apply {
- when (obj) {
- is TGeoNodeMatrix -> {
- useMatrix(obj.fMatrix)
- }
- is TGeoNodeOffset -> {
- x = obj.fOffset
- }
- }
- }
- }
-}
-
-private fun buildGroup(volume: TGeoVolume): SolidGroup {
- return if (volume is TGeoVolumeAssemblyRef) {
- buildGroup(volume.value)
- } else {
- SolidGroup {
- volume.fShape?.let { addShape(it) }
- volume.fNodes?.let {
- it.arr.forEach { obj ->
- node(obj)
- }
- }
- }
- }
-}
-
-private val SolidGroup.rootPrototypes: SolidGroup get() = (parent as? SolidGroup)?.rootPrototypes ?: this
-
-private fun SolidGroup.volume(volume: TGeoVolume, name: String? = null, cache: Boolean = true): Solid {
- val group = buildGroup(volume)
- val combinedName = if (volume.fName.isEmpty()) {
- name
- } else if (name == null) {
- volume.fName
- } else {
- "${name}_${volume.fName}"
- }
- return if (!cache) {
- group
- } else newRef(
- name = combinedName,
- obj = group,
- prototypeHolder = rootPrototypes,
- templateName = volumesName + Name.parse(combinedName ?: "volume[${group.hashCode()}]")
- )
-}
-
-// private fun load(geo: TGeoManager): SolidGroup {
-//// /**
-//// * A special group for local templates
-//// */
-//// val proto = SolidGroup()
-////
-//// val solids = proto.group(solidsName) {
-//// setPropertyNode("edges.enabled", false)
-//// }
-////
-//// val volumes = proto.group(volumesName)
-////
-//// val referenceStore = HashMap>()
-// }
-
-
-public fun TGeoManager.toSolid(): SolidGroup = SolidGroup {
- fNodes.arr.forEach {
- node(it)
- }
-}
\ No newline at end of file
diff --git a/demo/README.md b/demo/README.md
deleted file mode 100644
index e2a13c47..00000000
--- a/demo/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# Module demo
-
-
-
diff --git a/demo/build.gradle.kts b/demo/build.gradle.kts
new file mode 100644
index 00000000..e69de29b
diff --git a/demo/gdml/README.md b/demo/gdml/README.md
index b9de634c..3c6d1482 100644
--- a/demo/gdml/README.md
+++ b/demo/gdml/README.md
@@ -1,4 +1,14 @@
-# Module gdml
+### GDML Example
+Visualization example for geometry defined as GDML file.
+##### Building project
+
+To build the app, run `demo/gdml/Tasks/kotlin browser/jsBrowserDistribution` Gradle task, then
+drag-and-drop GDML file to the window to see visualization. For an example file, you can use
+`demo/gdml/src/jsMain/resources/cubes.gdml`.
+
+##### Example view:
+
+![](../../docs/images/gdml-demo.png)
diff --git a/demo/gdml/api/gdml.api b/demo/gdml/api/gdml.api
deleted file mode 100644
index 480385c3..00000000
--- a/demo/gdml/api/gdml.api
+++ /dev/null
@@ -1,27 +0,0 @@
-public final class space/kscience/visionforge/gdml/demo/GDMLDemoApp : tornadofx/App {
- public fun ()V
-}
-
-public final class space/kscience/visionforge/gdml/demo/GDMLView : tornadofx/View {
- public static final field Companion Lspace/kscience/visionforge/gdml/demo/GDMLView$Companion;
- public fun ()V
- public fun getRoot ()Ljavafx/scene/Parent;
-}
-
-public final class space/kscience/visionforge/gdml/demo/GDMLView$Companion {
-}
-
-public final class space/kscience/visionforge/gdml/demo/GdmlFxDemoAppKt {
- public static final fun main ()V
- public static synthetic fun main ([Ljava/lang/String;)V
-}
-
-public final class space/kscience/visionforge/gdml/demo/ReadFileKt {
- public static final fun readFile (Lspace/kscience/visionforge/VisionManager;Ljava/io/File;)Lspace/kscience/visionforge/Vision;
- public static final fun readFile (Lspace/kscience/visionforge/VisionManager;Ljava/lang/String;)Lspace/kscience/visionforge/Vision;
-}
-
-public final class space/kscience/visionforge/gdml/demo/SaveToJsonKt {
- public static final fun main ([Ljava/lang/String;)V
-}
-
diff --git a/demo/gdml/build.gradle.kts b/demo/gdml/build.gradle.kts
index a6c3fb0a..c16fce83 100644
--- a/demo/gdml/build.gradle.kts
+++ b/demo/gdml/build.gradle.kts
@@ -1,29 +1,23 @@
-import ru.mipt.npm.gradle.DependencyConfiguration
-import ru.mipt.npm.gradle.FXModule
+import scientifik.DependencyConfiguration
+import scientifik.FXModule
+import scientifik.useFx
plugins {
- id("ru.mipt.npm.gradle.mpp")
- application
+ id("scientifik.mpp")
+ id("application")
}
-kscience {
- val fxVersion: String by rootProject.extra
- useFx(FXModule.CONTROLS, version = fxVersion, configuration = DependencyConfiguration.IMPLEMENTATION)
- application()
-}
+val fxVersion: String by rootProject.extra
+useFx(FXModule.CONTROLS, version = fxVersion, configuration = DependencyConfiguration.IMPLEMENTATION)
kotlin {
+
jvm {
withJava()
}
js {
useCommonJs()
- browser {
- commonWebpackConfig {
- cssSupport.enabled = false
- }
- }
}
sourceSets {
@@ -33,16 +27,9 @@ kotlin {
implementation(project(":visionforge-gdml"))
}
}
- jvmMain {
+ jsMain{
dependencies {
- implementation(project(":visionforge-fx"))
- implementation("ch.qos.logback:logback-classic:1.2.5")
- }
- }
- jsMain {
- dependencies {
- implementation(project(":ui:ring"))
- implementation(project(":visionforge-threejs"))
+ implementation(project(":ui:bootstrap"))
implementation(npm("react-file-drop", "3.0.6"))
}
}
@@ -50,11 +37,11 @@ kotlin {
}
application {
- mainClass.set("space.kscience.visionforge.gdml.demo.GdmlFxDemoAppKt")
+ mainClassName = "hep.dataforge.vision.gdml.demo.GDMLDemoAppKt"
}
val convertGdmlToJson by tasks.creating(JavaExec::class) {
group = "application"
classpath = sourceSets["main"].runtimeClasspath
- mainClass.set("space.kscience.dataforge.vis.spatial.gdml.demo.SaveToJsonKt")
+ main = "hep.dataforge.vis.spatial.gdml.demo.SaveToJsonKt"
}
\ No newline at end of file
diff --git a/demo/gdml/src/commonMain/kotlin/hep/dataforge/vision/gdml/demo/cubes.kt b/demo/gdml/src/commonMain/kotlin/hep/dataforge/vision/gdml/demo/cubes.kt
new file mode 100644
index 00000000..e0666f2a
--- /dev/null
+++ b/demo/gdml/src/commonMain/kotlin/hep/dataforge/vision/gdml/demo/cubes.kt
@@ -0,0 +1,54 @@
+package hep.dataforge.vision.gdml.demo
+
+import scientifik.gdml.*
+
+
+fun cubes(): GDML = GDML {
+ val center = define.position("center")
+ structure {
+ val air = ref("G4_AIR")
+ val tubeMaterial = ref("tube")
+ val boxMaterial = ref("box")
+ val segment = solids.tube("segment", 20, 5.0) {
+ rmin = 17
+ deltaphi = 60
+ aunit = AUnit.DEG.title
+ }
+ val worldBox = solids.box("LargeBox", 200, 200, 200)
+ val smallBox = solids.box("smallBox", 30, 30, 30)
+ val segmentVolume = volume("segment", tubeMaterial, segment.ref()) {}
+ val circle = volume("composite", boxMaterial, smallBox.ref()) {
+ for (i in 0 until 6) {
+ physVolume(segmentVolume) {
+ name = "segment$i"
+ positionref = center.ref()
+ rotation {
+ z = 60 * i
+ unit = AUnit.DEG.title
+ }
+ }
+ }
+ }
+ world = volume("world", air, worldBox.ref()) {
+ for (i in 0 until 3) {
+ for (j in 0 until 3) {
+ for (k in 0 until 3) {
+ physVolume(circle) {
+ name = "composite$i$j$k"
+ position {
+ x = (-50 + i * 50)
+ y = (-50 + j * 50)
+ z = (-50 + k * 50)
+ }
+ rotation {
+ x = i * 120
+ y = j * 120
+ z = 120 * k
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/demo/gdml/src/commonTest/kotlin/hep/dataforge/vision/gdml/GDMLVisualTest.kt b/demo/gdml/src/commonTest/kotlin/hep/dataforge/vision/gdml/GDMLVisualTest.kt
new file mode 100644
index 00000000..ed3710e3
--- /dev/null
+++ b/demo/gdml/src/commonTest/kotlin/hep/dataforge/vision/gdml/GDMLVisualTest.kt
@@ -0,0 +1,20 @@
+package hep.dataforge.vision.gdml
+
+import hep.dataforge.meta.setItem
+import hep.dataforge.meta.string
+import hep.dataforge.names.toName
+import hep.dataforge.values.asValue
+import hep.dataforge.vision.gdml.demo.cubes
+import hep.dataforge.vision.solid.SolidMaterial
+import kotlin.test.Test
+import kotlin.test.assertEquals
+
+class GDMLVisualTest {
+ @Test
+ fun testPrototypeProperty() {
+ val gdml = cubes()
+ val visual = gdml.toVision()
+ visual["composite000.segment0".toName()]?.setItem(SolidMaterial.MATERIAL_COLOR_KEY, "red".asValue())
+ assertEquals("red", visual["composite000.segment0".toName()]?.getItem(SolidMaterial.MATERIAL_COLOR_KEY).string)
+ }
+}
\ No newline at end of file
diff --git a/demo/gdml/src/commonTest/kotlin/space/kscience/visionforge/gdml/GDMLVisionTest.kt b/demo/gdml/src/commonTest/kotlin/space/kscience/visionforge/gdml/GDMLVisionTest.kt
deleted file mode 100644
index 12918532..00000000
--- a/demo/gdml/src/commonTest/kotlin/space/kscience/visionforge/gdml/GDMLVisionTest.kt
+++ /dev/null
@@ -1,41 +0,0 @@
-package space.kscience.visionforge.gdml
-
-import space.kscience.dataforge.names.Name
-import space.kscience.dataforge.values.asValue
-import space.kscience.dataforge.values.string
-import space.kscience.gdml.GdmlShowCase
-import space.kscience.visionforge.Vision
-import space.kscience.visionforge.computeProperties
-import space.kscience.visionforge.get
-import space.kscience.visionforge.setProperty
-import space.kscience.visionforge.solid.Solid
-import space.kscience.visionforge.solid.SolidMaterial
-import space.kscience.visionforge.solid.material
-import kotlin.test.Test
-import kotlin.test.assertEquals
-import kotlin.test.assertNotNull
-
-class GDMLVisionTest {
- private val cubes = GdmlShowCase.cubes().toVision()
-
- @Test
- fun testCubesStyles(){
- val segment = cubes["composite-000.segment-0"] as Solid
- println(segment.computeProperties().getValue(Vision.STYLE_KEY))
-// println(segment.computePropertyNode(SolidMaterial.MATERIAL_KEY))
-// println(segment.computeProperty(SolidMaterial.MATERIAL_COLOR_KEY))
-
- println(segment.material?.meta)
-
- //println(Solids.encodeToString(cubes))
- }
-
-
- @Test
- fun testPrototypeProperty() {
- val child = cubes[Name.of("composite-000","segment-0")]
- assertNotNull(child)
- child.setProperty(SolidMaterial.MATERIAL_COLOR_KEY, "red".asValue())
- assertEquals("red", child.getPropertyValue(SolidMaterial.MATERIAL_COLOR_KEY)?.string)
- }
-}
\ No newline at end of file
diff --git a/demo/gdml/src/jsMain/kotlin/drop/FileDrop.kt b/demo/gdml/src/jsMain/kotlin/drop/FileDrop.kt
index 635c4580..2799eead 100644
--- a/demo/gdml/src/jsMain/kotlin/drop/FileDrop.kt
+++ b/demo/gdml/src/jsMain/kotlin/drop/FileDrop.kt
@@ -5,9 +5,7 @@ package drop
import org.w3c.dom.DragEvent
import org.w3c.files.FileList
-import react.Component
-import react.Props
-import react.State
+import react.*
external enum class DropEffects {
copy,
@@ -16,7 +14,7 @@ external enum class DropEffects {
none
}
-external interface FileDropProps: Props {
+external interface FileDropProps: RProps {
var className: String?
var targetClassName: String?
var draggingOverFrameClassName: String?
@@ -32,7 +30,7 @@ external interface FileDropProps: Props {
var dropEffect: DropEffects?
}
-external interface FileDropState: State {
+external interface FileDropState: RState {
var draggingOverFrame: Boolean
var draggingOverTarget: Boolean
}
diff --git a/demo/gdml/src/jsMain/kotlin/hep/dataforge/vision/gdml/demo/GDMLAppComponent.kt b/demo/gdml/src/jsMain/kotlin/hep/dataforge/vision/gdml/demo/GDMLAppComponent.kt
new file mode 100644
index 00000000..ee788190
--- /dev/null
+++ b/demo/gdml/src/jsMain/kotlin/hep/dataforge/vision/gdml/demo/GDMLAppComponent.kt
@@ -0,0 +1,154 @@
+package hep.dataforge.vision.gdml.demo
+
+import hep.dataforge.context.Context
+import hep.dataforge.names.Name
+import hep.dataforge.names.isEmpty
+import hep.dataforge.vision.Vision
+import hep.dataforge.vision.VisionGroup
+import hep.dataforge.vision.bootstrap.*
+import hep.dataforge.vision.gdml.toVision
+import hep.dataforge.vision.react.component
+import hep.dataforge.vision.react.configEditor
+import hep.dataforge.vision.react.flexColumn
+import hep.dataforge.vision.react.state
+import hep.dataforge.vision.solid.Solid
+import hep.dataforge.vision.solid.SolidGroup
+import hep.dataforge.vision.solid.specifications.Camera
+import hep.dataforge.vision.solid.specifications.Canvas3DOptions
+import hep.dataforge.vision.solid.three.ThreeCanvas
+import hep.dataforge.vision.solid.three.ThreeCanvasComponent
+import hep.dataforge.vision.solid.three.canvasControls
+import kotlinx.css.FlexBasis
+import kotlinx.css.Overflow
+import kotlinx.css.flex
+import kotlinx.css.overflow
+import org.w3c.files.FileReader
+import org.w3c.files.get
+import react.RProps
+import react.dom.h1
+import scientifik.gdml.GDML
+import scientifik.gdml.parse
+import styled.css
+import styled.styledDiv
+import kotlin.browser.window
+import kotlin.math.PI
+
+interface GDMLAppProps : RProps {
+ var context: Context
+ var rootObject: Vision?
+ var selected: Name?
+}
+
+private val canvasConfig = Canvas3DOptions {
+ camera = Camera {
+ distance = 2100.0
+ latitude = PI / 6
+ azimuth = PI + PI / 6
+ }
+}
+
+val GDMLApp = component { props ->
+ var selected by state { props.selected }
+ var canvas: ThreeCanvas? by state { null }
+ var visual: Vision? by state { props.rootObject }
+
+ val select: (Name?) -> Unit = {
+ selected = it
+ }
+
+ fun loadData(name: String, data: String) {
+ visual = when {
+ name.endsWith(".gdml") || name.endsWith(".xml") -> {
+ val gdml = GDML.parse(data)
+ gdml.toVision(gdmlConfiguration)
+ }
+ name.endsWith(".json") -> SolidGroup.parseJson(data)
+ else -> {
+ window.alert("File extension is not recognized: $name")
+ error("File extension is not recognized: $name")
+ }
+ }
+ }
+
+ flexColumn {
+ css {
+ flex(1.0, 1.0, FlexBasis.auto)
+ }
+ h1 { +"GDML/JSON loader demo" }
+ styledDiv {
+ css {
+ classes.add("row")
+ classes.add("p-1")
+ overflow = Overflow.auto
+ }
+ gridColumn(3, maxSize= GridMaxSize.XL, classes = "order-2 order-xl-1") {
+ card("Load data") {
+ fileDrop("(drag file here)") { files ->
+ val file = files?.get(0)
+ if (file != null) {
+
+ FileReader().apply {
+ onload = {
+ val string = result as String
+ loadData(file.name, string)
+ }
+ readAsText(file)
+ }
+ }
+ }
+ }
+ //tree
+ card("Object tree", "overflow-auto") {
+ visual?.let {
+ objectTree(it, selected, select)
+ }
+ }
+ }
+
+ gridColumn(6, maxSize= GridMaxSize.XL, classes = "order-1 order-xl-2") {
+ //canvas
+ (visual as? Solid)?.let { visual3D ->
+ child(ThreeCanvasComponent::class) {
+ attrs {
+ this.context = props.context
+ this.obj = visual3D
+ this.selected = selected
+ this.clickCallback = select
+ this.canvasCallback = {
+ canvas = it
+ }
+ }
+ }
+ }
+ }
+ gridColumn(3, maxSize= GridMaxSize.XL, classes = "order-3") {
+ container {
+ //settings
+ canvas?.let {
+ card("Canvas configuration") {
+ canvasControls(it)
+ }
+ }
+ }
+ container {
+ namecrumbs(selected, "World") { selected = it }
+ }
+ container {
+ //properties
+ card("Properties") {
+ selected.let { selected ->
+ val selectedObject: Vision? = when {
+ selected == null -> null
+ selected.isEmpty() -> visual
+ else -> (visual as? VisionGroup)?.get(selected)
+ }
+ if (selectedObject != null) {
+ configEditor(selectedObject, default = selectedObject.getAllProperties(), key = selected)
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/demo/gdml/src/jsMain/kotlin/hep/dataforge/vision/gdml/demo/GDMLDemoApp.kt b/demo/gdml/src/jsMain/kotlin/hep/dataforge/vision/gdml/demo/GDMLDemoApp.kt
new file mode 100644
index 00000000..56b9fecd
--- /dev/null
+++ b/demo/gdml/src/jsMain/kotlin/hep/dataforge/vision/gdml/demo/GDMLDemoApp.kt
@@ -0,0 +1,86 @@
+package hep.dataforge.vision.gdml.demo
+
+import hep.dataforge.context.Global
+import hep.dataforge.js.Application
+import hep.dataforge.js.startApplication
+import hep.dataforge.vision.gdml.GDMLTransformer
+import hep.dataforge.vision.gdml.LUnit
+import hep.dataforge.vision.gdml.toVision
+import hep.dataforge.vision.solid.SolidMaterial.Companion.MATERIAL_OPACITY_KEY
+import kotlinx.css.*
+import react.child
+import react.dom.render
+import styled.injectGlobal
+import kotlin.browser.document
+
+
+val gdmlConfiguration: GDMLTransformer.() -> Unit = {
+ lUnit = LUnit.CM
+ volumeAction = { volume ->
+ when {
+ volume.name.startsWith("ecal01lay") -> GDMLTransformer.Action.REJECT
+ volume.name.startsWith("UPBL") -> GDMLTransformer.Action.REJECT
+ volume.name.startsWith("USCL") -> GDMLTransformer.Action.REJECT
+ volume.name.startsWith("VPBL") -> GDMLTransformer.Action.REJECT
+ volume.name.startsWith("VSCL") -> GDMLTransformer.Action.REJECT
+ else -> GDMLTransformer.Action.CACHE
+ }
+ }
+
+ solidConfiguration = { parent, solid ->
+ if (
+ solid.name.startsWith("Yoke")
+ || solid.name.startsWith("Pole")
+ || parent.physVolumes.isNotEmpty()
+ ) {
+ useStyle("opaque") {
+ MATERIAL_OPACITY_KEY put 0.3
+ }
+ }
+ }
+}
+
+private class GDMLDemoApp : Application {
+
+ override fun start(state: Map) {
+
+ injectGlobal {
+ body {
+ height = 100.pct
+ width = 100.pct
+ margin(0.px)
+ padding(0.px)
+ }
+ }
+
+ val context = Global.context("demo") {}
+ val element = document.getElementById("app") ?: error("Element with id 'app' not found on page")
+
+ render(element) {
+ child(GDMLApp) {
+ attrs {
+ this.context = context
+ this.rootObject = cubes().toVision(gdmlConfiguration)
+ }
+ }
+ }
+// (document.getElementById("file_load_button") as? HTMLInputElement)?.apply {
+// addEventListener("change", {
+// (it.target as HTMLInputElement).files?.asList()?.first()?.let { file ->
+// FileReader().apply {
+// onload = {
+// val string = result as String
+// action(file.name, string)
+// }
+// readAsText(file)
+// }
+// }
+// }, false)
+// }
+
+ }
+}
+
+fun main() {
+ startApplication(::GDMLDemoApp)
+}
\ No newline at end of file
diff --git a/demo/gdml/src/jsMain/kotlin/space/kscience/visionforge/gdml/demo/fileDrop.kt b/demo/gdml/src/jsMain/kotlin/hep/dataforge/vision/gdml/demo/fileDrop.kt
similarity index 90%
rename from demo/gdml/src/jsMain/kotlin/space/kscience/visionforge/gdml/demo/fileDrop.kt
rename to demo/gdml/src/jsMain/kotlin/hep/dataforge/vision/gdml/demo/fileDrop.kt
index e91fedee..4bf47c85 100644
--- a/demo/gdml/src/jsMain/kotlin/space/kscience/visionforge/gdml/demo/fileDrop.kt
+++ b/demo/gdml/src/jsMain/kotlin/hep/dataforge/vision/gdml/demo/fileDrop.kt
@@ -1,4 +1,4 @@
-package space.kscience.visionforge.gdml.demo
+package hep.dataforge.vision.gdml.demo
import drop.FileDrop
import kotlinx.css.*
@@ -14,7 +14,6 @@ fun RBuilder.fileDrop(title: String, action: (files: FileList?) -> Unit) {
styledDiv {
css {
border(style = BorderStyle.dashed, width = 1.px, color = Color.orange)
- flexGrow = 0.0
alignContent = Align.center
}
diff --git a/demo/gdml/src/jsMain/kotlin/space/kscience/visionforge/gdml/demo/GDMLAppComponent.kt b/demo/gdml/src/jsMain/kotlin/space/kscience/visionforge/gdml/demo/GDMLAppComponent.kt
deleted file mode 100644
index 823297ec..00000000
--- a/demo/gdml/src/jsMain/kotlin/space/kscience/visionforge/gdml/demo/GDMLAppComponent.kt
+++ /dev/null
@@ -1,98 +0,0 @@
-package space.kscience.visionforge.gdml.demo
-
-import kotlinx.browser.window
-import kotlinx.coroutines.CompletableDeferred
-import kotlinx.coroutines.Deferred
-import kotlinx.css.*
-import org.w3c.files.File
-import org.w3c.files.FileReader
-import org.w3c.files.get
-import react.Props
-import react.dom.h2
-import react.fc
-import react.useMemo
-import react.useState
-import space.kscience.dataforge.context.Context
-import space.kscience.dataforge.context.fetch
-import space.kscience.dataforge.names.Name
-import space.kscience.gdml.Gdml
-import space.kscience.gdml.decodeFromString
-import space.kscience.visionforge.gdml.markLayers
-import space.kscience.visionforge.gdml.toVision
-import space.kscience.visionforge.ring.ThreeCanvasWithControls
-import space.kscience.visionforge.ring.tab
-import space.kscience.visionforge.setAsRoot
-import space.kscience.visionforge.solid.Solid
-import space.kscience.visionforge.solid.Solids
-import styled.css
-import styled.styledDiv
-
-external interface GDMLAppProps : Props {
- var context: Context
- var vision: Solid?
- var selected: Name?
-}
-
-@JsExport
-val GDMLApp = fc("GDMLApp") { props ->
- val visionManager = useMemo(props.context) { props.context.fetch(Solids).visionManager }
- var deferredVision: Deferred by useState {
- CompletableDeferred(props.vision)
- }
-
- fun readFileAsync(file: File): Deferred {
- val deferred = CompletableDeferred()
- FileReader().apply {
- onload = {
- val data = result as String
- val name = file.name
- val parsedVision = when {
- name.endsWith(".gdml") || name.endsWith(".xml") -> {
- val gdml = Gdml.decodeFromString(data)
- gdml.toVision().apply {
- setAsRoot(visionManager)
- console.info("Marking layers for file $name")
- markLayers()
- }
- }
- name.endsWith(".json") -> visionManager.decodeFromString(data)
- else -> {
- window.alert("File extension is not recognized: $name")
- error("File extension is not recognized: $name")
- }
- }
- deferred.complete(parsedVision as? Solid ?: error("Parsed vision is not a solid"))
- }
- readAsText(file)
- }
-
- return deferred
- }
-
- styledDiv {
- css {
- height = 100.vh - 12.pt
- width = 100.vw
- }
- child(ThreeCanvasWithControls) {
- attrs {
- this.context = props.context
- this.builderOfSolid = deferredVision
- this.selected = props.selected
- tab("Load") {
- h2 {
- +"Drag and drop .gdml or .json VisionForge files here"
- }
- fileDrop("(drag file here)") { files ->
- val file = files?.get(0)
- if (file != null) {
- deferredVision = readFileAsync(file)
- }
- }
- }
- }
-
- }
- }
-}
-
diff --git a/demo/gdml/src/jsMain/kotlin/space/kscience/visionforge/gdml/demo/GdmlJsDemoApp.kt b/demo/gdml/src/jsMain/kotlin/space/kscience/visionforge/gdml/demo/GdmlJsDemoApp.kt
deleted file mode 100644
index 74246432..00000000
--- a/demo/gdml/src/jsMain/kotlin/space/kscience/visionforge/gdml/demo/GdmlJsDemoApp.kt
+++ /dev/null
@@ -1,57 +0,0 @@
-package space.kscience.visionforge.gdml.demo
-
-import kotlinx.browser.document
-import kotlinx.css.*
-import react.dom.render
-import space.kscience.dataforge.context.Context
-import space.kscience.gdml.GdmlShowCase
-import space.kscience.visionforge.Application
-import space.kscience.visionforge.gdml.toVision
-import space.kscience.visionforge.solid.three.ThreePlugin
-import space.kscience.visionforge.startApplication
-import styled.injectGlobal
-
-
-private class GDMLDemoApp : Application {
-
- override fun start(state: Map) {
- val context = Context("gdml-demo"){
- plugin(ThreePlugin)
- }
-
- injectGlobal {
- html{
- height = 100.pct
- }
-
- body{
- height = 100.pct
- display = Display.flex
- alignItems = Align.stretch
- }
-
- "#application"{
- width = 100.pct
- display = Display.flex
- alignItems = Align.stretch
- }
- }
-
- val element = document.getElementById("application") ?: error("Element with id 'application' not found on page")
-
- render(element) {
- child(GDMLApp) {
- val vision = GdmlShowCase.cubes().toVision()
- //println(context.plugins.fetch(VisionManager).encodeToString(vision))
- attrs {
- this.context = context
- this.vision = vision
- }
- }
- }
- }
-}
-
-fun main() {
- startApplication(::GDMLDemoApp)
-}
\ No newline at end of file
diff --git a/demo/gdml/src/jsMain/resources/index.html b/demo/gdml/src/jsMain/resources/index.html
index c468cbd5..fb53883c 100644
--- a/demo/gdml/src/jsMain/resources/index.html
+++ b/demo/gdml/src/jsMain/resources/index.html
@@ -2,12 +2,16 @@
-
+
Three js demo for particle physics
-
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/demo/gdml/src/jvmMain/kotlin/space/kscience/visionforge/gdml/demo/GdmlFxDemoApp.kt b/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vision/gdml/demo/GDMLDemoApp.kt
similarity index 50%
rename from demo/gdml/src/jvmMain/kotlin/space/kscience/visionforge/gdml/demo/GdmlFxDemoApp.kt
rename to demo/gdml/src/jvmMain/kotlin/hep/dataforge/vision/gdml/demo/GDMLDemoApp.kt
index 83e750ba..35b00615 100644
--- a/demo/gdml/src/jvmMain/kotlin/space/kscience/visionforge/gdml/demo/GdmlFxDemoApp.kt
+++ b/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vision/gdml/demo/GDMLDemoApp.kt
@@ -1,51 +1,47 @@
-package space.kscience.visionforge.gdml.demo
+package hep.dataforge.vision.gdml.demo
+import hep.dataforge.context.Global
+import hep.dataforge.vision.editor.VisualObjectEditorFragment
+import hep.dataforge.vision.editor.VisualObjectTreeFragment
+import hep.dataforge.vision.gdml.toVision
+import hep.dataforge.vision.solid.SolidManager
+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
-import space.kscience.dataforge.context.Context
-import space.kscience.dataforge.context.fetch
-import space.kscience.gdml.GdmlShowCase
-import space.kscience.visionforge.VisionManager
-import space.kscience.visionforge.editor.VisionEditorFragment
-import space.kscience.visionforge.editor.VisionTreeFragment
-import space.kscience.visionforge.gdml.toVision
-import space.kscience.visionforge.solid.FX3DPlugin
-import space.kscience.visionforge.solid.FXCanvas3D
-import space.kscience.visionforge.solid.Solid
-import space.kscience.visionforge.solid.SolidMaterial
import tornadofx.*
class GDMLDemoApp : App(GDMLView::class)
class GDMLView : View() {
- private val context = Context {
- plugin(FX3DPlugin)
- }
-
- private val fx3d = context.fetch(FX3DPlugin)
- private val visionManager = context.fetch(VisionManager)
+ private val fx3d = Global.plugins.fetch(FX3DPlugin)
private val canvas = FXCanvas3D(fx3d)
- private val treeFragment = VisionTreeFragment().apply {
+ private val treeFragment = VisualObjectTreeFragment().apply {
this.itemProperty.bind(canvas.rootObjectProperty)
}
- private val propertyEditor = VisionEditorFragment().apply {
+ private val propertyEditor = VisualObjectEditorFragment {
+ it.getAllProperties()
+ }.apply {
descriptorProperty.set(SolidMaterial.descriptor)
- visionProperty.bind(treeFragment.selectedProperty)
+ itemProperty.bind(treeFragment.selectedProperty)
}
+
override val root: Parent = borderpane {
top {
buttonbar {
button("Load GDML/json") {
action {
- val file = chooseFile("Select a GDML/json file", filters = fileNameFilter).firstOrNull()
- if (file != null) {
- runAsync {
- visionManager.readFile(file) as Solid
- } ui {
+ runAsync {
+ val file = chooseFile("Select a GDML/json file", filters = fileNameFilter).firstOrNull()
+ ?: return@runAsync null
+ SolidManager.readFile(file)
+ } ui {
+ if (it != null) {
canvas.render(it)
}
}
@@ -62,7 +58,7 @@ class GDMLView : View() {
init {
runAsync {
- GdmlShowCase.cubes().toVision()
+ cubes().toVision()
} ui {
canvas.render(it)
}
diff --git a/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vision/gdml/demo/readFile.kt b/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vision/gdml/demo/readFile.kt
new file mode 100644
index 00000000..c0fcd2ed
--- /dev/null
+++ b/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vision/gdml/demo/readFile.kt
@@ -0,0 +1,54 @@
+package hep.dataforge.vision.gdml.demo
+
+import hep.dataforge.meta.DFExperimental
+import hep.dataforge.meta.setItem
+import hep.dataforge.values.asValue
+import hep.dataforge.vision.gdml.LUnit
+import hep.dataforge.vision.gdml.readFile
+import hep.dataforge.vision.gdml.toVision
+import hep.dataforge.vision.solid.SolidGroup
+import hep.dataforge.vision.solid.SolidManager
+import hep.dataforge.vision.solid.SolidMaterial
+import scientifik.gdml.GDML
+import java.io.File
+import java.util.zip.GZIPInputStream
+import java.util.zip.ZipInputStream
+
+@OptIn(DFExperimental::class)
+fun SolidManager.Companion.readFile(file: File): SolidGroup = when {
+ file.extension == "gdml" || file.extension == "xml" -> {
+ GDML.readFile(file.toPath()).toVision {
+ lUnit = LUnit.CM
+
+ solidConfiguration = { parent, solid ->
+ if (solid.name == "cave") {
+ setItem(SolidMaterial.MATERIAL_WIREFRAME_KEY, true.asValue())
+ }
+ if (parent.physVolumes.isNotEmpty()) {
+ useStyle("opaque") {
+ SolidMaterial.MATERIAL_OPACITY_KEY put 0.3
+ }
+ }
+ }
+ }
+ }
+ file.extension == "json" -> SolidGroup.parseJson(file.readText())
+ file.name.endsWith("json.zip") -> {
+ file.inputStream().use {
+ val unzip = ZipInputStream(it, Charsets.UTF_8)
+ val text = unzip.readBytes().decodeToString()
+ SolidGroup.parseJson(text)
+ }
+ }
+ file.name.endsWith("json.gz") -> {
+ file.inputStream().use {
+ val unzip = GZIPInputStream(it)
+ val text = unzip.readBytes().decodeToString()
+ SolidGroup.parseJson(text)
+ }
+ }
+ else -> error("Unknown extension ${file.extension}")
+}
+
+@OptIn(DFExperimental::class)
+fun SolidManager.Companion.readFile(fileName: String): SolidGroup = readFile(File(fileName))
\ No newline at end of file
diff --git a/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vision/gdml/demo/saveToJson.kt b/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vision/gdml/demo/saveToJson.kt
new file mode 100644
index 00000000..5c0c09c6
--- /dev/null
+++ b/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vision/gdml/demo/saveToJson.kt
@@ -0,0 +1,28 @@
+package hep.dataforge.vision.gdml.demo
+
+import hep.dataforge.vision.gdml.LUnit
+import hep.dataforge.vision.gdml.readFile
+import hep.dataforge.vision.gdml.toVision
+import hep.dataforge.vision.solid.stringify
+import scientifik.gdml.GDML
+import java.io.File
+import java.nio.file.Paths
+
+fun main(args: Array) {
+ require(args.isNotEmpty()){"At least one argument is required"}
+ val inputFileName = args[0]
+ require(inputFileName.endsWith(".gdml")){"GDML required"}
+ val outputFileName = args.getOrNull(1)?:inputFileName.replace(".gdml",".json")
+
+ val gdml = GDML.readFile(Paths.get(inputFileName))
+ //GDML.readFile(Paths.get("D:\\Work\\Projects\\visionforge\\visionforge-spatial-gdml\\src\\jvmTest\\resources\\gdml\\simple1.gdml"))
+
+ val visual = gdml.toVision {
+ lUnit = LUnit.CM
+ }
+
+ val json = visual.stringify()
+ println(json)
+ File(outputFileName).writeText(json)
+ //File("D:\\Work\\Projects\\gdml.kt\\gdml-source\\cubes.json").writeText(json)
+}
\ No newline at end of file
diff --git a/demo/gdml/src/jvmMain/kotlin/space/kscience/visionforge/gdml/demo/readFile.kt b/demo/gdml/src/jvmMain/kotlin/space/kscience/visionforge/gdml/demo/readFile.kt
deleted file mode 100644
index 933fac3c..00000000
--- a/demo/gdml/src/jvmMain/kotlin/space/kscience/visionforge/gdml/demo/readFile.kt
+++ /dev/null
@@ -1,37 +0,0 @@
-package space.kscience.visionforge.gdml.demo
-
-import space.kscience.dataforge.misc.DFExperimental
-import space.kscience.gdml.Gdml
-import space.kscience.gdml.decodeFromFile
-import space.kscience.visionforge.Vision
-import space.kscience.visionforge.VisionManager
-import space.kscience.visionforge.gdml.toVision
-import java.io.File
-import java.util.zip.GZIPInputStream
-import java.util.zip.ZipInputStream
-
-@OptIn(DFExperimental::class)
-fun VisionManager.readFile(file: File): Vision = when {
- file.extension == "gdml" || file.extension == "xml" -> {
- Gdml.decodeFromFile(file.toPath(),true).toVision()
- }
- file.extension == "json" -> decodeFromString(file.readText())
- file.name.endsWith("json.zip") -> {
- file.inputStream().use {
- val unzip = ZipInputStream(it, Charsets.UTF_8)
- val text = unzip.readBytes().decodeToString()
- decodeFromString(text)
- }
- }
- file.name.endsWith("json.gz") -> {
- file.inputStream().use {
- val unzip = GZIPInputStream(it)
- val text = unzip.readBytes().decodeToString()
- decodeFromString(text)
- }
- }
- else -> error("Unknown extension ${file.extension}")
-}
-
-@OptIn(DFExperimental::class)
-fun VisionManager.readFile(fileName: String): Vision = readFile(File(fileName))
\ No newline at end of file
diff --git a/demo/gdml/src/jvmMain/kotlin/space/kscience/visionforge/gdml/demo/saveToJson.kt b/demo/gdml/src/jvmMain/kotlin/space/kscience/visionforge/gdml/demo/saveToJson.kt
deleted file mode 100644
index 9e4c04b1..00000000
--- a/demo/gdml/src/jvmMain/kotlin/space/kscience/visionforge/gdml/demo/saveToJson.kt
+++ /dev/null
@@ -1,28 +0,0 @@
-package space.kscience.visionforge.gdml.demo
-
-import space.kscience.gdml.Gdml
-import space.kscience.gdml.LUnit
-import space.kscience.gdml.decodeFromFile
-import space.kscience.visionforge.gdml.toVision
-import space.kscience.visionforge.solid.Solids
-import java.io.File
-import java.nio.file.Paths
-
-fun main(args: Array) {
- require(args.isNotEmpty()) { "At least one argument is required" }
- val inputFileName = args[0]
- require(inputFileName.endsWith(".gdml")) { "GDML required" }
- val outputFileName = args.getOrNull(1) ?: inputFileName.replace(".gdml", ".json")
-
- val gdml = Gdml.decodeFromFile(Paths.get(inputFileName), true)
- //GDML.readFile(Paths.get("D:\\Work\\Projects\\visionforge\\visionforge-spatial-gdml\\src\\jvmTest\\resources\\gdml\\simple1.gdml"))
-
- val vision = gdml.toVision {
- lUnit = LUnit.CM
- }
-
- val json = Solids.encodeToString(vision)
- println(json)
- File(outputFileName).writeText(json)
- //File("D:\\Work\\Projects\\gdml.kt\\gdml-source\\cubes.json").writeText(json)
-}
\ No newline at end of file
diff --git a/demo/gdml/src/jvmTest/kotlin/space/kscience/visionforge/solid/FileSerializationTest.kt b/demo/gdml/src/jvmTest/kotlin/hep/dataforge/vision/solid/FileSerializationTest.kt
similarity index 65%
rename from demo/gdml/src/jvmTest/kotlin/space/kscience/visionforge/solid/FileSerializationTest.kt
rename to demo/gdml/src/jvmTest/kotlin/hep/dataforge/vision/solid/FileSerializationTest.kt
index cd45a97b..e10acbee 100644
--- a/demo/gdml/src/jvmTest/kotlin/space/kscience/visionforge/solid/FileSerializationTest.kt
+++ b/demo/gdml/src/jvmTest/kotlin/hep/dataforge/vision/solid/FileSerializationTest.kt
@@ -1,7 +1,7 @@
-package space.kscience.visionforge.solid
+package hep.dataforge.vision.solid
+import hep.dataforge.names.asName
import org.junit.jupiter.api.Test
-import space.kscience.dataforge.names.asName
import kotlin.test.Ignore
class FileSerializationTest {
@@ -9,7 +9,7 @@ class FileSerializationTest {
@Ignore
fun testFileRead(){
val text = this::class.java.getResourceAsStream("/cubes.json").readBytes().decodeToString()
- val visual = Solids.decodeFromString(text) as SolidGroup
+ val visual = SolidGroup.parseJson(text)
visual["composite_001".asName()]
}
}
\ No newline at end of file
diff --git a/demo/gdml/webpack.config.d/01.ring.js b/demo/gdml/webpack.config.d/01.ring.js
deleted file mode 100644
index 41da041c..00000000
--- a/demo/gdml/webpack.config.d/01.ring.js
+++ /dev/null
@@ -1,3 +0,0 @@
-const ringConfig = require('@jetbrains/ring-ui/webpack.config').config;
-
-config.module.rules.push(...ringConfig.module.rules)
\ No newline at end of file
diff --git a/demo/js-playground/README.md b/demo/js-playground/README.md
deleted file mode 100644
index 6b899a57..00000000
--- a/demo/js-playground/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# Module js-playground
-
-
-
diff --git a/demo/js-playground/build.gradle.kts b/demo/js-playground/build.gradle.kts
deleted file mode 100644
index ccec7015..00000000
--- a/demo/js-playground/build.gradle.kts
+++ /dev/null
@@ -1,28 +0,0 @@
-plugins {
- id("ru.mipt.npm.gradle.js")
-}
-
-kscience{
- useCoroutines()
- application()
-}
-
-kotlin{
- js(IR){
- useCommonJs()
- browser {
- commonWebpackConfig {
- cssSupport.enabled = false
- }
- }
- }
-}
-
-
-dependencies{
- implementation(projects.visionforge.visionforgeGdml)
- implementation(projects.visionforge.visionforgePlotly)
- implementation(projects.visionforge.visionforgeMarkdown)
- implementation(projects.visionforge.visionforgeThreejs)
- implementation(projects.ui.ring)
-}
\ No newline at end of file
diff --git a/demo/js-playground/src/main/kotlin/JsPlaygroundApp.kt b/demo/js-playground/src/main/kotlin/JsPlaygroundApp.kt
deleted file mode 100644
index a1ffa4ff..00000000
--- a/demo/js-playground/src/main/kotlin/JsPlaygroundApp.kt
+++ /dev/null
@@ -1,112 +0,0 @@
-import kotlinx.browser.document
-import kotlinx.css.*
-import react.child
-import react.dom.render
-import ringui.SmartTabs
-import ringui.Tab
-import space.kscience.dataforge.context.Context
-import space.kscience.plotly.models.Trace
-import space.kscience.plotly.scatter
-import space.kscience.visionforge.Application
-import space.kscience.visionforge.VisionClient
-import space.kscience.visionforge.plotly.PlotlyPlugin
-import space.kscience.visionforge.ring.ThreeCanvasWithControls
-import space.kscience.visionforge.ring.ThreeWithControlsPlugin
-import space.kscience.visionforge.ring.solid
-import space.kscience.visionforge.solid.*
-import space.kscience.visionforge.startApplication
-import styled.css
-import styled.styledDiv
-import kotlin.random.Random
-
-fun Trace.appendXYLatest(x: Number, y: Number, history: Int = 400, xErr: Number? = null, yErr: Number? = null) {
- this.x.numbers = (this.x.numbers + x).takeLast(history)
- this.y.numbers = (this.y.numbers + y).takeLast(history)
- xErr?.let { error_x.array = (error_x.array + xErr).takeLast(history) }
- yErr?.let { error_y.array = (error_y.array + yErr).takeLast(history) }
-}
-
-private class JsPlaygroundApp : Application {
-
- override fun start(state: Map) {
-
- val playgroundContext = Context {
- plugin(ThreeWithControlsPlugin)
- plugin(VisionClient)
- plugin(PlotlyPlugin)
- }
-
- val element = document.getElementById("playground") ?: error("Element with id 'playground' not found on page")
-
- render(element) {
- styledDiv {
- css {
- padding(0.pt)
- margin(0.pt)
- height = 100.vh
- width = 100.vw
- }
- SmartTabs("gravity") {
- Tab("gravity") {
- GravityDemo{
- attrs {
- this.context = playgroundContext
- }
- }
- }
-
-// Tab("D0") {
-// child(ThreeCanvasWithControls) {
-// attrs {
-// context = playgroundContext
-// solid = GdmlShowCase.babyIaxo().toVision()
-// }
-// }
-// }
- Tab("spheres") {
- styledDiv {
- css {
- height = 100.vh - 50.pt
- }
- child(ThreeCanvasWithControls) {
- val random = Random(112233)
- attrs {
- context = playgroundContext
- solid {
- repeat(100) {
- sphere(5, name = "sphere[$it]") {
- x = random.nextDouble(-300.0, 300.0)
- y = random.nextDouble(-300.0, 300.0)
- z = random.nextDouble(-300.0, 300.0)
- material {
- color(random.nextInt())
- }
- detail = 16
- }
- }
- }
- }
- }
- }
- }
- Tab("plotly") {
- Plotly {
- attrs {
- plot = space.kscience.plotly.Plotly.plot {
- scatter {
- x(1, 2, 3)
- y(5, 8, 7)
- }
- }
- }
- }
- }
- }
- }
- }
- }
-}
-
-public fun main() {
- startApplication(::JsPlaygroundApp)
-}
\ No newline at end of file
diff --git a/demo/js-playground/src/main/kotlin/gravityDemo.kt b/demo/js-playground/src/main/kotlin/gravityDemo.kt
deleted file mode 100644
index 716cc2c3..00000000
--- a/demo/js-playground/src/main/kotlin/gravityDemo.kt
+++ /dev/null
@@ -1,106 +0,0 @@
-import kotlinx.coroutines.delay
-import kotlinx.coroutines.isActive
-import kotlinx.coroutines.launch
-import kotlinx.css.*
-import react.Props
-import react.fc
-import space.kscience.dataforge.context.Context
-import space.kscience.plotly.layout
-import space.kscience.plotly.models.Trace
-import space.kscience.visionforge.markup.VisionOfMarkup
-import space.kscience.visionforge.react.flexRow
-import space.kscience.visionforge.ring.ThreeCanvasWithControls
-import space.kscience.visionforge.ring.solid
-import space.kscience.visionforge.solid.*
-import styled.css
-import styled.styledDiv
-import kotlin.math.sqrt
-
-external interface DemoProps : Props {
- var context: Context
-}
-
-val GravityDemo = fc { props ->
- val velocityTrace = Trace{
- name = "velocity"
- }
- val energyTrace = Trace{
- name = "energy"
- }
- val markup = VisionOfMarkup()
-
- styledDiv {
- css {
- height = 100.vh - 50.pt
- }
- styledDiv {
- css {
- height = 50.vh
- }
- child(ThreeCanvasWithControls) {
- attrs {
- context = props.context
- solid {
- sphere(5.0, "ball") {
- detail = 16
- color("red")
- val h = 100.0
- y = h
- context.launch {
- val g = 10.0
- val dt = 0.1
- var time = 0.0
- var velocity = 0.0
- while (isActive) {
- delay(20)
- time += dt
- velocity -= g * dt
- val energy = g * y.toDouble() + velocity * velocity / 2
- y = y.toDouble() + velocity * dt
-
- velocityTrace.appendXYLatest(time, y)
- energyTrace.appendXYLatest(time, energy)
-
- if (y.toDouble() <= 2.5) {
- //conservation of energy
- velocity = sqrt(2 * g * h)
- }
-
- markup.content = """
- ## Bouncing sphere parameters
-
- **velocity** = $velocity
-
- **energy** = $energy
- """.trimIndent()
- }
- }
- }
-
- box(200, 5, 200, name = "floor") {
- y = -2.5
- }
- }
- }
- }
- }
- flexRow {
- css {
- alignContent = Align.stretch
- alignItems = Align.stretch
- height = 50.vh - 50.pt
- }
- plotly {
- traces(velocityTrace,energyTrace)
- layout {
- xaxis.title = "time"
- }
- }
- Markup {
- attrs {
- this.markup = markup
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/demo/js-playground/src/main/kotlin/markupComponent.kt b/demo/js-playground/src/main/kotlin/markupComponent.kt
deleted file mode 100644
index 4bbe4b80..00000000
--- a/demo/js-playground/src/main/kotlin/markupComponent.kt
+++ /dev/null
@@ -1,56 +0,0 @@
-import kotlinx.css.*
-import kotlinx.css.properties.border
-import kotlinx.dom.clear
-import kotlinx.html.dom.append
-import org.intellij.markdown.flavours.commonmark.CommonMarkFlavourDescriptor
-import org.intellij.markdown.flavours.gfm.GFMFlavourDescriptor
-import org.w3c.dom.Element
-import org.w3c.dom.HTMLElement
-import react.Props
-import react.fc
-import react.useEffect
-import react.useRef
-import space.kscience.visionforge.markup.VisionOfMarkup
-import space.kscience.visionforge.markup.markdown
-import space.kscience.visionforge.useProperty
-import styled.css
-import styled.styledDiv
-
-external interface MarkupProps : Props {
- var markup: VisionOfMarkup?
-}
-
-val Markup = fc("Markup") { props ->
- val elementRef = useRef(null)
-
- useEffect(props.markup, elementRef) {
- val element = elementRef.current as? HTMLElement ?: error("Markup element not found")
- props.markup?.let { vision ->
- val flavour = when (vision.format) {
- VisionOfMarkup.COMMONMARK_FORMAT -> CommonMarkFlavourDescriptor()
- VisionOfMarkup.GFM_FORMAT -> GFMFlavourDescriptor()
- //TODO add new formats via plugins
- else -> error("Format ${vision.format} not recognized")
- }
- vision.useProperty(VisionOfMarkup::content) { content: String? ->
- element.clear()
- element.append {
- markdown(flavour) { content ?: "" }
- }
- }
- }
- }
-
- styledDiv {
- css {
- width = 100.pct
- height = 100.pct
- border(2.pt, BorderStyle.solid, Color.blue)
- padding(left = 8.pt)
- backgroundColor = Color.white
- flex(1.0)
- zIndex = 10000
- }
- ref = elementRef
- }
-}
\ No newline at end of file
diff --git a/demo/js-playground/src/main/kotlin/plotlyComponent.kt b/demo/js-playground/src/main/kotlin/plotlyComponent.kt
deleted file mode 100644
index 5a2c6a81..00000000
--- a/demo/js-playground/src/main/kotlin/plotlyComponent.kt
+++ /dev/null
@@ -1,44 +0,0 @@
-import kotlinx.css.*
-import kotlinx.css.properties.border
-import org.w3c.dom.Element
-import org.w3c.dom.HTMLElement
-import react.*
-import space.kscience.plotly.Plot
-import space.kscience.plotly.PlotlyConfig
-import space.kscience.plotly.plot
-import styled.css
-import styled.styledDiv
-
-external interface PlotlyProps : Props {
- var plot: Plot?
-}
-
-
-val Plotly = fc("Plotly") { props ->
- val elementRef = useRef(null)
-
- useEffect(props.plot, elementRef) {
- val element = elementRef.current as? HTMLElement ?: error("Plotly element not found")
- props.plot?.let {
- element.plot(it, PlotlyConfig {
- responsive = true
- })
- }
- }
-
- styledDiv {
- css {
- width = 100.pct
- height = 100.pct
- border(2.pt, BorderStyle.solid, Color.blue)
- flex(1.0)
- }
- ref = elementRef
- }
-}
-
-fun RBuilder.plotly(plotbuilder: Plot.() -> Unit) = Plotly {
- attrs {
- this.plot = Plot().apply(plotbuilder)
- }
-}
\ No newline at end of file
diff --git a/demo/js-playground/src/main/resources/index.html b/demo/js-playground/src/main/resources/index.html
deleted file mode 100644
index 83a9016e..00000000
--- a/demo/js-playground/src/main/resources/index.html
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
- js-playground
-
-
-
-
-
-
\ No newline at end of file
diff --git a/demo/js-playground/webpack.config.d/01.ring.js b/demo/js-playground/webpack.config.d/01.ring.js
deleted file mode 100644
index 41da041c..00000000
--- a/demo/js-playground/webpack.config.d/01.ring.js
+++ /dev/null
@@ -1,3 +0,0 @@
-const ringConfig = require('@jetbrains/ring-ui/webpack.config').config;
-
-config.module.rules.push(...ringConfig.module.rules)
\ No newline at end of file
diff --git a/demo/muon-monitor/README.md b/demo/muon-monitor/README.md
index 74c935e4..739a4956 100644
--- a/demo/muon-monitor/README.md
+++ b/demo/muon-monitor/README.md
@@ -1,4 +1,34 @@
-# Module muon-monitor
+### Muon Monitor Visualization
+This directory contains a full-stack application example built with `visionforge`.
+It is visualizing the
+[Muon Monitor](http://npm.mipt.ru/projects/physics.html#mounMonitor) experiment set-up,
+including experiment's geometry and events (particle tracks).
+
+#### Reusing code and going Full-Stack with Kotlin Multiplatform
+
+The application includes both server back-end generating events, as well as client
+visualization front-end.
+
+As is common for Kotlin multiplatform projects, the code base of this simple application
+is put in the following main directories:
+* `commonMain` - common code, used by both JS client and JVM server. For example, the `Monitor`
+object describes general geometry definitions needed in all parts of the application.
+* `jsMain` - JavaScript client code. It performs visualization and reads events from the server.
+* `jvmMain` - JVM server code. It runs `ktor` HTTP server, responding with event data when
+client requests them.
+
+Note that in a more traditional approach when client and server are developed separately
+and possibly using different languages, there would be no common code and benefits associated
+with it.
+
+##### Building project
+
+To run full-stack Muon Monitor Visualization application (both JVM server and Web browser front-end),
+run `demo/muon-monitor/application/run` task.
+
+##### Example view:
+
+![](../../doc/resources/muon-monitor.png)
diff --git a/demo/muon-monitor/api/muon-monitor.api b/demo/muon-monitor/api/muon-monitor.api
deleted file mode 100644
index da3a84ed..00000000
--- a/demo/muon-monitor/api/muon-monitor.api
+++ /dev/null
@@ -1,148 +0,0 @@
-public final class ru/mipt/npm/muon/monitor/Event {
- public static final field Companion Lru/mipt/npm/muon/monitor/Event$Companion;
- public synthetic fun (IILjava/util/List;Ljava/util/Collection;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V
- public fun (ILjava/util/List;Ljava/util/Collection;)V
- public final fun component1 ()I
- public final fun component2 ()Ljava/util/List;
- public final fun component3 ()Ljava/util/Collection;
- public final fun copy (ILjava/util/List;Ljava/util/Collection;)Lru/mipt/npm/muon/monitor/Event;
- public static synthetic fun copy$default (Lru/mipt/npm/muon/monitor/Event;ILjava/util/List;Ljava/util/Collection;ILjava/lang/Object;)Lru/mipt/npm/muon/monitor/Event;
- public fun equals (Ljava/lang/Object;)Z
- public final fun getHits ()Ljava/util/Collection;
- public final fun getId ()I
- public final fun getTrack ()Ljava/util/List;
- public fun hashCode ()I
- public fun toString ()Ljava/lang/String;
- public static final fun write$Self (Lru/mipt/npm/muon/monitor/Event;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
-}
-
-public final class ru/mipt/npm/muon/monitor/Event$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
- public static final field INSTANCE Lru/mipt/npm/muon/monitor/Event$$serializer;
- public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
- public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
- public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
- public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/muon/monitor/Event;
- public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
- public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
- public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/muon/monitor/Event;)V
- public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/muon/monitor/Event$Companion {
- public final fun serializer ()Lkotlinx/serialization/KSerializer;
-}
-
-public final class ru/mipt/npm/muon/monitor/Model {
- public fun (Lspace/kscience/visionforge/VisionManager;)V
- public final fun displayEvent (Lru/mipt/npm/muon/monitor/Event;)V
- public final fun encodeToString ()Ljava/lang/String;
- public final fun getManager ()Lspace/kscience/visionforge/VisionManager;
- public final fun getRoot ()Lspace/kscience/visionforge/solid/SolidGroup;
- public final fun getTracks ()Lspace/kscience/visionforge/solid/SolidGroup;
- public final fun reset ()V
- public final fun setTracks (Lspace/kscience/visionforge/solid/SolidGroup;)V
-}
-
-public final class ru/mipt/npm/muon/monitor/Monitor {
- public static final field CENTRAL_LAYER_Z F
- public static final field GEOMETRY_TOLERANCE D
- public static final field INSTANCE Lru/mipt/npm/muon/monitor/Monitor;
- public static final field LOWER_LAYER_Z F
- public static final field PIXEL_XY_SIZE F
- public static final field PIXEL_XY_SPACING F
- public static final field PIXEL_Z_SIZE F
- public static final field UPPER_LAYER_Z F
- public final fun getDetectors ()Ljava/util/Collection;
- public final fun getPixels ()Ljava/util/Collection;
-}
-
-public final class ru/mipt/npm/muon/monitor/ReadResourceKt {
- public static final fun readResource (Ljava/lang/String;)Ljava/lang/String;
-}
-
-public final class ru/mipt/npm/muon/monitor/SC1 {
- public fun (Ljava/lang/String;Lspace/kscience/visionforge/solid/Point3D;FFF)V
- public synthetic fun (Ljava/lang/String;Lspace/kscience/visionforge/solid/Point3D;FFFILkotlin/jvm/internal/DefaultConstructorMarker;)V
- public final fun getCenter ()Lspace/kscience/visionforge/solid/Point3D;
- public final fun getName ()Ljava/lang/String;
- public final fun getXSize ()F
- public final fun getYSize ()F
- public final fun getZSize ()F
-}
-
-public final class ru/mipt/npm/muon/monitor/SC16 {
- public fun (Ljava/lang/String;Lspace/kscience/visionforge/solid/Point3D;)V
- public final fun getCenter ()Lspace/kscience/visionforge/solid/Point3D;
- public final fun getName ()Ljava/lang/String;
- public final fun getPixels ()Ljava/util/Collection;
-}
-
-public final class ru/mipt/npm/muon/monitor/server/MMServerKt {
- public static final fun main ()V
- public static synthetic fun main ([Ljava/lang/String;)V
- public static final fun module (Lio/ktor/application/Application;Lspace/kscience/dataforge/context/Context;)V
- public static synthetic fun module$default (Lio/ktor/application/Application;Lspace/kscience/dataforge/context/Context;ILjava/lang/Object;)V
-}
-
-public final class ru/mipt/npm/muon/monitor/sim/Cos2TrackGenerator : ru/mipt/npm/muon/monitor/sim/TrackGenerator {
- public fun (Lorg/apache/commons/math3/random/RandomGenerator;DFF)V
- public synthetic fun (Lorg/apache/commons/math3/random/RandomGenerator;DFFILkotlin/jvm/internal/DefaultConstructorMarker;)V
- public fun generate ()Lorg/apache/commons/math3/geometry/euclidean/threed/Line;
- public final fun getMaxX ()F
- public final fun getMaxY ()F
- public final fun getPower ()D
- public fun getRnd ()Lorg/apache/commons/math3/random/RandomGenerator;
-}
-
-public final class ru/mipt/npm/muon/monitor/sim/FixedAngleGenerator : ru/mipt/npm/muon/monitor/sim/TrackGenerator {
- public fun (Lorg/apache/commons/math3/random/RandomGenerator;DDFF)V
- public synthetic fun (Lorg/apache/commons/math3/random/RandomGenerator;DDFFILkotlin/jvm/internal/DefaultConstructorMarker;)V
- public fun generate ()Lorg/apache/commons/math3/geometry/euclidean/threed/Line;
- public final fun getMaxX ()F
- public final fun getMaxY ()F
- public final fun getPhi ()D
- public fun getRnd ()Lorg/apache/commons/math3/random/RandomGenerator;
- public final fun getTheta ()D
-}
-
-public final class ru/mipt/npm/muon/monitor/sim/LineKt {
- public static final fun getPhi (Lorg/apache/commons/math3/geometry/euclidean/threed/Line;)D
- public static final fun getTheta (Lorg/apache/commons/math3/geometry/euclidean/threed/Line;)D
- public static final fun getX (Lorg/apache/commons/math3/geometry/euclidean/threed/Line;)D
- public static final fun getY (Lorg/apache/commons/math3/geometry/euclidean/threed/Line;)D
- public static final fun makeTrack (DDDD)Lorg/apache/commons/math3/geometry/euclidean/threed/Line;
- public static final fun makeTrack (Lorg/apache/commons/math3/geometry/euclidean/threed/Vector3D;Lorg/apache/commons/math3/geometry/euclidean/threed/Vector3D;)Lorg/apache/commons/math3/geometry/euclidean/threed/Line;
- public static final fun toPoint (Lorg/apache/commons/math3/geometry/euclidean/threed/Vector3D;)Lspace/kscience/visionforge/solid/Point3D;
- public static final fun toPoints (Lorg/apache/commons/math3/geometry/euclidean/threed/Line;)Ljava/util/List;
-}
-
-public final class ru/mipt/npm/muon/monitor/sim/MonitorKt {
- public static final fun buildEventByTrack (ILorg/apache/commons/math3/geometry/euclidean/threed/Line;Lkotlin/jvm/functions/Function1;)Lru/mipt/npm/muon/monitor/Event;
- public static synthetic fun buildEventByTrack$default (ILorg/apache/commons/math3/geometry/euclidean/threed/Line;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lru/mipt/npm/muon/monitor/Event;
- public static final fun findLayer (F)Lorg/apache/commons/math3/geometry/euclidean/threed/Plane;
- public static final fun getDefaultHitResolver ()Lkotlin/jvm/functions/Function1;
- public static final fun readEffs ()Ljava/util/Map;
-}
-
-public final class ru/mipt/npm/muon/monitor/sim/PixelKt {
- public static final fun isHit (Lru/mipt/npm/muon/monitor/SC1;Lorg/apache/commons/math3/geometry/euclidean/threed/Line;)Z
-}
-
-public final class ru/mipt/npm/muon/monitor/sim/SimulationKt {
- public static final fun simulateOne (Lru/mipt/npm/muon/monitor/sim/TrackGenerator;)Lru/mipt/npm/muon/monitor/Event;
-}
-
-public abstract interface class ru/mipt/npm/muon/monitor/sim/TrackGenerator {
- public abstract fun generate ()Lorg/apache/commons/math3/geometry/euclidean/threed/Line;
- public abstract fun getRnd ()Lorg/apache/commons/math3/random/RandomGenerator;
-}
-
-public final class ru/mipt/npm/muon/monitor/sim/UniformTrackGenerator : ru/mipt/npm/muon/monitor/sim/TrackGenerator {
- public fun (Lorg/apache/commons/math3/random/RandomGenerator;FF)V
- public synthetic fun (Lorg/apache/commons/math3/random/RandomGenerator;FFILkotlin/jvm/internal/DefaultConstructorMarker;)V
- public fun generate ()Lorg/apache/commons/math3/geometry/euclidean/threed/Line;
- public final fun getMaxX ()F
- public final fun getMaxY ()F
- public fun getRnd ()Lorg/apache/commons/math3/random/RandomGenerator;
-}
-
diff --git a/demo/muon-monitor/build.gradle.kts b/demo/muon-monitor/build.gradle.kts
index d33cd455..ccb4d098 100644
--- a/demo/muon-monitor/build.gradle.kts
+++ b/demo/muon-monitor/build.gradle.kts
@@ -1,39 +1,43 @@
+import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation.Companion.MAIN_COMPILATION_NAME
+import scientifik.jsDistDirectory
+
plugins {
- id("ru.mipt.npm.gradle.mpp")
- application
+ id("scientifik.mpp")
+ id("application")
}
group = "ru.mipt.npm"
-val ktorVersion: String = npmlibs.versions.ktor.get()
-
-kscience {
- useCoroutines()
- useSerialization()
- application()
-}
+val ktorVersion = "1.3.2"
kotlin {
- jvm {
- withJava()
- }
+
+ val installJS = tasks.getByName("jsBrowserDistribution")
+
js {
- useCommonJs()
browser {
- commonWebpackConfig {
- cssSupport.enabled = false
+ dceTask {
+ dceOptions {
+ keep("ktor-ktor-io.\$\$importsForInline\$\$.ktor-ktor-io.io.ktor.utils.io")
+ }
+ }
+ webpackTask {
+ mode = org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig.Mode.PRODUCTION
}
}
}
- afterEvaluate {
- val jsBrowserDistribution by tasks.getting
-
- tasks.getByName("jvmProcessResources") {
- dependsOn(jsBrowserDistribution)
- duplicatesStrategy = DuplicatesStrategy.EXCLUDE
- from(jsBrowserDistribution)
+ jvm {
+ withJava()
+ compilations[MAIN_COMPILATION_NAME]?.apply {
+ tasks.getByName(processResourcesTaskName) {
+ dependsOn(installJS)
+ afterEvaluate {
+ from(project.jsDistDirectory)
+ }
+ }
}
+
}
sourceSets {
@@ -45,31 +49,39 @@ kotlin {
jvmMain {
dependencies {
implementation("org.apache.commons:commons-math3:3.6.1")
- implementation(npmlibs.ktor.server.cio)
- implementation(npmlibs.ktor.serialization)
+ implementation("io.ktor:ktor-server-cio:$ktorVersion")
+ implementation("io.ktor:ktor-serialization:$ktorVersion")
}
}
jsMain {
dependencies {
- implementation(project(":ui:ring"))
- implementation(project(":visionforge-threejs"))
- //implementation(devNpm("webpack-bundle-analyzer", "4.4.0"))
+ implementation(project(":ui:bootstrap"))
+ implementation("io.ktor:ktor-client-js:$ktorVersion")
+ implementation("io.ktor:ktor-client-serialization-js:$ktorVersion")
+ implementation(npm("text-encoding"))
+ implementation(npm("abort-controller"))
+ implementation(npm("bufferutil"))
+ implementation(npm("utf-8-validate"))
+ implementation(npm("fs"))
+// implementation(npm("jquery"))
+// implementation(npm("popper.js"))
+// implementation(npm("react-is"))
}
}
}
}
application {
- mainClass.set("ru.mipt.npm.muon.monitor.server.MMServerKt")
+ mainClassName = "ru.mipt.npm.muon.monitor.server.MMServerKt"
}
-//distributions {
-// main {
-// contents {
-// from("$buildDir/libs") {
-// rename("${rootProject.name}-jvm", rootProject.name)
-// into("lib")
-// }
-// }
-// }
-//}
\ No newline at end of file
+distributions {
+ main {
+ contents {
+ from("$buildDir/libs") {
+ rename("${rootProject.name}-jvm", rootProject.name)
+ into("lib")
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/demo/muon-monitor/src/commonMain/kotlin/ru/mipt/npm/muon/monitor/Event.kt b/demo/muon-monitor/src/commonMain/kotlin/ru/mipt/npm/muon/monitor/Event.kt
index b47c2b66..b0f8ca04 100644
--- a/demo/muon-monitor/src/commonMain/kotlin/ru/mipt/npm/muon/monitor/Event.kt
+++ b/demo/muon-monitor/src/commonMain/kotlin/ru/mipt/npm/muon/monitor/Event.kt
@@ -1,7 +1,10 @@
+@file:UseSerializers(Point3DSerializer::class)
package ru.mipt.npm.muon.monitor
+import hep.dataforge.vision.solid.Point3D
+import hep.dataforge.vision.solid.Point3DSerializer
import kotlinx.serialization.Serializable
-import space.kscience.visionforge.solid.Point3D
+import kotlinx.serialization.UseSerializers
typealias Track = List
diff --git a/demo/muon-monitor/src/commonMain/kotlin/ru/mipt/npm/muon/monitor/Model.kt b/demo/muon-monitor/src/commonMain/kotlin/ru/mipt/npm/muon/monitor/Model.kt
index 2dab49a2..55d88a11 100644
--- a/demo/muon-monitor/src/commonMain/kotlin/ru/mipt/npm/muon/monitor/Model.kt
+++ b/demo/muon-monitor/src/commonMain/kotlin/ru/mipt/npm/muon/monitor/Model.kt
@@ -1,16 +1,13 @@
package ru.mipt.npm.muon.monitor
+import hep.dataforge.vision.removeAll
+import hep.dataforge.vision.solid.*
import ru.mipt.npm.muon.monitor.Monitor.CENTRAL_LAYER_Z
import ru.mipt.npm.muon.monitor.Monitor.LOWER_LAYER_Z
import ru.mipt.npm.muon.monitor.Monitor.UPPER_LAYER_Z
-import space.kscience.visionforge.VisionManager
-import space.kscience.visionforge.removeAll
-import space.kscience.visionforge.setAsRoot
-import space.kscience.visionforge.setProperty
-import space.kscience.visionforge.solid.*
import kotlin.math.PI
-class Model(val manager: VisionManager) {
+class Model {
private val map = HashMap()
private val events = HashSet()
@@ -37,11 +34,6 @@ class Model(val manager: VisionManager) {
var tracks: SolidGroup
val root: SolidGroup = SolidGroup().apply {
- setAsRoot(this@Model.manager)
- material {
- wireframe
- color("darkgreen")
- }
rotationX = PI / 2
group("bottom") {
Monitor.detectors.filter { it.center.z == LOWER_LAYER_Z }.forEach {
@@ -60,23 +52,23 @@ class Model(val manager: VisionManager) {
detector(it)
}
}
+
tracks = group("tracks")
}
private fun highlight(pixel: String) {
- println("highlight $pixel")
- map[pixel]?.color?.invoke("blue")
+ map[pixel]?.color("blue")
}
fun reset() {
map.values.forEach {
- it.setProperty(SolidMaterial.MATERIAL_COLOR_KEY, null)
+ it.config
+ it.setItem(SolidMaterial.MATERIAL_COLOR_KEY, null)
}
tracks.removeAll()
}
fun displayEvent(event: Event) {
- println("Received event: $event")
events.add(event)
event.hits.forEach {
highlight(it)
@@ -84,10 +76,11 @@ class Model(val manager: VisionManager) {
event.track?.let {
tracks.polyline(*it.toTypedArray(), name = "track[${event.id}]") {
thickness = 4
- color("red")
}
}
}
- fun encodeToString(): String = manager.encodeToString(this.root)
+ companion object {
+ fun buildGeometry() = Model().root
+ }
}
\ No newline at end of file
diff --git a/demo/muon-monitor/src/commonMain/kotlin/ru/mipt/npm/muon/monitor/Monitor.kt b/demo/muon-monitor/src/commonMain/kotlin/ru/mipt/npm/muon/monitor/Monitor.kt
index 3e1db5bc..e526c131 100644
--- a/demo/muon-monitor/src/commonMain/kotlin/ru/mipt/npm/muon/monitor/Monitor.kt
+++ b/demo/muon-monitor/src/commonMain/kotlin/ru/mipt/npm/muon/monitor/Monitor.kt
@@ -1,9 +1,9 @@
package ru.mipt.npm.muon.monitor
+import hep.dataforge.vision.solid.Point3D
+import hep.dataforge.vision.solid.plus
import ru.mipt.npm.muon.monitor.Monitor.PIXEL_XY_SIZE
import ru.mipt.npm.muon.monitor.Monitor.PIXEL_Z_SIZE
-import space.kscience.visionforge.solid.Point3D
-import space.kscience.visionforge.solid.plus
/**
* A single pixel
@@ -11,7 +11,7 @@ import space.kscience.visionforge.solid.plus
class SC1(
val name: String,
val center: Point3D,
- val xSize: Float = PIXEL_XY_SIZE, val ySize: Float = PIXEL_XY_SIZE, val zSize: Float = PIXEL_Z_SIZE
+ val xSize: Double = PIXEL_XY_SIZE, val ySize: Double = PIXEL_XY_SIZE, val zSize: Double = PIXEL_Z_SIZE
)
class SC16(
@@ -98,7 +98,7 @@ class SC16(
}
val offset = Point3D(-y, x, 0)//rotateDetector(Point3D(x, y, 0.0));
val pixelName = "${name}_${index}"
- SC1(pixelName, offset + center)
+ SC1(pixelName, center + offset)
}
}
}
@@ -121,12 +121,12 @@ internal expect fun readMonitorConfig(): String
object Monitor {
const val GEOMETRY_TOLERANCE = 0.01
- const val PIXEL_XY_SIZE = 122.0f
- const val PIXEL_XY_SPACING = 123.2f
- const val PIXEL_Z_SIZE = 30.0f
- const val CENTRAL_LAYER_Z = 0.0f
- const val UPPER_LAYER_Z = -166.0f
- const val LOWER_LAYER_Z = 180.0f
+ const val PIXEL_XY_SIZE = 122.0
+ const val PIXEL_XY_SPACING = 123.2
+ const val PIXEL_Z_SIZE = 30.0
+ const val CENTRAL_LAYER_Z = 0.0
+ const val UPPER_LAYER_Z = -166.0
+ const val LOWER_LAYER_Z = 180.0
/**
* Build map for the whole monitor
diff --git a/demo/muon-monitor/src/jsMain/kotlin/ru/mipt/npm/muon/monitor/MMAppComponent.kt b/demo/muon-monitor/src/jsMain/kotlin/ru/mipt/npm/muon/monitor/MMAppComponent.kt
index 558317cb..1291efb0 100644
--- a/demo/muon-monitor/src/jsMain/kotlin/ru/mipt/npm/muon/monitor/MMAppComponent.kt
+++ b/demo/muon-monitor/src/jsMain/kotlin/ru/mipt/npm/muon/monitor/MMAppComponent.kt
@@ -1,274 +1,166 @@
package ru.mipt.npm.muon.monitor
-import kotlinx.browser.window
-import kotlinx.coroutines.CompletableDeferred
-import kotlinx.coroutines.DelicateCoroutinesApi
-import kotlinx.coroutines.await
+import hep.dataforge.context.Context
+import hep.dataforge.names.Name
+import hep.dataforge.names.NameToken
+import hep.dataforge.names.isEmpty
+import hep.dataforge.vision.Vision
+import hep.dataforge.vision.bootstrap.card
+import hep.dataforge.vision.bootstrap.objectTree
+import hep.dataforge.vision.react.component
+import hep.dataforge.vision.react.configEditor
+import hep.dataforge.vision.react.state
+import hep.dataforge.vision.solid.specifications.Camera
+import hep.dataforge.vision.solid.specifications.Canvas3DOptions
+import hep.dataforge.vision.solid.three.ThreeCanvas
+import hep.dataforge.vision.solid.three.ThreeCanvasComponent
+import hep.dataforge.vision.solid.three.canvasControls
+import io.ktor.client.HttpClient
+import io.ktor.client.request.get
+import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
-import kotlinx.css.*
import kotlinx.html.js.onClickFunction
-import kotlinx.serialization.json.Json
-import org.w3c.fetch.RequestInit
-import react.Props
-import react.dom.attrs
-import react.dom.button
-import react.dom.p
-import react.fc
-import react.useMemo
-import react.useState
-import space.kscience.dataforge.context.Context
-import space.kscience.dataforge.names.Name
-import space.kscience.visionforge.react.flexColumn
-import space.kscience.visionforge.react.flexRow
-import space.kscience.visionforge.ring.ThreeCanvasWithControls
-import space.kscience.visionforge.ring.tab
-import space.kscience.visionforge.solid.specifications.Camera
-import space.kscience.visionforge.solid.specifications.Canvas3DOptions
-import space.kscience.visionforge.solid.three.edges
-import styled.css
-import styled.styledDiv
-import styled.styledSpan
+import react.RProps
+import react.dom.*
import kotlin.math.PI
-external interface MMAppProps : Props {
+interface MMAppProps : RProps {
var model: Model
var context: Context
+ var connection: HttpClient
var selected: Name?
}
-@OptIn(DelicateCoroutinesApi::class)
-@JsExport
-val MMApp = fc("Muon monitor") { props ->
+private val canvasConfig = Canvas3DOptions {
+ camera = Camera {
+ distance = 2100.0
+ latitude = PI / 6
+ azimuth = PI + PI / 6
+ }
+}
- val mmOptions = useMemo {
- Canvas3DOptions {
- camera = Camera {
- distance = 2100.0
- latitude = PI / 6
- azimuth = PI + PI / 6
+val MMApp = component { props ->
+ var selected by state { props.selected }
+ var canvas: ThreeCanvas? by state { null }
+
+ val select: (Name?) -> Unit = {
+ selected = it
+ }
+
+ val visual = props.model.root
+
+ div("row") {
+ h1("mx-auto") {
+ +"Muon monitor demo"
+ }
+ }
+ div("row") {
+ div("col-lg-3 px-0 overflow-auto") {
+ //tree
+ card("Object tree") {
+ objectTree(visual, selected, select)
}
}
- }
-
- val root = useMemo(props.model) {
- props.model.root.apply {
- edges()
+ div("col-lg-6") {
+ //canvas
+ child(ThreeCanvasComponent::class) {
+ attrs {
+ this.context = props.context
+ this.obj = visual
+ this.options = canvasConfig
+ this.selected = selected
+ this.clickCallback = select
+ this.canvasCallback = {
+ canvas = it
+ }
+ }
+ }
}
- }
-
- var events: Set by useState(emptySet())
-
- styledDiv {
- css {
- height = 100.vh - 12.pt
- }
- child(ThreeCanvasWithControls) {
- attrs {
- this.context = props.context
- this.builderOfSolid = CompletableDeferred(root)
- this.selected = props.selected
- this.options = mmOptions
- tab("Events") {
- flexColumn {
- flexRow {
- button {
- +"Next"
- attrs {
- onClickFunction = {
- context.launch {
- val event = window.fetch(
- "http://localhost:8080/event",
- RequestInit("GET")
- ).then { response ->
- if (response.ok) {
- response.text()
- } else {
- error("Failed to get event")
- }
- }.then { body ->
- Json.decodeFromString(Event.serializer(), body)
- }.await()
- events = events + event
- props.model.displayEvent(event)
- }
- }
- }
- }
- button {
- +"Clear"
- attrs {
- onClickFunction = {
- events = emptySet()
- props.model.reset()
- }
+ div("col-lg-3") {
+ div("row") {
+ //settings
+ canvas?.let {
+ card("Canvas configuration") {
+ canvasControls(it)
+ }
+ }
+ card("Events") {
+ button {
+ +"Next"
+ attrs {
+ onClickFunction = {
+ GlobalScope.launch {
+ val event = props.connection.get("http://localhost:8080/event")
+ props.model.displayEvent(event)
}
}
}
}
- events.forEach { event ->
- p {
- styledSpan {
- +event.id.toString()
- }
- +" : "
- styledSpan {
- css {
- color = Color.blue
- }
- +event.hits.toString()
+ button {
+ +"Clear"
+ attrs {
+ onClickFunction = {
+ props.model.reset()
}
}
}
}
}
-
+ div("row") {
+ div("container-fluid p-0") {
+ nav {
+ attrs {
+ attributes["aria-label"] = "breadcrumb"
+ }
+ ol("breadcrumb") {
+ li("breadcrumb-item") {
+ button(classes = "btn btn-link p-0") {
+ +"World"
+ attrs {
+ onClickFunction = {
+ selected = hep.dataforge.names.Name.EMPTY
+ }
+ }
+ }
+ }
+ if (selected != null) {
+ val tokens = ArrayList(selected?.length ?: 1)
+ selected?.tokens?.forEach { token ->
+ tokens.add(token)
+ val fullName = Name(tokens.toList())
+ li("breadcrumb-item") {
+ button(classes = "btn btn-link p-0") {
+ +token.toString()
+ attrs {
+ onClickFunction = {
+ console.log("Selected = $fullName")
+ selected = fullName
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ div("row") {
+ //properties
+ card("Properties") {
+ selected.let { selected ->
+ val selectedObject: Vision? = when {
+ selected == null -> null
+ selected.isEmpty() -> visual
+ else -> visual[selected]
+ }
+ if (selectedObject != null) {
+ configEditor(selectedObject, default = selectedObject.getAllProperties(), key = selected)
+ }
+ }
+ }
+ }
}
+
}
-
-// var selected by useState { props.selected }
-//
-// val onSelect: (Name?) -> Unit = {
-// selected = it
-// }
-//
-
-//
-// gridRow {
-// flexColumn {
-// css {
-// +"col-lg-3"
-// +"order-lg-1"
-// +"order-2"
-// padding(0.px)
-// overflowY = Overflow.auto
-// height = 100.vh
-// }
-// //tree
-// card("Object tree") {
-// css {
-// flex(1.0, 1.0, FlexBasis.auto)
-// }
-// visionTree(root, selected, onSelect)
-// }
-// }
-// flexColumn {
-// css {
-// +"col-lg-6"
-// +"order-lg-2"
-// +"order-1"
-// height = 100.vh
-// }
-// h1("mx-auto page-header") {
-// +"Muon monitor demo"
-// }
-// //canvas
-//
-// child(ThreeCanvasComponent) {
-// attrs {
-// this.context = props.context
-// this.solid = root
-// this.selected = selected
-// this.options = mmOptions
-// }
-// }
-// }
-// flexColumn {
-// css {
-// +"col-lg-3"
-// +"order-3"
-// padding(0.px)
-// height = 100.vh
-// }
-// styledDiv {
-// css {
-// flex(0.0, 1.0, FlexBasis.zero)
-// }
-// //settings
-// card("Canvas configuration") {
-// canvasControls(mmOptions, root)
-// }
-//
-// card("Events") {
-// button {
-// +"Next"
-// attrs {
-// onClickFunction = {
-// GlobalScope.launch {
-// val event = props.connection.get("http://localhost:8080/event")
-// props.model.displayEvent(event)
-// }
-// }
-// }
-// }
-// button {
-// +"Clear"
-// attrs {
-// onClickFunction = {
-// props.model.reset()
-// }
-// }
-// }
-// }
-// }
-// styledDiv {
-// css {
-// padding(0.px)
-// }
-// nav {
-// attrs {
-// attributes["aria-label"] = "breadcrumb"
-// }
-// ol("breadcrumb") {
-// li("breadcrumb-item") {
-// button(classes = "btn btn-link p-0") {
-// +"World"
-// attrs {
-// onClickFunction = {
-// selected = Name.EMPTY
-// }
-// }
-// }
-// }
-// if (selected != null) {
-// val tokens = ArrayList(selected?.length ?: 1)
-// selected?.tokens?.forEach { token ->
-// tokens.add(token)
-// val fullName = Name(tokens.toList())
-// li("breadcrumb-item") {
-// button(classes = "btn btn-link p-0") {
-// +token.toString()
-// attrs {
-// onClickFunction = {
-// console.log("Selected = $fullName")
-// selected = fullName
-// }
-// }
-// }
-// }
-// }
-// }
-// }
-// }
-// }
-// styledDiv {
-// css {
-// overflowY = Overflow.auto
-// }
-// //properties
-// card("Properties") {
-// selected.let { selected ->
-// val selectedObject: Vision? = when {
-// selected == null -> null
-// selected.isEmpty() -> root
-// else -> root[selected]
-// }
-// if (selectedObject != null) {
-// visionPropertyEditor(selectedObject, key = selected)
-// }
-// }
-// }
-// }
-// }
-//
-// }
}
\ No newline at end of file
diff --git a/demo/muon-monitor/src/jsMain/kotlin/ru/mipt/npm/muon/monitor/MMDemoApp.kt b/demo/muon-monitor/src/jsMain/kotlin/ru/mipt/npm/muon/monitor/MMDemoApp.kt
index 6b611146..3fc00667 100644
--- a/demo/muon-monitor/src/jsMain/kotlin/ru/mipt/npm/muon/monitor/MMDemoApp.kt
+++ b/demo/muon-monitor/src/jsMain/kotlin/ru/mipt/npm/muon/monitor/MMDemoApp.kt
@@ -1,31 +1,43 @@
package ru.mipt.npm.muon.monitor
-import kotlinx.browser.document
+import hep.dataforge.context.Global
+import hep.dataforge.js.Application
+import hep.dataforge.js.startApplication
+import hep.dataforge.vision.solid.SolidManager
+import io.ktor.client.HttpClient
+import io.ktor.client.features.json.JsonFeature
+import io.ktor.client.features.json.serializer.KotlinxSerializer
+import kotlinx.serialization.json.Json
+import react.child
+import react.dom.div
import react.dom.render
-import space.kscience.dataforge.context.Context
-import space.kscience.dataforge.context.fetch
-import space.kscience.visionforge.Application
-import space.kscience.visionforge.VisionManager
-import space.kscience.visionforge.solid.three.ThreePlugin
-import space.kscience.visionforge.startApplication
+import kotlin.browser.document
private class MMDemoApp : Application {
+ private val model = Model()
+
+ private val connection = HttpClient {
+ install(JsonFeature) {
+ serializer = KotlinxSerializer(Json(context = SolidManager.serialModule))
+ }
+ }
+
+ //TODO introduce react application
+
override fun start(state: Map) {
- val context = Context("MM-demo") {
- plugin(ThreePlugin)
- }
- val visionManager = context.fetch(VisionManager)
-
- val model = Model(visionManager)
-
+ val context = Global.context("demo") {}
val element = document.getElementById("app") ?: error("Element with id 'app' not found on page")
+
render(element) {
- child(MMApp) {
- attrs {
- this.model = model
- this.context = context
+ div("container-fluid h-100") {
+ child(MMApp) {
+ attrs {
+ model = this@MMDemoApp.model
+ connection = this@MMDemoApp.connection
+ this.context = context
+ }
}
}
}
diff --git a/demo/muon-monitor/src/jsMain/kotlin/ru/mipt/npm/muon/monitor/readResource.kt b/demo/muon-monitor/src/jsMain/kotlin/ru/mipt/npm/muon/monitor/readResource.kt
index 4fce1715..46242a20 100644
--- a/demo/muon-monitor/src/jsMain/kotlin/ru/mipt/npm/muon/monitor/readResource.kt
+++ b/demo/muon-monitor/src/jsMain/kotlin/ru/mipt/npm/muon/monitor/readResource.kt
@@ -1,7 +1,9 @@
package ru.mipt.npm.muon.monitor
+import hep.dataforge.js.requireJS
+
actual fun readResource(path: String): String {
- return kotlinext.js.require(path) as String
+ return requireJS(path) as String
}
// TODO replace by resource
diff --git a/demo/muon-monitor/src/jsMain/resources/index.html b/demo/muon-monitor/src/jsMain/resources/index.html
index dbca2406..13624f25 100644
--- a/demo/muon-monitor/src/jsMain/resources/index.html
+++ b/demo/muon-monitor/src/jsMain/resources/index.html
@@ -4,10 +4,13 @@
Three js demo for particle physics
-
-
+
+
+
+
+
-