Skip to content

Commit

Permalink
Fix examples to accurately generate input files (#458)
Browse files Browse the repository at this point in the history
* Change example file

* Refactor World Zone

* Update Submodules

* build(deps): bump @emotion/react from 11.9.0 to 11.9.3

Bumps [@emotion/react](https://github.com/emotion-js/emotion) from 11.9.0 to 11.9.3.
- [Release notes](https://github.com/emotion-js/emotion/releases)
- [Changelog](https://github.com/emotion-js/emotion/blob/main/CHANGELOG.md)
- [Commits](https://github.com/emotion-js/emotion/compare/@emotion/react@11.9.0...@emotion/react@11.9.3)

---
updated-dependencies:
- dependency-name: "@emotion/react"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump typescript from 4.7.3 to 4.7.4

Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.7.3 to 4.7.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](microsoft/TypeScript@v4.7.3...v4.7.4)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump @types/jest from 28.1.1 to 28.1.2

Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 28.1.1 to 28.1.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

---
updated-dependencies:
- dependency-name: "@types/jest"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump @mui/lab from 5.0.0-alpha.84 to 5.0.0-alpha.86

Bumps [@mui/lab](https://github.com/mui/material-ui/tree/HEAD/packages/mui-lab) from 5.0.0-alpha.84 to 5.0.0-alpha.86.
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/HEAD/packages/mui-lab)

---
updated-dependencies:
- dependency-name: "@mui/lab"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix world zone implementation

* build(deps): bump src/libs/converter from `56a098d` to `7ebd616`

Bumps [src/libs/converter](https://github.com/yaptide/converter) from `56a098d` to `7ebd616`.
- [Release notes](https://github.com/yaptide/converter/releases)
- [Commits](yaptide/converter@56a098d...7ebd616)

---
updated-dependencies:
- dependency-name: src/libs/converter
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump public/libs/jsroot from `3d0cfa4` to `83e00fa`

Bumps [public/libs/jsroot](https://github.com/root-project/jsroot) from `3d0cfa4` to `83e00fa`.
- [Release notes](https://github.com/root-project/jsroot/releases)
- [Commits](root-project/jsroot@3d0cfa4...83e00fa)

---
updated-dependencies:
- dependency-name: public/libs/jsroot
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Remove phanton module

* Fix Dependabot issues

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
Derstilon and dependabot[bot] authored Jun 24, 2022
1 parent 5938c36 commit d8e2d03
Show file tree
Hide file tree
Showing 23 changed files with 648 additions and 474 deletions.
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[submodule "public/libs/converter"]
path = src/libs/converter
url = https://github.com/yaptide/converter
branch = master
shallow = true

[submodule "public/libs/jsroot"]
Expand Down
2 changes: 1 addition & 1 deletion public/libs/jsroot
Submodule jsroot updated 205 files
1 change: 0 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import WrapperApp from './WrapperApp/WrapperApp';

function App() {
const prefersDarkMode = useMediaQuery('(prefers-color-scheme: dark)');

const theme = React.useMemo(
() =>
createTheme({
Expand Down
8 changes: 4 additions & 4 deletions src/ThreeEditor/examples/ex1.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@
"uuid": "48EE4307-80C7-47AA-BF01-9132898B2B5A",
"type": "BoxMesh",
"name": "Box",
"userData": {
"geometryData": {
"id": 860,
"geometryType": "CylinderGeometry",
"position": [0, 0, 10],
"rotation": [90, 0, 0],
"parameters": {
"radiusTop": 10,
"height": 20
"radius": 10,
"depth": 20
}
},
"layers": 1,
Expand Down Expand Up @@ -213,7 +213,7 @@
"marginMultiplier": 1.1,
"autoCalculate": false,
"materialUuid": "37C3F777-8B67-46B2-9D7F-374B49330F5C",
"userData": {
"geometryData": {
"geometryType": "BoxGeometry",
"parameters": {
"width": 22,
Expand Down
180 changes: 131 additions & 49 deletions src/ThreeEditor/examples/ex2.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"geometries": [
{
"uuid": "32b5253c-d0cb-404f-9999-5bbee3499b00",
"uuid": "e1aec771-4f70-4521-a427-7fe2e8aef7b7",
"type": "CylinderGeometry",
"radiusTop": 10,
"radiusBottom": 10,
Expand All @@ -30,11 +30,46 @@
"openEnded": false,
"thetaStart": 0,
"thetaLength": 6.283185307179586
},
{
"uuid": "4decc799-70e5-47ac-ad90-5b03a016ebff",
"type": "CylinderGeometry",
"radiusTop": 15,
"radiusBottom": 15,
"height": 25,
"radialSegments": 16,
"heightSegments": 1,
"openEnded": false,
"thetaStart": 0,
"thetaLength": 6.283185307179586
}
],
"materials": [
{
"uuid": "2dbe3356-074f-44b8-bfd3-a231a309d25b",
"uuid": "81a7aa32-b85f-45c4-bcd7-f648a0be12dc",
"type": "MeshBasicMaterial",
"color": 0,
"reflectivity": 1,
"refractionRatio": 0.98,
"side": 2,
"opacity": 0.5,
"transparent": true,
"depthFunc": 3,
"depthTest": true,
"depthWrite": true,
"colorWrite": true,
"stencilWrite": false,
"stencilWriteMask": 255,
"stencilFunc": 519,
"stencilRef": 0,
"stencilFuncMask": 255,
"stencilFail": 7680,
"stencilZFail": 7680,
"stencilZPass": 7680,
"wireframe": true
},
{
"uuid": "8485707f-07bf-49d2-86ab-070eb9878a00",
"type": "MeshBasicMaterial",
"color": 0,
"reflectivity": 1,
Expand All @@ -61,27 +96,47 @@
"uuid": "C1BF5EE7-ACC7-4896-8451-A5B358DF9889",
"type": "Scene",
"name": "Figures",
"visible": false,
"layers": 1,
"matrix": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1],
"children": [
{
"uuid": "30e7daf2-1841-4b75-b189-da47edad8dc5",
"uuid": "7ab62ba9-6dba-4543-b50b-ce31e143d482",
"type": "CylinderMesh",
"name": "Cylinder",
"userData": {
"id": 927,
"name": "RCC1",
"layers": 1,
"matrix": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 10, 1],
"geometry": "e1aec771-4f70-4521-a427-7fe2e8aef7b7",
"material": "81a7aa32-b85f-45c4-bcd7-f648a0be12dc",
"geometryData": {
"id": 854,
"geometryType": "CylinderGeometry",
"position": [0, 0, -10],
"position": [0, 0, 10],
"rotation": [0, 0, 0],
"parameters": {
"radiusTop": 10,
"height": 20
"radius": 10,
"depth": 20
}
},
}
},
{
"uuid": "aeeffad9-ed86-44ae-bfe4-b5f78580741b",
"type": "CylinderMesh",
"name": "RCC2",
"layers": 1,
"matrix": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, -10, 1],
"geometry": "32b5253c-d0cb-404f-9999-5bbee3499b00",
"material": "2dbe3356-074f-44b8-bfd3-a231a309d25b"
"matrix": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 7.5, 1],
"geometry": "4decc799-70e5-47ac-ad90-5b03a016ebff",
"material": "8485707f-07bf-49d2-86ab-070eb9878a00",
"geometryData": {
"id": 856,
"geometryType": "CylinderGeometry",
"position": [0, 0, 7.5],
"rotation": [0, 0, 0],
"parameters": {
"radius": 15,
"depth": 25
}
}
}
]
}
Expand All @@ -93,50 +148,69 @@
"zoneManager": {
"zones": [
{
"uuid": "4bd13170-b8bd-48a7-b97b-8e0b87c91e6f",
"name": "Zone",
"materialUuid": "d85fe808-54b8-472c-adef-b6f3c09605bf",
"uuid": "9ee041c1-acc0-433f-bc66-90e057b72474",
"name": "Zone1",
"materialUuid": "49ce56b9-ee48-4640-88d4-bcfd660d8c0e",
"unionOperations": [
[
{
"mode": "union",
"objectUuid": "7ab62ba9-6dba-4543-b50b-ce31e143d482"
}
]
],
"subscribedObjects": {
"7ab62ba9-6dba-4543-b50b-ce31e143d482": 1
}
},
{
"uuid": "a2c614cf-7074-4abe-a757-4a850f6731b3",
"name": "Zone2",
"materialUuid": "cd7c2eb0-e91f-4144-b4eb-536e4626cc09",
"unionOperations": [
[
{
"mode": "union",
"objectUuid": "30e7daf2-1841-4b75-b189-da47edad8dc5"
"objectUuid": "aeeffad9-ed86-44ae-bfe4-b5f78580741b"
}
]
],
"subscribedObjects": {
"30e7daf2-1841-4b75-b189-da47edad8dc5": 1
"aeeffad9-ed86-44ae-bfe4-b5f78580741b": 1
}
}
],
"uuid": "368269D3-6F9B-4241-84A0-5D908D10E196",
"name": "Zones",
"worldZone": {
"uuid": "4eb3646b-88ec-47a6-a9bd-a1333f2c37b5",
"uuid": "ffbb8307-0e11-4570-b410-553ce4e07d3e",
"center": {
"isVector3": true,
"x": 0,
"y": 0,
"z": -10
"z": 5
},
"size": {
"x": 15,
"y": 15,
"isVector3": true,
"x": 20,
"y": 20,
"z": 30
},
"type": "WorldZone",
"geometryType": "Cylinder",
"name": "World Zone",
"marginMultiplier": 1.1,
"autoCalculate": false,
"materialUuid": "cd7c2eb0-e91f-4144-b4eb-536e4626cc09",
"userData": {
"materialUuid": "1dd2e8f0-6684-42c2-ad35-7aa55358204e",
"geometryData": {
"id": 14,
"geometryType": "CylinderGeometry",
"position": [0, 0, 5],
"rotation": [0, 0, 0],
"parameters": {
"radiusTop": 15,
"height": 15
},
"position": [0, 0, -10],
"rotation": [0, 0, 0]
"radius": 20,
"depth": 30
}
}
}
},
Expand All @@ -145,7 +219,7 @@
"name": "DetectManager",
"detectGeometries": [
{
"uuid": "11d33a68-4e64-4b9f-906c-78bfe0a25250",
"uuid": "186ec65a-8511-418b-8218-8890138c6b12",
"data": {
"radius": 10,
"innerRadius": 0,
Expand All @@ -154,22 +228,22 @@
"zSegments": 400
},
"type": "Cyl",
"position": [0, 0, -10],
"position": [0, 0, 10],
"name": "CylZ_Mesh",
"colorHex": 65535
"colorHex": 327424
},
{
"uuid": "d0cc5103-a9d3-4166-9bde-2f283cef17d0",
"uuid": "3306e98b-5da2-46ee-8892-ac0191d645a7",
"data": {
"width": 1,
"height": 4,
"depth": 20,
"xSegments": 1,
"ySegments": 1,
"zSegments": 100
"ySegments": 80,
"zSegments": 400
},
"type": "Mesh",
"position": [0, 0, -10],
"position": [0, 0, 10],
"name": "YZ_Mesh",
"colorHex": 65535
}
Expand All @@ -196,22 +270,30 @@
"materialManager": {
"materials": [
{
"uuid": "d85fe808-54b8-472c-adef-b6f3c09605bf",
"uuid": "1dd2e8f0-6684-42c2-ad35-7aa55358204e",
"name": "BLACK HOLE",
"icru": 0,
"color": 196613
},
{
"uuid": "49ce56b9-ee48-4640-88d4-bcfd660d8c0e",
"name": "WATER, LIQUID",
"icru": 276,
"color": 43775,
"transparent": true,
"opacity": 0.5
"color": 34047,
"opacity": 0.4
},
{
"uuid": "cd7c2eb0-e91f-4144-b4eb-536e4626cc09",
"name": "VACUUM",
"icru": 1000,
"color": 16777215
"color": 16119285,
"transparent": true,
"opacity": 0.1
}
],
"selectedMaterials": {
"d85fe808-54b8-472c-adef-b6f3c09605bf": 1,
"1dd2e8f0-6684-42c2-ad35-7aa55358204e": 1,
"49ce56b9-ee48-4640-88d4-bcfd660d8c0e": 1,
"cd7c2eb0-e91f-4144-b4eb-536e4626cc09": 1
}
},
Expand All @@ -221,34 +303,34 @@
"scoringOutputs": [
{
"name": "cylz",
"uuid": "acd8cefc-ec88-4d15-9a31-a104ef3786e9",
"uuid": "d24dd7eb-6a7c-40d0-b39e-f4424b3dd937",
"quantities": {
"active": [
{
"uuid": "bd51ae94-cd14-4615-881d-15056ab4df25",
"uuid": "e3488754-9a67-4d3c-b0ea-17300d651a8a",
"keyword": "DoseGy",
"modifiers": []
}
],
"disabled": []
},
"detectGeometry": "11d33a68-4e64-4b9f-906c-78bfe0a25250",
"detectGeometry": "186ec65a-8511-418b-8218-8890138c6b12",
"trace": false
},
{
"name": "yzmsh.bdo",
"uuid": "8a5864fc-67ab-4085-b821-66e577c374dc",
"name": "yzmsh",
"uuid": "6e69ee1b-a73c-4936-a5a2-e81f5bf8bc04",
"quantities": {
"active": [
{
"uuid": "68354147-5373-48cd-a4b6-f198fc07a3ab",
"uuid": "c3499475-9496-4ee5-b705-950b83867dac",
"keyword": "DoseGy",
"modifiers": []
}
],
"disabled": []
},
"detectGeometry": "d0cc5103-a9d3-4166-9bde-2f283cef17d0",
"detectGeometry": "3306e98b-5da2-46ee-8892-ac0191d645a7",
"trace": false
}
]
Expand Down
10 changes: 5 additions & 5 deletions src/ThreeEditor/js/Editor.Context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import { isScoringManager, ScoringManager } from '../util/Scoring/ScoringManager';
import { ScoringOutput, isOutput } from '../util/Scoring/ScoringOutput';
import { isQuantity, ScoringQuantity } from '../util/Scoring/ScoringQuantity';
import { isWorldZone, WorldZone } from '../util/WorldZone';
import { isWorldZone, WorldZone } from '../util/WorldZone/WorldZone';
import { Editor } from './Editor';

export type Context = 'scene' | 'scoring' | 'parameters' | 'settings';
Expand Down Expand Up @@ -132,6 +132,10 @@ export class ContextManager {
}
}

get selected(): SceneObject | OutputObject | null {
return this.selectedByContext(this._context);
}

selectedByContext(context: Context): SceneObject | OutputObject | null {
switch (context) {
case 'scene':
Expand All @@ -142,10 +146,6 @@ export class ContextManager {
return null;
}
}

get selected(): SceneObject | OutputObject | null {
return this.selectedByContext(this._context);
}
}

export const isOutputObject = (x: unknown): x is OutputObject => {
Expand Down
Loading

0 comments on commit d8e2d03

Please sign in to comment.