Compare commits
369 Commits
v0.2.0-dev
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| ad5ec93598 | |||
| 5f285ff7a1 | |||
| 67dea7c3f1 | |||
| a42edb44f9 | |||
| 447831707d | |||
| c70f5a1704 | |||
| 198b3707c2 | |||
| f7338ad9b8 | |||
| 85fd825cfc | |||
| 09bb68c208 | |||
| d9c67de415 | |||
| 505686f678 | |||
| baec701f4b | |||
| e762b59499 | |||
| 5429674b28 | |||
| 9131d693d6 | |||
| 8172309de1 | |||
| bb7361d97e | |||
| 858b7d7b25 | |||
| 3e4bedde48 | |||
| 97b5973894 | |||
| 5a847141d0 | |||
| 674ade5a59 | |||
| 82538ad70c | |||
| 2c2dcd45f8 | |||
| 83f650e9ee | |||
| 5d5e284fe2 | |||
| 63a79a59cd | |||
| 4071f2c9cd | |||
| 5fd8e66eee | |||
| 718a841040 | |||
| 6086dd684d | |||
| 78b14a3641 | |||
| b61278b524 | |||
| 3ba378f870 | |||
| 6619fde71d | |||
| 723c0b82e5 | |||
| 7d3078879d | |||
| 50bff2b729 | |||
| 3446a88b46 | |||
| a2b3157c8a | |||
| aba3742b56 | |||
| 4f49901351 | |||
| 6fd719b9ee | |||
| 42e98f0bcc | |||
| f238b03833 | |||
| fd5ff5e30c | |||
| 51bb46a45c | |||
| d0220c98a4 | |||
| 5038829288 | |||
| e5882d01f8 | |||
| d305789aa8 | |||
| ec238edbd1 | |||
| 6dc1b9f349 | |||
| 1145483a90 | |||
| f0db286ce6 | |||
| d90c1edc6c | |||
| 38d6a9c419 | |||
| cbf3f4941a | |||
| 30ad680688 | |||
| 629923c03a | |||
| c499c3fc47 | |||
| 1022b74d23 | |||
| 58d7bd9383 | |||
| 067ed4aa3d | |||
| 30f6d51745 | |||
| 15ac3545b5 | |||
| da0f4c0ff0 | |||
| 7871987df1 | |||
| b5a1296070 | |||
| 3f144a5dbd | |||
| 659b9c3525 | |||
| 72ead21ef0 | |||
| 49be579bd3 | |||
| 4fd5c634bb | |||
| 8deabbcb99 | |||
| 60b1b1997e | |||
| 2e2524450d | |||
| 6ce1e68b86 | |||
| e36e4abb7f | |||
| 4f6f4b9268 | |||
| 0c9d849e97 | |||
| 9c2db6d321 | |||
| f40bed7bb9 | |||
| c5c3868786 | |||
| c0cf852c62 | |||
| 05b87857f4 | |||
| bce61c0fb0 | |||
| 9fc6f1e34c | |||
|
|
8e5503f0d8 | ||
| 595512959c | |||
| fbb402de90 | |||
| c877fcbce3 | |||
| 7561ddad36 | |||
| 5f4972a05e | |||
| 469655092e | |||
| 80284a99ef | |||
| e6bdb67262 | |||
| 71f7f59cb3 | |||
| ed71ba9ccb | |||
| 7b9fe54363 | |||
| f0048a4d46 | |||
| c7d4bdfa5f | |||
| 1ea5ef86e6 | |||
| 399be206be | |||
| 64c447a37b | |||
| 9c1246fb26 | |||
| cf6d73305b | |||
| 6144410d22 | |||
| 2578fd6f77 | |||
| 001efa711a | |||
| 1ebeefe01c | |||
| 8fac827acb | |||
| bdc2885c0d | |||
| 15b7dbd057 | |||
| 8749c0bda7 | |||
| cf4743b600 | |||
| 52d346453c | |||
| c7640a686a | |||
| 00213c089d | |||
| 9356e34328 | |||
| d44f25ad4c | |||
| af2539eed2 | |||
| 4b91e5d62b | |||
| ae12084dee | |||
| 35ec4bac0e | |||
| ba70af3a24 | |||
| 20fc81305c | |||
| 92bfb173d8 | |||
| 6a801f9999 | |||
|
|
cd28f377ab | ||
| 3529d0efc6 | |||
| 1e29c5dbaa | |||
| f5fba4747e | |||
| ed491bdae0 | |||
| b3f68d879f | |||
| a49a4f1a7f | |||
| 5783cf1430 | |||
| c1f275ce45 | |||
| 8b25761dc6 | |||
| 086948492c | |||
| 25c3a19eed | |||
| ea9d37b9a1 | |||
| 04b4a12946 | |||
| 8611327cc4 | |||
| f2d7e20fd3 | |||
| 07b54fde51 | |||
| 4bce9ad34c | |||
| 20851baaf5 | |||
| a695e5e7c9 | |||
| 2b70afdb86 | |||
| 8204eb63c3 | |||
| 442fcb6c5b | |||
| 38302eac4c | |||
| 140c59497e | |||
| 23cb8765b6 | |||
| a872f10523 | |||
| be52551564 | |||
| c4b866f5b5 | |||
| d32dc3fa08 | |||
| 18c39fc076 | |||
| f6f74b54f6 | |||
| 33778801b6 | |||
| c48e5aac25 | |||
| c921d5541b | |||
| 4ec611eda3 | |||
| 35fc7a7042 | |||
| 2bdaea2e82 | |||
| d28873e796 | |||
| fef1df3ab4 | |||
| fd8f693151 | |||
| c8141c6338 | |||
| 20b20a621f | |||
| d6c974fcbc | |||
| 4ceffef67a | |||
| 279b848039 | |||
| b2624cb10b | |||
| eae1316de5 | |||
| 3c51060e2e | |||
| 960d17855b | |||
| 81aa5d2fcc | |||
| f0a6e12358 | |||
| 56d577453a | |||
| 25fc143363 | |||
| 75540a078f | |||
| 40b784f551 | |||
| 67afa4e45b | |||
| cb25dca34c | |||
| 98bb935de5 | |||
| e2f281debe | |||
| ac651c4d50 | |||
| 846e87a44b | |||
| 34fbb23c60 | |||
| eeec89f0e6 | |||
| 43362f51f5 | |||
| c586a2ea14 | |||
| ecf4a6a198 | |||
| 0ea1ee056a | |||
| 9221df785d | |||
| 47bde02488 | |||
| c71042ae06 | |||
| 9b1ca8332b | |||
| 791d6d7a81 | |||
| 4b1149b99b | |||
| 86935ce52a | |||
| ce02a18c09 | |||
| 212d729afb | |||
| 3198bad094 | |||
|
|
fb12ca8902 | ||
| 9648533ac8 | |||
| 7ee40679b9 | |||
| f828f86e29 | |||
|
|
c6258e72fb | ||
| db5064f6ed | |||
| d504943295 | |||
| 8a6fab97e3 | |||
| b88090a7dd | |||
| 9745a58873 | |||
| bfa7f5ea57 | |||
|
|
ad9f43f5a5 | ||
| abf04cc657 | |||
| f2f6608a2e | |||
|
|
e512e9bbcf | ||
| 30fa35bef5 | |||
|
|
cebef9472a | ||
|
|
d278427f66 | ||
|
|
6260117c68 | ||
|
|
e70ef813de | ||
| faeefe8572 | |||
| 6d5c00f88b | |||
| 59e939a175 | |||
| bf5d47fd0e | |||
| 43285de33c | |||
| 6b8e166978 | |||
| 104e8f8f6f | |||
| b5fdc6c4fe | |||
| 3caa22f8bf | |||
| e7f0e1e4fc | |||
| 8d74bc55d1 | |||
| a715c2660a | |||
| 6787ec85de | |||
| b40c1d0025 | |||
| 9eb5def13c | |||
| dee2cf848c | |||
| 0ec9033702 | |||
|
|
44c4356794 | ||
| 0041a66575 | |||
| 42eb0a6f66 | |||
|
|
a655410a2a | ||
| d131dc49ab | |||
| f89b003e93 | |||
| bdbe940272 | |||
| 2e3b63c0f4 | |||
| aea4eb7d45 | |||
| 0ee14aa90e | |||
| e25c1bd49b | |||
| 7b5faaa61e | |||
| 68704086e9 | |||
| 193665b99a | |||
| df30f8ecc3 | |||
| e39f79e4ab | |||
| 64e084dc53 | |||
|
|
cc1e35bfca | ||
|
|
a3eaa167a5 | ||
|
|
59bc541540 | ||
|
|
51b8ae279a | ||
|
|
ce9a2dde11 | ||
|
|
5f07bf1920 | ||
|
|
ab1ff5b16f | ||
|
|
0b4fea5ff1 | ||
|
|
9b6cdd0166 | ||
| 1b2d61008f | |||
|
|
1e4e4373bc | ||
|
|
f0bf293017 | ||
|
|
a7252e62f9 | ||
| 02df77e97e | |||
|
|
7103f49ff9 | ||
| 829d0dfde7 | |||
| 9a1ea8bd1f | |||
| 5d2c853cbe | |||
| a748282d63 | |||
| 4201362cc4 | |||
| f2120aedf3 | |||
| 6ff3a04278 | |||
| b79265e8c2 | |||
|
|
f00408166b | ||
| a15afb3d52 | |||
| 9afe5da45b | |||
| bb61b97c1d | |||
| cbc67cb16b | |||
| 238a9e0dd1 | |||
|
|
f602e21b23 | ||
|
|
350d7c6634 | ||
|
|
67a2d3c241 | ||
|
|
0c71101858 | ||
|
|
c70d4d2da6 | ||
|
|
d361d42c29 | ||
|
|
7b99ec54d2 | ||
|
|
68495c0cdf | ||
| 8a8bac48db | |||
| 95459422d6 | |||
| af327c17e3 | |||
| f99a359e24 | |||
| a33d9d1946 | |||
| 60cec91ab8 | |||
| d916dde6a7 | |||
| c44162671f | |||
| c425f3b36f | |||
| 1505aa8091 | |||
| c410baac8c | |||
| e38bac8d23 | |||
|
|
25e46a6c47 | ||
| 5721bb9456 | |||
|
|
a027e71c48 | ||
|
|
004cdc049b | ||
| 7b78052f61 | |||
| 8d21d3cd74 | |||
|
|
052336700a | ||
|
|
2a9e5c4078 | ||
|
|
0e3c3cf2ce | ||
|
|
60da696785 | ||
|
|
5b2da86838 | ||
|
|
92474b0334 | ||
|
|
623d1e7e3e | ||
|
|
99c6d0e14c | ||
|
|
84e0211b54 | ||
|
|
16c3144b45 | ||
|
|
9c6d646b53 | ||
|
|
2d6be6629a | ||
|
|
cb057db93b | ||
|
|
133de264c1 | ||
|
|
f71130ea0b | ||
|
|
1d77768071 | ||
|
|
689071d0da | ||
|
|
6d7356f08c | ||
|
|
d5c0afd8c0 | ||
|
|
2c2b7a5fa2 | ||
|
|
b3ecc2136e | ||
|
|
426c1ff990 | ||
|
|
b566d1c9f6 | ||
|
|
eea617f418 | ||
|
|
a0d3e46f61 | ||
|
|
89cff65a90 | ||
|
|
0dafbb2a34 | ||
|
|
29bcaab1f8 | ||
|
|
639a192d59 | ||
|
|
145673752e | ||
|
|
2643d2b587 | ||
|
|
4bdea746fc | ||
|
|
aa53b7b9b7 | ||
|
|
456e01fcfa | ||
|
|
4a2b891b83 | ||
|
|
d51a38eac4 | ||
|
|
a474ad7b3b | ||
|
|
72d3503dc3 | ||
|
|
786b902fd9 | ||
|
|
e818ecdcc3 | ||
|
|
f611409208 | ||
|
|
44da86d496 | ||
|
|
10626a836d | ||
|
|
73d5943a07 | ||
|
|
3a5da762d1 | ||
|
|
e37bc77988 | ||
|
|
5bd6f98c6e | ||
|
|
eb3786c5ca | ||
| a0d62c65d7 | |||
| 787c841a51 | |||
|
|
bdb28eb338 | ||
|
|
6435f71783 |
24
.github/workflows/build.yml
vendored
Normal file
24
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
name: Gradle build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ dev, master ]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-java@v3.5.1
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'liberica'
|
||||
cache: 'gradle'
|
||||
- name: Gradle Wrapper Validation
|
||||
uses: gradle/wrapper-validation-action@v1.0.4
|
||||
- name: Gradle Build
|
||||
uses: gradle/gradle-build-action@v2.4.2
|
||||
with:
|
||||
arguments: test jvmTest
|
||||
19
.github/workflows/gradle.yml
vendored
19
.github/workflows/gradle.yml
vendored
@@ -1,19 +0,0 @@
|
||||
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
|
||||
24
.github/workflows/pages.yml
vendored
Normal file
24
.github/workflows/pages.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
name: Dokka publication
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
release:
|
||||
types: [ created ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 40
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: 17
|
||||
distribution: liberica
|
||||
- uses: gradle/gradle-build-action@v3
|
||||
with:
|
||||
arguments: dokkaGenerate --no-parallel
|
||||
- uses: JamesIves/github-pages-deploy-action@v4
|
||||
with:
|
||||
branch: gh-pages
|
||||
folder: build/dokka/html
|
||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -3,6 +3,12 @@
|
||||
*.iws
|
||||
out/
|
||||
.gradle
|
||||
.kotlin/
|
||||
build/
|
||||
data/
|
||||
|
||||
jcef-bundle/
|
||||
|
||||
!gradle-wrapper.jar
|
||||
|
||||
/kotlin-js-store/yarn.lock
|
||||
|
||||
108
CHANGELOG.md
108
CHANGELOG.md
@@ -1,7 +1,104 @@
|
||||
# Changelog
|
||||
|
||||
## [Unreleased]
|
||||
## Unreleased
|
||||
|
||||
### Added
|
||||
|
||||
### Changed
|
||||
|
||||
### Deprecated
|
||||
|
||||
### Removed
|
||||
|
||||
### Fixed
|
||||
|
||||
### Security
|
||||
|
||||
## 0.5.0 - 2025-03-21
|
||||
|
||||
### Added
|
||||
|
||||
- Plotly refactored on top of visionforge/server. Now it is called `plotly-kt`. Version follows general VisionForge version.
|
||||
|
||||
### Changed
|
||||
|
||||
- Simplified Vision and VisionGroup logic. Observation logic moved out.
|
||||
- Use `Name` for child designation and `Path` for tree access
|
||||
- The default intensity for AmbientLight is 1.0. The intensity scale for Three-js is 3.0.
|
||||
|
||||
### Removed
|
||||
|
||||
- VisionChildren and VisionProperties
|
||||
|
||||
### Fixed
|
||||
|
||||
- Vision server now automatically switches to WSS protocol for updates if incoming protocol is HTTPS
|
||||
- Issue with track removal in muon monitor demo.
|
||||
|
||||
## 0.4.2 - 2024-06-06
|
||||
|
||||
### Added
|
||||
|
||||
- Moved plotly-kt repo inside this one
|
||||
|
||||
### Changed
|
||||
|
||||
- Kotlin 2.0
|
||||
- DataForge 0.9
|
||||
|
||||
## 0.4.1 - 2024-03-15
|
||||
|
||||
### Changed
|
||||
|
||||
- VisionProperties `flowChanges()` -> `changes`
|
||||
|
||||
### Fixed
|
||||
|
||||
- Bug with ElementVisionRenderer having the same name
|
||||
- Plotly update problem
|
||||
|
||||
## 0.4.0 - 2024-02-16
|
||||
|
||||
### Added
|
||||
|
||||
- Added compose-mpp rendering.
|
||||
|
||||
### Changed
|
||||
|
||||
- **Breaking API** Move vision cache to upper level for renderers to avoid re-creating visions for page reload.
|
||||
- **Breaking API** Forms refactor.
|
||||
- **Breaking API** Migrated from React to Compose-html.
|
||||
- **Breaking API** changed js package for `visionforge-core` to `space.kscience.visionforge.html` to avoid mixing html and generic parts.
|
||||
|
||||
## 0.3.0 - 2023-12-23
|
||||
|
||||
### Added
|
||||
|
||||
- Context receivers flag
|
||||
- MeshLine for thick lines
|
||||
- Custom client-side events and thier processing in VisionServer
|
||||
- Control/input visions
|
||||
|
||||
### Changed
|
||||
|
||||
- Color accessor property is now `colorProperty`. Color uses non-nullable `invoke` instead of `set`.
|
||||
- API update for server and pages
|
||||
- Edges moved to solids module for easier construction
|
||||
- Visions **must** be rooted in order to subscribe to updates.
|
||||
- Visions use flows instead of direct subscriptions.
|
||||
- Radical change of inner workings of vision children and properties.
|
||||
- Three package changed to `three`.
|
||||
- Naming of Canvas3D options.
|
||||
- Lights are added to the scene instead of 3D options.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Jupyter integration for IDEA and Jupyter lab.
|
||||
|
||||
## 0.2.0
|
||||
|
||||
### Added
|
||||
|
||||
- Server module
|
||||
- Change collector
|
||||
- Customizable accessors for colors
|
||||
@@ -9,8 +106,11 @@
|
||||
- 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
|
||||
@@ -25,12 +125,10 @@
|
||||
- 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
|
||||
- Version conflicts
|
||||
|
||||
182
README.md
182
README.md
@@ -14,25 +14,22 @@
|
||||
* [Features](#features)
|
||||
* [About DataForge](#about-dataforge)
|
||||
* [Modules contained in this repository](#modules-contained-in-this-repository)
|
||||
* [visionforge-core](#visionforge-core)
|
||||
* [visionforge-solid](#visionforge-solid)
|
||||
* [visionforge-gdml](#visionforge-gdml)
|
||||
* [Visualization for External Systems](#visualization-for-external-systems)
|
||||
* [Visualization for External Systems](#visualization-for-external-systems)
|
||||
* [Demonstrations](#demonstrations)
|
||||
* [Simple Example - Spatial Showcase](#simple-example---spatial-showcase)
|
||||
* [Simple Example - Solid Showcase](#simple-example---solid-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
|
||||
@@ -57,28 +54,128 @@ 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
|
||||
|
||||
Contains a general hierarchy of classes and interfaces useful for visualization.
|
||||
This module is not specific to 3D-visualization.
|
||||
### [cern-root-loader](cern-root-loader)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
The `visionforge-core` module also includes configuration editors for JS (in `jsMain`) and JVM (in `jvmMain`).
|
||||
### [demo](demo)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
**Class diagram:**
|
||||
### [plotly-kt](plotly-kt)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||

|
||||
### [visionforge-compose-html](visionforge-compose-html)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
### [visionforge-compose-multiplatform](visionforge-compose-multiplatform)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
### visionforge-solid
|
||||
### [visionforge-core](visionforge-core)
|
||||
>
|
||||
> **Maturity**: DEVELOPMENT
|
||||
|
||||
### [visionforge-gdml](visionforge-gdml)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
### [visionforge-jupyter](visionforge-jupyter)
|
||||
> Common visionforge jupyter module
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
### [visionforge-markdown](visionforge-markdown)
|
||||
>
|
||||
> **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
|
||||
|
||||
### [demo/compose-desktop-demo](demo/compose-desktop-demo)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
### [demo/gdml](demo/gdml)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
### [demo/js-playground](demo/js-playground)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
### [demo/muon-monitor](demo/muon-monitor)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
### [demo/playground](demo/playground)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
### [demo/sat-demo](demo/sat-demo)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
### [demo/solid-showcase](demo/solid-showcase)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
### [plotly-kt/examples](plotly-kt/examples)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
### [plotly-kt/plotly-kt-core](plotly-kt/plotly-kt-core)
|
||||
>
|
||||
> **Maturity**: DEVELOPMENT
|
||||
|
||||
### [plotly-kt/plotly-kt-server](plotly-kt/plotly-kt-server)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
### [visionforge-jupyter/visionforge-jupyter-common](visionforge-jupyter/visionforge-jupyter-common)
|
||||
> Jupyter api artifact including all common modules
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
### [visionforge-threejs/visionforge-threejs-server](visionforge-threejs/visionforge-threejs-server)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
### [plotly-kt/examples/compose-demo](plotly-kt/examples/compose-demo)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
### [plotly-kt/examples/js-demo](plotly-kt/examples/js-demo)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
### [plotly-kt/examples/native-demo](plotly-kt/examples/native-demo)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
Includes common classes and serializers for 3D visualization, as well as Three.js and JavaFX implementations.
|
||||
|
||||
**Class diagram:**
|
||||
|
||||
@@ -87,30 +184,26 @@ Includes common classes and serializers for 3D visualization, as well as Three.j
|
||||
##### 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
|
||||
The `prototypes` property tree is defined in `SolidGroup` class via `PrototypeHolder` interface, and
|
||||
`SolidReference` class helps to reuse a template object.
|
||||
|
||||
##### Styles
|
||||
|
||||
`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<String>` property.
|
||||
`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<String>` property.
|
||||
|
||||
### visionforge-threejs
|
||||
|
||||
### visionforge-gdml
|
||||
|
||||
GDML bindings for 3D visualization (to be moved to gdml project).
|
||||
|
||||
|
||||
## Visualization for External Systems
|
||||
## 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
|
||||
|
||||
@@ -118,21 +211,21 @@ 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 - Spatial Showcase
|
||||
### Simple Example - Solid 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/spatial-showcase/README.md)
|
||||
[More details](demo/solid-showcase/README.md)
|
||||
|
||||
**Example view:**
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
### 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)
|
||||
@@ -144,7 +237,7 @@ A full-stack application example, showing the
|
||||
|
||||
### GDML Example
|
||||
|
||||
Visualization example for geometry defined as GDML file.
|
||||
Visualization example for geometry defined as GDML file.
|
||||
|
||||
[More details](demo/gdml/README.md)
|
||||
|
||||
@@ -153,7 +246,22 @@ Visualization example for geometry defined as GDML file.
|
||||

|
||||
|
||||
|
||||
## Stability and documentation
|
||||
|
||||
VisionForge is a modular library. Different modules provide different features with different API stability guarantees. All core modules are released with the same version, but with different API change policy. The features are described in module definitions below. The module stability could have the following levels:
|
||||
|
||||
* **PROTOTYPE**. On this level there are no compatibility guarantees. All methods and classes form those modules could break any moment. You can still use it, but be sure to fix the specific version.
|
||||
* **EXPERIMENTAL**. The general API is decided, but some changes could be made. Volatile API is marked
|
||||
with `@DFExperimental` or other stability warning annotations.
|
||||
* **DEVELOPMENT**. API breaking generally follows semantic versioning ideology. There could be changes in minor
|
||||
versions, but not in patch versions. API is protected with [binary-compatibility-validator](https://github.com/Kotlin/binary-compatibility-validator) tool.
|
||||
* **STABLE**. The API stabilized. Breaking changes are allowed only in major releases.
|
||||
|
||||
Additionally, one should note that the VisionForge Json format impacts the reproducibility of stored vision fragments. There should not be any breaks of the format between major releases. All problems should be reported.
|
||||
|
||||
The documentation for the project is a work in progress. Please report any issues with missing, vague or wrong information. The contributions into documentation are quite welcome.
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -1,41 +1,55 @@
|
||||
plugins {
|
||||
id("ru.mipt.npm.gradle.project")
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
import space.kscience.gradle.useApache2Licence
|
||||
import space.kscience.gradle.useSPCTeam
|
||||
|
||||
//Override kotlin version
|
||||
// val kotlinVersion = "1.5.20-RC"
|
||||
// kotlin("multiplatform") version(kotlinVersion) apply false
|
||||
// kotlin("jvm") version(kotlinVersion) apply false
|
||||
// kotlin("js") version(kotlinVersion) apply false
|
||||
plugins {
|
||||
id("space.kscience.gradle.project")
|
||||
alias(spclibs.plugins.kotlinx.kover)
|
||||
}
|
||||
|
||||
val dataforgeVersion by extra("0.4.3")
|
||||
val fxVersion by extra("11")
|
||||
val dataforgeVersion by extra("0.10.1")
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
maven("https://repo.kotlin.link")
|
||||
maven("https://maven.jzy3d.org/releases")
|
||||
}
|
||||
|
||||
group = "space.kscience"
|
||||
version = "0.2.0-dev-22"
|
||||
version = "0.5.0"
|
||||
}
|
||||
|
||||
subprojects {
|
||||
if (name.startsWith("visionforge")) {
|
||||
plugins.apply("maven-publish")
|
||||
if (name.startsWith("visionforge")) apply<MavenPublishPlugin>()
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
maven("https://repo.kotlin.link")
|
||||
mavenCentral()
|
||||
maven("https://maven.jzy3d.org/releases")
|
||||
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
compilerOptions {
|
||||
freeCompilerArgs.addAll("-Xcontext-parameters")
|
||||
}
|
||||
}
|
||||
|
||||
// tasks.withType<KotlinJsCompile>{
|
||||
// kotlinOptions{
|
||||
// useEsClasses = true
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
ksciencePublish{
|
||||
github("visionforge")
|
||||
space()
|
||||
sonatype()
|
||||
|
||||
ksciencePublish {
|
||||
pom("https://github.com/SciProgCentre/visionforge") {
|
||||
useApache2Licence()
|
||||
useSPCTeam()
|
||||
}
|
||||
repository("spc", "https://maven.sciprog.center/kscience")
|
||||
central()
|
||||
}
|
||||
|
||||
apiValidation {
|
||||
validationDisabled = true
|
||||
ignoredPackages.add("info.laht.threekt")
|
||||
}
|
||||
}
|
||||
|
||||
readme.readmeTemplate = file("docs/templates/README-TEMPLATE.md")
|
||||
21
cern-root-loader/README.md
Normal file
21
cern-root-loader/README.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Module cern-root-loader
|
||||
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
## Artifact:
|
||||
|
||||
The Maven coordinates of this project are `space.kscience:cern-root-loader:0.5.0`.
|
||||
|
||||
**Gradle Kotlin DSL:**
|
||||
```kotlin
|
||||
repositories {
|
||||
maven("https://repo.kotlin.link")
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("space.kscience:cern-root-loader:0.5.0")
|
||||
}
|
||||
```
|
||||
970
cern-root-loader/api/cern-root-loader.api
Normal file
970
cern-root-loader/api/cern-root-loader.api
Normal file
@@ -0,0 +1,970 @@
|
||||
public final class ru/mipt/npm/root/BMN {
|
||||
public static final field INSTANCE Lru/mipt/npm/root/BMN;
|
||||
public final fun getJson ()Lkotlinx/serialization/json/Json;
|
||||
public final fun readEventJson (Ljava/lang/String;)Lru/mipt/npm/root/BmnEventContainer;
|
||||
}
|
||||
|
||||
public final class ru/mipt/npm/root/BMNKt {
|
||||
public static final fun toVector (Lru/mipt/npm/root/FairTrackParam;)Lspace/kscience/kmath/geometry/Vector3D;
|
||||
}
|
||||
|
||||
public final class ru/mipt/npm/root/BmnEventContainer {
|
||||
public fun <init> (Ljava/util/List;Ljava/util/List;)V
|
||||
public final fun getBmnGlobalTracks ()Ljava/util/List;
|
||||
public final fun getCbmTracks ()Ljava/util/List;
|
||||
}
|
||||
|
||||
public final class ru/mipt/npm/root/BmnGlobalTrack {
|
||||
public static final field Companion Lru/mipt/npm/root/BmnGlobalTrack$Companion;
|
||||
public fun <init> (Lru/mipt/npm/root/FairTrackParam;Lru/mipt/npm/root/FairTrackParam;)V
|
||||
public final fun component1 ()Lru/mipt/npm/root/FairTrackParam;
|
||||
public final fun component2 ()Lru/mipt/npm/root/FairTrackParam;
|
||||
public final fun copy (Lru/mipt/npm/root/FairTrackParam;Lru/mipt/npm/root/FairTrackParam;)Lru/mipt/npm/root/BmnGlobalTrack;
|
||||
public static synthetic fun copy$default (Lru/mipt/npm/root/BmnGlobalTrack;Lru/mipt/npm/root/FairTrackParam;Lru/mipt/npm/root/FairTrackParam;ILjava/lang/Object;)Lru/mipt/npm/root/BmnGlobalTrack;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public final fun getFParamFirst ()Lru/mipt/npm/root/FairTrackParam;
|
||||
public final fun getFParamLast ()Lru/mipt/npm/root/FairTrackParam;
|
||||
public fun hashCode ()I
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public synthetic class ru/mipt/npm/root/BmnGlobalTrack$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
|
||||
public static final field INSTANCE Lru/mipt/npm/root/BmnGlobalTrack$$serializer;
|
||||
public final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/BmnGlobalTrack;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/BmnGlobalTrack;)V
|
||||
}
|
||||
|
||||
public final class ru/mipt/npm/root/BmnGlobalTrack$Companion {
|
||||
public final fun serializer ()Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
public final class ru/mipt/npm/root/CbmStsTrack {
|
||||
public static final field Companion Lru/mipt/npm/root/CbmStsTrack$Companion;
|
||||
public fun <init> (Lru/mipt/npm/root/FairTrackParam;Lru/mipt/npm/root/FairTrackParam;)V
|
||||
public final fun component1 ()Lru/mipt/npm/root/FairTrackParam;
|
||||
public final fun component2 ()Lru/mipt/npm/root/FairTrackParam;
|
||||
public final fun copy (Lru/mipt/npm/root/FairTrackParam;Lru/mipt/npm/root/FairTrackParam;)Lru/mipt/npm/root/CbmStsTrack;
|
||||
public static synthetic fun copy$default (Lru/mipt/npm/root/CbmStsTrack;Lru/mipt/npm/root/FairTrackParam;Lru/mipt/npm/root/FairTrackParam;ILjava/lang/Object;)Lru/mipt/npm/root/CbmStsTrack;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public final fun getFParamFirst ()Lru/mipt/npm/root/FairTrackParam;
|
||||
public final fun getFParamLast ()Lru/mipt/npm/root/FairTrackParam;
|
||||
public fun hashCode ()I
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public synthetic class ru/mipt/npm/root/CbmStsTrack$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
|
||||
public static final field INSTANCE Lru/mipt/npm/root/CbmStsTrack$$serializer;
|
||||
public final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/CbmStsTrack;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/CbmStsTrack;)V
|
||||
}
|
||||
|
||||
public final class ru/mipt/npm/root/CbmStsTrack$Companion {
|
||||
public final fun serializer ()Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
public final class ru/mipt/npm/root/DGeoBoolNode : ru/mipt/npm/root/DObject {
|
||||
public fun <init> (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 class ru/mipt/npm/root/DGeoCombiTrans : ru/mipt/npm/root/DGeoMatrix {
|
||||
public fun <init> (Lspace/kscience/dataforge/meta/Meta;Lru/mipt/npm/root/DObjectCache;)V
|
||||
public final fun getFRotation ()Lru/mipt/npm/root/DGeoRotation;
|
||||
public final fun getFTranslation ()[D
|
||||
}
|
||||
|
||||
public final class ru/mipt/npm/root/DGeoGenTrans : ru/mipt/npm/root/DGeoCombiTrans {
|
||||
public fun <init> (Lspace/kscience/dataforge/meta/Meta;Lru/mipt/npm/root/DObjectCache;)V
|
||||
public final fun getFScale ()[D
|
||||
}
|
||||
|
||||
public final class ru/mipt/npm/root/DGeoHMatrix : ru/mipt/npm/root/DGeoMatrix {
|
||||
public fun <init> (Lspace/kscience/dataforge/meta/Meta;Lru/mipt/npm/root/DObjectCache;)V
|
||||
public final fun getFRotation ()Lru/mipt/npm/root/DGeoRotation;
|
||||
public final fun getFScale ()[D
|
||||
public final fun getFTranslation ()[D
|
||||
}
|
||||
|
||||
public final class ru/mipt/npm/root/DGeoIdentity : ru/mipt/npm/root/DGeoMatrix {
|
||||
public fun <init> (Lspace/kscience/dataforge/meta/Meta;Lru/mipt/npm/root/DObjectCache;)V
|
||||
}
|
||||
|
||||
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 <init> (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 <init> (Lspace/kscience/dataforge/meta/Meta;Lru/mipt/npm/root/DObjectCache;)V
|
||||
}
|
||||
|
||||
public abstract class ru/mipt/npm/root/DGeoMatrix : ru/mipt/npm/root/DNamed {
|
||||
public synthetic fun <init> (Lspace/kscience/dataforge/meta/Meta;Lru/mipt/npm/root/DObjectCache;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
}
|
||||
|
||||
public final class ru/mipt/npm/root/DGeoMedium : ru/mipt/npm/root/DNamed {
|
||||
public fun <init> (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 <init> (Lspace/kscience/dataforge/meta/Meta;Lru/mipt/npm/root/DObjectCache;)V
|
||||
public final fun getFVolume ()Lru/mipt/npm/root/DGeoVolume;
|
||||
}
|
||||
|
||||
public final class ru/mipt/npm/root/DGeoRotation : ru/mipt/npm/root/DGeoMatrix {
|
||||
public fun <init> (Lspace/kscience/dataforge/meta/Meta;Lru/mipt/npm/root/DObjectCache;)V
|
||||
public final fun getFRotationMatrix ()[D
|
||||
}
|
||||
|
||||
public final class ru/mipt/npm/root/DGeoScale : ru/mipt/npm/root/DGeoMatrix {
|
||||
public fun <init> (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 <init> (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/DGeoTranslation : ru/mipt/npm/root/DGeoMatrix {
|
||||
public fun <init> (Lspace/kscience/dataforge/meta/Meta;Lru/mipt/npm/root/DObjectCache;)V
|
||||
public final fun getFTranslation ()[D
|
||||
}
|
||||
|
||||
public final class ru/mipt/npm/root/DGeoVolume : ru/mipt/npm/root/DNamed, space/kscience/dataforge/misc/Named {
|
||||
public fun <init> (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 <init> (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 <init> (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 <init> (Ljava/util/List;Ljava/util/List;)V
|
||||
public synthetic fun <init> (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 rootGeo (Lspace/kscience/visionforge/MutableVisionContainer;Lru/mipt/npm/root/DGeoManager;Ljava/lang/String;IZ)Lspace/kscience/visionforge/solid/SolidGroup;
|
||||
public static synthetic fun rootGeo$default (Lspace/kscience/visionforge/MutableVisionContainer;Lru/mipt/npm/root/DGeoManager;Ljava/lang/String;IZILjava/lang/Object;)Lspace/kscience/visionforge/solid/SolidGroup;
|
||||
}
|
||||
|
||||
public final class ru/mipt/npm/root/FairTrackParam {
|
||||
public static final field Companion Lru/mipt/npm/root/FairTrackParam$Companion;
|
||||
public fun <init> (DDDDDD)V
|
||||
public final fun component1 ()D
|
||||
public final fun component2 ()D
|
||||
public final fun component3 ()D
|
||||
public final fun component4 ()D
|
||||
public final fun component5 ()D
|
||||
public final fun component6 ()D
|
||||
public final fun copy (DDDDDD)Lru/mipt/npm/root/FairTrackParam;
|
||||
public static synthetic fun copy$default (Lru/mipt/npm/root/FairTrackParam;DDDDDDILjava/lang/Object;)Lru/mipt/npm/root/FairTrackParam;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public final fun getFQp ()D
|
||||
public final fun getFTx ()D
|
||||
public final fun getFTy ()D
|
||||
public final fun getFX ()D
|
||||
public final fun getFY ()D
|
||||
public final fun getFZ ()D
|
||||
public fun hashCode ()I
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public synthetic class ru/mipt/npm/root/FairTrackParam$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
|
||||
public static final field INSTANCE Lru/mipt/npm/root/FairTrackParam$$serializer;
|
||||
public final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/FairTrackParam;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/FairTrackParam;)V
|
||||
}
|
||||
|
||||
public final class ru/mipt/npm/root/FairTrackParam$Companion {
|
||||
public final fun serializer ()Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
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 rootGeo (Lspace/kscience/visionforge/MutableVisionContainer;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 <init> ()V
|
||||
public synthetic fun <init> (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 synthetic fun write$Self (Lru/mipt/npm/root/serialization/TGeoBBox;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
|
||||
}
|
||||
|
||||
public synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoBBox;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoBBox;)V
|
||||
}
|
||||
|
||||
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 <init> (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 synthetic 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 fun <init> ([DLru/mipt/npm/root/serialization/TGeoRotation;)V
|
||||
public synthetic fun <init> ([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 synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoCombiTrans;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoCombiTrans;)V
|
||||
}
|
||||
|
||||
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 fun <init> (Lru/mipt/npm/root/serialization/TGeoBoolNode;)V
|
||||
public final fun getFNode ()Lru/mipt/npm/root/serialization/TGeoBoolNode;
|
||||
}
|
||||
|
||||
public synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoCompositeShape;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoCompositeShape;)V
|
||||
}
|
||||
|
||||
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 fun <init> ([D[D[D)V
|
||||
public final fun getFRotationMatrix ()[D
|
||||
public final fun getFScale ()[D
|
||||
public final fun getFTranslation ()[D
|
||||
}
|
||||
|
||||
public synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoHMatrix;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoHMatrix;)V
|
||||
}
|
||||
|
||||
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 <init> ()V
|
||||
}
|
||||
|
||||
public synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoIdentity;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoIdentity;)V
|
||||
}
|
||||
|
||||
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 fun <init> (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 synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoIntersection;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoIntersection;)V
|
||||
}
|
||||
|
||||
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 <init> ()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 synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoManager;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoManager;)V
|
||||
}
|
||||
|
||||
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 <init> ()V
|
||||
public synthetic fun <init> (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;Lkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public static final synthetic fun write$Self (Lru/mipt/npm/root/serialization/TGeoMaterial;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
|
||||
}
|
||||
|
||||
public synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoMaterial;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoMaterial;)V
|
||||
}
|
||||
|
||||
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 <init> (ILkotlin/UInt;Lkotlin/UInt;Ljava/lang/String;Ljava/lang/String;Lkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public static final synthetic 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 fun <init> (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 synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoMedium;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoMedium;)V
|
||||
}
|
||||
|
||||
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 <init> ()V
|
||||
}
|
||||
|
||||
public synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoMixture;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoMixture;)V
|
||||
}
|
||||
|
||||
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 <init> ()V
|
||||
public synthetic fun <init> (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 synthetic fun write$Self (Lru/mipt/npm/root/serialization/TGeoNode;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
|
||||
}
|
||||
|
||||
public synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoNode;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoNode;)V
|
||||
}
|
||||
|
||||
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 <init> ()V
|
||||
public final fun getFMatrix ()Lru/mipt/npm/root/serialization/TGeoMatrix;
|
||||
}
|
||||
|
||||
public synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoNodeMatrix;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoNodeMatrix;)V
|
||||
}
|
||||
|
||||
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 <init> ()V
|
||||
public final fun getFOffset ()D
|
||||
}
|
||||
|
||||
public synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoNodeOffset;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoNodeOffset;)V
|
||||
}
|
||||
|
||||
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 <init> ()V
|
||||
public synthetic fun <init> (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 synthetic fun write$Self (Lru/mipt/npm/root/serialization/TGeoPcon;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
|
||||
}
|
||||
|
||||
public synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoPcon;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoPcon;)V
|
||||
}
|
||||
|
||||
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 <init> ()V
|
||||
public synthetic fun <init> (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 synthetic fun write$Self (Lru/mipt/npm/root/serialization/TGeoPgon;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
|
||||
}
|
||||
|
||||
public synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoPgon;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoPgon;)V
|
||||
}
|
||||
|
||||
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 fun <init> ([D)V
|
||||
public final fun getFRotationMatrix ()[D
|
||||
}
|
||||
|
||||
public synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoRotation;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoRotation;)V
|
||||
}
|
||||
|
||||
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 <init> (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 synthetic 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 fun <init> (Lru/mipt/npm/root/serialization/TGeoVolumeAssembly;Z)V
|
||||
public synthetic fun <init> (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 synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoShapeAssembly;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoShapeAssembly;)V
|
||||
}
|
||||
|
||||
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 <init> (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 fun <init> (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 synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoSubtraction;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoSubtraction;)V
|
||||
}
|
||||
|
||||
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 fun <init> ([D)V
|
||||
public final fun getFTranslation ()[D
|
||||
}
|
||||
|
||||
public synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoTranslation;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoTranslation;)V
|
||||
}
|
||||
|
||||
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 <init> ()V
|
||||
public synthetic fun <init> (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 synthetic fun write$Self (Lru/mipt/npm/root/serialization/TGeoTube;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
|
||||
}
|
||||
|
||||
public synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoTube;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoTube;)V
|
||||
}
|
||||
|
||||
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 <init> (DDDDDDDDD)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 synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoTubeSeg;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoTubeSeg;)V
|
||||
}
|
||||
|
||||
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 fun <init> (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 synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoUnion;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoUnion;)V
|
||||
}
|
||||
|
||||
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 <init> ()V
|
||||
public synthetic fun <init> (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 synthetic fun write$Self (Lru/mipt/npm/root/serialization/TGeoVolume;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
|
||||
}
|
||||
|
||||
public synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoVolume;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoVolume;)V
|
||||
}
|
||||
|
||||
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 <init> ()V
|
||||
public synthetic fun <init> (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 synthetic fun write$Self (Lru/mipt/npm/root/serialization/TGeoVolumeAssembly;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
|
||||
}
|
||||
|
||||
public synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoVolumeAssembly;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoVolumeAssembly;)V
|
||||
}
|
||||
|
||||
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 <init> (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 <init> (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 <init> (IID[D[D[D[D[D[D)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 synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TGeoXtru;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TGeoXtru;)V
|
||||
}
|
||||
|
||||
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 fun <init> (Ljava/util/List;)V
|
||||
public final fun getArr ()Ljava/util/List;
|
||||
}
|
||||
|
||||
public synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/THashList;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/THashList;)V
|
||||
}
|
||||
|
||||
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 fun <init> (Ljava/util/List;)V
|
||||
public final fun getArr ()Ljava/util/List;
|
||||
}
|
||||
|
||||
public synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TList;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TList;)V
|
||||
}
|
||||
|
||||
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 <init> ()V
|
||||
public synthetic fun <init> (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 synthetic fun write$Self (Lru/mipt/npm/root/serialization/TNamed;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
|
||||
}
|
||||
|
||||
public synthetic 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 final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TNamed;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TNamed;)V
|
||||
}
|
||||
|
||||
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 fun <init> (Ljava/util/List;)V
|
||||
public final fun getArr ()Ljava/util/List;
|
||||
}
|
||||
|
||||
public synthetic class ru/mipt/npm/root/serialization/TObjArray$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
|
||||
public fun <init> (Lkotlinx/serialization/KSerializer;)V
|
||||
public final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/root/serialization/TObjArray;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/root/serialization/TObjArray;)V
|
||||
public final 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 <init> ()V
|
||||
public synthetic fun <init> (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 synthetic 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;
|
||||
}
|
||||
|
||||
15
cern-root-loader/build.gradle.kts
Normal file
15
cern-root-loader/build.gradle.kts
Normal file
@@ -0,0 +1,15 @@
|
||||
plugins {
|
||||
id("space.kscience.gradle.mpp")
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
kscience{
|
||||
jvm()
|
||||
js()
|
||||
dependencies {
|
||||
api(projects.visionforgeSolid)
|
||||
}
|
||||
useSerialization {
|
||||
json()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package ru.mipt.npm.root
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.builtins.ListSerializer
|
||||
import kotlinx.serialization.json.Json
|
||||
import kotlinx.serialization.json.JsonArray
|
||||
import space.kscience.kmath.geometry.euclidean3d.Float32Vector3D
|
||||
|
||||
|
||||
@Serializable
|
||||
public data class FairTrackParam(
|
||||
val fX: Double,
|
||||
val fY: Double,
|
||||
val fZ: Double,
|
||||
val fTx: Double,
|
||||
val fTy: Double,
|
||||
val fQp: Double,
|
||||
)
|
||||
|
||||
public fun FairTrackParam.toVector(): Float32Vector3D = Float32Vector3D(fX,fY,fZ)
|
||||
|
||||
@Serializable
|
||||
public data class CbmStsTrack(
|
||||
val fParamFirst: FairTrackParam,
|
||||
val fParamLast: FairTrackParam,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
public data class BmnGlobalTrack(
|
||||
val fParamFirst: FairTrackParam,
|
||||
val fParamLast: FairTrackParam,
|
||||
)
|
||||
|
||||
public class BmnEventContainer(
|
||||
public val cbmTracks: List<CbmStsTrack>,
|
||||
public val bmnGlobalTracks: List<BmnGlobalTrack>,
|
||||
)
|
||||
|
||||
public object BMN {
|
||||
public val json: Json = Json {
|
||||
ignoreUnknownKeys = true
|
||||
classDiscriminator = "_typename"
|
||||
}
|
||||
|
||||
public fun readEventJson(string: String): BmnEventContainer {
|
||||
val jsonArray = json.parseToJsonElement(string) as JsonArray
|
||||
val cbmTracks: List<CbmStsTrack> =
|
||||
json.decodeFromJsonElement(ListSerializer(CbmStsTrack.serializer()), jsonArray[0])
|
||||
val bmnGlobalTracks: List<BmnGlobalTrack> =
|
||||
json.decodeFromJsonElement(ListSerializer(BmnGlobalTrack.serializer()), jsonArray[1])
|
||||
return BmnEventContainer(cbmTracks, bmnGlobalTracks)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
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 kotlin.properties.ReadOnlyProperty
|
||||
|
||||
public fun MetaProvider.doubleArray(
|
||||
vararg default: Double,
|
||||
key: Name? = null,
|
||||
): ReadOnlyProperty<Any?, DoubleArray> = value(key) {
|
||||
it?.doubleArray ?: doubleArrayOf(*default)
|
||||
}
|
||||
|
||||
public class DObjectCache(private val cache: List<Meta>, public val refStack: List<Int> = 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 <T : DObject> 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 <T : DObject> tObjectArray(
|
||||
builder: (Meta, DObjectCache) -> T,
|
||||
): ReadOnlyProperty<Any?, List<T>> = ReadOnlyProperty { _, property ->
|
||||
meta.getIndexed(Name.of(property.name, "arr")).values.mapNotNull {
|
||||
resolve(builder, it)
|
||||
}
|
||||
}
|
||||
|
||||
internal fun <T : DObject> dObject(
|
||||
builder: (Meta, DObjectCache) -> T,
|
||||
key: Name? = null,
|
||||
): ReadOnlyProperty<Any?, T?> = ReadOnlyProperty { _, property ->
|
||||
meta[key ?: property.name.asName()]?.takeIf { it.value != Null }?.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<DGeoNode> 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 sealed class DGeoMatrix(meta: Meta, refCache: DObjectCache) : DNamed(meta, refCache)
|
||||
|
||||
public class DGeoIdentity(meta: Meta, refCache: DObjectCache) : DGeoMatrix(meta, refCache)
|
||||
|
||||
public 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 DGeoRotation(meta: Meta, refCache: DObjectCache) : DGeoMatrix(meta, refCache) {
|
||||
public val fRotationMatrix: DoubleArray by meta.doubleArray()
|
||||
}
|
||||
|
||||
public class DGeoTranslation(meta: Meta, refCache: DObjectCache) : DGeoMatrix(meta, refCache) {
|
||||
public val fTranslation: DoubleArray by meta.doubleArray()
|
||||
}
|
||||
|
||||
public open class DGeoCombiTrans(meta: Meta, refCache: DObjectCache) : DGeoMatrix(meta, refCache) {
|
||||
public val fRotation: DGeoRotation? by dObject(::DGeoRotation)
|
||||
public val fTranslation: DoubleArray by meta.doubleArray()
|
||||
}
|
||||
|
||||
public class DGeoGenTrans(meta: Meta, refCache: DObjectCache) : DGeoCombiTrans(meta, refCache) {
|
||||
public val fScale: DoubleArray by meta.doubleArray()
|
||||
}
|
||||
|
||||
public class DGeoHMatrix(meta: Meta, refCache: DObjectCache) : DGeoMatrix(meta, refCache) {
|
||||
public val fRotation: DGeoRotation? by dObject(::DGeoRotation)
|
||||
public val fTranslation: DoubleArray by meta.doubleArray()
|
||||
public val fScale: DoubleArray by meta.doubleArray()
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a specialized version of [DGeoMatrix]
|
||||
*/
|
||||
internal fun dGeoMatrix(
|
||||
meta: Meta,
|
||||
refCache: DObjectCache,
|
||||
): DGeoMatrix = when (val typename = meta["_typename"].string) {
|
||||
null -> error("Type name is undefined")
|
||||
"TGeoIdentity" -> DGeoIdentity(meta, refCache)
|
||||
"TGeoScale" -> DGeoScale(meta, refCache)
|
||||
"TGeoRotation" -> DGeoRotation(meta, refCache)
|
||||
"TGeoTranslation" -> DGeoTranslation(meta, refCache)
|
||||
"TGeoCombiTrans" -> DGeoCombiTrans(meta, refCache)
|
||||
"TGeoGenTrans" -> DGeoGenTrans(meta, refCache)
|
||||
"TGeoHMatrix" -> DGeoHMatrix(meta, refCache)
|
||||
else -> error("$typename is not a member of TGeoMatrix")
|
||||
}
|
||||
|
||||
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<DGeoMatrix> by tObjectArray(::dGeoMatrix)
|
||||
|
||||
public val fShapes: List<DGeoShape> by tObjectArray(::DGeoShape)
|
||||
|
||||
public val fVolumes: List<DGeoVolume> by tObjectArray(::DGeoVolume)
|
||||
|
||||
public val fNodes: List<DGeoNode> by tObjectArray(::DGeoNode)
|
||||
|
||||
public companion object {
|
||||
|
||||
public fun parse(string: String): DGeoManager {
|
||||
val meta = Json.decodeFromString(MetaSerializer, string)
|
||||
val res = ArrayList<Meta>(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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,428 @@
|
||||
package ru.mipt.npm.root
|
||||
|
||||
import space.kscience.dataforge.meta.*
|
||||
import space.kscience.dataforge.names.Name
|
||||
import space.kscience.dataforge.names.NameToken
|
||||
import space.kscience.dataforge.names.plus
|
||||
import space.kscience.dataforge.names.withIndex
|
||||
import space.kscience.kmath.complex.Quaternion
|
||||
import space.kscience.kmath.geometry.euclidean3d.Float32Vector3D
|
||||
import space.kscience.kmath.geometry.euclidean3d.fromRotationMatrix
|
||||
import space.kscience.kmath.linear.VirtualMatrix
|
||||
import space.kscience.visionforge.MutableVisionContainer
|
||||
import space.kscience.visionforge.solid.*
|
||||
import space.kscience.visionforge.solid.SolidMaterial.Companion.MATERIAL_COLOR_KEY
|
||||
import kotlin.math.PI
|
||||
import kotlin.math.cos
|
||||
import kotlin.math.sin
|
||||
|
||||
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,
|
||||
val ignoreRootColors: Boolean = false,
|
||||
val colorCache: MutableMap<Meta, String> = mutableMapOf(),
|
||||
)
|
||||
|
||||
// apply rotation from a matrix
|
||||
private fun Solid.rotate(rot: DoubleArray) {
|
||||
val matrix = VirtualMatrix(3, 3) { i, j -> rot[i * 3 + j] }
|
||||
quaternion = Quaternion.fromRotationMatrix(matrix)
|
||||
}
|
||||
|
||||
private fun Solid.translate(trans: DoubleArray) {
|
||||
val (x, y, z) = trans
|
||||
position = Float32Vector3D(x, y, z)
|
||||
}
|
||||
|
||||
private fun Solid.scale(s: DoubleArray) {
|
||||
scale = Float32Vector3D(s[0], s[1], s[2])
|
||||
}
|
||||
|
||||
private fun Solid.useMatrix(matrix: DGeoMatrix?): Unit {
|
||||
when (matrix) {
|
||||
null -> {}
|
||||
is DGeoIdentity -> {}
|
||||
is DGeoTranslation -> translate(matrix.fTranslation)
|
||||
is DGeoRotation -> rotate(matrix.fRotationMatrix)
|
||||
is DGeoScale -> scale(matrix.fScale)
|
||||
is DGeoGenTrans -> {
|
||||
translate(matrix.fTranslation)
|
||||
matrix.fRotation?.fRotationMatrix?.let { rotate(it) }
|
||||
scale(matrix.fScale)
|
||||
}
|
||||
|
||||
is DGeoCombiTrans -> {
|
||||
translate(matrix.fTranslation)
|
||||
matrix.fRotation?.fRotationMatrix?.let { rotate(it) }
|
||||
}
|
||||
|
||||
is DGeoHMatrix -> {
|
||||
translate(matrix.fTranslation)
|
||||
matrix.fRotation?.fRotationMatrix?.let { rotate(it) }
|
||||
scale(matrix.fScale)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
useMatrix(node.fLeftMat)
|
||||
}
|
||||
addShape(node.fRight!!, context, null) {
|
||||
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) {
|
||||
shape {
|
||||
(0 until fNvert).forEach { index ->
|
||||
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("Polycone is not implemented")
|
||||
}
|
||||
}
|
||||
|
||||
"TGeoPgon" -> {
|
||||
|
||||
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)
|
||||
|
||||
fun Shape2DBuilder.pGon(radius: Double) {
|
||||
(0..<fNedges).forEach {
|
||||
val phi = deltaphi / fNedges * it + startphi
|
||||
point(radius * cos(phi), radius * sin(phi))
|
||||
}
|
||||
}
|
||||
|
||||
surface(name) {
|
||||
//getting the radius of first
|
||||
require(fNz > 1) { "The polyhedron geometry requires at least two planes" }
|
||||
for (index in 0 until fNz) {
|
||||
layer(
|
||||
fZ[index],
|
||||
innerBuilder = {
|
||||
pGon(fRmin[index])
|
||||
},
|
||||
outerBuilder = {
|
||||
pGon(fRmax[index])
|
||||
}
|
||||
)
|
||||
}
|
||||
}.apply(block)
|
||||
}
|
||||
|
||||
"TGeoShapeAssembly" -> {
|
||||
val fVolume by shape.dObject(::DGeoVolume)
|
||||
fVolume?.let { volume ->
|
||||
addRootVolume(volume, context, name = volume.fName.ifEmpty { null }, 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 = Float32Vector3D(-fBl1, -fH1, -fDz)
|
||||
val node2 = Float32Vector3D(fBl1, -fH1, -fDz)
|
||||
val node3 = Float32Vector3D(fTl1, fH1, -fDz)
|
||||
val node4 = Float32Vector3D(-fTl1, fH1, -fDz)
|
||||
val node5 = Float32Vector3D(-fBl2, -fH2, fDz)
|
||||
val node6 = Float32Vector3D(fBl2, -fH2, fDz)
|
||||
val node7 = Float32Vector3D(fTl2, fH2, fDz)
|
||||
val node8 = Float32Vector3D(-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 ->
|
||||
solidGroup(name?.let { NameToken.parse(it) }) {
|
||||
scale = Float32Vector3D(fScale?.x ?: 1.0, fScale?.y ?: 1.0, fScale?.z ?: 1.0)
|
||||
addShape(scaledShape, context)
|
||||
apply(block)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
"TGeoCone" -> {
|
||||
val fDz by shape.meta.double(0.0)
|
||||
val fRmin1 by shape.meta.double(0.0)
|
||||
val fRmax1 by shape.meta.double(0.0)
|
||||
val fRmin2 by shape.meta.double(0.0)
|
||||
val fRmax2 by shape.meta.double(0.0)
|
||||
|
||||
coneSurface(
|
||||
bottomOuterRadius = fRmax1,
|
||||
bottomInnerRadius = fRmin1,
|
||||
height = fDz * 2.0,
|
||||
topOuterRadius = fRmax2,
|
||||
topInnerRadius = fRmin2,
|
||||
name = name,
|
||||
)
|
||||
}
|
||||
|
||||
"TGeoCtub" -> {
|
||||
val fRmin by shape.meta.double(0.0)
|
||||
val fRmax by shape.meta.double(0.0)
|
||||
val fDz by shape.meta.double(0.0)
|
||||
val fPhi1 by shape.meta.double(0.0)
|
||||
val fPhi2 by shape.meta.double(PI2.toDouble())
|
||||
val fNlow by shape.meta.doubleArray()
|
||||
val fNhigh by shape.meta.doubleArray()
|
||||
|
||||
cutTube(
|
||||
outerRadius = fRmax,
|
||||
innerRadius = fRmin,
|
||||
height = fDz * 2.0,
|
||||
startAngle = degToRad(fPhi1),
|
||||
angle = degToRad(fPhi2 - fPhi1),
|
||||
topNormal = Float32Vector3D(fNhigh[0], fNhigh[1], fNhigh[2]),
|
||||
bottomNormal = Float32Vector3D(fNlow[0], fNlow[1], fNlow[2]),
|
||||
name = name,
|
||||
)
|
||||
}
|
||||
|
||||
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().apply {
|
||||
//set current layer
|
||||
layer = context.currentLayer
|
||||
val nodes = volume.fNodes
|
||||
|
||||
if (volume.typename != "TGeoVolumeAssembly" && (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.visions.isEmpty()) {
|
||||
null
|
||||
} else if (group.visions.size == 1 && group.properties.isEmpty()) {
|
||||
group.visions.values.first().apply { parent = null }
|
||||
} else {
|
||||
group
|
||||
}.apply {
|
||||
volume.fMedium?.let { medium ->
|
||||
color(context.colorCache.getOrPut(medium.meta) { RootColors[11 + context.colorCache.size] })
|
||||
}
|
||||
|
||||
if (!context.ignoreRootColors) {
|
||||
volume.fFillColor?.let {
|
||||
properties[MATERIAL_COLOR_KEY] = RootColors[it]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//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: NameToken = name?.let {
|
||||
val token = NameToken.parse(it)
|
||||
// this fix is required to work around malformed root files with duplicated node names
|
||||
if (get(it) != null) {
|
||||
token.withIndex(volume.hashCode().toString(16))
|
||||
} else {
|
||||
token
|
||||
}
|
||||
} ?: NameToken("volume[${volume.hashCode().toString(16)}]")
|
||||
|
||||
if (!cache) {
|
||||
val group = buildVolume(volume, context)?.apply(block) ?: return
|
||||
set(combinedName, group)
|
||||
} else {
|
||||
val templateName = volumesName + volume.name
|
||||
val existing = context.prototypeHolder.getPrototype(templateName)
|
||||
if (existing == null) {
|
||||
context.prototypeHolder.prototypes {
|
||||
val group = buildVolume(volume, context) ?: return@prototypes
|
||||
set(templateName, group)
|
||||
}
|
||||
}
|
||||
|
||||
ref(templateName, combinedName).apply(block)
|
||||
}
|
||||
}
|
||||
|
||||
public fun MutableVisionContainer<Solid>.rootGeo(
|
||||
dGeoManager: DGeoManager,
|
||||
name: String? = null,
|
||||
maxLayer: Int = 5,
|
||||
ignoreRootColors: Boolean = false,
|
||||
): SolidGroup = solidGroup(token = name?.let { NameToken.parse(it) }) {
|
||||
val context = RootToSolidContext(this, maxLayer = maxLayer, ignoreRootColors = ignoreRootColors)
|
||||
dGeoManager.fNodes.forEach { node ->
|
||||
addRootNode(node, context)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package ru.mipt.npm.root
|
||||
|
||||
public object RootColors {
|
||||
private val colorMap = MutableList(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]
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
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<TGeoMatrix> = TObjArray.getEmpty()
|
||||
|
||||
public val fShapes: TObjArray<TGeoShape> = TObjArray.getEmpty()
|
||||
|
||||
public val fVolumes: TObjArray<TGeoVolume> = TObjArray.getEmpty()
|
||||
|
||||
public val fNodes: TObjArray<TGeoNode> = TObjArray.getEmpty()
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
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()
|
||||
@@ -0,0 +1,42 @@
|
||||
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()
|
||||
@@ -0,0 +1,14 @@
|
||||
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()
|
||||
@@ -0,0 +1,34 @@
|
||||
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
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
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)
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
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)
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
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<T: TObject>(public val arr: List<@Contextual T>): TObject() {
|
||||
public companion object{
|
||||
public fun <T: TObject> getEmpty(): TObjArray<T> = 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()
|
||||
@@ -0,0 +1,240 @@
|
||||
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
|
||||
|
||||
|
||||
@Suppress("UNUSED_PARAMETER")
|
||||
private fun <T> jsonRootDeserializer(
|
||||
tSerializer: KSerializer<T>,
|
||||
builder: (JsonElement) -> T,
|
||||
): DeserializationStrategy<T> = object :
|
||||
DeserializationStrategy<T> {
|
||||
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 <T : TObject> TObject.decodeFromJson(serializer: KSerializer<T>, jsonElement: JsonElement): T =
|
||||
RootDecoder.decode(serializer, jsonElement)
|
||||
|
||||
public fun <T : TObject> TObject.decodeFromString(serializer: KSerializer<T>, string: String): T {
|
||||
val json = Json.parseToJsonElement(string)
|
||||
return RootDecoder.decode(serializer, json)
|
||||
}
|
||||
|
||||
private object RootDecoder {
|
||||
|
||||
private class RootUnrefSerializer<T>(
|
||||
private val tSerializer: KSerializer<T>,
|
||||
private val refCache: List<RefEntry>,
|
||||
) : KSerializer<T> by tSerializer {
|
||||
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@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 <T> KSerializer<T>.unref(refCache: List<RefEntry>): KSerializer<T> = RootUnrefSerializer(this, refCache)
|
||||
|
||||
fun unrefSerializersModule(
|
||||
refCache: List<RefEntry>,
|
||||
): 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))
|
||||
|
||||
defaultDeserializer {
|
||||
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)
|
||||
defaultDeserializer {
|
||||
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)
|
||||
defaultDeserializer {
|
||||
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)
|
||||
defaultDeserializer {
|
||||
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<RefEntry>): Json = Json {
|
||||
encodeDefaults = true
|
||||
ignoreUnknownKeys = true
|
||||
classDiscriminator = "_typename"
|
||||
serializersModule = unrefSerializersModule(refCache)
|
||||
}
|
||||
|
||||
|
||||
fun <T : TObject> decode(sourceDeserializer: KSerializer<T>, source: JsonElement): T {
|
||||
val refCache = ArrayList<RefEntry>()
|
||||
|
||||
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
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun <T> 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
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
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.kmath.geometry.euclidean3d.Float32Vector3D
|
||||
import space.kscience.visionforge.MutableVisionContainer
|
||||
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 = Float32Vector3D(xAngle, yAngle, zAngle)
|
||||
}
|
||||
|
||||
private fun Solid.translate(trans: DoubleArray) {
|
||||
val (x, y, z) = trans
|
||||
position = Float32Vector3D(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 = Float32Vector3D(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().apply {
|
||||
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,
|
||||
prototypeName = 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<Name, MutableList<SolidReferenceGroup>>()
|
||||
// }
|
||||
|
||||
|
||||
public fun MutableVisionContainer<Solid>.rootGeo(tGeoManager: TGeoManager): SolidGroup = solidGroup {
|
||||
tGeoManager.fNodes.arr.forEach {
|
||||
node(it)
|
||||
}
|
||||
}
|
||||
4
demo/README.md
Normal file
4
demo/README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# Module demo
|
||||
|
||||
|
||||
|
||||
11
demo/build.gradle.kts
Normal file
11
demo/build.gradle.kts
Normal file
@@ -0,0 +1,11 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper
|
||||
|
||||
subprojects {
|
||||
plugins.withType<KotlinPluginWrapper> {
|
||||
configure<KotlinProjectExtension> {
|
||||
explicitApi = ExplicitApiMode.Disabled
|
||||
}
|
||||
}
|
||||
}
|
||||
4
demo/compose-desktop-demo/README.md
Normal file
4
demo/compose-desktop-demo/README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# Module compose-desktop-demo
|
||||
|
||||
|
||||
|
||||
14
demo/compose-desktop-demo/api/compose-desktop-demo.api
Normal file
14
demo/compose-desktop-demo/api/compose-desktop-demo.api
Normal file
@@ -0,0 +1,14 @@
|
||||
public final class ComposableSingletons$MainKt {
|
||||
public static final field INSTANCE LComposableSingletons$MainKt;
|
||||
public fun <init> ()V
|
||||
public final fun getLambda$-1618970650$compose_desktop_demo ()Lkotlin/jvm/functions/Function3;
|
||||
public final fun getLambda$272118144$compose_desktop_demo ()Lkotlin/jvm/functions/Function2;
|
||||
public final fun getLambda$436015572$compose_desktop_demo ()Lkotlin/jvm/functions/Function3;
|
||||
}
|
||||
|
||||
public final class MainKt {
|
||||
public static final fun App (Landroidx/compose/runtime/Composer;I)V
|
||||
public static final fun main ()V
|
||||
public static synthetic fun main ([Ljava/lang/String;)V
|
||||
}
|
||||
|
||||
41
demo/compose-desktop-demo/build.gradle.kts
Normal file
41
demo/compose-desktop-demo/build.gradle.kts
Normal file
@@ -0,0 +1,41 @@
|
||||
plugins {
|
||||
id("space.kscience.gradle.mpp")
|
||||
alias(spclibs.plugins.compose.compiler)
|
||||
alias(spclibs.plugins.compose.jb)
|
||||
}
|
||||
|
||||
kscience {
|
||||
jvm()
|
||||
useCoroutines()
|
||||
|
||||
commonMain{
|
||||
implementation(projects.visionforgeSolid)
|
||||
}
|
||||
|
||||
jvmMain {
|
||||
implementation(projects.visionforgeComposeMultiplatform)
|
||||
}
|
||||
}
|
||||
|
||||
kotlin{
|
||||
explicitApi = null
|
||||
sourceSets{
|
||||
commonMain{
|
||||
dependencies {
|
||||
implementation(compose.desktop.currentOs)
|
||||
api(compose.preview)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
compose{
|
||||
desktop{
|
||||
desktop {
|
||||
application {
|
||||
mainClass = "MainKt"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
33
demo/compose-desktop-demo/src/jvmMain/kotlin/main.kt
Normal file
33
demo/compose-desktop-demo/src/jvmMain/kotlin/main.kt
Normal file
@@ -0,0 +1,33 @@
|
||||
import androidx.compose.desktop.ui.tooling.preview.Preview
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.window.Window
|
||||
import androidx.compose.ui.window.application
|
||||
import space.kscience.dataforge.meta.set
|
||||
import space.kscience.visionforge.compose.PropertyEditor
|
||||
import space.kscience.visionforge.solid.specifications.Canvas3DOptions
|
||||
|
||||
@Composable
|
||||
@Preview
|
||||
fun App(){
|
||||
val options = remember {
|
||||
Canvas3DOptions{
|
||||
meta["custom.field"] = 32
|
||||
}
|
||||
}
|
||||
PropertyEditor(
|
||||
properties = options.meta,
|
||||
descriptor = Canvas3DOptions.descriptor,
|
||||
expanded = true
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
fun main() = application {
|
||||
Window(onCloseRequest = ::exitApplication) {
|
||||
MaterialTheme {
|
||||
App()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,4 @@
|
||||
# Module gdml
|
||||
|
||||
### GDML Example
|
||||
|
||||
Visualization example for geometry defined as GDML file.
|
||||
|
||||
##### Building project
|
||||
|
||||
To build the app, run `demo/gdml/Tasks/distribution/jsBrowserDistribution` Gradle task, then open
|
||||
`demo/gdml/build/distribuions/gdml-js-0.1.3-dev/index.html` file in your browser, and
|
||||
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:
|
||||
|
||||

|
||||
|
||||
9
demo/gdml/api/gdml.api
Normal file
9
demo/gdml/api/gdml.api
Normal file
@@ -0,0 +1,9 @@
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,57 +1,47 @@
|
||||
import ru.mipt.npm.gradle.DependencyConfiguration
|
||||
import ru.mipt.npm.gradle.FXModule
|
||||
|
||||
plugins {
|
||||
id("ru.mipt.npm.gradle.mpp")
|
||||
application
|
||||
id("space.kscience.gradle.mpp")
|
||||
alias(spclibs.plugins.compose.compiler)
|
||||
alias(spclibs.plugins.compose.jb)
|
||||
}
|
||||
|
||||
group = "demo"
|
||||
|
||||
kscience {
|
||||
val fxVersion: String by rootProject.extra
|
||||
useFx(FXModule.CONTROLS, version = fxVersion, configuration = DependencyConfiguration.IMPLEMENTATION)
|
||||
application()
|
||||
// jvm()
|
||||
js {
|
||||
browser {
|
||||
binaries.executable()
|
||||
commonWebpackConfig{
|
||||
cssSupport{
|
||||
enabled = true
|
||||
}
|
||||
scssSupport{
|
||||
enabled = true
|
||||
}
|
||||
sourceMaps = true
|
||||
}
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
implementation(projects.visionforgeSolid)
|
||||
implementation(projects.visionforgeGdml)
|
||||
}
|
||||
// jvmMain {
|
||||
//// implementation(project(":visionforge-fx"))
|
||||
// implementation(spclibs.logback.classic)
|
||||
// }
|
||||
jsMain {
|
||||
implementation(projects.visionforgeThreejs)
|
||||
}
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvm {
|
||||
withJava()
|
||||
}
|
||||
js{
|
||||
useCommonJs()
|
||||
browser {
|
||||
commonWebpackConfig {
|
||||
cssSupport.enabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
sourceSets {
|
||||
commonMain {
|
||||
dependencies {
|
||||
implementation(project(":visionforge-solid"))
|
||||
implementation(project(":visionforge-gdml"))
|
||||
}
|
||||
}
|
||||
jvmMain {
|
||||
dependencies {
|
||||
implementation(project(":visionforge-fx"))
|
||||
}
|
||||
}
|
||||
jsMain {
|
||||
dependencies {
|
||||
implementation(project(":ui:ring"))
|
||||
implementation(project(":visionforge-threejs"))
|
||||
implementation(npm("react-file-drop", "3.0.6"))
|
||||
}
|
||||
}
|
||||
}
|
||||
explicitApi = null
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass.set("space.kscience.visionforge.gdml.demo.GdmlFxDemoAppKt")
|
||||
}
|
||||
|
||||
val convertGdmlToJson by tasks.creating(JavaExec::class) {
|
||||
group = "application"
|
||||
classpath = sourceSets["main"].runtimeClasspath
|
||||
main = "space.kscience.dataforge.vis.spatial.gdml.demo.SaveToJsonKt"
|
||||
}
|
||||
//val convertGdmlToJson by tasks.creating(JavaExec::class) {
|
||||
// group = "application"
|
||||
// classpath = sourceSets["main"].runtimeClasspath
|
||||
// mainClass.set("space.kscience.dataforge.vis.spatial.gdml.demo.SaveToJsonKt")
|
||||
//}
|
||||
@@ -1,32 +1,38 @@
|
||||
package space.kscience.visionforge.gdml
|
||||
|
||||
import space.kscience.dataforge.meta.asValue
|
||||
import space.kscience.dataforge.meta.string
|
||||
import space.kscience.dataforge.names.toName
|
||||
import space.kscience.dataforge.values.asValue
|
||||
import space.kscience.dataforge.names.Name
|
||||
import space.kscience.gdml.GdmlShowCase
|
||||
import space.kscience.visionforge.setProperty
|
||||
import space.kscience.visionforge.Vision
|
||||
import space.kscience.visionforge.solid.SolidMaterial
|
||||
import space.kscience.visionforge.solid.get
|
||||
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 cubes = gdml.toVision()
|
||||
// val segment = cubes["composite000.segment_0".toName()] as Solid
|
||||
// println(segment.styles)
|
||||
// println(segment.material)
|
||||
// }
|
||||
@Test
|
||||
fun testCubesStyles(){
|
||||
val segment = cubes.get("composite-000.segment-0")!!
|
||||
println(segment.properties.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 vision = GdmlShowCase.cubes().toVision()
|
||||
val child = vision["composite-000.segment-0".toName()]
|
||||
val child = cubes[Name.of("composite-000","segment-0")]
|
||||
assertNotNull(child)
|
||||
child.setProperty(SolidMaterial.MATERIAL_COLOR_KEY, "red".asValue())
|
||||
assertEquals("red", child.getProperty(SolidMaterial.MATERIAL_COLOR_KEY).string)
|
||||
child.properties.setValue(SolidMaterial.MATERIAL_COLOR_KEY, "red".asValue())
|
||||
assertEquals("red", child.readProperty(SolidMaterial.MATERIAL_COLOR_KEY).string)
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
@file:JsModule("react-file-drop")
|
||||
@file:JsNonModule
|
||||
|
||||
package drop
|
||||
|
||||
import org.w3c.dom.DragEvent
|
||||
import org.w3c.files.FileList
|
||||
import react.Component
|
||||
import react.RProps
|
||||
import react.RState
|
||||
|
||||
external enum class DropEffects {
|
||||
copy,
|
||||
move,
|
||||
link,
|
||||
none
|
||||
}
|
||||
|
||||
external interface FileDropProps: RProps {
|
||||
var className: String?
|
||||
var targetClassName: String?
|
||||
var draggingOverFrameClassName: String?
|
||||
var draggingOverTargetClassName: String?
|
||||
|
||||
// var frame?: Exclude<HTMLElementTagNameMap[keyof HTMLElementTagNameMap], HTMLElement> | HTMLDocument;
|
||||
var onFrameDragEnter: ((event: DragEvent) -> Unit)?
|
||||
var onFrameDragLeave: ((event: DragEvent) -> Unit)?
|
||||
var onFrameDrop: ((event: DragEvent) -> Unit)?
|
||||
// var onDragOver: ReactDragEventHandler<HTMLDivElement>?
|
||||
// var onDragLeave: ReactDragEventHandler<HTMLDivElement>?
|
||||
var onDrop: ((files: FileList?, event: dynamic) -> Unit)?//event:DragEvent<HTMLDivElement>)
|
||||
var dropEffect: DropEffects?
|
||||
}
|
||||
|
||||
external interface FileDropState: RState {
|
||||
var draggingOverFrame: Boolean
|
||||
var draggingOverTarget: Boolean
|
||||
}
|
||||
|
||||
external class FileDrop : Component<FileDropProps, FileDropState> {
|
||||
override fun render(): dynamic
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
@file:OptIn(ExperimentalComposeWebApi::class)
|
||||
|
||||
package space.kscience.visionforge.gdml.demo
|
||||
|
||||
import androidx.compose.runtime.*
|
||||
import app.softwork.bootstrapcompose.Container
|
||||
import app.softwork.bootstrapcompose.Icon
|
||||
import org.jetbrains.compose.web.ExperimentalComposeWebApi
|
||||
import org.jetbrains.compose.web.attributes.InputType
|
||||
import org.jetbrains.compose.web.attributes.name
|
||||
import org.jetbrains.compose.web.css.*
|
||||
import org.jetbrains.compose.web.dom.Input
|
||||
import org.jetbrains.compose.web.dom.Text
|
||||
import org.w3c.files.FileList
|
||||
|
||||
|
||||
//https://codepen.io/zahedkamal87/pen/PobNNwE
|
||||
@Composable
|
||||
fun FileDrop(
|
||||
title: String = "Drop files or Click here to select files to upload.",
|
||||
onFileDrop: (FileList) -> Unit,
|
||||
) {
|
||||
var dragOver by remember { mutableStateOf(false) }
|
||||
|
||||
Container(attrs = {
|
||||
id("dropzone")
|
||||
style {
|
||||
border(
|
||||
width = 0.2.cssRem,
|
||||
style = LineStyle.Dashed,
|
||||
color = Color("#6583fe")
|
||||
)
|
||||
padding(2.cssRem)
|
||||
borderRadius(0.25.cssRem)
|
||||
backgroundColor(Color("#fff"))
|
||||
textAlign("center")
|
||||
fontSize(1.5.cssRem)
|
||||
transitions {
|
||||
all {
|
||||
delay(0.25.s)
|
||||
timingFunction(AnimationTimingFunction.EaseInOut)
|
||||
properties("background-color")
|
||||
}
|
||||
}
|
||||
cursor("pointer")
|
||||
}
|
||||
listOf("drag", "dragstart", "dragend", "dragenter").forEach {
|
||||
addEventListener(it) { event ->
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
}
|
||||
onDragOver { event ->
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
dragOver = true
|
||||
}
|
||||
onDragLeave { event ->
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
dragOver = false
|
||||
}
|
||||
onDrop { event ->
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
dragOver = false
|
||||
event.dataTransfer?.files?.let {
|
||||
onFileDrop(it)
|
||||
}
|
||||
}
|
||||
}) {
|
||||
Icon("cloud-upload"){ classes("dropzone-icon") }
|
||||
Text(title)
|
||||
Input(type = InputType.File, attrs = {
|
||||
style {
|
||||
display(DisplayStyle.None)
|
||||
}
|
||||
classes("dropzone-input")
|
||||
name("files")
|
||||
})
|
||||
}
|
||||
}
|
||||
//
|
||||
//dropzone.addEventListener("click", function(e) {
|
||||
// dropzone_input.click();
|
||||
//});
|
||||
@@ -1,78 +1,84 @@
|
||||
package space.kscience.visionforge.gdml.demo
|
||||
|
||||
import androidx.compose.runtime.*
|
||||
import kotlinx.browser.window
|
||||
import org.jetbrains.compose.web.css.*
|
||||
import org.jetbrains.compose.web.dom.Div
|
||||
import org.jetbrains.compose.web.dom.P
|
||||
import org.jetbrains.compose.web.dom.Text
|
||||
import org.w3c.files.File
|
||||
import org.w3c.files.FileReader
|
||||
import org.w3c.files.get
|
||||
import react.*
|
||||
import react.dom.h2
|
||||
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.Colors
|
||||
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.root
|
||||
import space.kscience.visionforge.setAsRoot
|
||||
import space.kscience.visionforge.solid.Solid
|
||||
import space.kscience.visionforge.solid.Solids
|
||||
import space.kscience.visionforge.solid.ambientLight
|
||||
import space.kscience.visionforge.solid.invoke
|
||||
import space.kscience.visionforge.solid.three.compose.ThreeView
|
||||
import space.kscience.visionforge.visionManager
|
||||
|
||||
external interface GDMLAppProps : RProps {
|
||||
var context: Context
|
||||
var vision: Solid?
|
||||
var selected: Name?
|
||||
}
|
||||
|
||||
@JsExport
|
||||
val GDMLApp = functionalComponent<GDMLAppProps>("GDMLApp") { props ->
|
||||
val visionManager = useMemo(props.context) { props.context.fetch(Solids).visionManager }
|
||||
var vision: Solid? by useState { props.vision?.apply { root(visionManager) } }
|
||||
@Composable
|
||||
fun GDMLApp(context: Context, initialVision: Solid?, selected: Name? = null) {
|
||||
var vision: Solid? by remember { mutableStateOf(initialVision) }
|
||||
|
||||
fun loadData(name: String, data: String) {
|
||||
val parsedVision = when {
|
||||
name.endsWith(".gdml") || name.endsWith(".xml") -> {
|
||||
val gdml = Gdml.decodeFromString(data)
|
||||
gdml.toVision().apply {
|
||||
root(visionManager)
|
||||
console.info("Marking layers for file $name")
|
||||
markLayers()
|
||||
fun readFileAsync(file: File) {
|
||||
val visionManager = context.visionManager
|
||||
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()
|
||||
ambientLight {
|
||||
color(Colors.white)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
name.endsWith(".json") -> visionManager.decodeFromString(data)
|
||||
else -> {
|
||||
window.alert("File extension is not recognized: $name")
|
||||
error("File extension is not recognized: $name")
|
||||
}
|
||||
}
|
||||
vision = parsedVision as? Solid ?: error("Parsed vision is not a solid")
|
||||
Unit
|
||||
}
|
||||
name.endsWith(".json") -> visionManager.decodeFromString(data)
|
||||
else -> {
|
||||
window.alert("File extension is not recognized: $name")
|
||||
error("File extension is not recognized: $name")
|
||||
}
|
||||
readAsText(file)
|
||||
}
|
||||
|
||||
vision = parsedVision as? Solid ?: error("Parsed vision is not a solid")
|
||||
}
|
||||
|
||||
child(ThreeCanvasWithControls) {
|
||||
attrs {
|
||||
this.context = props.context
|
||||
this.solid = vision
|
||||
this.selected = props.selected
|
||||
tab("Load") {
|
||||
h2 {
|
||||
+"Drag and drop .gdml or .json VisionForge files here"
|
||||
Div({
|
||||
style {
|
||||
height(100.vh - 12.pt)
|
||||
width(100.vw)
|
||||
}
|
||||
}) {
|
||||
ThreeView(context, vision, selected) {
|
||||
Tab("Load") {
|
||||
P {
|
||||
Text("Drag and drop .gdml or .json VisionForge files here")
|
||||
}
|
||||
fileDrop("(drag file here)") { files ->
|
||||
val file = files?.get(0)
|
||||
FileDrop("(drag file here)") { files ->
|
||||
val file = files[0]
|
||||
if (file != null) {
|
||||
FileReader().apply {
|
||||
onload = {
|
||||
val string = result as String
|
||||
loadData(file.name, string)
|
||||
}
|
||||
readAsText(file)
|
||||
}
|
||||
readFileAsync(file)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,58 +1,55 @@
|
||||
package space.kscience.visionforge.gdml.demo
|
||||
|
||||
import kotlinx.browser.document
|
||||
import kotlinx.css.*
|
||||
import react.child
|
||||
import react.dom.render
|
||||
import space.kscience.dataforge.context.Global
|
||||
import org.jetbrains.compose.web.css.*
|
||||
import org.jetbrains.compose.web.dom.Style
|
||||
import org.jetbrains.compose.web.renderComposable
|
||||
import space.kscience.dataforge.context.Context
|
||||
import space.kscience.gdml.GdmlShowCase
|
||||
import space.kscience.visionforge.Application
|
||||
import space.kscience.visionforge.Colors
|
||||
import space.kscience.visionforge.gdml.toVision
|
||||
import space.kscience.visionforge.html.VisionForgeStyles
|
||||
import space.kscience.visionforge.html.startApplication
|
||||
import space.kscience.visionforge.setAsRoot
|
||||
import space.kscience.visionforge.solid.ambientLight
|
||||
import space.kscience.visionforge.solid.invoke
|
||||
import space.kscience.visionforge.solid.three.ThreePlugin
|
||||
import space.kscience.visionforge.startApplication
|
||||
import styled.injectGlobal
|
||||
import space.kscience.visionforge.visionManager
|
||||
|
||||
|
||||
private class GDMLDemoApp : Application {
|
||||
fun main() = startApplication { document ->
|
||||
|
||||
override fun start(state: Map<String, Any>) {
|
||||
val context = Global.buildContext("gdml-demo"){
|
||||
plugin(ThreePlugin)
|
||||
val context = Context("gdml-demo") {
|
||||
plugin(ThreePlugin)
|
||||
}
|
||||
|
||||
val element = document.getElementById("application") ?: error("Element with id 'application' not found on page")
|
||||
|
||||
val vision = GdmlShowCase.cubes().toVision().apply {
|
||||
ambientLight {
|
||||
color(Colors.white)
|
||||
}
|
||||
setAsRoot(context.visionManager)
|
||||
}
|
||||
|
||||
injectGlobal {
|
||||
html{
|
||||
height = 100.pct
|
||||
renderComposable(element) {
|
||||
Style(VisionForgeStyles)
|
||||
Style {
|
||||
"html" {
|
||||
height(100.percent)
|
||||
}
|
||||
|
||||
body{
|
||||
height = 100.pct
|
||||
display = Display.flex
|
||||
alignItems = Align.stretch
|
||||
"body" {
|
||||
height(100.percent)
|
||||
display(DisplayStyle.Flex)
|
||||
alignItems(AlignItems.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
|
||||
}
|
||||
"#application" {
|
||||
width(100.percent)
|
||||
display(DisplayStyle.Flex)
|
||||
alignItems(AlignItems.Stretch)
|
||||
}
|
||||
}
|
||||
GDMLApp(context, vision)
|
||||
}
|
||||
}
|
||||
|
||||
fun main() {
|
||||
startApplication(::GDMLDemoApp)
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package space.kscience.visionforge.gdml.demo
|
||||
|
||||
import drop.FileDrop
|
||||
import kotlinx.css.*
|
||||
import kotlinx.css.properties.border
|
||||
import org.w3c.files.FileList
|
||||
import react.RBuilder
|
||||
import styled.css
|
||||
import styled.styledDiv
|
||||
|
||||
//TODO move styles to inline
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
child(FileDrop::class) {
|
||||
attrs {
|
||||
onDrop = { files, _ ->
|
||||
console.info("loaded $files")
|
||||
action(files)
|
||||
}
|
||||
}
|
||||
+title
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,88 +1,83 @@
|
||||
package space.kscience.visionforge.gdml.demo
|
||||
|
||||
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.describedProperties
|
||||
import space.kscience.visionforge.editor.VisualObjectEditorFragment
|
||||
import space.kscience.visionforge.editor.VisualObjectTreeFragment
|
||||
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)
|
||||
plugin(VisionManager)
|
||||
}
|
||||
|
||||
private val fx3d = context.fetch(FX3DPlugin)
|
||||
private val visionManager = context.fetch(VisionManager)
|
||||
private val canvas = FXCanvas3D(fx3d)
|
||||
|
||||
private val treeFragment = VisualObjectTreeFragment().apply {
|
||||
this.itemProperty.bind(canvas.rootObjectProperty)
|
||||
}
|
||||
|
||||
private val propertyEditor = VisualObjectEditorFragment {
|
||||
it.describedProperties
|
||||
}.apply {
|
||||
descriptorProperty.set(SolidMaterial.descriptor)
|
||||
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 {
|
||||
canvas.render(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
center {
|
||||
splitpane(Orientation.HORIZONTAL, treeFragment.root, canvas.root, propertyEditor.root) {
|
||||
setDividerPositions(0.2, 0.6, 0.2)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
runAsync {
|
||||
GdmlShowCase.cubes().toVision()
|
||||
} ui {
|
||||
canvas.render(it)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val fileNameFilter = arrayOf(
|
||||
FileChooser.ExtensionFilter("GDML", "*.gdml", "*.xml"),
|
||||
FileChooser.ExtensionFilter("JSON", "*.json"),
|
||||
FileChooser.ExtensionFilter("JSON.ZIP", "*.json.zip"),
|
||||
FileChooser.ExtensionFilter("JSON.GZ", "*.json.gz")
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun main() {
|
||||
launch<GDMLDemoApp>()
|
||||
}
|
||||
//package space.kscience.visionforge.gdml.demo
|
||||
//
|
||||
//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 canvas = FXCanvas3D(fx3d)
|
||||
//
|
||||
// private val treeFragment = VisionTreeFragment().apply {
|
||||
// this.itemProperty.bind(canvas.rootObjectProperty)
|
||||
// }
|
||||
//
|
||||
// private val propertyEditor = VisionEditorFragment().apply {
|
||||
// descriptorProperty.set(SolidMaterial.descriptor)
|
||||
// visionProperty.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 {
|
||||
// canvas.render(it)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// center {
|
||||
// splitpane(Orientation.HORIZONTAL, treeFragment.root, canvas.root, propertyEditor.root) {
|
||||
// setDividerPositions(0.2, 0.6, 0.2)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// init {
|
||||
// runAsync {
|
||||
// GdmlShowCase.cubes().toVision()
|
||||
// } ui {
|
||||
// canvas.render(it)
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// companion object {
|
||||
// private val fileNameFilter = arrayOf(
|
||||
// FileChooser.ExtensionFilter("GDML", "*.gdml", "*.xml"),
|
||||
// FileChooser.ExtensionFilter("JSON", "*.json"),
|
||||
// FileChooser.ExtensionFilter("JSON.ZIP", "*.json.zip"),
|
||||
// FileChooser.ExtensionFilter("JSON.GZ", "*.json.gz")
|
||||
// )
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//fun main() {
|
||||
// launch<GDMLDemoApp>()
|
||||
//}
|
||||
3
demo/gdml/webpack.config.d/01.ring.js
vendored
3
demo/gdml/webpack.config.d/01.ring.js
vendored
@@ -1,3 +0,0 @@
|
||||
const ringConfig = require('@jetbrains/ring-ui/webpack.config').config;
|
||||
|
||||
config.module.rules.push(...ringConfig.module.rules)
|
||||
4
demo/js-playground/README.md
Normal file
4
demo/js-playground/README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# Module js-playground
|
||||
|
||||
|
||||
|
||||
@@ -1,27 +1,36 @@
|
||||
plugins {
|
||||
id("ru.mipt.npm.gradle.js")
|
||||
id("space.kscience.gradle.mpp")
|
||||
alias(spclibs.plugins.compose.compiler)
|
||||
alias(spclibs.plugins.compose.jb)
|
||||
}
|
||||
|
||||
kscience{
|
||||
kscience {
|
||||
useCoroutines()
|
||||
application()
|
||||
}
|
||||
|
||||
kotlin{
|
||||
js(IR){
|
||||
useCommonJs()
|
||||
kotlin {
|
||||
explicitApi = null
|
||||
js {
|
||||
browser {
|
||||
commonWebpackConfig {
|
||||
cssSupport.enabled = false
|
||||
binaries.executable()
|
||||
commonWebpackConfig{
|
||||
cssSupport{
|
||||
enabled = true
|
||||
}
|
||||
scssSupport{
|
||||
enabled = true
|
||||
}
|
||||
sourceMaps = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
dependencies{
|
||||
implementation(project(":visionforge-gdml"))
|
||||
implementation(project(":visionforge-plotly"))
|
||||
implementation(project(":visionforge-threejs"))
|
||||
implementation(project(":ui:ring"))
|
||||
kscience {
|
||||
dependencies {
|
||||
implementation(projects.plotlyKt.plotlyKtCore)
|
||||
implementation(projects.visionforge.visionforgeGdml)
|
||||
implementation(projects.visionforge.visionforgeMarkdown)
|
||||
implementation(projects.visionforge.visionforgeThreejs)
|
||||
}
|
||||
}
|
||||
97
demo/js-playground/src/jsMain/kotlin/JsPlaygroundApp.kt
Normal file
97
demo/js-playground/src/jsMain/kotlin/JsPlaygroundApp.kt
Normal file
@@ -0,0 +1,97 @@
|
||||
import org.jetbrains.compose.web.css.*
|
||||
import org.jetbrains.compose.web.dom.Div
|
||||
import org.jetbrains.compose.web.renderComposable
|
||||
import space.kscience.dataforge.context.Context
|
||||
import space.kscience.plotly.PlotlyJsPlugin
|
||||
import space.kscience.plotly.models.Trace
|
||||
import space.kscience.plotly.models.scatter
|
||||
import space.kscience.visionforge.Colors
|
||||
import space.kscience.visionforge.html.Tabs
|
||||
import space.kscience.visionforge.html.VisionForgeStyles
|
||||
import space.kscience.visionforge.html.startApplication
|
||||
import space.kscience.visionforge.markup.MarkupJsPlugin
|
||||
import space.kscience.visionforge.solid.*
|
||||
import space.kscience.visionforge.solid.three.ThreePlugin
|
||||
import space.kscience.visionforge.solid.three.compose.ThreeView
|
||||
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) }
|
||||
}
|
||||
|
||||
public fun main() {
|
||||
val playgroundContext = Context {
|
||||
plugin(ThreePlugin)
|
||||
plugin(PlotlyJsPlugin)
|
||||
plugin(MarkupJsPlugin)
|
||||
}
|
||||
startApplication { document ->
|
||||
|
||||
// val solids = playgroundContext.request(Solids)
|
||||
// val client = playgroundContext.request(JsVisionClient)
|
||||
|
||||
val element = document.getElementById("playground") ?: error("Element with id 'playground' not found on page")
|
||||
|
||||
renderComposable(element) {
|
||||
Style(VisionForgeStyles)
|
||||
Div({
|
||||
style {
|
||||
padding(0.pt)
|
||||
margin(0.pt)
|
||||
height(100.vh)
|
||||
width(100.vw)
|
||||
}
|
||||
}) {
|
||||
Tabs("gravity") {
|
||||
Tab("gravity") {
|
||||
GravityDemo(playgroundContext)
|
||||
}
|
||||
|
||||
// Tab("D0") {
|
||||
// child(ThreeCanvasWithControls) {
|
||||
// attrs {
|
||||
// context = playgroundContext
|
||||
// solid = GdmlShowCase.babyIaxo().toVision()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
Tab("spheres") {
|
||||
Div({
|
||||
style {
|
||||
height(100.vh - 50.pt)
|
||||
}
|
||||
}) {
|
||||
ThreeView(playgroundContext, SolidGroup {
|
||||
ambientLight {
|
||||
color(Colors.white)
|
||||
}
|
||||
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") {
|
||||
Plot(playgroundContext) {
|
||||
scatter {
|
||||
x(1, 2, 3)
|
||||
y(5, 8, 7)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
164
demo/js-playground/src/jsMain/kotlin/gravityDemo.kt
Normal file
164
demo/js-playground/src/jsMain/kotlin/gravityDemo.kt
Normal file
@@ -0,0 +1,164 @@
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.remember
|
||||
import app.softwork.bootstrapcompose.Column
|
||||
import app.softwork.bootstrapcompose.Row
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.isActive
|
||||
import org.jetbrains.compose.web.css.*
|
||||
import org.jetbrains.compose.web.dom.AttrBuilderContext
|
||||
import org.jetbrains.compose.web.dom.Div
|
||||
import org.w3c.dom.HTMLDivElement
|
||||
import space.kscience.dataforge.context.Context
|
||||
import space.kscience.dataforge.meta.Meta
|
||||
import space.kscience.plotly.Plot
|
||||
import space.kscience.plotly.layout
|
||||
import space.kscience.plotly.models.Trace
|
||||
import space.kscience.plotly.models.invoke
|
||||
import space.kscience.visionforge.Colors
|
||||
import space.kscience.visionforge.html.VisionDiv
|
||||
import space.kscience.visionforge.html.zIndex
|
||||
import space.kscience.visionforge.markup.VisionOfMarkup
|
||||
import space.kscience.visionforge.solid.*
|
||||
import space.kscience.visionforge.solid.three.compose.ThreeView
|
||||
import kotlin.math.sqrt
|
||||
|
||||
@Composable
|
||||
fun Plot(
|
||||
context: Context,
|
||||
meta: Meta = Meta.EMPTY,
|
||||
attrs: AttrBuilderContext<HTMLDivElement>? = null,
|
||||
block: Plot.() -> Unit,
|
||||
) = VisionDiv(
|
||||
context = context,
|
||||
attrs = attrs,
|
||||
meta = meta,
|
||||
vision = Plot().apply(block)
|
||||
)
|
||||
|
||||
@Composable
|
||||
fun Markup(
|
||||
context: Context,
|
||||
markup: VisionOfMarkup,
|
||||
meta: Meta = Meta.EMPTY,
|
||||
attrs: AttrBuilderContext<HTMLDivElement>? = null,
|
||||
) = VisionDiv(
|
||||
context = context,
|
||||
attrs = attrs,
|
||||
meta = meta,
|
||||
vision = markup
|
||||
)
|
||||
|
||||
|
||||
private val h = 100.0
|
||||
|
||||
@Composable
|
||||
fun GravityDemo(context: Context) {
|
||||
val velocityTrace = remember {
|
||||
Trace {
|
||||
name = "velocity"
|
||||
}
|
||||
}
|
||||
|
||||
val energyTrace = remember {
|
||||
Trace {
|
||||
name = "energy"
|
||||
}
|
||||
}
|
||||
|
||||
val markup = remember { VisionOfMarkup() }
|
||||
|
||||
val solid = remember {
|
||||
SolidGroup {
|
||||
pointLight(200, 200, 200, name = "light") {
|
||||
color(Colors.white)
|
||||
}
|
||||
ambientLight()
|
||||
|
||||
sphere(5.0, "ball") {
|
||||
detail = 16
|
||||
color("red")
|
||||
y = h
|
||||
|
||||
|
||||
box(200, 5, 200, name = "floor") {
|
||||
y = -2.5
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LaunchedEffect(solid) {
|
||||
val ball = solid["ball"]!!
|
||||
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 * ball.y.toDouble() + velocity * velocity / 2
|
||||
ball.y = ball.y.toDouble() + velocity * dt
|
||||
|
||||
velocityTrace.appendXYLatest(time, ball.y)
|
||||
energyTrace.appendXYLatest(time, energy)
|
||||
|
||||
if (ball.y.toDouble() <= 2.5) {
|
||||
//conservation of energy
|
||||
velocity = sqrt(2 * g * h)
|
||||
}
|
||||
|
||||
markup.content = """
|
||||
## Bouncing sphere parameters
|
||||
|
||||
**velocity** = $velocity
|
||||
|
||||
**energy** = $energy
|
||||
""".trimIndent()
|
||||
}
|
||||
}
|
||||
|
||||
Div({
|
||||
style {
|
||||
height(100.vh - 50.pt)
|
||||
}
|
||||
}) {
|
||||
Div({
|
||||
style {
|
||||
height(50.vh)
|
||||
}
|
||||
}) {
|
||||
ThreeView(context, solid)
|
||||
}
|
||||
Row(attrs = {
|
||||
style {
|
||||
alignContent(AlignContent.Stretch)
|
||||
alignItems(AlignItems.Stretch)
|
||||
height(50.vh - 50.pt)
|
||||
}
|
||||
}) {
|
||||
Column {
|
||||
Plot(context) {
|
||||
traces(velocityTrace, energyTrace)
|
||||
layout {
|
||||
xaxis.title = "time"
|
||||
}
|
||||
}
|
||||
}
|
||||
Column {
|
||||
Markup(context, markup, attrs = {
|
||||
style {
|
||||
width(100.percent)
|
||||
height(100.percent)
|
||||
border(2.pt, LineStyle.Solid, Color.blue)
|
||||
paddingLeft(8.pt)
|
||||
backgroundColor(Color.white)
|
||||
flex(1)
|
||||
zIndex(10000)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
import kotlinx.browser.document
|
||||
import kotlinx.css.*
|
||||
import react.child
|
||||
import react.dom.render
|
||||
import space.kscience.dataforge.context.Context
|
||||
import space.kscience.gdml.GdmlShowCase
|
||||
import space.kscience.visionforge.Application
|
||||
import space.kscience.visionforge.VisionClient
|
||||
import space.kscience.visionforge.gdml.toVision
|
||||
import space.kscience.visionforge.ring.ThreeCanvasWithControls
|
||||
import space.kscience.visionforge.ring.ThreeWithControlsPlugin
|
||||
import space.kscience.visionforge.startApplication
|
||||
import styled.css
|
||||
import styled.styledDiv
|
||||
|
||||
private class JsPlaygroundApp : Application {
|
||||
|
||||
override fun start(state: Map<String, Any>) {
|
||||
|
||||
val playgroundContext = Context {
|
||||
plugin(ThreeWithControlsPlugin)
|
||||
plugin(VisionClient)
|
||||
}
|
||||
|
||||
val element = document.getElementById("playground") ?: error("Element with id 'playground' not found on page")
|
||||
|
||||
val visionOfD0 = GdmlShowCase.babyIaxo().toVision()
|
||||
|
||||
render(element) {
|
||||
styledDiv {
|
||||
css{
|
||||
padding(0.pt)
|
||||
margin(0.pt)
|
||||
height = 100.vh
|
||||
width = 100.vw
|
||||
}
|
||||
child(ThreeCanvasWithControls) {
|
||||
attrs {
|
||||
context = playgroundContext
|
||||
solid = visionOfD0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public fun main() {
|
||||
startApplication(::JsPlaygroundApp)
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
const ringConfig = require('@jetbrains/ring-ui/webpack.config').config;
|
||||
|
||||
config.module.rules.push(...ringConfig.module.rules)
|
||||
@@ -1,35 +0,0 @@
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
kotlin("jupyter.api")
|
||||
id("com.github.johnrengelman.shadow") version "6.1.0"
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://repo.kotlin.link")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":demo:playground"))
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile> {
|
||||
kotlinOptions {
|
||||
useIR = true
|
||||
jvmTarget = ru.mipt.npm.gradle.KScienceVersions.JVM_TARGET.toString()
|
||||
}
|
||||
}
|
||||
|
||||
extensions.findByType<JavaPluginExtension>()?.apply {
|
||||
targetCompatibility = ru.mipt.npm.gradle.KScienceVersions.JVM_TARGET
|
||||
}
|
||||
|
||||
tasks.withType<Test> {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
tasks.processJupyterApiResources {
|
||||
libraryProducers = listOf("space.kscience.dataforge.playground.VisionForgePlayGroundForJupyter")
|
||||
}
|
||||
|
||||
tasks.findByName("shadowJar")?.dependsOn("processJupyterApiResources")
|
||||
@@ -1,98 +0,0 @@
|
||||
package space.kscience.dataforge.playground
|
||||
|
||||
import kotlinx.html.div
|
||||
import kotlinx.html.id
|
||||
import kotlinx.html.script
|
||||
import kotlinx.html.stream.createHTML
|
||||
import kotlinx.html.unsafe
|
||||
import org.jetbrains.kotlinx.jupyter.api.HTML
|
||||
import org.jetbrains.kotlinx.jupyter.api.annotations.JupyterLibrary
|
||||
import org.jetbrains.kotlinx.jupyter.api.libraries.*
|
||||
import space.kscience.dataforge.context.Context
|
||||
import space.kscience.dataforge.misc.DFExperimental
|
||||
import space.kscience.gdml.Gdml
|
||||
import space.kscience.plotly.Plot
|
||||
import space.kscience.visionforge.Vision
|
||||
import space.kscience.visionforge.gdml.toVision
|
||||
import space.kscience.visionforge.html.HtmlVisionFragment
|
||||
import space.kscience.visionforge.html.Page
|
||||
import space.kscience.visionforge.html.embedVisionFragment
|
||||
import space.kscience.visionforge.plotly.PlotlyPlugin
|
||||
import space.kscience.visionforge.plotly.asVision
|
||||
import space.kscience.visionforge.solid.Solids
|
||||
import space.kscience.visionforge.visionManager
|
||||
|
||||
@JupyterLibrary
|
||||
@DFExperimental
|
||||
internal class VisionForgePlayGroundForJupyter : JupyterIntegration() {
|
||||
|
||||
private val context = Context("VisionForge") {
|
||||
plugin(Solids)
|
||||
plugin(PlotlyPlugin)
|
||||
}
|
||||
|
||||
private val jsBundle = ResourceFallbacksBundle(listOf(
|
||||
ResourceLocation("js/visionforge-playground.js", ResourcePathType.CLASSPATH_PATH))
|
||||
)
|
||||
private val jsResource = LibraryResource(name = "VisionForge", type = ResourceType.JS, bundles = listOf(jsBundle))
|
||||
|
||||
private var counter = 0
|
||||
|
||||
private fun produceHtmlVisionString(fragment: HtmlVisionFragment) = createHTML().div {
|
||||
val id = "visionforge.vision[${counter++}]"
|
||||
div {
|
||||
this.id = id
|
||||
embedVisionFragment(context.visionManager, fragment = fragment)
|
||||
}
|
||||
script {
|
||||
type = "text/javascript"
|
||||
unsafe { +"window.renderAllVisionsById(\"$id\");" }
|
||||
}
|
||||
}
|
||||
|
||||
override fun Builder.onLoaded() {
|
||||
resource(jsResource)
|
||||
|
||||
import(
|
||||
"space.kscience.gdml.*",
|
||||
"space.kscience.plotly.*",
|
||||
"space.kscience.plotly.models.*",
|
||||
"kotlinx.html.*",
|
||||
"space.kscience.visionforge.solid.*",
|
||||
"space.kscience.visionforge.html.Page",
|
||||
"space.kscience.visionforge.html.page"
|
||||
)
|
||||
|
||||
render<Gdml> { gdmlModel ->
|
||||
val fragment = HtmlVisionFragment {
|
||||
vision(gdmlModel.toVision())
|
||||
}
|
||||
HTML(produceHtmlVisionString(fragment))
|
||||
}
|
||||
|
||||
render<Vision> { vision ->
|
||||
val fragment = HtmlVisionFragment {
|
||||
vision(vision)
|
||||
}
|
||||
|
||||
HTML(produceHtmlVisionString(fragment))
|
||||
}
|
||||
|
||||
render<Plot> { plot ->
|
||||
val fragment = HtmlVisionFragment {
|
||||
vision(plot.asVision())
|
||||
}
|
||||
|
||||
HTML(produceHtmlVisionString(fragment))
|
||||
}
|
||||
|
||||
render<space.kscience.plotly.PlotlyHtmlFragment> { fragment ->
|
||||
HTML(createHTML().apply(fragment.visit).finalize())
|
||||
}
|
||||
|
||||
render<Page> { page ->
|
||||
HTML(page.render(createHTML()), true)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,34 +1,4 @@
|
||||
# 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:
|
||||
|
||||

|
||||
|
||||
|
||||
152
demo/muon-monitor/api/muon-monitor.api
Normal file
152
demo/muon-monitor/api/muon-monitor.api
Normal file
@@ -0,0 +1,152 @@
|
||||
public final class ru/mipt/npm/muon/monitor/Event {
|
||||
public static final field $stable I
|
||||
public static final field Companion Lru/mipt/npm/muon/monitor/Event$Companion;
|
||||
public fun <init> (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 synthetic class ru/mipt/npm/muon/monitor/Event$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
|
||||
public static final field $stable I
|
||||
public static final field INSTANCE Lru/mipt/npm/muon/monitor/Event$$serializer;
|
||||
public final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lru/mipt/npm/muon/monitor/Event;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Lru/mipt/npm/muon/monitor/Event;)V
|
||||
}
|
||||
|
||||
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/MMServerKt {
|
||||
public static final fun main ()V
|
||||
public static synthetic fun main ([Ljava/lang/String;)V
|
||||
public static final fun module (Lio/ktor/server/application/Application;Lspace/kscience/dataforge/context/Context;)V
|
||||
public static synthetic fun module$default (Lio/ktor/server/application/Application;Lspace/kscience/dataforge/context/Context;ILjava/lang/Object;)V
|
||||
}
|
||||
|
||||
public final class ru/mipt/npm/muon/monitor/Model {
|
||||
public static final field $stable I
|
||||
public fun <init> (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 class ru/mipt/npm/muon/monitor/Monitor {
|
||||
public static final field $stable I
|
||||
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 static final field $stable I
|
||||
public fun <init> (Ljava/lang/String;Lspace/kscience/kmath/geometry/Vector3D;FFF)V
|
||||
public synthetic fun <init> (Ljava/lang/String;Lspace/kscience/kmath/geometry/Vector3D;FFFILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public final fun getCenter ()Lspace/kscience/kmath/geometry/Vector3D;
|
||||
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 static final field $stable I
|
||||
public fun <init> (Ljava/lang/String;Lspace/kscience/kmath/geometry/Vector3D;)V
|
||||
public final fun getCenter ()Lspace/kscience/kmath/geometry/Vector3D;
|
||||
public final fun getName ()Ljava/lang/String;
|
||||
public final fun getPixels ()Ljava/util/Collection;
|
||||
}
|
||||
|
||||
public final class ru/mipt/npm/muon/monitor/sim/Cos2TrackGenerator : ru/mipt/npm/muon/monitor/sim/TrackGenerator {
|
||||
public static final field $stable I
|
||||
public fun <init> (Lorg/apache/commons/math3/random/RandomGenerator;DFF)V
|
||||
public synthetic fun <init> (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 static final field $stable I
|
||||
public fun <init> (Lorg/apache/commons/math3/random/RandomGenerator;DDFF)V
|
||||
public synthetic fun <init> (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 toKMathVector (Lorg/apache/commons/math3/geometry/euclidean/threed/Vector3D;)Lspace/kscience/kmath/geometry/Vector3D;
|
||||
public static final fun toKMathVectors (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 static final field $stable I
|
||||
public fun <init> (Lorg/apache/commons/math3/random/RandomGenerator;FF)V
|
||||
public synthetic fun <init> (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;
|
||||
}
|
||||
|
||||
@@ -1,75 +1,54 @@
|
||||
plugins {
|
||||
id("ru.mipt.npm.gradle.mpp")
|
||||
application
|
||||
id("space.kscience.gradle.mpp")
|
||||
alias(spclibs.plugins.compose.compiler)
|
||||
alias(spclibs.plugins.compose.jb)
|
||||
}
|
||||
|
||||
group = "ru.mipt.npm"
|
||||
|
||||
val ktorVersion: String = ru.mipt.npm.gradle.KScienceVersions.ktorVersion
|
||||
|
||||
kscience {
|
||||
fullStack(
|
||||
"muon-monitor.js",
|
||||
development = false,
|
||||
jvmConfig = {
|
||||
binaries {
|
||||
executable {
|
||||
mainClass.set("ru.mipt.npm.muon.monitor.MMServerKt")
|
||||
}
|
||||
}
|
||||
},
|
||||
browserConfig = {
|
||||
commonWebpackConfig {
|
||||
cssSupport {
|
||||
enabled = true
|
||||
}
|
||||
scssSupport {
|
||||
enabled = true
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
useCoroutines()
|
||||
useSerialization()
|
||||
application()
|
||||
|
||||
commonMain {
|
||||
implementation(projects.visionforgeSolid)
|
||||
implementation(projects.visionforgeComposeHtml)
|
||||
}
|
||||
jvmMain {
|
||||
implementation("org.apache.commons:commons-math3:3.6.1")
|
||||
implementation("io.ktor:ktor-server-cio")
|
||||
implementation("io.ktor:ktor-server-content-negotiation")
|
||||
implementation("io.ktor:ktor-serialization-kotlinx-json")
|
||||
implementation(spclibs.logback.classic)
|
||||
}
|
||||
jsMain {
|
||||
implementation(projects.visionforgeThreejs)
|
||||
}
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvm {
|
||||
withJava()
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
val jsBrowserDistribution by tasks.getting
|
||||
|
||||
tasks.getByName<ProcessResources>("jvmProcessResources") {
|
||||
dependsOn(jsBrowserDistribution)
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
from(jsBrowserDistribution)
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
commonMain {
|
||||
dependencies {
|
||||
implementation(project(":visionforge-solid"))
|
||||
}
|
||||
}
|
||||
jvmMain {
|
||||
dependencies {
|
||||
implementation("org.apache.commons:commons-math3:3.6.1")
|
||||
implementation("io.ktor:ktor-server-cio:$ktorVersion")
|
||||
implementation("io.ktor:ktor-serialization:$ktorVersion")
|
||||
}
|
||||
}
|
||||
jsMain {
|
||||
dependencies {
|
||||
implementation(project(":ui:bootstrap"))
|
||||
implementation("io.ktor:ktor-client-js:$ktorVersion")
|
||||
implementation("io.ktor:ktor-client-serialization:$ktorVersion")
|
||||
implementation(project(":visionforge-threejs"))
|
||||
implementation(devNpm("webpack-bundle-analyzer", "4.4.0"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass.set("ru.mipt.npm.muon.monitor.server.MMServerKt")
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile>() {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = freeCompilerArgs + "-Xir-property-lazy-initialization"
|
||||
}
|
||||
}
|
||||
|
||||
//distributions {
|
||||
// main {
|
||||
// contents {
|
||||
// from("$buildDir/libs") {
|
||||
// rename("${rootProject.name}-jvm", rootProject.name)
|
||||
// into("lib")
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
explicitApi = null
|
||||
}
|
||||
@@ -1,9 +1,13 @@
|
||||
@file:UseSerializers(Float32Space3D.VectorSerializer::class)
|
||||
package ru.mipt.npm.muon.monitor
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
import space.kscience.visionforge.solid.Point3D
|
||||
import kotlinx.serialization.UseSerializers
|
||||
import space.kscience.kmath.geometry.euclidean3d.Float32Space3D
|
||||
import space.kscience.kmath.geometry.euclidean3d.Float32Vector3D
|
||||
|
||||
typealias Track = List<Point3D>
|
||||
|
||||
typealias Track = List<Float32Vector3D>
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -3,9 +3,10 @@ package ru.mipt.npm.muon.monitor
|
||||
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.kmath.geometry.euclidean3d.Float32Vector3D
|
||||
import space.kscience.visionforge.MutableVisionContainer
|
||||
import space.kscience.visionforge.VisionManager
|
||||
import space.kscience.visionforge.removeAll
|
||||
import space.kscience.visionforge.root
|
||||
import space.kscience.visionforge.setAsRoot
|
||||
import space.kscience.visionforge.solid.*
|
||||
import kotlin.math.PI
|
||||
|
||||
@@ -13,9 +14,9 @@ class Model(val manager: VisionManager) {
|
||||
private val map = HashMap<String, SolidGroup>()
|
||||
private val events = HashSet<Event>()
|
||||
|
||||
private fun SolidGroup.pixel(pixel: SC1) {
|
||||
val group = group(pixel.name) {
|
||||
position = Point3D(pixel.center.x, pixel.center.y, pixel.center.z)
|
||||
private fun MutableVisionContainer<Solid>.pixel(pixel: SC1) {
|
||||
val group = solidGroup(pixel.name) {
|
||||
position = Float32Vector3D(pixel.center.x, pixel.center.y, pixel.center.z)
|
||||
box(pixel.xSize, pixel.ySize, pixel.zSize)
|
||||
label(pixel.name) {
|
||||
z = -Monitor.PIXEL_Z_SIZE / 2 - 5
|
||||
@@ -26,57 +27,66 @@ class Model(val manager: VisionManager) {
|
||||
}
|
||||
|
||||
private fun SolidGroup.detector(detector: SC16) {
|
||||
group(detector.name) {
|
||||
solidGroup(detector.name) {
|
||||
detector.pixels.forEach {
|
||||
pixel(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var tracks: SolidGroup
|
||||
val tracks: SolidGroup = SolidGroup()
|
||||
|
||||
val root: SolidGroup = SolidGroup().apply {
|
||||
root(this@Model.manager)
|
||||
setAsRoot(this@Model.manager)
|
||||
material {
|
||||
color("darkgreen")
|
||||
}
|
||||
rotationX = PI / 2
|
||||
group("bottom") {
|
||||
solidGroup("bottom") {
|
||||
Monitor.detectors.filter { it.center.z == LOWER_LAYER_Z }.forEach {
|
||||
detector(it)
|
||||
}
|
||||
}
|
||||
|
||||
group("middle") {
|
||||
solidGroup("middle") {
|
||||
Monitor.detectors.filter { it.center.z == CENTRAL_LAYER_Z }.forEach {
|
||||
detector(it)
|
||||
}
|
||||
}
|
||||
|
||||
group("top") {
|
||||
solidGroup("top") {
|
||||
Monitor.detectors.filter { it.center.z == UPPER_LAYER_Z }.forEach {
|
||||
detector(it)
|
||||
}
|
||||
}
|
||||
tracks = group("tracks")
|
||||
|
||||
set("tracks", tracks)
|
||||
}
|
||||
|
||||
private fun highlight(pixel: String) {
|
||||
map[pixel]?.color?.invoke("blue")
|
||||
println("highlight $pixel")
|
||||
map[pixel]?.color("blue")
|
||||
}
|
||||
|
||||
fun reset() {
|
||||
map.values.forEach {
|
||||
it.setProperty(SolidMaterial.MATERIAL_COLOR_KEY, null)
|
||||
it.properties[SolidMaterial.MATERIAL_COLOR_KEY] = null
|
||||
}
|
||||
val tracksToRemove = tracks.visions.keys.toList()
|
||||
tracksToRemove.forEach {
|
||||
tracks.setVision(it, null)
|
||||
}
|
||||
tracks.removeAll()
|
||||
}
|
||||
|
||||
fun displayEvent(event: Event) {
|
||||
println("Received event: $event")
|
||||
events.add(event)
|
||||
event.hits.forEach {
|
||||
highlight(it)
|
||||
}
|
||||
event.track?.let {
|
||||
tracks.polyline(*it.toTypedArray(), name = "track[${event.id}]") {
|
||||
thickness = 4
|
||||
color("red")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,21 +2,21 @@ package ru.mipt.npm.muon.monitor
|
||||
|
||||
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
|
||||
import space.kscience.kmath.geometry.euclidean3d.Float32Space3D
|
||||
import space.kscience.kmath.geometry.euclidean3d.Float32Vector3D
|
||||
|
||||
/**
|
||||
* A single pixel
|
||||
*/
|
||||
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 center: Float32Vector3D,
|
||||
val xSize: Float = PIXEL_XY_SIZE, val ySize: Float = PIXEL_XY_SIZE, val zSize: Float = PIXEL_Z_SIZE,
|
||||
)
|
||||
|
||||
class SC16(
|
||||
val name: String,
|
||||
val center: Point3D
|
||||
val center: Float32Vector3D,
|
||||
) {
|
||||
|
||||
/**
|
||||
@@ -28,77 +28,90 @@ class SC16(
|
||||
val y: Double
|
||||
when (index) {
|
||||
7 -> {
|
||||
x = 1.5 * Monitor.PIXEL_XY_SPACING;
|
||||
y = 1.5 * Monitor.PIXEL_XY_SPACING;
|
||||
x = 1.5 * Monitor.PIXEL_XY_SPACING
|
||||
y = 1.5 * Monitor.PIXEL_XY_SPACING
|
||||
}
|
||||
|
||||
4 -> {
|
||||
x = 0.5 * Monitor.PIXEL_XY_SPACING;
|
||||
y = 1.5 * Monitor.PIXEL_XY_SPACING;
|
||||
x = 0.5 * Monitor.PIXEL_XY_SPACING
|
||||
y = 1.5 * Monitor.PIXEL_XY_SPACING
|
||||
}
|
||||
|
||||
6 -> {
|
||||
x = 1.5 * Monitor.PIXEL_XY_SPACING;
|
||||
y = 0.5 * Monitor.PIXEL_XY_SPACING;
|
||||
x = 1.5 * Monitor.PIXEL_XY_SPACING
|
||||
y = 0.5 * Monitor.PIXEL_XY_SPACING
|
||||
}
|
||||
|
||||
5 -> {
|
||||
x = 0.5 * Monitor.PIXEL_XY_SPACING;
|
||||
y = 0.5 * Monitor.PIXEL_XY_SPACING;
|
||||
x = 0.5 * Monitor.PIXEL_XY_SPACING
|
||||
y = 0.5 * Monitor.PIXEL_XY_SPACING
|
||||
}
|
||||
|
||||
3 -> {
|
||||
x = -1.5 * Monitor.PIXEL_XY_SPACING;
|
||||
y = 1.5 * Monitor.PIXEL_XY_SPACING;
|
||||
x = -1.5 * Monitor.PIXEL_XY_SPACING
|
||||
y = 1.5 * Monitor.PIXEL_XY_SPACING
|
||||
}
|
||||
|
||||
0 -> {
|
||||
x = -0.5 * Monitor.PIXEL_XY_SPACING;
|
||||
y = 1.5 * Monitor.PIXEL_XY_SPACING;
|
||||
x = -0.5 * Monitor.PIXEL_XY_SPACING
|
||||
y = 1.5 * Monitor.PIXEL_XY_SPACING
|
||||
}
|
||||
|
||||
2 -> {
|
||||
x = -1.5 * Monitor.PIXEL_XY_SPACING;
|
||||
y = 0.5 * Monitor.PIXEL_XY_SPACING;
|
||||
x = -1.5 * Monitor.PIXEL_XY_SPACING
|
||||
y = 0.5 * Monitor.PIXEL_XY_SPACING
|
||||
}
|
||||
|
||||
1 -> {
|
||||
x = -0.5 * Monitor.PIXEL_XY_SPACING;
|
||||
y = 0.5 * Monitor.PIXEL_XY_SPACING;
|
||||
x = -0.5 * Monitor.PIXEL_XY_SPACING
|
||||
y = 0.5 * Monitor.PIXEL_XY_SPACING
|
||||
}
|
||||
|
||||
11 -> {
|
||||
x = -1.5 * Monitor.PIXEL_XY_SPACING;
|
||||
y = -1.5 * Monitor.PIXEL_XY_SPACING;
|
||||
x = -1.5 * Monitor.PIXEL_XY_SPACING
|
||||
y = -1.5 * Monitor.PIXEL_XY_SPACING
|
||||
}
|
||||
|
||||
8 -> {
|
||||
x = -0.5 * Monitor.PIXEL_XY_SPACING;
|
||||
y = -1.5 * Monitor.PIXEL_XY_SPACING;
|
||||
x = -0.5 * Monitor.PIXEL_XY_SPACING
|
||||
y = -1.5 * Monitor.PIXEL_XY_SPACING
|
||||
}
|
||||
|
||||
10 -> {
|
||||
x = -1.5 * Monitor.PIXEL_XY_SPACING;
|
||||
y = -0.5 * Monitor.PIXEL_XY_SPACING;
|
||||
x = -1.5 * Monitor.PIXEL_XY_SPACING
|
||||
y = -0.5 * Monitor.PIXEL_XY_SPACING
|
||||
}
|
||||
|
||||
9 -> {
|
||||
x = -0.5 * Monitor.PIXEL_XY_SPACING;
|
||||
y = -0.5 * Monitor.PIXEL_XY_SPACING;
|
||||
x = -0.5 * Monitor.PIXEL_XY_SPACING
|
||||
y = -0.5 * Monitor.PIXEL_XY_SPACING
|
||||
}
|
||||
|
||||
15 -> {
|
||||
x = 1.5 * Monitor.PIXEL_XY_SPACING;
|
||||
y = -1.5 * Monitor.PIXEL_XY_SPACING;
|
||||
x = 1.5 * Monitor.PIXEL_XY_SPACING
|
||||
y = -1.5 * Monitor.PIXEL_XY_SPACING
|
||||
}
|
||||
|
||||
12 -> {
|
||||
x = 0.5 * Monitor.PIXEL_XY_SPACING;
|
||||
y = -1.5 * Monitor.PIXEL_XY_SPACING;
|
||||
x = 0.5 * Monitor.PIXEL_XY_SPACING
|
||||
y = -1.5 * Monitor.PIXEL_XY_SPACING
|
||||
}
|
||||
|
||||
14 -> {
|
||||
x = 1.5 * Monitor.PIXEL_XY_SPACING;
|
||||
y = -0.5 * Monitor.PIXEL_XY_SPACING;
|
||||
x = 1.5 * Monitor.PIXEL_XY_SPACING
|
||||
y = -0.5 * Monitor.PIXEL_XY_SPACING
|
||||
}
|
||||
|
||||
13 -> {
|
||||
x = 0.5 * Monitor.PIXEL_XY_SPACING;
|
||||
y = -0.5 * Monitor.PIXEL_XY_SPACING;
|
||||
x = 0.5 * Monitor.PIXEL_XY_SPACING
|
||||
y = -0.5 * Monitor.PIXEL_XY_SPACING
|
||||
}
|
||||
else -> throw Error();
|
||||
|
||||
else -> throw Error()
|
||||
}
|
||||
val offset = Point3D(-y, x, 0)//rotateDetector(Point3D(x, y, 0.0));
|
||||
val offset = Float32Vector3D(-y, x, 0)//rotateDetector(Point3D(x, y, 0.0));
|
||||
val pixelName = "${name}_${index}"
|
||||
SC1(pixelName, center + offset)
|
||||
SC1(pixelName, with(Float32Space3D) { offset + center })
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -137,11 +150,11 @@ object Monitor {
|
||||
.mapNotNull { line ->
|
||||
if (line.startsWith(" ")) {
|
||||
val split = line.trim().split("\\s+".toRegex())
|
||||
val detectorName = split[1];
|
||||
val detectorName = split[1]
|
||||
val x = split[4].toDouble() - 500
|
||||
val y = split[5].toDouble() - 500
|
||||
val z = 180 - split[6].toDouble()
|
||||
SC16(detectorName, Point3D(x, y, z))
|
||||
SC16(detectorName, Float32Vector3D(x, y, z))
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
@@ -1,196 +1,113 @@
|
||||
package ru.mipt.npm.muon.monitor
|
||||
|
||||
import io.ktor.client.HttpClient
|
||||
import io.ktor.client.request.get
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.mutableStateListOf
|
||||
import androidx.compose.runtime.remember
|
||||
import app.softwork.bootstrapcompose.Button
|
||||
import app.softwork.bootstrapcompose.ButtonGroup
|
||||
import app.softwork.bootstrapcompose.Layout.Width
|
||||
import kotlinx.browser.window
|
||||
import kotlinx.coroutines.await
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.css.*
|
||||
import kotlinx.html.js.onClickFunction
|
||||
import react.*
|
||||
import react.dom.*
|
||||
import kotlinx.serialization.json.Json
|
||||
import org.jetbrains.compose.web.css.*
|
||||
import org.jetbrains.compose.web.dom.Div
|
||||
import org.jetbrains.compose.web.dom.P
|
||||
import org.jetbrains.compose.web.dom.Span
|
||||
import org.jetbrains.compose.web.dom.Text
|
||||
import org.w3c.fetch.RequestInit
|
||||
import space.kscience.dataforge.context.Context
|
||||
import space.kscience.dataforge.meta.invoke
|
||||
import space.kscience.dataforge.names.Name
|
||||
import space.kscience.dataforge.names.NameToken
|
||||
import space.kscience.dataforge.names.isEmpty
|
||||
import space.kscience.dataforge.names.length
|
||||
import space.kscience.visionforge.Vision
|
||||
import space.kscience.visionforge.bootstrap.canvasControls
|
||||
import space.kscience.visionforge.bootstrap.card
|
||||
import space.kscience.visionforge.bootstrap.gridRow
|
||||
import space.kscience.visionforge.bootstrap.visionPropertyEditor
|
||||
import space.kscience.visionforge.react.ThreeCanvasComponent
|
||||
import space.kscience.visionforge.react.flexColumn
|
||||
import space.kscience.visionforge.react.visionTree
|
||||
import space.kscience.visionforge.solid.specifications.Camera
|
||||
import space.kscience.visionforge.Colors
|
||||
import space.kscience.visionforge.solid.ambientLight
|
||||
import space.kscience.visionforge.solid.edges
|
||||
import space.kscience.visionforge.solid.invoke
|
||||
import space.kscience.visionforge.solid.specifications.Canvas3DOptions
|
||||
import styled.css
|
||||
import styled.styledDiv
|
||||
import space.kscience.visionforge.solid.three.compose.ThreeView
|
||||
import kotlin.math.PI
|
||||
|
||||
external interface MMAppProps : RProps {
|
||||
var model: Model
|
||||
var context: Context
|
||||
var connection: HttpClient
|
||||
var selected: Name?
|
||||
}
|
||||
@Composable
|
||||
fun MMApp(context: Context, model: Model, selected: Name? = null) {
|
||||
|
||||
@JsExport
|
||||
val MMApp = functionalComponent<MMAppProps>("Muon monitor") { props ->
|
||||
var selected by useState { props.selected }
|
||||
|
||||
val onSelect: (Name?) -> Unit = {
|
||||
selected = it
|
||||
}
|
||||
|
||||
val mmOptions = useMemo {
|
||||
val mmOptions = remember {
|
||||
Canvas3DOptions {
|
||||
camera = Camera {
|
||||
camera {
|
||||
distance = 2100.0
|
||||
latitude = PI / 6
|
||||
azimuth = PI + PI / 6
|
||||
}
|
||||
this.onSelect = onSelect
|
||||
}
|
||||
}
|
||||
|
||||
val root = props.model.root
|
||||
|
||||
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)
|
||||
val root = remember(model) {
|
||||
model.root.apply {
|
||||
edges()
|
||||
ambientLight {
|
||||
color(Colors.white)
|
||||
}
|
||||
}
|
||||
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
|
||||
}
|
||||
val events = remember { mutableStateListOf<Event>() }
|
||||
|
||||
Div(
|
||||
attrs = {
|
||||
classes("container-fluid")
|
||||
style {
|
||||
height(100.vh - 12.pt)
|
||||
}
|
||||
}
|
||||
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<Event>("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
|
||||
) {
|
||||
ThreeView(
|
||||
context,
|
||||
solid = root,
|
||||
initialSelected = selected,
|
||||
options = mmOptions,
|
||||
sidebarTabs = {
|
||||
Tab("Events") {
|
||||
ButtonGroup({ Layout.width = Width.Full }) {
|
||||
Button("Next") {
|
||||
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.add(event)
|
||||
model.displayEvent(event)
|
||||
}
|
||||
}
|
||||
if (selected != null) {
|
||||
val tokens = ArrayList<NameToken>(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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Button("Clear", color = app.softwork.bootstrapcompose.Color.Secondary) {
|
||||
events.clear()
|
||||
model.reset()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
events.forEach { event ->
|
||||
P {
|
||||
Span {
|
||||
Text(event.id.toString())
|
||||
}
|
||||
Text(" : ")
|
||||
Span({
|
||||
style {
|
||||
color(Color.blue)
|
||||
}
|
||||
}) {
|
||||
Text(event.hits.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,48 +1,26 @@
|
||||
package ru.mipt.npm.muon.monitor
|
||||
|
||||
import io.ktor.client.HttpClient
|
||||
import io.ktor.client.features.json.JsonFeature
|
||||
import io.ktor.client.features.json.serializer.KotlinxSerializer
|
||||
import kotlinx.browser.document
|
||||
import react.child
|
||||
import react.dom.render
|
||||
import org.jetbrains.compose.web.css.Style
|
||||
import org.jetbrains.compose.web.renderComposable
|
||||
import space.kscience.dataforge.context.Context
|
||||
import space.kscience.dataforge.context.Global
|
||||
import space.kscience.dataforge.context.fetch
|
||||
import space.kscience.visionforge.Application
|
||||
import space.kscience.dataforge.context.request
|
||||
import space.kscience.visionforge.VisionManager
|
||||
import space.kscience.visionforge.bootstrap.useBootstrap
|
||||
import space.kscience.visionforge.startApplication
|
||||
import space.kscience.visionforge.html.VisionForgeStyles
|
||||
import space.kscience.visionforge.html.startApplication
|
||||
import space.kscience.visionforge.solid.three.ThreePlugin
|
||||
|
||||
private class MMDemoApp : Application {
|
||||
|
||||
private val visionManager = Global.fetch(VisionManager)
|
||||
private val model = Model(visionManager)
|
||||
|
||||
private val connection = HttpClient {
|
||||
install(JsonFeature) {
|
||||
serializer = KotlinxSerializer()
|
||||
}
|
||||
fun main(): Unit = startApplication {
|
||||
val context = Context("MM-demo") {
|
||||
plugin(ThreePlugin)
|
||||
}
|
||||
|
||||
override fun start(state: Map<String, Any>) {
|
||||
useBootstrap()
|
||||
val visionManager = context.request(VisionManager)
|
||||
|
||||
val element = document.getElementById("app") ?: error("Element with id 'app' not found on page")
|
||||
val model = Model(visionManager)
|
||||
|
||||
val context = Context("demo")
|
||||
render(element) {
|
||||
child(MMApp) {
|
||||
attrs {
|
||||
this.model = this@MMDemoApp.model
|
||||
this.connection = this@MMDemoApp.connection
|
||||
this.context = context
|
||||
}
|
||||
}
|
||||
}
|
||||
renderComposable("app") {
|
||||
Style(VisionForgeStyles)
|
||||
MMApp(context, model)
|
||||
}
|
||||
}
|
||||
|
||||
fun main() {
|
||||
startApplication(::MMDemoApp)
|
||||
}
|
||||
@@ -1,11 +1,9 @@
|
||||
package ru.mipt.npm.muon.monitor
|
||||
|
||||
actual fun readResource(path: String): String {
|
||||
return kotlinext.js.require(path) as String
|
||||
}
|
||||
actual fun readResource(path: String): String = js("require(path)")
|
||||
|
||||
// TODO replace by resource
|
||||
internal actual fun readMonitorConfig(): String{
|
||||
internal actual fun readMonitorConfig(): String {
|
||||
return """
|
||||
--Place-|-SC16-|-TB-CHN-|-HB-CHN-|-X-coord-|-Y-coord-|-Z-coord-|-Theta-|-Phi
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
<!-- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">-->
|
||||
<title>Three js demo for particle physics</title>
|
||||
<script type="text/javascript" src="muon-monitor.js"></script>
|
||||
<link rel="stylesheet" href="css/custom-bootstrap.css">
|
||||
</head>
|
||||
<body class="application">
|
||||
<div class="container-fluid max-vh-100" id = "app"> </div>
|
||||
|
||||
@@ -1,31 +1,26 @@
|
||||
package ru.mipt.npm.muon.monitor.server
|
||||
package ru.mipt.npm.muon.monitor
|
||||
|
||||
|
||||
import io.ktor.application.Application
|
||||
import io.ktor.application.call
|
||||
import io.ktor.application.install
|
||||
import io.ktor.application.log
|
||||
import io.ktor.features.CallLogging
|
||||
import io.ktor.features.ContentNegotiation
|
||||
import io.ktor.features.DefaultHeaders
|
||||
import io.ktor.http.ContentType
|
||||
import io.ktor.http.HttpStatusCode
|
||||
import io.ktor.http.content.resources
|
||||
import io.ktor.http.content.static
|
||||