Compare commits
537 Commits
v0.1.5-dev
...
kotlin/2.2
| Author | SHA1 | Date | |
|---|---|---|---|
| 4da02e29ce | |||
| 9389d3a032 | |||
| 7e3a51d4a4 | |||
| e708caf584 | |||
| bae747b601 | |||
| 7f05e5a556 | |||
| 29ab796807 | |||
| 953c696956 | |||
| 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 | |||
|
|
f6459ec07f | ||
| e50e266f94 | |||
| 01ea6b5494 | |||
| 87260cea86 | |||
|
|
bdb28eb338 | ||
|
|
6435f71783 | ||
| a87692ae1f | |||
| c1627b4504 | |||
| 493c527743 | |||
| fb358dbc8e | |||
|
|
7242b5b4e0 | ||
|
|
a5466dca0c | ||
|
|
95220422cc | ||
| e1138be861 | |||
| 38c76e824d | |||
| 8f95d6f485 | |||
| f2e7e16d62 | |||
| 0d53b6f77d | |||
| 5af8fe3e99 | |||
| 073d374a9e | |||
| 42e2530f6f | |||
| 7b30b62849 | |||
| 2b6942b827 | |||
| ba637413c7 | |||
| c82c0ecea3 | |||
| 199cad1dc1 | |||
| 18b6ac2c37 | |||
|
|
32dad9d8b5 | ||
|
|
3fdd0d62d4 | ||
| a7841edb3c | |||
| a583030c1c | |||
| 230cd5dc61 | |||
| b0cd80a4e6 | |||
| 7cf819d7ce | |||
| ea5f0abbf6 | |||
| 9cc3f65a18 | |||
| 9b99df88a5 | |||
| 91e7e8573e | |||
| dfc0ffda38 | |||
| bd1f7d75fc | |||
| 288307eaa8 | |||
| 359eb05f83 | |||
| fb3ff4d6fc | |||
| bdbff04d78 | |||
| 8652b03fa5 | |||
| 1f8700efde | |||
| 5afa9117c4 | |||
| b8fadb06b5 | |||
| e615fcc2bc | |||
| 65c0183ba7 | |||
| faf3fa8512 | |||
| 2798439582 | |||
| 03b666017b | |||
| e644b1b20a | |||
| ff80629f24 | |||
| 3a87e43483 | |||
| 8a41f185de | |||
| 0961ae90b7 | |||
| 97b988d419 | |||
| 1a5a207fb7 | |||
| 8060933859 | |||
| 7febb4452a | |||
| 3f6e39b18d | |||
| 545753b14b | |||
| 30e6370204 | |||
| 0e488563a9 | |||
| 78a04728ba | |||
| 720555a942 | |||
| 7c9315b029 | |||
| bc15d9241b | |||
| a5bfa0f147 | |||
| 27fe492ab7 | |||
| 5d0ceb8e50 | |||
| 60906db32e | |||
| 1da4381a4c | |||
| e82ea7bb94 | |||
| 2b7971eeea | |||
| dab93fc136 | |||
| 19513656bd | |||
| 4820082248 | |||
| f7301805fd | |||
| 18828e87f2 | |||
| 5eb9925d35 | |||
| 716487d70a | |||
| bb6c6e2175 | |||
| 0c1d6139ae | |||
| 33146fef1b | |||
| 3f9f253416 | |||
|
|
f0f117d4fc | ||
| 51af6b9378 | |||
| 56481933ed | |||
| 1e183107cf | |||
| 346b61724f | |||
| 2b02f151d2 | |||
| 25a47a9719 | |||
| 3c0df98f50 | |||
| 216be4a6a1 | |||
| 66ea23ad60 | |||
| eefc036dcb | |||
| 0259d4eb15 | |||
| 4c235b0f53 | |||
| ccb916cff7 | |||
| 6939fba292 | |||
| be1d79c229 | |||
| 97cdfd3719 | |||
| 6a6d9659ca | |||
| 929832f3a5 | |||
| b2ba92e745 | |||
| 85bb690699 | |||
| c83954dca9 | |||
| 1ccd45d6c5 | |||
| 382686b9aa | |||
| f4970955cb | |||
| 651a875eee | |||
| 70ac2c99dd | |||
| 734d1e1168 | |||
| a38d70bade | |||
| 6a742658af | |||
| faddb8a393 | |||
| a7136d3eff | |||
| 8a4779e9c4 | |||
| face7bfd0c | |||
| a85cd828e6 | |||
| 9b42d4f186 | |||
| ebb7bf72d1 | |||
| 2be4576495 | |||
| 5e340aa179 | |||
| a44e8091c8 | |||
| e44096e844 | |||
| 698f74adaa | |||
| d1607459a1 | |||
| dc805228b4 | |||
| d2553d5b40 | |||
| e01a688664 | |||
| cae3ab00d9 | |||
| 6a48948c15 | |||
| 613624ff17 | |||
| 62a76f2c86 | |||
| 7e037b57fc | |||
| dfac01d352 | |||
| fdc221dfa1 | |||
| 5b8d298ac6 | |||
| 6b4bc6912f | |||
| 8f6c3822ff | |||
| 7571b58e99 | |||
| aaad836567 | |||
| 3edb00b6bf | |||
| 22c3521a9e | |||
| 072b036fa2 | |||
| f72d626b0b | |||
| c3001cd858 | |||
| 6116523091 | |||
| 9361145197 | |||
| c83a25b0a1 | |||
| 68cf4748d8 | |||
| ea82082304 | |||
| 998afb1ce0 | |||
| b362f86f9b | |||
| a5eba1789b | |||
| 48705e6670 | |||
| de2ef1dcc5 | |||
| 62a6eafdeb | |||
| ea276d35e9 |
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,8 +3,12 @@
|
||||
*.iws
|
||||
out/
|
||||
.gradle
|
||||
.kotlin/
|
||||
build/
|
||||
data/
|
||||
|
||||
jcef-bundle/
|
||||
|
||||
!gradle-wrapper.jar
|
||||
gradle.properties
|
||||
|
||||
/kotlin-js-store/yarn.lock
|
||||
|
||||
135
CHANGELOG.md
135
CHANGELOG.md
@@ -0,0 +1,135 @@
|
||||
# Changelog
|
||||
|
||||
## Unreleased
|
||||
|
||||
### Added
|
||||
|
||||
### Changed
|
||||
|
||||
### Deprecated
|
||||
|
||||
### Removed
|
||||
|
||||
### Fixed
|
||||
- Fix the problem where property listeners do not react on property child node changa
|
||||
|
||||
### 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
|
||||
- SphereLayer solid
|
||||
- Hexagon interface and GenericHexagon implementation (Box inherits Hexagon)
|
||||
- Increased the default detail level for spheres and cones to 32
|
||||
- Simple clipping for Solids in ThreeJs
|
||||
- Markdown module
|
||||
- Tables module
|
||||
|
||||
### Changed
|
||||
|
||||
- Vision does not implement ItemProvider anymore. Property changes are done via `getProperty`/`setProperty` and `property` delegate.
|
||||
- Point3D and Point2D are made separate classes instead of expect/actual (to split up different engines.
|
||||
- JavaFX support moved to a separate module
|
||||
- Threejs support moved to a separate module
|
||||
- \[Format breaking change!\] Stylesheets are moved into properties under `@stylesheet` key
|
||||
- VisionGroup builder accepts `null` as name for statics instead of `""`
|
||||
- gdml sphere is rendered as a SphereLayer instead of Sphere (#35)
|
||||
- Tube is replaced by more general ConeSurface
|
||||
- position, rotation and size moved to properties
|
||||
- prototypes moved to children
|
||||
- Immutable Solid instances
|
||||
- Property listeners are not triggered if there are no changes.
|
||||
- Feedback websocket connection in the client.
|
||||
|
||||
### Removed
|
||||
|
||||
- Primary modules dependencies on UI
|
||||
|
||||
### Fixed
|
||||
|
||||
- Version conflicts
|
||||
|
||||
213
README.md
213
README.md
@@ -1,34 +1,40 @@
|
||||
[](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
|
||||
[](https://zenodo.org/badge/latestdoi/174502624)
|
||||
|
||||

|
||||
|
||||
[](https://kotlinlang.slack.com/archives/CEXV2QWNM)
|
||||
|
||||
# DataForge Visualization Platform
|
||||
|
||||
## Table of Contents
|
||||
|
||||
* [Introduction](#introduction)
|
||||
* [Requirements](#requirements)
|
||||
* [Features](#features)
|
||||
* [About DataForge](#about-dataforge)
|
||||
* [Modules contained in this repository](#modules-contained-in-this-repository)
|
||||
* [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
|
||||
|
||||
JVM backend requires JDK 11 or later
|
||||
|
||||
## Features
|
||||
|
||||
@@ -48,60 +54,156 @@ 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
|
||||
|
||||
### [demo](demo)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
### [plotly-kt](plotly-kt)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
### [visionforge-compose-html](visionforge-compose-html)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
### [visionforge-compose-multiplatform](visionforge-compose-multiplatform)
|
||||
>
|
||||
> **Maturity**: EXPERIMENTAL
|
||||
|
||||
### [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
|
||||
|
||||
The `visionforge-core` module also includes configuration editors for JS (in `jsMain`) and JVM (in `jvmMain`).
|
||||
|
||||
**Class diagram:**
|
||||
|
||||

|
||||
|
||||
|
||||
### visionforge-solid
|
||||
|
||||
Includes common classes and serializers for 3D visualization, as well as Three.js and JavaFX implementations.
|
||||
|
||||
**Class diagram:**
|
||||
|
||||

|
||||

|
||||
|
||||
##### 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
|
||||
`Proxy` class helps to reuse a template object.
|
||||
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
|
||||
|
||||
@@ -109,36 +211,57 @@ 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)
|
||||
|
||||
**Example view:**
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
### GDML Example
|
||||
|
||||
Visualization example for geometry defined as GDML file.
|
||||
Visualization example for geometry defined as GDML file.
|
||||
|
||||
[More details](demo/gdml/README.md)
|
||||
|
||||
##### Example view:
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -1,35 +1,55 @@
|
||||
import scientifik.useFx
|
||||
import scientifik.useSerialization
|
||||
|
||||
val dataforgeVersion by extra("0.1.8")
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
import space.kscience.gradle.useApache2Licence
|
||||
import space.kscience.gradle.useSPCTeam
|
||||
|
||||
plugins {
|
||||
id("scientifik.mpp") apply false
|
||||
id("scientifik.jvm") apply false
|
||||
id("scientifik.js") apply false
|
||||
id("scientifik.publish") apply false
|
||||
id("org.jetbrains.changelog") version "0.4.0"
|
||||
id("space.kscience.gradle.project")
|
||||
alias(spclibs.plugins.kotlinx.kover)
|
||||
}
|
||||
|
||||
val dataforgeVersion by extra("0.10.1")
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
maven("https://dl.bintray.com/pdvrieze/maven")
|
||||
maven("http://maven.jzy3d.org/releases")
|
||||
}
|
||||
|
||||
group = "hep.dataforge"
|
||||
version = "0.1.5-dev"
|
||||
group = "space.kscience"
|
||||
version = "0.5.1-dev-1"
|
||||
}
|
||||
|
||||
val githubProject by extra("visionforge")
|
||||
val bintrayRepo by extra("dataforge")
|
||||
val fxVersion by extra("14")
|
||||
|
||||
subprojects {
|
||||
if(name.startsWith("visionforge")) {
|
||||
apply(plugin = "scientifik.publish")
|
||||
if (name.startsWith("visionforge")) 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")
|
||||
}
|
||||
useSerialization()
|
||||
useFx(scientifik.FXModule.CONTROLS, version = fxVersion)
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
compilerOptions {
|
||||
freeCompilerArgs.addAll("-Xcontext-parameters")
|
||||
}
|
||||
}
|
||||
|
||||
// tasks.withType<KotlinJsCompile>{
|
||||
// kotlinOptions{
|
||||
// useEsClasses = true
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
ksciencePublish {
|
||||
pom("https://github.com/SciProgCentre/visionforge") {
|
||||
useApache2Licence()
|
||||
useSPCTeam()
|
||||
}
|
||||
repository("spc", "https://maven.sciprog.center/kscience")
|
||||
central()
|
||||
}
|
||||
|
||||
apiValidation {
|
||||
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)
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
import org.jetbrains.kotlin.gradle.frontend.KotlinFrontendExtension
|
||||
import org.jetbrains.kotlin.gradle.frontend.npm.NpmExtension
|
||||
import org.jetbrains.kotlin.gradle.frontend.webpack.WebPackExtension
|
||||
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile
|
||||
|
||||
plugins {
|
||||
id("kotlin2js")
|
||||
id("kotlin-dce-js")
|
||||
id("org.jetbrains.kotlin.frontend")
|
||||
}
|
||||
|
||||
val kotlinVersion: String by rootProject.extra
|
||||
|
||||
dependencies {
|
||||
implementation(project(":visionforge-spatial-js"))
|
||||
testCompile(kotlin("test-js"))
|
||||
}
|
||||
|
||||
configure<KotlinFrontendExtension> {
|
||||
downloadNodeJsVersion = "latest"
|
||||
|
||||
configure<NpmExtension> {
|
||||
dependency("three","0.106.2")
|
||||
dependency("@hi-level/three-csg")
|
||||
dependency("style-loader")
|
||||
dependency("element-resize-event")
|
||||
devDependency("karma")
|
||||
}
|
||||
|
||||
sourceMaps = true
|
||||
|
||||
bundle<WebPackExtension>("webpack") {
|
||||
this as WebPackExtension
|
||||
bundleName = "main"
|
||||
contentPath = file("src/main/web")
|
||||
sourceMapEnabled = true
|
||||
//mode = "production"
|
||||
mode = "development"
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
"compileKotlin2Js"(Kotlin2JsCompile::class) {
|
||||
kotlinOptions {
|
||||
metaInfo = true
|
||||
outputFile = "${project.buildDir.path}/js/${project.name}.js"
|
||||
sourceMap = true
|
||||
moduleKind = "commonjs"
|
||||
main = "call"
|
||||
kotlinOptions.sourceMapEmbedSources = "always"
|
||||
}
|
||||
}
|
||||
|
||||
"compileTestKotlin2Js"(Kotlin2JsCompile::class) {
|
||||
kotlinOptions {
|
||||
metaInfo = true
|
||||
outputFile = "${project.buildDir.path}/js/${project.name}-test.js"
|
||||
sourceMap = true
|
||||
moduleKind = "commonjs"
|
||||
kotlinOptions.sourceMapEmbedSources = "always"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package hep.dataforge.vis.jsroot
|
||||
|
||||
external val module: Module
|
||||
|
||||
external interface Module {
|
||||
val hot: Hot?
|
||||
}
|
||||
|
||||
external interface Hot {
|
||||
val data: dynamic
|
||||
|
||||
fun accept()
|
||||
fun accept(dependency: String, callback: () -> Unit)
|
||||
fun accept(dependencies: Array<String>, callback: (updated: Array<String>) -> Unit)
|
||||
|
||||
fun dispose(callback: (data: dynamic) -> Unit)
|
||||
}
|
||||
|
||||
external fun require(name: String): dynamic
|
||||
@@ -1,6 +0,0 @@
|
||||
@file:JsModule("JSRootUtils")
|
||||
@file:JsNonModule
|
||||
|
||||
package hep.dataforge.vis.jsroot
|
||||
|
||||
external fun parse(obj: String): dynamic
|
||||
@@ -1,78 +0,0 @@
|
||||
package hep.dataforge.vis.jsroot
|
||||
|
||||
import hep.dataforge.context.Global
|
||||
import hep.dataforge.meta.EmptyMeta
|
||||
import hep.dataforge.vis.spatial.render
|
||||
import hep.dataforge.vis.spatial.three.ThreePlugin
|
||||
import hep.dataforge.vis.spatial.three.output
|
||||
import org.w3c.dom.HTMLDivElement
|
||||
import org.w3c.dom.events.Event
|
||||
import org.w3c.files.FileList
|
||||
import org.w3c.files.FileReader
|
||||
import org.w3c.files.get
|
||||
import kotlin.browser.document
|
||||
import kotlin.dom.clear
|
||||
|
||||
|
||||
class JSRootDemoApp : ApplicationBase() {
|
||||
|
||||
override val stateKeys: List<String> = emptyList()
|
||||
|
||||
override fun start(state: Map<String, Any>) {
|
||||
|
||||
|
||||
//TODO remove after DI fix
|
||||
// Global.plugins.load(ThreePlugin())
|
||||
// Global.plugins.load(JSRootPlugin())
|
||||
|
||||
Global.plugins.load(JSRootPlugin)
|
||||
|
||||
|
||||
|
||||
(document.getElementById("drop_zone") as? HTMLDivElement)?.apply {
|
||||
addEventListener("dragover", { handleDragOver(it) }, false)
|
||||
addEventListener("drop", { loadData(it) }, false)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle mouse drag according to https://www.html5rocks.com/en/tutorials/file/dndfiles/
|
||||
*/
|
||||
private fun handleDragOver(event: Event) {
|
||||
event.stopPropagation()
|
||||
event.preventDefault()
|
||||
event.asDynamic().dataTransfer.dropEffect = "copy"
|
||||
}
|
||||
|
||||
/**
|
||||
* Load data from text file
|
||||
*/
|
||||
private fun loadData(event: Event) {
|
||||
event.stopPropagation()
|
||||
event.preventDefault()
|
||||
|
||||
|
||||
val file = (event.asDynamic().dataTransfer.files as FileList)[0]
|
||||
?: throw RuntimeException("Failed to load file");
|
||||
FileReader().apply {
|
||||
onload = {
|
||||
val string = result as String
|
||||
val renderer = Global.plugins.fetch(ThreePlugin).output()
|
||||
val canvas = document.getElementById("canvas")!!
|
||||
canvas.clear()
|
||||
renderer.attach(canvas)
|
||||
println("started")
|
||||
|
||||
renderer.render {
|
||||
val json = parse(string)
|
||||
JSRootObject(this, EmptyMeta, json).also { add(it) }
|
||||
}
|
||||
}
|
||||
readAsText(file)
|
||||
}
|
||||
}
|
||||
|
||||
override fun dispose() = emptyMap<String, Any>()//mapOf("lines" put presenter.dispose())
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
@file:JsModule("JSRootGeoBase")
|
||||
@file:JsNonModule
|
||||
|
||||
package hep.dataforge.vis.jsroot
|
||||
|
||||
import info.laht.threekt.core.BufferGeometry
|
||||
import info.laht.threekt.core.Object3D
|
||||
|
||||
external fun createGeometry(shape: dynamic, limit: Int): BufferGeometry
|
||||
|
||||
external fun createCubeBuffer(shape: dynamic, limit: Int): BufferGeometry
|
||||
|
||||
external fun createTubeBuffer(shape: dynamic, limit: Int): BufferGeometry
|
||||
|
||||
external fun createXtruBuffer(shape: dynamic, limit: Int): BufferGeometry
|
||||
|
||||
external fun build(obj: dynamic, opt: dynamic): Object3D
|
||||
@@ -1,82 +0,0 @@
|
||||
package hep.dataforge.vis.jsroot
|
||||
|
||||
import hep.dataforge.meta.EmptyMeta
|
||||
import hep.dataforge.meta.Meta
|
||||
import hep.dataforge.meta.buildMeta
|
||||
import hep.dataforge.meta.toDynamic
|
||||
import hep.dataforge.vis.common.*
|
||||
import hep.dataforge.vis.spatial.three.MeshThreeFactory
|
||||
import info.laht.threekt.core.BufferGeometry
|
||||
|
||||
class JSRootGeometry(parent: VisualObject?, meta: Meta) : DisplayLeaf(parent, meta) {
|
||||
|
||||
var shape by node()
|
||||
|
||||
var facesLimit by int(0)
|
||||
|
||||
fun box(xSize: Number, ySize: Number, zSize: Number) = buildMeta {
|
||||
"_typename" put "TGeoBBox"
|
||||
"fDX" put xSize
|
||||
"fDY" put ySize
|
||||
"fDZ" put zSize
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a GDML union
|
||||
*/
|
||||
operator fun Meta.plus(other: Meta) = buildMeta {
|
||||
"fNode.fLeft" put this
|
||||
"fNode.fRight" put other
|
||||
"fNode._typename" put "TGeoUnion"
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a GDML subtraction
|
||||
*/
|
||||
operator fun Meta.minus(other: Meta) = buildMeta {
|
||||
"fNode.fLeft" put this
|
||||
"fNode.fRight" put other
|
||||
"fNode._typename" put "TGeoSubtraction"
|
||||
}
|
||||
|
||||
/**
|
||||
* Intersect two GDML geometries
|
||||
*/
|
||||
infix fun Meta.intersect(other: Meta) = buildMeta {
|
||||
"fNode.fLeft" put this
|
||||
"fNode.fRight" put other
|
||||
"fNode._typename" put "TGeoIntersection"
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TYPE = "geometry.spatial.jsRoot.geometry"
|
||||
}
|
||||
}
|
||||
|
||||
fun VisualGroup.jsRootGeometry(meta: Meta = EmptyMeta, action: JSRootGeometry.() -> Unit = {}) =
|
||||
JSRootGeometry(this, meta).apply(action).also { add(it) }
|
||||
|
||||
//fun Meta.toDynamic(): dynamic {
|
||||
// fun MetaItem<*>.toDynamic(): dynamic = when (this) {
|
||||
// is MetaItem.ValueItem -> this.value.value.asDynamic()
|
||||
// is MetaItem.NodeItem -> this.node.toDynamic()
|
||||
// }
|
||||
//
|
||||
// val res = js("{}")
|
||||
// this.items.entries.groupBy { it.key.body }.forEach { (key, value) ->
|
||||
// val list = value.map { it.value }
|
||||
// res[key] = when (list.size) {
|
||||
// 1 -> list.first().toDynamic()
|
||||
// else -> list.map { it.toDynamic() }
|
||||
// }
|
||||
// }
|
||||
// return res
|
||||
//}
|
||||
|
||||
|
||||
object ThreeJSRootGeometryFactory : MeshThreeFactory<JSRootGeometry>(JSRootGeometry::class) {
|
||||
override fun buildGeometry(obj: JSRootGeometry): BufferGeometry {
|
||||
val shapeMeta = obj.shape?.toDynamic() ?: error("The shape not defined")
|
||||
return createGeometry(shapeMeta, obj.facesLimit)
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package hep.dataforge.vis.jsroot
|
||||
|
||||
import hep.dataforge.meta.EmptyMeta
|
||||
import hep.dataforge.meta.Meta
|
||||
import hep.dataforge.meta.toDynamic
|
||||
import hep.dataforge.vis.common.VisualGroup
|
||||
import hep.dataforge.vis.common.DisplayLeaf
|
||||
import hep.dataforge.vis.common.VisualObject
|
||||
import hep.dataforge.vis.common.node
|
||||
import hep.dataforge.vis.spatial.three.ThreeFactory
|
||||
import info.laht.threekt.core.Object3D
|
||||
|
||||
class JSRootObject(parent: VisualObject?, meta: Meta, val data: dynamic) : DisplayLeaf(parent, meta) {
|
||||
|
||||
var options by node()
|
||||
|
||||
companion object {
|
||||
const val TYPE = "geometry.spatial.jsRoot.object"
|
||||
}
|
||||
}
|
||||
|
||||
object ThreeJSRootObjectFactory : ThreeFactory<JSRootObject> {
|
||||
|
||||
override val type = JSRootObject::class
|
||||
|
||||
override fun invoke(obj: JSRootObject): Object3D {
|
||||
return build(obj.data, obj.options?.toDynamic())
|
||||
}
|
||||
}
|
||||
|
||||
fun VisualGroup.jsRootObject(str: String) {
|
||||
val json = JSON.parse<Any>(str)
|
||||
JSRootObject(this, EmptyMeta, json).also { add(it) }
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package hep.dataforge.vis.jsroot
|
||||
|
||||
import hep.dataforge.context.AbstractPlugin
|
||||
import hep.dataforge.context.PluginFactory
|
||||
import hep.dataforge.context.PluginTag
|
||||
import hep.dataforge.meta.Meta
|
||||
import hep.dataforge.names.Name
|
||||
import hep.dataforge.names.toName
|
||||
import hep.dataforge.vis.spatial.three.ThreeFactory
|
||||
import hep.dataforge.vis.spatial.three.ThreePlugin
|
||||
|
||||
class JSRootPlugin : AbstractPlugin() {
|
||||
override val tag: PluginTag get() = Companion.tag
|
||||
|
||||
override fun dependsOn() = listOf(ThreePlugin)
|
||||
|
||||
override fun provideTop(target: String): Map<Name, Any> {
|
||||
return when(target){
|
||||
ThreeFactory.TYPE -> mapOf(
|
||||
"jsRoot.geometry".toName() to ThreeJSRootGeometryFactory,
|
||||
"jsRoot.object".toName() to ThreeJSRootObjectFactory
|
||||
)
|
||||
else -> emptyMap()
|
||||
}
|
||||
}
|
||||
|
||||
companion object: PluginFactory<JSRootPlugin> {
|
||||
override val tag = PluginTag("vis.jsroot", "hep.dataforge")
|
||||
override val type = JSRootPlugin::class
|
||||
override fun invoke(meta: Meta) = JSRootPlugin()
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package hep.dataforge.vis.jsroot
|
||||
|
||||
import kotlin.browser.document
|
||||
import kotlin.dom.hasClass
|
||||
|
||||
|
||||
abstract class ApplicationBase {
|
||||
abstract val stateKeys: List<String>
|
||||
|
||||
abstract fun start(state: Map<String, Any>)
|
||||
abstract fun dispose(): Map<String, Any>
|
||||
}
|
||||
|
||||
|
||||
fun main() {
|
||||
var application: ApplicationBase? = null
|
||||
|
||||
val state: dynamic = module.hot?.let { hot ->
|
||||
hot.accept()
|
||||
|
||||
hot.dispose { data ->
|
||||
data.appState = application?.dispose()
|
||||
application = null
|
||||
}
|
||||
|
||||
hot.data
|
||||
}
|
||||
|
||||
if (document.body != null) {
|
||||
application = start(state)
|
||||
} else {
|
||||
application = null
|
||||
document.addEventListener("DOMContentLoaded", { application = start(state) })
|
||||
}
|
||||
}
|
||||
|
||||
fun start(state: dynamic): ApplicationBase? {
|
||||
return if (document.body?.hasClass("application") == true) {
|
||||
val application = JSRootDemoApp()
|
||||
|
||||
@Suppress("UnsafeCastFromDynamic")
|
||||
application.start(state?.appState ?: emptyMap<String, Any>())
|
||||
|
||||
application
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
3577
dataforge-vis-jsroot/src/main/resources/JSRootGeoBase.js
vendored
3577
dataforge-vis-jsroot/src/main/resources/JSRootGeoBase.js
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,765 +0,0 @@
|
||||
|
||||
/** Generate mask for given bit
|
||||
*
|
||||
* @param {number} n bit number
|
||||
* @returns {Number} produced make
|
||||
* @private */
|
||||
export function BIT(n) {
|
||||
return 1 << (n);
|
||||
}
|
||||
|
||||
/** Wrapper for console.log, let redirect output to specified div element
|
||||
* @private */
|
||||
function console(value, divid) {
|
||||
if ((typeof divid == 'string') && document.getElementById(divid))
|
||||
document.getElementById(divid).innerHTML = value;
|
||||
else if ((typeof console != 'undefined') && (typeof console.log == 'function'))
|
||||
console.log(value);
|
||||
}
|
||||
|
||||
|
||||
/** @summary Wrapper for alert, throws Error in Node.js
|
||||
* @private */
|
||||
export function alert(msg) {
|
||||
if (this.nodeis) throw new Error(msg);
|
||||
if (typeof alert === 'function') alert(msg);
|
||||
else console('ALERT: ' + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Seed simple random generator
|
||||
*
|
||||
* @private
|
||||
* @param {number} i seed value
|
||||
*/
|
||||
export function seed(i) {
|
||||
i = Math.abs(i);
|
||||
if (i > 1e8) i = Math.abs(1e8 * Math.sin(i)); else if (i < 1) i *= 1e8;
|
||||
this.m_w = Math.round(i);
|
||||
this.m_z = 987654321;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Simple random generator
|
||||
*
|
||||
* @desc Works like Math.random(), but with configurable seed - see {@link JSROOT.seed}
|
||||
* @private
|
||||
* @returns {number} random value between 0 (inclusive) and 1.0 (exclusive)
|
||||
*/
|
||||
export function random() {
|
||||
if (this.m_z === undefined) return Math.random();
|
||||
this.m_z = (36969 * (this.m_z & 65535) + (this.m_z >> 16)) & 0xffffffff;
|
||||
this.m_w = (18000 * (this.m_w & 65535) + (this.m_w >> 16)) & 0xffffffff;
|
||||
var result = ((this.m_z << 16) + this.m_w) & 0xffffffff;
|
||||
result /= 4294967296;
|
||||
return result + 0.5;
|
||||
}
|
||||
|
||||
|
||||
/** @summary Should be used to reintroduce objects references, produced by TBufferJSON.
|
||||
*
|
||||
* @desc Replace all references inside object, object should not be null
|
||||
* Idea of the code taken from JSON-R code, found on
|
||||
* https://github.com/graniteds/jsonr
|
||||
* Only unref part was used, arrays are not accounted as objects
|
||||
* @param {object} obj object where references will be replaced
|
||||
* @returns {object} same object with replaced references
|
||||
* @private */
|
||||
function JSONR_unref(obj) {
|
||||
|
||||
let map = [], newfmt = undefined;
|
||||
|
||||
function unref_value(value) {
|
||||
if ((value === null) || (value === undefined)) return;
|
||||
|
||||
/*
|
||||
if object is a reference string in "old format"
|
||||
Old format seems to be single string with "$ref:" prefix. New format is an object
|
||||
*/
|
||||
if (typeof value === 'string') {
|
||||
if (newfmt || (value.length < 6) || (value.indexOf("$ref:") !== 0)) return; //switch to "new format" if needed
|
||||
let ref = parseInt(value.substr(5)); // get ref number
|
||||
if (isNaN(ref) || (ref < 0) || (ref >= map.length)) return; //skip if not a ref
|
||||
newfmt = false;
|
||||
return map[ref]; //return an object from cache
|
||||
}
|
||||
|
||||
if (typeof value !== 'object') return;
|
||||
|
||||
let i, k, res, proto = Object.prototype.toString.apply(value);
|
||||
|
||||
// scan array - it can contain other objects
|
||||
if ((proto.indexOf('[object') === 0) && (proto.indexOf('Array]') > 0)) {
|
||||
for (i = 0; i < value.length; ++i) {
|
||||
res = unref_value(value[i]);
|
||||
if (res !== undefined) value[i] = res;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
let ks = Object.keys(value), len = ks.length;
|
||||
|
||||
if ((newfmt !== false) && (len === 1) && (ks[0] === '$ref')) {
|
||||
let ref = parseInt(value['$ref']);
|
||||
if (isNaN(ref) || (ref < 0) || (ref >= map.length)) return;
|
||||
newfmt = true;
|
||||
return map[ref];
|
||||
}
|
||||
|
||||
if ((newfmt !== false) && (len > 1) && (ks[0] === '$arr') && (ks[1] === 'len')) {
|
||||
// this is ROOT-coded array
|
||||
var arr = null, dflt = (value.$arr === "Bool") ? false : 0;
|
||||
switch (value.$arr) {
|
||||
case "Int8" :
|
||||
arr = new Int8Array(value.len);
|
||||
break;
|
||||
case "Uint8" :
|
||||
arr = new Uint8Array(value.len);
|
||||
break;
|
||||
case "Int16" :
|
||||
arr = new Int16Array(value.len);
|
||||
break;
|
||||
case "Uint16" :
|
||||
arr = new Uint16Array(value.len);
|
||||
break;
|
||||
case "Int32" :
|
||||
arr = new Int32Array(value.len);
|
||||
break;
|
||||
case "Uint32" :
|
||||
arr = new Uint32Array(value.len);
|
||||
break;
|
||||
case "Float32" :
|
||||
arr = new Float32Array(value.len);
|
||||
break;
|
||||
case "Int64" :
|
||||
case "Uint64" :
|
||||
case "Float64" :
|
||||
arr = new Float64Array(value.len);
|
||||
break;
|
||||
default :
|
||||
arr = new Array(value.len);
|
||||
break;
|
||||
}
|
||||
for (let k = 0; k < value.len; ++k) arr[k] = dflt;
|
||||
|
||||
var nkey = 2, p = 0;
|
||||
while (nkey < len) {
|
||||
if (ks[nkey][0] === "p") p = value[ks[nkey++]]; // position
|
||||
if (ks[nkey][0] !== 'v') throw new Error('Unexpected member ' + ks[nkey] + ' in array decoding');
|
||||
let v = value[ks[nkey++]]; // value
|
||||
if (typeof v === 'object') {
|
||||
for (let k = 0; k < v.length; ++k) arr[p++] = v[k];
|
||||
} else {
|
||||
arr[p++] = v;
|
||||
if ((nkey < len) && (ks[nkey][0] === 'n')) {
|
||||
let cnt = value[ks[nkey++]]; // counter
|
||||
while (--cnt) arr[p++] = v;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return arr;
|
||||
}
|
||||
|
||||
if ((newfmt !== false) && (len === 3) && (ks[0] === '$pair') && (ks[1] === 'first') && (ks[2] === 'second')) {
|
||||
newfmt = true;
|
||||
let f1 = unref_value(value.first),
|
||||
s1 = unref_value(value.second);
|
||||
if (f1 !== undefined) value.first = f1;
|
||||
if (s1 !== undefined) value.second = s1;
|
||||
value._typename = value['$pair'];
|
||||
delete value['$pair'];
|
||||
return; // pair object is not counted in the objects map
|
||||
}
|
||||
|
||||
// debug code, can be commented out later
|
||||
if (map.indexOf(value) >= 0) {
|
||||
console('should never happen - object already in the map');
|
||||
return;
|
||||
}
|
||||
|
||||
// add object to object map
|
||||
map.push(value);
|
||||
|
||||
// add methods to all objects, where _typename is specified
|
||||
//if ('_typename' in value) JSROOT.addMethods(value);
|
||||
|
||||
for (let k = 0; k < len; ++k) {
|
||||
i = ks[k];
|
||||
res = unref_value(value[i]);
|
||||
if (res !== undefined) value[i] = res;
|
||||
}
|
||||
}
|
||||
|
||||
unref_value(obj);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
/** @summary Just copies (not clone) all fields from source to the target object
|
||||
* @desc This is simple replacement of jQuery.extend method
|
||||
* @private */
|
||||
function extend(tgt, src) {
|
||||
if ((src === null) || (typeof src !== 'object')) return tgt;
|
||||
if ((tgt === null) || (typeof tgt !== 'object')) tgt = {};
|
||||
|
||||
for (var k in src)
|
||||
tgt[k] = src[k];
|
||||
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @summary Parse JSON code produced with TBufferJSON.
|
||||
*
|
||||
* @param {string} json string to parse
|
||||
* @return {object|null} returns parsed object
|
||||
*/
|
||||
export function parse(json) {
|
||||
if (!json) return null;
|
||||
let obj = JSON.parse(json);
|
||||
if (obj) obj = JSONR_unref(obj);
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @summary Parse multi.json request results
|
||||
* @desc Method should be used to parse JSON code, produced by multi.json request of THttpServer
|
||||
*
|
||||
* @param {string} json string to parse
|
||||
* @return {Array|null} returns array of parsed elements
|
||||
*/
|
||||
export function parse_multi(json) {
|
||||
if (!json) return null;
|
||||
let arr = JSON.parse(json);
|
||||
if (arr && arr.length)
|
||||
for (let i = 0; i < arr.length; ++i)
|
||||
arr[i] = JSONR_unref(arr[i]);
|
||||
return arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Method converts JavaScript object into ROOT-like JSON
|
||||
*
|
||||
* @desc Produced JSON can be used in JSROOT.parse() again
|
||||
* When performed properly, JSON can be used in TBufferJSON to read data back with C++
|
||||
*/
|
||||
export function toJSON(obj) {
|
||||
if (!obj || typeof obj !== 'object') return "";
|
||||
|
||||
var map = []; // map of stored objects
|
||||
|
||||
function copy_value(value) {
|
||||
if (typeof value === "function") return undefined;
|
||||
|
||||
if ((value === undefined) || (value === null) || (typeof value !== 'object')) return value;
|
||||
|
||||
var proto = Object.prototype.toString.apply(value);
|
||||
|
||||
// typed array need to be converted into normal array, otherwise looks strange
|
||||
if ((proto.indexOf('[object ') === 0) && (proto.indexOf('Array]') === proto.length - 6)) {
|
||||
var arr = new Array(value.length);
|
||||
for (var i = 0; i < value.length; ++i)
|
||||
arr[i] = copy_value(value[i]);
|
||||
return arr;
|
||||
}
|
||||
|
||||
// this is how reference is code
|
||||
var refid = map.indexOf(value);
|
||||
if (refid >= 0) return {$ref: refid};
|
||||
|
||||
var ks = Object.keys(value), len = ks.length, tgt = {};
|
||||
|
||||
if ((len === 3) && (ks[0] === '$pair') && (ks[1] === 'first') && (ks[2] === 'second')) {
|
||||
// special handling of pair objects which does not included into objects map
|
||||
tgt.$pair = value.$pair;
|
||||
tgt.first = copy_value(value.first);
|
||||
tgt.second = copy_value(value.second);
|
||||
return tgt;
|
||||
}
|
||||
|
||||
map.push(value);
|
||||
|
||||
for (var k = 0; k < len; ++k) {
|
||||
var name = ks[k];
|
||||
tgt[name] = copy_value(value[name]);
|
||||
}
|
||||
|
||||
return tgt;
|
||||
}
|
||||
|
||||
var tgt = copy_value(obj);
|
||||
|
||||
return JSON.stringify(tgt);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @summary Parse string value as array.
|
||||
*
|
||||
* @desc It could be just simple string: "value" or
|
||||
* array with or without string quotes: [element], ['elem1',elem2]
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function ParseAsArray(val) {
|
||||
|
||||
var res = [];
|
||||
|
||||
if (typeof val != 'string') return res;
|
||||
|
||||
val = val.trim();
|
||||
if (val === "") return res;
|
||||
|
||||
// return as array with single element
|
||||
if ((val.length < 2) || (val[0] !== '[') || (val[val.length - 1] !== ']')) {
|
||||
res.push(val);
|
||||
return res;
|
||||
}
|
||||
|
||||
// try to split ourself, checking quotes and brackets
|
||||
var nbr = 0, nquotes = 0, ndouble = 0, last = 1;
|
||||
|
||||
for (var indx = 1; indx < val.length; ++indx) {
|
||||
if (nquotes > 0) {
|
||||
if (val[indx] === "'") nquotes--;
|
||||
continue;
|
||||
}
|
||||
if (ndouble > 0) {
|
||||
if (val[indx] === '"') ndouble--;
|
||||
continue;
|
||||
}
|
||||
switch (val[indx]) {
|
||||
case "'":
|
||||
nquotes++;
|
||||
break;
|
||||
case '"':
|
||||
ndouble++;
|
||||
break;
|
||||
case "[":
|
||||
nbr++;
|
||||
break;
|
||||
case "]":
|
||||
if (indx < val.length - 1) {
|
||||
nbr--;
|
||||
break;
|
||||
}
|
||||
case ",":
|
||||
if (nbr === 0) {
|
||||
var sub = val.substring(last, indx).trim();
|
||||
if ((sub.length > 1) && (sub[0] === sub[sub.length - 1]) && ((sub[0] === '"') || (sub[0] === "'")))
|
||||
sub = sub.substr(1, sub.length - 2);
|
||||
res.push(sub);
|
||||
last = indx + 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (res.length === 0)
|
||||
res.push(val.substr(1, val.length - 2).trim());
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Find function with given name.
|
||||
*
|
||||
* @desc Function name may include several namespaces like 'JSROOT.Painter.drawFrame'
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function findFunction(name) {
|
||||
if (typeof name === 'function') return name;
|
||||
if (typeof name !== 'string') return null;
|
||||
var names = name.split('.'), elem = null;
|
||||
if (typeof window === 'object') elem = window;
|
||||
if (names[0] === 'JSROOT') {
|
||||
elem = this;
|
||||
names.shift();
|
||||
}
|
||||
|
||||
for (var n = 0; elem && (n < names.length); ++n)
|
||||
elem = elem[names[n]];
|
||||
|
||||
return (typeof elem == 'function') ? elem : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Generic method to invoke callback function.
|
||||
*
|
||||
* @param {object|function} func either normal function or container like
|
||||
* { obj: object_pointer, func: name of method to call }
|
||||
* @param arg1 first optional argument of callback
|
||||
* @param arg2 second optional argument of callback
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function callBack(func, arg1, arg2) {
|
||||
|
||||
if (typeof func == 'string') func = findFunction(func);
|
||||
|
||||
if (!func) return;
|
||||
|
||||
if (typeof func == 'function') return func(arg1, arg2);
|
||||
|
||||
if (typeof func != 'object') return;
|
||||
|
||||
if (('obj' in func) && ('func' in func) &&
|
||||
(typeof func.obj == 'object') && (typeof func.func == 'string') &&
|
||||
(typeof func.obj[func.func] == 'function')) {
|
||||
return func.obj[func.func](arg1, arg2);
|
||||
}
|
||||
}
|
||||
|
||||
let methodsCache = {}; // variable used to keep methods for known classes
|
||||
|
||||
|
||||
/** @summary Returns methods for given typename
|
||||
* @private
|
||||
*/
|
||||
function getMethods(typename, obj) {
|
||||
|
||||
var m = methodsCache[typename],
|
||||
has_methods = (m !== undefined);
|
||||
|
||||
if (!has_methods) m = {};
|
||||
|
||||
// Due to binary I/O such TObject methods may not be set for derived classes
|
||||
// Therefore when methods requested for given object, check also that basic methods are there
|
||||
if ((typename === "TObject") || (typename === "TNamed") || (obj && (obj.fBits !== undefined)))
|
||||
if (m.TestBit === undefined) {
|
||||
m.TestBit = function (f) {
|
||||
return (this.fBits & f) !== 0;
|
||||
};
|
||||
m.InvertBit = function (f) {
|
||||
this.fBits = this.fBits ^ (f & 0xffffff);
|
||||
};
|
||||
}
|
||||
|
||||
if (has_methods) return m;
|
||||
|
||||
if ((typename === 'TList') || (typename === 'THashList')) {
|
||||
m.Clear = function () {
|
||||
this.arr = [];
|
||||
this.opt = [];
|
||||
};
|
||||
m.Add = function (obj, opt) {
|
||||
this.arr.push(obj);
|
||||
this.opt.push((opt && typeof opt == 'string') ? opt : "");
|
||||
};
|
||||
m.AddFirst = function (obj, opt) {
|
||||
this.arr.unshift(obj);
|
||||
this.opt.unshift((opt && typeof opt == 'string') ? opt : "");
|
||||
};
|
||||
m.RemoveAt = function (indx) {
|
||||
this.arr.splice(indx, 1);
|
||||
this.opt.splice(indx, 1);
|
||||
}
|
||||
}
|
||||
|
||||
// if ((typename === "TPaveText") || (typename === "TPaveStats")) {
|
||||
// m.AddText = function (txt) {
|
||||
// // this.fLines.Add({ _typename: 'TLatex', fTitle: txt, fTextColor: 1 });
|
||||
// var line = JSROOT.Create("TLatex");
|
||||
// line.fTitle = txt;
|
||||
// this.fLines.Add(line);
|
||||
// };
|
||||
// m.Clear = function () {
|
||||
// this.fLines.Clear();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if ((typename.indexOf("TF1") === 0) || (typename === "TF2")) {
|
||||
// m.addFormula = function (obj) {
|
||||
// if (!obj) return;
|
||||
// if (this.formulas === undefined) this.formulas = [];
|
||||
// this.formulas.push(obj);
|
||||
// };
|
||||
//
|
||||
// m.evalPar = function (x, y) {
|
||||
// if (!('_func' in this) || (this._title !== this.fTitle)) {
|
||||
//
|
||||
// var _func = this.fTitle, isformula = false, pprefix = "[";
|
||||
// if (_func === "gaus") _func = "gaus(0)";
|
||||
// if (this.fFormula && typeof this.fFormula.fFormula == "string") {
|
||||
// if (this.fFormula.fFormula.indexOf("[](double*x,double*p)") === 0) {
|
||||
// isformula = true;
|
||||
// pprefix = "p[";
|
||||
// _func = this.fFormula.fFormula.substr(21);
|
||||
// } else {
|
||||
// _func = this.fFormula.fFormula;
|
||||
// pprefix = "[p";
|
||||
// }
|
||||
// if (this.fFormula.fClingParameters && this.fFormula.fParams) {
|
||||
// for (var i = 0; i < this.fFormula.fParams.length; ++i) {
|
||||
// var regex = new RegExp('(\\[' + this.fFormula.fParams[i].first + '\\])', 'g'),
|
||||
// parvalue = this.fFormula.fClingParameters[this.fFormula.fParams[i].second];
|
||||
// _func = _func.replace(regex, (parvalue < 0) ? "(" + parvalue + ")" : parvalue);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if ('formulas' in this)
|
||||
// for (var i = 0; i < this.formulas.length; ++i)
|
||||
// while (_func.indexOf(this.formulas[i].fName) >= 0)
|
||||
// _func = _func.replace(this.formulas[i].fName, this.formulas[i].fTitle);
|
||||
// _func = _func.replace(/\b(abs)\b/g, 'TMath::Abs')
|
||||
// .replace(/TMath::Exp\(/g, 'Math.exp(')
|
||||
// .replace(/TMath::Abs\(/g, 'Math.abs(');
|
||||
// if (typeof JSROOT.Math == 'object') {
|
||||
// this._math = JSROOT.Math;
|
||||
// _func = _func.replace(/TMath::Prob\(/g, 'this._math.Prob(')
|
||||
// .replace(/TMath::Gaus\(/g, 'this._math.Gaus(')
|
||||
// .replace(/TMath::BreitWigner\(/g, 'this._math.BreitWigner(')
|
||||
// .replace(/xygaus\(/g, 'this._math.gausxy(this, x, y, ')
|
||||
// .replace(/gaus\(/g, 'this._math.gaus(this, x, ')
|
||||
// .replace(/gausn\(/g, 'this._math.gausn(this, x, ')
|
||||
// .replace(/expo\(/g, 'this._math.expo(this, x, ')
|
||||
// .replace(/landau\(/g, 'this._math.landau(this, x, ')
|
||||
// .replace(/landaun\(/g, 'this._math.landaun(this, x, ')
|
||||
// .replace(/ROOT::Math::/g, 'this._math.');
|
||||
// }
|
||||
// for (var i = 0; i < this.fNpar; ++i) {
|
||||
// var parname = pprefix + i + "]";
|
||||
// while (_func.indexOf(parname) !== -1)
|
||||
// _func = _func.replace(parname, '(' + this.GetParValue(i) + ')');
|
||||
// }
|
||||
// _func = _func.replace(/\b(sin)\b/gi, 'Math.sin')
|
||||
// .replace(/\b(cos)\b/gi, 'Math.cos')
|
||||
// .replace(/\b(tan)\b/gi, 'Math.tan')
|
||||
// .replace(/\b(exp)\b/gi, 'Math.exp')
|
||||
// .replace(/\b(pow)\b/gi, 'Math.pow')
|
||||
// .replace(/pi/g, 'Math.PI');
|
||||
// for (var n = 2; n < 10; ++n)
|
||||
// _func = _func.replace('x^' + n, 'Math.pow(x,' + n + ')');
|
||||
//
|
||||
// if (isformula) {
|
||||
// _func = _func.replace(/x\[0\]/g, "x");
|
||||
// if (this._typename === "TF2") {
|
||||
// _func = _func.replace(/x\[1\]/g, "y");
|
||||
// this._func = new Function("x", "y", _func).bind(this);
|
||||
// } else {
|
||||
// this._func = new Function("x", _func).bind(this);
|
||||
// }
|
||||
// } else if (this._typename === "TF2")
|
||||
// this._func = new Function("x", "y", "return " + _func).bind(this);
|
||||
// else
|
||||
// this._func = new Function("x", "return " + _func).bind(this);
|
||||
//
|
||||
// this._title = this.fTitle;
|
||||
// }
|
||||
//
|
||||
// return this._func(x, y);
|
||||
// };
|
||||
// m.GetParName = function (n) {
|
||||
// if (this.fFormula && this.fFormula.fParams) return this.fFormula.fParams[n].first;
|
||||
// if (this.fNames && this.fNames[n]) return this.fNames[n];
|
||||
// return "p" + n;
|
||||
// };
|
||||
// m.GetParValue = function (n) {
|
||||
// if (this.fFormula && this.fFormula.fClingParameters) return this.fFormula.fClingParameters[n];
|
||||
// if (this.fParams) return this.fParams[n];
|
||||
// return undefined;
|
||||
// };
|
||||
// m.GetParError = function (n) {
|
||||
// return this.fParErrors ? this.fParErrors[n] : undefined;
|
||||
// };
|
||||
// m.GetNumPars = function () {
|
||||
// return this.fNpar;
|
||||
// }
|
||||
// }
|
||||
|
||||
if (((typename.indexOf("TGraph") === 0) || (typename === "TCutG")) && (typename !== "TGraphPolargram") && (typename !== "TGraphTime")) {
|
||||
// check if point inside figure specified by the TGraph
|
||||
m.IsInside = function (xp, yp) {
|
||||
var i, j = this.fNpoints - 1, x = this.fX, y = this.fY, oddNodes = false;
|
||||
|
||||
for (i = 0; i < this.fNpoints; ++i) {
|
||||
if ((y[i] < yp && y[j] >= yp) || (y[j] < yp && y[i] >= yp)) {
|
||||
if (x[i] + (yp - y[i]) / (y[j] - y[i]) * (x[j] - x[i]) < xp) {
|
||||
oddNodes = !oddNodes;
|
||||
}
|
||||
}
|
||||
j = i;
|
||||
}
|
||||
|
||||
return oddNodes;
|
||||
};
|
||||
}
|
||||
|
||||
if (typename.indexOf("TH1") === 0 ||
|
||||
typename.indexOf("TH2") === 0 ||
|
||||
typename.indexOf("TH3") === 0) {
|
||||
m.getBinError = function (bin) {
|
||||
// -*-*-*-*-*Return value of error associated to bin number bin*-*-*-*-*
|
||||
// if the sum of squares of weights has been defined (via Sumw2),
|
||||
// this function returns the sqrt(sum of w2).
|
||||
// otherwise it returns the sqrt(contents) for this bin.
|
||||
if (bin >= this.fNcells) bin = this.fNcells - 1;
|
||||
if (bin < 0) bin = 0;
|
||||
if (bin < this.fSumw2.length)
|
||||
return Math.sqrt(this.fSumw2[bin]);
|
||||
return Math.sqrt(Math.abs(this.fArray[bin]));
|
||||
};
|
||||
m.setBinContent = function (bin, content) {
|
||||
// Set bin content - only trivial case, without expansion
|
||||
this.fEntries++;
|
||||
this.fTsumw = 0;
|
||||
if ((bin >= 0) && (bin < this.fArray.length))
|
||||
this.fArray[bin] = content;
|
||||
};
|
||||
}
|
||||
|
||||
if (typename.indexOf("TH1") === 0) {
|
||||
m.getBin = function (x) {
|
||||
return x;
|
||||
};
|
||||
m.getBinContent = function (bin) {
|
||||
return this.fArray[bin];
|
||||
};
|
||||
m.Fill = function (x, weight) {
|
||||
var axis = this.fXaxis,
|
||||
bin = 1 + Math.floor((x - axis.fXmin) / (axis.fXmax - axis.fXmin) * axis.fNbins);
|
||||
if (bin < 0) bin = 0; else if (bin > axis.fNbins + 1) bin = axis.fNbins + 1;
|
||||
this.fArray[bin] += ((weight === undefined) ? 1 : weight);
|
||||
}
|
||||
}
|
||||
|
||||
if (typename.indexOf("TH2") === 0) {
|
||||
m.getBin = function (x, y) {
|
||||
return (x + (this.fXaxis.fNbins + 2) * y);
|
||||
};
|
||||
m.getBinContent = function (x, y) {
|
||||
return this.fArray[this.getBin(x, y)];
|
||||
};
|
||||
m.Fill = function (x, y, weight) {
|
||||
var axis1 = this.fXaxis, axis2 = this.fYaxis,
|
||||
bin1 = 1 + Math.floor((x - axis1.fXmin) / (axis1.fXmax - axis1.fXmin) * axis1.fNbins),
|
||||
bin2 = 1 + Math.floor((y - axis2.fXmin) / (axis2.fXmax - axis2.fXmin) * axis2.fNbins);
|
||||
if (bin1 < 0) bin1 = 0; else if (bin1 > axis1.fNbins + 1) bin1 = axis1.fNbins + 1;
|
||||
if (bin2 < 0) bin2 = 0; else if (bin2 > axis2.fNbins + 1) bin2 = axis2.fNbins + 1;
|
||||
this.fArray[bin1 + (axis1.fNbins + 2) * bin2] += ((weight === undefined) ? 1 : weight);
|
||||
}
|
||||
}
|
||||
|
||||
if (typename.indexOf("TH3") === 0) {
|
||||
m.getBin = function (x, y, z) {
|
||||
return (x + (this.fXaxis.fNbins + 2) * (y + (this.fYaxis.fNbins + 2) * z));
|
||||
};
|
||||
m.getBinContent = function (x, y, z) {
|
||||
return this.fArray[this.getBin(x, y, z)];
|
||||
};
|
||||
m.Fill = function (x, y, z, weight) {
|
||||
var axis1 = this.fXaxis, axis2 = this.fYaxis, axis3 = this.fZaxis,
|
||||
bin1 = 1 + Math.floor((x - axis1.fXmin) / (axis1.fXmax - axis1.fXmin) * axis1.fNbins),
|
||||
bin2 = 1 + Math.floor((y - axis2.fXmin) / (axis2.fXmax - axis2.fXmin) * axis2.fNbins),
|
||||
bin3 = 1 + Math.floor((z - axis3.fXmin) / (axis3.fXmax - axis3.fXmin) * axis3.fNbins);
|
||||
if (bin1 < 0) bin1 = 0; else if (bin1 > axis1.fNbins + 1) bin1 = axis1.fNbins + 1;
|
||||
if (bin2 < 0) bin2 = 0; else if (bin2 > axis2.fNbins + 1) bin2 = axis2.fNbins + 1;
|
||||
if (bin3 < 0) bin3 = 0; else if (bin3 > axis3.fNbins + 1) bin3 = axis3.fNbins + 1;
|
||||
this.fArray[bin1 + (axis1.fNbins + 2) * (bin2 + (axis2.fNbins + 2) * bin3)] += ((weight === undefined) ? 1 : weight);
|
||||
}
|
||||
}
|
||||
|
||||
if (typename.indexOf("TProfile") === 0) {
|
||||
if (typename.indexOf("TProfile2D") === 0) {
|
||||
m.getBin = function (x, y) {
|
||||
return (x + (this.fXaxis.fNbins + 2) * y);
|
||||
};
|
||||
m.getBinContent = function (x, y) {
|
||||
var bin = this.getBin(x, y);
|
||||
if (bin < 0 || bin >= this.fNcells) return 0;
|
||||
if (this.fBinEntries[bin] < 1e-300) return 0;
|
||||
if (!this.fArray) return 0;
|
||||
return this.fArray[bin] / this.fBinEntries[bin];
|
||||
};
|
||||
m.getBinEntries = function (x, y) {
|
||||
var bin = this.getBin(x, y);
|
||||
if (bin < 0 || bin >= this.fNcells) return 0;
|
||||
return this.fBinEntries[bin];
|
||||
}
|
||||
} else {
|
||||
m.getBin = function (x) {
|
||||
return x;
|
||||
};
|
||||
m.getBinContent = function (bin) {
|
||||
if (bin < 0 || bin >= this.fNcells) return 0;
|
||||
if (this.fBinEntries[bin] < 1e-300) return 0;
|
||||
if (!this.fArray) return 0;
|
||||
return this.fArray[bin] / this.fBinEntries[bin];
|
||||
};
|
||||
}
|
||||
m.getBinEffectiveEntries = function (bin) {
|
||||
if (bin < 0 || bin >= this.fNcells) return 0;
|
||||
var sumOfWeights = this.fBinEntries[bin];
|
||||
if (!this.fBinSumw2 || this.fBinSumw2.length !== this.fNcells) {
|
||||
// this can happen when reading an old file
|
||||
return sumOfWeights;
|
||||
}
|
||||
var sumOfWeightsSquare = this.fBinSumw2[bin];
|
||||
return (sumOfWeightsSquare > 0) ? sumOfWeights * sumOfWeights / sumOfWeightsSquare : 0;
|
||||
};
|
||||
m.getBinError = function (bin) {
|
||||
if (bin < 0 || bin >= this.fNcells) return 0;
|
||||
var cont = this.fArray[bin], // sum of bin w *y
|
||||
sum = this.fBinEntries[bin], // sum of bin weights
|
||||
err2 = this.fSumw2[bin], // sum of bin w * y^2
|
||||
neff = this.getBinEffectiveEntries(bin); // (sum of w)^2 / (sum of w^2)
|
||||
if (sum < 1e-300) return 0; // for empty bins
|
||||
var EErrorType = {kERRORMEAN: 0, kERRORSPREAD: 1, kERRORSPREADI: 2, kERRORSPREADG: 3};
|
||||
// case the values y are gaussian distributed y +/- sigma and w = 1/sigma^2
|
||||
if (this.fErrorMode === EErrorType.kERRORSPREADG)
|
||||
return 1.0 / Math.sqrt(sum);
|
||||
// compute variance in y (eprim2) and standard deviation in y (eprim)
|
||||
var contsum = cont / sum, eprim = Math.sqrt(Math.abs(err2 / sum - contsum * contsum));
|
||||
if (this.fErrorMode === EErrorType.kERRORSPREADI) {
|
||||
if (eprim !== 0) return eprim / Math.sqrt(neff);
|
||||
// in case content y is an integer (so each my has an error +/- 1/sqrt(12)
|
||||
// when the std(y) is zero
|
||||
return 1.0 / Math.sqrt(12 * neff);
|
||||
}
|
||||
// if approximate compute the sums (of w, wy and wy2) using all the bins
|
||||
// when the variance in y is zero
|
||||
// case option "S" return standard deviation in y
|
||||
if (this.fErrorMode === EErrorType.kERRORSPREAD) return eprim;
|
||||
// default case : fErrorMode = kERRORMEAN
|
||||
// return standard error on the mean of y
|
||||
return (eprim / Math.sqrt(neff));
|
||||
};
|
||||
}
|
||||
|
||||
if (typename === "TAxis") {
|
||||
m.GetBinLowEdge = function (bin) {
|
||||
if (this.fNbins <= 0) return 0;
|
||||
if ((this.fXbins.length > 0) && (bin > 0) && (bin <= this.fNbins)) return this.fXbins[bin - 1];
|
||||
return this.fXmin + (bin - 1) * (this.fXmax - this.fXmin) / this.fNbins;
|
||||
};
|
||||
m.GetBinCenter = function (bin) {
|
||||
if (this.fNbins <= 0) return 0;
|
||||
if ((this.fXbins.length > 0) && (bin > 0) && (bin < this.fNbins)) return (this.fXbins[bin - 1] + this.fXbins[bin]) / 2;
|
||||
return this.fXmin + (bin - 0.5) * (this.fXmax - this.fXmin) / this.fNbins;
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof getMoreMethods == "function")
|
||||
getMoreMethods(m, typename, obj);
|
||||
|
||||
methodsCache[typename] = m;
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
/** @summary Adds specific methods to the object.
|
||||
*
|
||||
* JSROOT implements some basic methods for different ROOT classes.
|
||||
* @param {object} obj - object where methods are assigned
|
||||
* @param {string} typename - optional typename, if not specified, obj._typename will be used
|
||||
* @private
|
||||
*/
|
||||
function addMethods(obj, typename) {
|
||||
this.extend(obj, getMethods(typename || obj._typename, obj));
|
||||
}
|
||||
869
dataforge-vis-jsroot/src/main/resources/ThreeCSG.js
vendored
869
dataforge-vis-jsroot/src/main/resources/ThreeCSG.js
vendored
@@ -1,869 +0,0 @@
|
||||
import * as THREE from "three"
|
||||
|
||||
const EPSILON = 1e-5,
|
||||
COPLANAR = 0,
|
||||
FRONT = 1,
|
||||
BACK = 2,
|
||||
SPANNING = 3;
|
||||
|
||||
export function Geometry(geometry, transfer_matrix, nodeid, flippedMesh) {
|
||||
// Convert THREE.Geometry to ThreeBSP
|
||||
|
||||
if (geometry instanceof THREE.Geometry) {
|
||||
this.matrix = null; // new THREE.Matrix4; not create matrix when do not needed
|
||||
} else if (geometry instanceof THREE.Mesh) {
|
||||
// #todo: add hierarchy support
|
||||
geometry.updateMatrix();
|
||||
transfer_matrix = this.matrix = geometry.matrix.clone();
|
||||
geometry = geometry.geometry;
|
||||
} else if (geometry instanceof Node) {
|
||||
this.tree = geometry;
|
||||
this.matrix = null; // new THREE.Matrix4;
|
||||
return this;
|
||||
} else if (geometry instanceof THREE.BufferGeometry) {
|
||||
var pos_buf = geometry.getAttribute('position').array,
|
||||
norm_buf = geometry.getAttribute('normal').array,
|
||||
polygons = [], polygon, vert1, vert2, vert3;
|
||||
|
||||
for (var i = 0; i < pos_buf.length; i += 9) {
|
||||
polygon = new Polygon;
|
||||
|
||||
vert1 = new Vertex(pos_buf[i], pos_buf[i + 1], pos_buf[i + 2], norm_buf[i], norm_buf[i + 1], norm_buf[i + 2]);
|
||||
if (transfer_matrix) vert1.applyMatrix4(transfer_matrix);
|
||||
|
||||
vert2 = new Vertex(pos_buf[i + 3], pos_buf[i + 4], pos_buf[i + 5], norm_buf[i + 3], norm_buf[i + 4], norm_buf[i + 5]);
|
||||
if (transfer_matrix) vert2.applyMatrix4(transfer_matrix);
|
||||
|
||||
vert3 = new Vertex(pos_buf[i + 6], pos_buf[i + 7], pos_buf[i + 8], norm_buf[i + 6], norm_buf[i + 7], norm_buf[i + 8]);
|
||||
if (transfer_matrix) vert3.applyMatrix4(transfer_matrix);
|
||||
|
||||
if (flippedMesh) polygon.vertices.push(vert1, vert3, vert2);
|
||||
else polygon.vertices.push(vert1, vert2, vert3);
|
||||
|
||||
polygon.calculateProperties();
|
||||
polygons.push(polygon);
|
||||
}
|
||||
|
||||
this.tree = new Node(polygons, nodeid);
|
||||
if (nodeid !== undefined) this.maxid = this.tree.maxnodeid;
|
||||
return this;
|
||||
|
||||
} else if (geometry.polygons && (geometry.polygons[0] instanceof Polygon)) {
|
||||
var polygons = geometry.polygons;
|
||||
|
||||
for (var i = 0; i < polygons.length; ++i) {
|
||||
var polygon = polygons[i];
|
||||
if (transfer_matrix) {
|
||||
for (var n = 0; n < polygon.vertices.length; ++n)
|
||||
polygon.vertices[n].applyMatrix4(transfer_matrix);
|
||||
}
|
||||
|
||||
polygon.calculateProperties();
|
||||
}
|
||||
|
||||
this.tree = new Node(polygons, nodeid);
|
||||
if (nodeid !== undefined) this.maxid = this.tree.maxnodeid;
|
||||
return this;
|
||||
|
||||
} else {
|
||||
throw 'ThreeBSP: Given geometry is unsupported';
|
||||
}
|
||||
|
||||
var polygons = [],
|
||||
nfaces = geometry.faces.length,
|
||||
face, polygon, vertex;
|
||||
|
||||
for (var i = 0; i < nfaces; ++i) {
|
||||
face = geometry.faces[i];
|
||||
// faceVertexUvs = geometry.faceVertexUvs[0][i];
|
||||
polygon = new Polygon;
|
||||
|
||||
if (face instanceof THREE.Face3) {
|
||||
vertex = geometry.vertices[face.a];
|
||||
// uvs = faceVertexUvs ? new THREE.Vector2( faceVertexUvs[0].x, faceVertexUvs[0].y ) : null;
|
||||
vertex = new Vertex(vertex.x, vertex.y, vertex.z, face.vertexNormals[0].x, face.vertexNormals[0].y, face.vertexNormals[0].z /*face.normal , uvs */);
|
||||
if (transfer_matrix) vertex.applyMatrix4(transfer_matrix);
|
||||
polygon.vertices.push(vertex);
|
||||
|
||||
vertex = geometry.vertices[face.b];
|
||||
//uvs = faceVertexUvs ? new THREE.Vector2( faceVertexUvs[1].x, faceVertexUvs[1].y ) : null;
|
||||
vertex = new Vertex(vertex.x, vertex.y, vertex.z, face.vertexNormals[1].x, face.vertexNormals[1].y, face.vertexNormals[1].z/*face.normal , uvs */);
|
||||
if (transfer_matrix) vertex.applyMatrix4(transfer_matrix);
|
||||
polygon.vertices.push(vertex);
|
||||
|
||||
vertex = geometry.vertices[face.c];
|
||||
// uvs = faceVertexUvs ? new THREE.Vector2( faceVertexUvs[2].x, faceVertexUvs[2].y ) : null;
|
||||
vertex = new Vertex(vertex.x, vertex.y, vertex.z, face.vertexNormals[2].x, face.vertexNormals[2].y, face.vertexNormals[2].z /*face.normal, uvs */);
|
||||
if (transfer_matrix) vertex.applyMatrix4(transfer_matrix);
|
||||
polygon.vertices.push(vertex);
|
||||
} else {
|
||||
throw 'Invalid face type at index ' + i;
|
||||
}
|
||||
|
||||
polygon.calculateProperties();
|
||||
polygons.push(polygon);
|
||||
}
|
||||
|
||||
this.tree = new Node(polygons, nodeid);
|
||||
if (nodeid !== undefined) this.maxid = this.tree.maxnodeid;
|
||||
}
|
||||
|
||||
Geometry.prototype.subtract = function (other_tree) {
|
||||
var a = this.tree.clone(),
|
||||
b = other_tree.tree.clone();
|
||||
|
||||
a.invert();
|
||||
a.clipTo(b);
|
||||
b.clipTo(a);
|
||||
b.invert();
|
||||
b.clipTo(a);
|
||||
b.invert();
|
||||
a.build(b.allPolygons());
|
||||
a.invert();
|
||||
a = new Geometry(a);
|
||||
a.matrix = this.matrix;
|
||||
return a;
|
||||
};
|
||||
|
||||
Geometry.prototype.union = function (other_tree) {
|
||||
var a = this.tree.clone(),
|
||||
b = other_tree.tree.clone();
|
||||
|
||||
a.clipTo(b);
|
||||
b.clipTo(a);
|
||||
b.invert();
|
||||
b.clipTo(a);
|
||||
b.invert();
|
||||
a.build(b.allPolygons());
|
||||
a = new Geometry(a);
|
||||
a.matrix = this.matrix;
|
||||
return a;
|
||||
};
|
||||
|
||||
Geometry.prototype.intersect = function (other_tree) {
|
||||
var a = this.tree.clone(),
|
||||
b = other_tree.tree.clone();
|
||||
|
||||
a.invert();
|
||||
b.clipTo(a);
|
||||
b.invert();
|
||||
a.clipTo(b);
|
||||
b.clipTo(a);
|
||||
a.build(b.allPolygons());
|
||||
a.invert();
|
||||
a = new Geometry(a);
|
||||
a.matrix = this.matrix;
|
||||
return a;
|
||||
};
|
||||
|
||||
Geometry.prototype.tryToCompress = function (polygons) {
|
||||
|
||||
if (this.maxid === undefined) return;
|
||||
|
||||
var arr = [], parts, foundpair,
|
||||
nreduce = 0, n, len = polygons.length,
|
||||
p, p1, p2, i1, i2;
|
||||
|
||||
// sort out polygons
|
||||
for (n = 0; n < len; ++n) {
|
||||
p = polygons[n];
|
||||
if (p.id === undefined) continue;
|
||||
if (arr[p.id] === undefined) arr[p.id] = [];
|
||||
|
||||
arr[p.id].push(p);
|
||||
}
|
||||
|
||||
for (n = 0; n < arr.length; ++n) {
|
||||
parts = arr[n];
|
||||
if (parts === undefined) continue;
|
||||
|
||||
len = parts.length;
|
||||
|
||||
foundpair = (len > 1);
|
||||
|
||||
while (foundpair) {
|
||||
foundpair = false;
|
||||
|
||||
for (i1 = 0; i1 < len - 1; ++i1) {
|
||||
p1 = parts[i1];
|
||||
if (!p1 || !p1.parent) continue;
|
||||
for (i2 = i1 + 1; i2 < len; ++i2) {
|
||||
p2 = parts[i2];
|
||||
if (p2 && (p1.parent === p2.parent) && (p1.nsign === p2.nsign)) {
|
||||
|
||||
if (p1.nsign !== p1.parent.nsign) p1.parent.flip();
|
||||
|
||||
nreduce++;
|
||||
parts[i1] = p1.parent;
|
||||
parts[i2] = null;
|
||||
if (p1.parent.vertices.length < 3) console.log('something wrong with parent');
|
||||
foundpair = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (nreduce > 0) {
|
||||
polygons.splice(0, polygons.length);
|
||||
|
||||
for (n = 0; n < arr.length; ++n) {
|
||||
parts = arr[n];
|
||||
if (parts !== undefined)
|
||||
for (i1 = 0, len = parts.length; i1 < len; ++i1)
|
||||
if (parts[i1]) polygons.push(parts[i1]);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
Geometry.prototype.direct_subtract = function (other_tree) {
|
||||
var a = this.tree,
|
||||
b = other_tree.tree;
|
||||
a.invert();
|
||||
a.clipTo(b);
|
||||
b.clipTo(a);
|
||||
b.invert();
|
||||
b.clipTo(a);
|
||||
b.invert();
|
||||
a.build(b.collectPolygons([]));
|
||||
a.invert();
|
||||
return this;
|
||||
};
|
||||
|
||||
Geometry.prototype.direct_union = function (other_tree) {
|
||||
var a = this.tree,
|
||||
b = other_tree.tree;
|
||||
|
||||
a.clipTo(b);
|
||||
b.clipTo(a);
|
||||
b.invert();
|
||||
b.clipTo(a);
|
||||
b.invert();
|
||||
a.build(b.collectPolygons([]));
|
||||
return this;
|
||||
};
|
||||
|
||||
Geometry.prototype.direct_intersect = function (other_tree) {
|
||||
var a = this.tree,
|
||||
b = other_tree.tree;
|
||||
|
||||
a.invert();
|
||||
b.clipTo(a);
|
||||
b.invert();
|
||||
a.clipTo(b);
|
||||
b.clipTo(a);
|
||||
a.build(b.collectPolygons([]));
|
||||
a.invert();
|
||||
return this;
|
||||
};
|
||||
|
||||
export function CreateNormal(axis_name, pos, size) {
|
||||
// create geometry to make cut on specified axis
|
||||
|
||||
var vert1, vert2, vert3;
|
||||
|
||||
if (!size || (size < 10000)) size = 10000;
|
||||
|
||||
switch (axis_name) {
|
||||
case "x":
|
||||
vert1 = new Vertex(pos, -3 * size, size, 1, 0, 0),
|
||||
vert3 = new Vertex(pos, size, size, 1, 0, 0),
|
||||
vert2 = new Vertex(pos, size, -3 * size, 1, 0, 0);
|
||||
break;
|
||||
case "y":
|
||||
vert1 = new Vertex(-3 * size, pos, size, 0, 1, 0),
|
||||
vert2 = new Vertex(size, pos, size, 0, 1, 0),
|
||||
vert3 = new Vertex(size, pos, -3 * size, 0, 1, 0);
|
||||
break;
|
||||
case "z":
|
||||
vert1 = new Vertex(-3 * size, size, pos, 0, 0, 1),
|
||||
vert3 = new Vertex(size, size, pos, 0, 0, 1),
|
||||
vert2 = new Vertex(size, -3 * size, pos, 0, 0, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
var polygon = new Polygon([vert1, vert2, vert3]);
|
||||
polygon.calculateProperties();
|
||||
|
||||
var node = new Node([polygon]);
|
||||
|
||||
return new Geometry(node);
|
||||
}
|
||||
|
||||
Geometry.prototype.cut_from_plane = function (other_tree) {
|
||||
// just cut peaces from second geometry, which just simple plane
|
||||
|
||||
var a = this.tree,
|
||||
b = other_tree.tree;
|
||||
|
||||
a.invert();
|
||||