Repository navigation
Ariadne views: a viewport widget, and node tags: that pick what each view draws - #1005
Merged
Merged
Conversation
…view draws A `type: viewport` widget shows the document's scene in one of its windows, from a camera of its own (<prefix>.viewers.<view>.camera). It draws the whole scene, or the untagged nodes plus those its show: / hide: allow, by the nodes' new `tags:` key (roadmap 9.5). A node's tags hold for its subtree. - scene.h / loader: SceneNode::tags (a list or one name), a built-in key. - RealizedScene::tagged: the tagged nodes at any depth, held weakly. - SceneNode::collectViewProps: every 3-D prop a node (and its subtree) can put in a renderer; GraphicsNode adds its bounding box, GridNode its planes. - Viewport::setMirrorFilter: which source props a mirror's re-sync copies. - ImGuiBackend::cut_window_background: a window that cut a hole last frame paints its own background around this frame's holes. - SceneViews (scene_views.h): the widget. Each view is a mirror viewport of the main one, placed in the widget's rect, hidden on frames the widget is not drawn (closed or collapsed window, hidden UI), framed on what it shows; drag orbits / pans, the wheel zooms. AriRuntime owns one, so arigl and pycvc_gl have it; a new document removes the last one's views. - components/scene_view.ari: a window around one viewport, configured by args. - examples/ariadne/documents/scene_views.ari: an overview map and a layers view. - docs: ARIADNE.md 5.18 and the component table; roadmap 9.5 status. Tests: cvcgl_ariadne_views (props per view, pixels, input, hiding, reload); AriadneScene.NodeTags; AriadneComponents.SceneViewPassesItsArgsToTheViewport.
…nager cvcgl_ari_switch (and arigl at exit) close the SceneRenderer before the AriRuntime goes; ~AriRuntime's views_->clear() then asked the closed view for its ViewportManager, which throws, and a throw from a destructor aborts. With the view closed, clear() and update() drop the views: their viewports went with the manager. cvcgl_ariadne_views now closes its view with views present.
# Conflicts: # docs/ARIADNE.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A document can now show its scene in one of its own windows. The view has its own camera, and can draw the whole scene or just some of it, picked by a new
tags:key on scene nodes. That covers an overview map, a second angle on the same scene, or one layer on its own, with no host code. This is the viewport work roadmap §9.5 described; until now it existed only as a design.The reference is
docs/ARIADNE.md§5.18.What's in it
Node
tags:SceneNode::tagstakes a list or a single name. It is a built-in key, so it is no longer left in a custom node type's props.RealizedScene::taggedlists the tagged nodes at any depth, held weakly.The
viewportwidget (SceneViews,scene_views.h)Viewport::setMirrorFilterdrops the props of the nodes a view'sshow:/hide:rule out. A newSceneNode::collectViewPropslists a node's 3-D props, including a bounding box and the grid's three planes.ImGuiBackend::cut_window_background).bind:takes the tag list from a state key, for a layers menu.clear_color:sets the view's background, which otherwise copies the main view's.Component:
cvc://components/scene_view.ariis a window around one viewport, configured by args (view,show,hide,camera,chrome,width,height,title,id). It is listed inINDEX.ari.Example:
examples/ariadne/documents/scene_views.arihas an overview map of the buildings and agents, without the goal markers or the grid. It also has a Layers view whose combo picks its tags.Tested (Windows, Release, cvcGL + arigl, cvcpkg prefix)
New tests
cvcgl_ariadne_views, 27 checks, offscreen through AriRuntime:[sim]view shows red and blue, with no yellow where the main view has 43k yellow pixels;AriadneScene.NodeTags.AriadneComponents.SceneViewPassesItsArgsToTheViewport.Existing suites:
ariadne_loader_test217 (withShippedComponentsLoadCleanandShippedExamplesDeclareWhatTheyNeedover the new files),ariadne_runtime_test250,ariadne_host_test42,cvcgl_ari_golden34 (the goldens unchanged),cvcgl_viewport,cvcgl_viewport_input,cvcgl_scene_renderer_facadeandcvcgl_ariadne_realize.Example:
arigl snapshotofscene_views.aridraws both views as described, with no load warnings.Not run locally: pycvc / pycvc_gl and the wasm build.
Not in this PR
override:).views:block of full-window views.ariadne_hellobuilds its own runtime, so it doesn't have the widget. arigl and pycvc_gl do.