From 4e252ed222f6316b49cf9763d9920a14e386741c Mon Sep 17 00:00:00 2001 From: ostatni5 <26521377+ostatni5@users.noreply.github.com> Date: Thu, 1 Sep 2022 15:23:53 +0200 Subject: [PATCH 1/6] add uniqe names to outputs and quantities --- src/ThreeEditor/util/Scoring/ScoringOutput.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ThreeEditor/util/Scoring/ScoringOutput.ts b/src/ThreeEditor/util/Scoring/ScoringOutput.ts index 94a47de7b..711c03e62 100644 --- a/src/ThreeEditor/util/Scoring/ScoringOutput.ts +++ b/src/ThreeEditor/util/Scoring/ScoringOutput.ts @@ -1,3 +1,4 @@ +import { Object3D } from 'three'; import { Editor } from '../../js/Editor'; import { DetectFilter } from '../Detect/DetectFilter'; import { DetectGeometry } from '../Detect/DetectGeometry'; From e8dc679dd0a1dd6ec7410f442f06ebb3fbdd9136 Mon Sep 17 00:00:00 2001 From: ostatni5 <26521377+ostatni5@users.noreply.github.com> Date: Thu, 1 Sep 2022 15:24:40 +0200 Subject: [PATCH 2/6] sort results --- src/JsRoot/JsRootGraph2D.tsx | 2 ++ src/ThreeEditor/util/Scoring/ScoringOutput.ts | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/JsRoot/JsRootGraph2D.tsx b/src/JsRoot/JsRootGraph2D.tsx index cc42091b4..37d5cfedc 100644 --- a/src/JsRoot/JsRootGraph2D.tsx +++ b/src/JsRoot/JsRootGraph2D.tsx @@ -40,6 +40,8 @@ export function JsRootGraph2D(props: { page: Page2D; title?: string }) { const histogram = JSROOT.createHistogram('TH2F', nxpoints, nypoints); + histogram.fTitle = title; + histogram.fXaxis.fXmin = x[0]; histogram.fXaxis.fXmax = x[nxpoints - 1]; histogram.fXaxis.fTitle = `${page.first_axis.name} [${page.first_axis.unit}]`; diff --git a/src/ThreeEditor/util/Scoring/ScoringOutput.ts b/src/ThreeEditor/util/Scoring/ScoringOutput.ts index 711c03e62..94a47de7b 100644 --- a/src/ThreeEditor/util/Scoring/ScoringOutput.ts +++ b/src/ThreeEditor/util/Scoring/ScoringOutput.ts @@ -1,4 +1,3 @@ -import { Object3D } from 'three'; import { Editor } from '../../js/Editor'; import { DetectFilter } from '../Detect/DetectFilter'; import { DetectGeometry } from '../Detect/DetectGeometry'; From e8ae2aabfdbd851b0b460f633adcaa2922fdbd94 Mon Sep 17 00:00:00 2001 From: ostatni5 <26521377+ostatni5@users.noreply.github.com> Date: Thu, 1 Sep 2022 15:25:02 +0200 Subject: [PATCH 3/6] add custom name and filter info --- src/JsRoot/JsRootGraph2D.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/JsRoot/JsRootGraph2D.tsx b/src/JsRoot/JsRootGraph2D.tsx index 37d5cfedc..cc42091b4 100644 --- a/src/JsRoot/JsRootGraph2D.tsx +++ b/src/JsRoot/JsRootGraph2D.tsx @@ -40,8 +40,6 @@ export function JsRootGraph2D(props: { page: Page2D; title?: string }) { const histogram = JSROOT.createHistogram('TH2F', nxpoints, nypoints); - histogram.fTitle = title; - histogram.fXaxis.fXmin = x[0]; histogram.fXaxis.fXmax = x[nxpoints - 1]; histogram.fXaxis.fTitle = `${page.first_axis.name} [${page.first_axis.unit}]`; From 5ea86fdbd47bd01335c86754a1d812610070a080 Mon Sep 17 00:00:00 2001 From: ostatni5 <26521377+ostatni5@users.noreply.github.com> Date: Thu, 1 Sep 2022 15:25:03 +0200 Subject: [PATCH 4/6] add more info --- src/JsRoot/JsRootGraph0D.tsx | 44 +++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/src/JsRoot/JsRootGraph0D.tsx b/src/JsRoot/JsRootGraph0D.tsx index 831c01d27..b793113f1 100644 --- a/src/JsRoot/JsRootGraph0D.tsx +++ b/src/JsRoot/JsRootGraph0D.tsx @@ -1,4 +1,5 @@ -import React, { useEffect, useState } from 'react'; +import { Grid } from '@mui/material'; +import React from 'react'; import { Page0D } from './GraphData'; export function JsRootGraph0D(props: { page: Page0D; title?: string }) { @@ -10,18 +11,35 @@ export function JsRootGraph0D(props: { page: Page0D; title?: string }) { }, [page]); return ( -
-

- {resultValue.toExponential(6)} -

-
+ + +

Custom name

+
+

{props.data.name}:

+

{props.data.values[0]}

+

[{props.data.unit}]

+
+
+ +

Filters

+
+
+

Filter1

+

Filter2

+
+
+
+
); } From fe62896df83ab86cda1a84877aa754055c97147b Mon Sep 17 00:00:00 2001 From: ostatni5 <26521377+ostatni5@users.noreply.github.com> Date: Thu, 1 Sep 2022 15:25:03 +0200 Subject: [PATCH 5/6] Update custom name --- src/JsRoot/JsRootGraph0D.tsx | 49 +++++++++++------------------------- 1 file changed, 14 insertions(+), 35 deletions(-) diff --git a/src/JsRoot/JsRootGraph0D.tsx b/src/JsRoot/JsRootGraph0D.tsx index b793113f1..c7221bf1a 100644 --- a/src/JsRoot/JsRootGraph0D.tsx +++ b/src/JsRoot/JsRootGraph0D.tsx @@ -1,45 +1,24 @@ -import { Grid } from '@mui/material'; +import { Box, Typography } from '@mui/material'; import React from 'react'; import { Page0D } from './GraphData'; export function JsRootGraph0D(props: { page: Page0D; title?: string }) { const { page, title } = props; - const [resultValue, setResultValue] = useState(0); - - useEffect(() => { - setResultValue(page.data.values[0]); - }, [page]); return ( - - -

Custom name

-
-

{props.data.name}:

-

{props.data.values[0]}

-

[{props.data.unit}]

-
-
- -

Filters

-
-
-

Filter1

-

Filter2

-
-
-
-
+ + {title ?? 'Quantity'} + +

{page.data.name}:

+

{page.data.values[0]}

+

[{page.data.unit}]

+
+
); } From 7f29daf1d3fffcf4d37658427745dade3c2fd9d1 Mon Sep 17 00:00:00 2001 From: ostatni5 <26521377+ostatni5@users.noreply.github.com> Date: Wed, 31 Aug 2022 22:26:14 +0200 Subject: [PATCH 6/6] fix loading examples --- src/ThreeEditor/examples/ex1.json | 41 ++++++++++++++++++---------- src/ThreeEditor/examples/examples.ts | 2 +- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/src/ThreeEditor/examples/ex1.json b/src/ThreeEditor/examples/ex1.json index a5a3903d6..167963b55 100644 --- a/src/ThreeEditor/examples/ex1.json +++ b/src/ThreeEditor/examples/ex1.json @@ -109,7 +109,7 @@ "geometry": "744d5753-c4ab-4565-bfbd-77c981e84fec", "material": "81a7aa32-b85f-45c4-bcd7-f648a0be12dc", "geometryData": { - "id": 859, + "id": 958, "geometryType": "CylinderGeometry", "position": [0,0,10], "rotation": [0,0,0], @@ -129,7 +129,7 @@ "geometry": "918ef747-7846-462d-ab4d-a1bfef2d196a", "material": "8485707f-07bf-49d2-86ab-070eb9878a00", "geometryData": { - "id": 861, + "id": 960, "geometryType": "CylinderGeometry", "position": [0,0,10.5], "rotation": [0,0,0], @@ -176,15 +176,13 @@ "uuid": "368269D3-6F9B-4241-84A0-5D908D10E196", "name": "Zones", "worldZone": { - "uuid": "65e9ab34-419e-4782-b2c0-97ef12ef87e4", + "uuid": "ef88c351-6eb0-4e7c-a546-01a4d621a3ef", "center": { - "isVector3": true, "x": 0, "y": 0, "z": 10.5 }, "size": { - "isVector3": true, "x": 6, "y": 6, "z": 24 @@ -391,29 +389,32 @@ "quantities": { "active": [ { + "name": "Quantity", "uuid": "e3488754-9a67-4d3c-b0ea-17300d651a8a", "keyword": "DoseGy", "modifiers": [] }, { + "name": "Quantity_1", "uuid": "53ba1036-4975-4a96-a6bd-3d336fc72612", "keyword": "Fluence", "filter": "9d0bae09-9ebe-46fe-9e59-bd7888db9442", "modifiers": [] }, { + "name": "Quantity_2", "uuid": "050f3919-a59b-45a4-9326-38d788c16ab7", "keyword": "Fluence", "filter": "eacf5223-2411-4529-8abe-2c0fb2daf57f", "modifiers": [] }, { + "name": "Quantity_3", "uuid": "b3286437-b2a1-4ee9-b7da-8cc2cc435fcd", "keyword": "Fluence", "filter": "6ba215e8-359e-447d-bac9-4f2808faed51", "modifiers": [] - }], - "disabled": [] + }] }, "detectGeometry": "186ec65a-8511-418b-8218-8890138c6b12", "trace": false @@ -424,23 +425,25 @@ "quantities": { "active": [ { + "name": "Quantity", "uuid": "c3499475-9496-4ee5-b705-950b83867dac", "keyword": "DoseGy", "modifiers": [] }, { + "name": "Quantity_1", "uuid": "be97ed10-07af-49d2-b91a-5bfe09c0c228", "keyword": "Fluence", "filter": "9d0bae09-9ebe-46fe-9e59-bd7888db9442", "modifiers": [] }, { + "name": "Quantity_2", "uuid": "69305c71-de72-466c-86bc-ba5e58635a9e", "keyword": "Fluence", "filter": "6ba215e8-359e-447d-bac9-4f2808faed51", "modifiers": [] - }], - "disabled": [] + }] }, "detectGeometry": "3306e98b-5da2-46ee-8892-ac0191d645a7", "trace": false @@ -451,36 +454,42 @@ "quantities": { "active": [ { + "name": "Quantity", "uuid": "48b2c7a4-58c4-4ff7-816b-865ce146ae95", "keyword": "AvgEnergy", "filter": "eacf5223-2411-4529-8abe-2c0fb2daf57f", "modifiers": [] }, { + "name": "Quantity_1", "uuid": "a9164784-1770-48d5-a772-3342fb06efe9", "keyword": "AvgEnergy", "filter": "9d0bae09-9ebe-46fe-9e59-bd7888db9442", "modifiers": [] }, { + "name": "Quantity_2", "uuid": "2bf3b68d-a855-443a-8ea0-2bf05eeb9e65", "keyword": "AvgEnergy", "filter": "6ba215e8-359e-447d-bac9-4f2808faed51", "modifiers": [] }, { + "name": "Quantity_3", "uuid": "d0c4addd-0775-420e-9240-d5ba3e279a2b", "keyword": "dLET", "filter": "9d0bae09-9ebe-46fe-9e59-bd7888db9442", "modifiers": [] }, { + "name": "Quantity_4", "uuid": "a4e9cac1-a643-4448-bc4a-89977101cc67", "keyword": "tLET", "filter": "9d0bae09-9ebe-46fe-9e59-bd7888db9442", "modifiers": [] }, { + "name": "Quantity_5", "uuid": "de64c12b-15cc-4e72-9262-b5507a738c9f", "keyword": "Fluence", "filter": "9d0bae09-9ebe-46fe-9e59-bd7888db9442", @@ -493,8 +502,7 @@ "isLog": false, "uuid": "1afaf3d8-443f-4bac-8999-be914ff0691a" }] - }], - "disabled": [] + }] }, "detectGeometry": "53fff3c4-30de-4210-9066-20dc0f90cccb", "trace": false @@ -505,36 +513,42 @@ "quantities": { "active": [ { + "name": "Quantity", "uuid": "54b85511-c885-41bd-a81d-a97842197764", "keyword": "AvgEnergy", "filter": "eacf5223-2411-4529-8abe-2c0fb2daf57f", "modifiers": [] }, { + "name": "Quantity_1", "uuid": "e7ff88d1-e46a-4a69-b676-e8e3ed1e67fd", "keyword": "AvgEnergy", "filter": "9d0bae09-9ebe-46fe-9e59-bd7888db9442", "modifiers": [] }, { + "name": "Quantity_2", "uuid": "95c292b9-966e-42fe-91a0-3d0f0db55876", "keyword": "AvgEnergy", "filter": "6ba215e8-359e-447d-bac9-4f2808faed51", "modifiers": [] }, { + "name": "Quantity_3", "uuid": "efd9f82c-8e0e-4d3d-a22d-70a0cc11ef7b", "keyword": "dLET", "filter": "9d0bae09-9ebe-46fe-9e59-bd7888db9442", "modifiers": [] }, { + "name": "Quantity_4", "uuid": "dac16bbd-e361-46d3-8eae-9c69571aea96", "keyword": "tLET", "filter": "9d0bae09-9ebe-46fe-9e59-bd7888db9442", "modifiers": [] }, { + "name": "Quantity_5", "uuid": "65f821c8-a654-4f6f-b666-0fdc8c925cf5", "keyword": "Fluence", "filter": "9d0bae09-9ebe-46fe-9e59-bd7888db9442", @@ -547,12 +561,11 @@ "isLog": false, "uuid": "07a5db58-a8ea-4175-93e7-9fe74ca14d34" }] - }], - "disabled": [] + }] }, "detectGeometry": "deb6a8f8-fab3-488e-8a01-9bb3e8ea4649", "trace": false }] }, - "hash": "9646c25a7efc0d9e83edb12db02d102cc84fda8b" + "hash": "709261855545792b10536bdc1336f0510a146ce5" } \ No newline at end of file diff --git a/src/ThreeEditor/examples/examples.ts b/src/ThreeEditor/examples/examples.ts index 3f3522505..17749efc1 100644 --- a/src/ThreeEditor/examples/examples.ts +++ b/src/ThreeEditor/examples/examples.ts @@ -21,7 +21,7 @@ while (canImport) { result.result.estimators, editor.scoringManager ); - + EXAMPLES.push({ editor, result }); iterator++; } catch (e) {