Skip to content

HTML project browser with property editor and WebGL view#992

Open
magnesj wants to merge 12 commits into
devfrom
investigate-html-editor
Open

HTML project browser with property editor and WebGL view#992
magnesj wants to merge 12 commits into
devfrom
investigate-html-editor

Conversation

@magnesj

@magnesj magnesj commented May 31, 2026

Copy link
Copy Markdown
Owner

Adds a lightweight HTTP server (RiaHtmlServer, on Qt6::HttpServer) that exposes the open project in a web browser, started automatically by the GUI application.

Features

  • Project tree + property editor: a two-pane page shows the collapsible project tree on the left and a property editor for the selected node on the right. The tree is collapsed by default but expands the chain down to the active 3D view.
  • Property editing: value fields render as text inputs, booleans as checkboxes, and option fields as drop-downs. Edits are applied through PdmUiCommandSystemProxy so enums and change notifications behave like the desktop editors. Pointer fields are shown read-only and never modified.
  • 3D view snapshot: a PNG of the active 3D view (/viewsnapshot).
  • WebGL triangle view: /trianglesview renders the active grid view's triangle meshes with three.js. Geometry is extracted with the same VdeVizDataExtractor pipeline used by RicHoloLensSession; cell-result coloring is reproduced by passing the color-legend texture and per-vertex texture coordinates to the browser.
  • Auto-refresh: the page polls a /viewstate version endpoint. Camera navigation in the desktop app refreshes the snapshot; a visible-cell change (filters, time step) refetches the triangle geometry. The WebGL view preserves its rotation/zoom/panning across geometry reloads.

Build

Qt6::HttpServer is scoped to ApplicationLibCode and removed from the top-level QT_LIBRARIES.

magnesj and others added 12 commits May 30, 2026 18:00
Add RiaHtmlServer built on QHttpServer (Qt6::HttpServer), started together
with the GUI. It serves the project tree as nested HTML and a property
editor form for any object, addressing objects by a dotted child-index path.

Editing a value posts back the form, applies changes via setFromQVariant,
fires fieldChangedByUi and refreshes connected editors. The full server URL
is logged to the message window on startup.
Render the project tree and property editor in a two-pane layout with a collapsible tree, and show the active 3D view as a PNG snapshot served from a new /viewsnapshot endpoint. Scope the Qt6::HttpServer dependency to ApplicationLibCode instead of the top-level CMakeLists.
Reuse the VdeVizDataExtractor pipeline (the same one RicHoloLensSession feeds to the HoloLens sharing server) to extract the active grid view's triangle meshes and serve them as JSON. A new /trianglesview page renders them with three.js, embedded alongside the existing snapshot on the object page. Cell-result meshes are colored by passing the color-legend texture and per-vertex texture coordinates to the browser, matching the native 3D view.
Add view-state version counters to the HTML server: one bumped on camera navigation (RiuViewer::navigationPolicyUpdate) and one bumped when the display model is rebuilt (Rim3dView), i.e. when the visible cell set changes via filters or time step. A new /viewstate endpoint exposes both. The object page polls it and reloads the snapshot on any change, while the triangle view refetches and rebuilds its geometry only on visible-cell changes, preserving its own orbit camera during plain navigation.
Tree nodes start collapsed. The root node and the chain of nodes leading to the active 3D view are open by default so that view is revealed on load.
Render boolean fields as checkboxes and option fields as drop-downs, applying edits through PdmUiCommandSystemProxy so enums and notifications work like the desktop editors. Pointer fields are shown read-only and never modified. The WebGL triangle view keeps its rotation, zoom and panning when the geometry reloads after a visible-cell change.
The Commands directory is already on the ApplicationLibCode include path, so HoloLensCommands/... resolves directly.
Apply the colors from the dark theme to the generated pages, add a header
bar with the application logo and project name, set the page title, and
serve the application icon at /appicon.png for use as the favicon.
Render option fields as a native <select> drop-down submitting the option
index. Fields with many options (string lists, etc.) get a filter box and a
list box so matches stay visible while typing. The option index is applied as
a UInt so the option-based field path maps it back to the stored value.
Use caf's UI tree ordering (defineUiTreeOrdering) with the MainWindow.ProjectTree
config name to build the tree, so it mirrors the desktop project tree. This makes
views appear under their grid model and honors custom ordering, grouping and hidden
items. Nodes are addressed by their index path in the ordering, kept consistent
across the tree, property editor and child links.
Render each tree node's UI icon to a PNG and serve it via a new /icon route.
Icons are deduplicated by content so identical icons share one id, keeping the
page small and cacheable. Icons are shown in the tree and the children list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant