From d7e4c8c6bd2e8a95337d0929532d61021a9fa339 Mon Sep 17 00:00:00 2001 From: Scott Vorthmann Date: Thu, 31 Oct 2024 14:01:27 -0500 Subject: [PATCH 1/3] formatting fix --- .../src/main/java/org/vorthmann/zome/ui/MeasurePanel.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/desktop/src/main/java/org/vorthmann/zome/ui/MeasurePanel.java b/desktop/src/main/java/org/vorthmann/zome/ui/MeasurePanel.java index b4e0d198c..98bdcf236 100644 --- a/desktop/src/main/java/org/vorthmann/zome/ui/MeasurePanel.java +++ b/desktop/src/main/java/org/vorthmann/zome/ui/MeasurePanel.java @@ -118,9 +118,9 @@ public void run() measures = controller .getCommandList( "measures" ); values = new String[ measures.length ]; for ( int i = 0; i < measures.length; i++ ) { - String measure = measures[i]; - values[ i ] = controller .getProperty( measure ); - } + String measure = measures[i]; + values[ i ] = controller .getProperty( measure ); + } fireTableDataChanged(); } } From 0ce7801c8944cfc2cbd84031bafe795007b87cd9 Mon Sep 17 00:00:00 2001 From: Scott Vorthmann Date: Thu, 31 Oct 2024 14:06:41 -0500 Subject: [PATCH 2/3] remove extra logging --- online/src/app/classic/tools/unified.jsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/online/src/app/classic/tools/unified.jsx b/online/src/app/classic/tools/unified.jsx index 08def3619..9efa2c0ab 100644 --- a/online/src/app/classic/tools/unified.jsx +++ b/online/src/app/classic/tools/unified.jsx @@ -36,7 +36,6 @@ const UnifiedTool = props => }, onClick: ( id, position, type, selected ) => { - console.log( 'UnifiedTool onClick' ); controllerAction( pickingController(), 'SelectManifestation', { id } ) }, @@ -48,7 +47,6 @@ const UnifiedTool = props => onDragStart: ( evt, id, position, type, selected ) => { if ( type !== 'ball' ) return; - console.log( 'UnifiedTool onDragStart' ); setPosition( position ); const { x, y, z } = new Vector3() .copy( eye() ) .sub( new Vector3( ...position ) ) .normalize(); setLine( [ x, y, z ] ); @@ -57,7 +55,6 @@ const UnifiedTool = props => }, onDrag: () => {}, onDragEnd: () => { - console.log( 'UnifiedTool onDragEnd' ); if ( operating() ) { setOperating( null ); endPreviewStrut(); From 875f5052a6fdd6ec8c75a534b8b1d0ba8c7ab723 Mon Sep 17 00:00:00 2001 From: Scott Vorthmann Date: Thu, 31 Oct 2024 14:36:06 -0500 Subject: [PATCH 3/3] Added Measure tab to online --- online/serve/app/classic/classic.css | 16 ++++++++ online/serve/app/kobalte.css | 5 +-- online/src/app/classic/classic.jsx | 23 +++++++++-- online/src/app/classic/components/camera.jsx | 6 +-- online/src/app/classic/components/measure.jsx | 41 +++++++++++++++++++ online/src/wc/zometool/parts-list.jsx | 16 ++++---- .../src/worker/legacy/controllers/editor.js | 3 ++ 7 files changed, 92 insertions(+), 18 deletions(-) create mode 100644 online/src/app/classic/components/measure.jsx diff --git a/online/serve/app/classic/classic.css b/online/serve/app/classic/classic.css index 41af250db..9cd6258bb 100644 --- a/online/serve/app/classic/classic.css +++ b/online/serve/app/classic/classic.css @@ -208,6 +208,7 @@ button:disabled > .toolbar-image { .editor-drawer { width: 320px; + border-inline-start: 1px solid darkgray; } .grid-rows-min-1 { @@ -252,6 +253,21 @@ button:disabled > .toolbar-image { margin: 3px; } +.tabs__content { + padding: 6px; +} + +#camera-controls { + display: grid; + grid-template-rows: min-content min-content; +} + +#ball-and-slider { + display: grid; + grid-template-columns: min-content 1fr; + border-block: 1px solid darkgray; +} + .scale-slider { margin: 9px; margin: auto; diff --git a/online/serve/app/kobalte.css b/online/serve/app/kobalte.css index cb3ba0527..bb46dc3a3 100644 --- a/online/serve/app/kobalte.css +++ b/online/serve/app/kobalte.css @@ -26,7 +26,7 @@ } .tabs__indicator[data-orientation="horizontal"] { bottom: -1px; - height: 2px; + height: 3px; } .tabs__indicator[data-orientation="vertical"] { right: -1px; @@ -37,9 +37,8 @@ padding: 8px 16px; outline: none; border: none; - font-size: large; + font-size: medium; text-transform: capitalize; - color: mediumblue; } .tabs__trigger:hover { background-color: hsl(0 0% 98%); diff --git a/online/src/app/classic/classic.jsx b/online/src/app/classic/classic.jsx index 3d8c549bd..7baf9ca29 100644 --- a/online/src/app/classic/classic.jsx +++ b/online/src/app/classic/classic.jsx @@ -1,5 +1,8 @@ +import { createSignal } from 'solid-js'; + import { subController, useEditor } from '../framework/context/editor.jsx'; +import { Tab, Tabs } from '../framework/tabs.jsx'; import { CameraControls } from './components/camera.jsx'; import { StrutBuildPanel } from './components/strutbuilder.jsx'; @@ -7,6 +10,7 @@ import { BookmarkBar, ToolBar, ToolFactoryBar } from './components/toolbars.jsx' import { SceneEditor } from './components/editor.jsx'; import { ErrorAlert } from "./components/alert.jsx"; import { SceneControls } from './components/scenecontrols.jsx'; +import { MeasurePanel } from './components/measure.jsx'; export const ClassicEditor = () => { @@ -17,6 +21,9 @@ export const ClassicEditor = () => const strutBuilder = () => subController( rootController(), 'strutBuilder' ); const toolsController = () => subController( strutBuilder(), 'tools' ); + const [ tab, setTab ] = createSignal( "Build" ); + const changeTab = (event, newValue) => setTab( newValue ); + let alertRoot; return (
@@ -37,9 +44,19 @@ export const ClassicEditor = () =>
-
- -
+ + +
+ +
+
+ + + + + + +
diff --git a/online/src/app/classic/components/camera.jsx b/online/src/app/classic/components/camera.jsx index 6120cac4b..bcec04c7c 100644 --- a/online/src/app/classic/components/camera.jsx +++ b/online/src/app/classic/components/camera.jsx @@ -84,7 +84,7 @@ export const CameraControls = (props) => {/* provider and CameraTool just to get the desired cursor */} -
+
}/> -
-
+
+
diff --git a/online/src/app/classic/components/measure.jsx b/online/src/app/classic/components/measure.jsx new file mode 100644 index 000000000..f5e1e187f --- /dev/null +++ b/online/src/app/classic/components/measure.jsx @@ -0,0 +1,41 @@ + +import TableContainer from "@suid/material/TableContainer"; +import Table from "@suid/material/Table"; +import TableBody from "@suid/material/TableBody"; +import TableHead from "@suid/material/TableHead"; +import TableRow from "@suid/material/TableRow"; +import TableCell from "@suid/material/TableCell"; +import Paper from "@suid/material/Paper"; + +import { controllerProperty, subController, useEditor } from '../../framework/context/editor.jsx'; + +export const MeasurePanel = () => +{ + const { rootController } = useEditor(); + const measureController = () => subController( rootController(), 'measure' ); + const measures = () => controllerProperty( measureController(), 'measures', 'measures', true ); + const value = measure => controllerProperty( measureController(), measure ); + + const cellStyle = { padding: '6px 0px', border: '0px' }; + const headerStyle = { ...cellStyle, borderBlockEnd: '1px solid darkgray', fontWeight: 'bold' }; + return ( + + + + + Measurement + Value + + + + { ( measure ) => + + { measure } + { value( measure ) } + + } + +
+
+ ); +} \ No newline at end of file diff --git a/online/src/wc/zometool/parts-list.jsx b/online/src/wc/zometool/parts-list.jsx index ff2b6da7d..b764a98a9 100644 --- a/online/src/wc/zometool/parts-list.jsx +++ b/online/src/wc/zometool/parts-list.jsx @@ -1,13 +1,11 @@ import { render } from "solid-js/web"; -import { - Paper, - Table, - TableBody, - TableCell, - TableContainer, - TableHead, - TableRow, -} from "@suid/material"; +import TableContainer from "@suid/material/TableContainer"; +import Table from "@suid/material/Table"; +import TableHead from "@suid/material/TableHead"; +import TableRow from "@suid/material/TableRow"; +import TableCell from "@suid/material/TableCell"; +import TableBody from "@suid/material/TableBody"; +import Paper from "@suid/material/Paper"; import { instructionsCSS } from "./zometool.css.js"; diff --git a/online/src/worker/legacy/controllers/editor.js b/online/src/worker/legacy/controllers/editor.js index c83a07514..152bfa652 100644 --- a/online/src/worker/legacy/controllers/editor.js +++ b/online/src/worker/legacy/controllers/editor.js @@ -60,6 +60,9 @@ export class EditorController extends com.vzome.desktop.controller.DefaultContro const quaternionController = new com.vzome.desktop.controller.VectorController( legacyField .basisVector( 4, com.vzome.core.algebra.AlgebraicVector.W4 ) ); this .addSubController( "quaternion", quaternionController ); + const measureController = new com.vzome.desktop.controller.MeasureController( editor, renderedModel ); + this .addSubController( "measure", measureController ); + const strutBuilder = new com.vzome.desktop.controller.StrutBuilderController( editContext, legacyField ) .withGraphicalViews( true ) // TODO use preset .withShowStrutScales( true ); // TODO use preset