205 lines
10 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>RenderingCanvas Tool Bar | HiAPI-C# 2025 </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="RenderingCanvas Tool Bar | HiAPI-C# 2025 ">
<link rel="icon" href="../img/HiAPI.favicon.ico">
<link rel="stylesheet" href="../public/docfx.min.css">
<link rel="stylesheet" href="../public/main.css">
<meta name="docfx:navrel" content="../toc.html">
<meta name="docfx:tocrel" content="toc.html">
<meta name="docfx:rel" content="../">
<meta name="loc:inThisArticle" content="In this article">
<meta name="loc:searchResultsCount" content="{count} results for &quot;{query}&quot;">
<meta name="loc:searchNoResults" content="No results for &quot;{query}&quot;">
<meta name="loc:tocFilter" content="Filter by title">
<meta name="loc:nextArticle" content="Next">
<meta name="loc:prevArticle" content="Previous">
<meta name="loc:themeLight" content="Light">
<meta name="loc:themeDark" content="Dark">
<meta name="loc:themeAuto" content="Auto">
<meta name="loc:changeTheme" content="Change theme">
<meta name="loc:copy" content="Copy">
<meta name="loc:downloadPdf" content="Download PDF">
<script type="module" src="./../public/docfx.min.js"></script>
<script>
const theme = localStorage.getItem('theme') || 'auto'
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
</script>
</head>
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="">
<header class="bg-body border-bottom">
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
<div class="container-xxl flex-nowrap">
<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../img/HiAPI.logo.png" alt="">
</a>
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
<i class="bi bi-three-dots"></i>
</button>
<div class="collapse navbar-collapse" id="navpanel">
<div id="navbar">
<form class="search" role="search" id="search">
<i class="bi bi-search"></i>
<input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
</form>
</div>
</div>
</div>
</nav>
</header>
<main class="container-xxl">
<div class="toc-offcanvas">
<div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<nav class="toc" id="toc"></nav>
</div>
</div>
</div>
<div class="content">
<div class="actionbar">
<button class="btn btn-lg border-0 d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
<i class="bi bi-list"></i>
</button>
<nav id="breadcrumb"></nav>
</div>
<article data-uid="">
<h1 id="renderingcanvas-tool-bar">RenderingCanvas Tool Bar</h1>
<p>The RenderingCanvas Tool Bar provides view control buttons for the 3D rendering canvas. It operates on <a class="xref" href="../api/Hi.Disp.DispEngine.html">DispEngine</a>.</p>
<h2 id="view-buttons">View Buttons</h2>
<p>The toolbar includes standard view buttons:</p>
<table>
<thead>
<tr>
<th>Button</th>
<th>API Method</th>
</tr>
</thead>
<tbody>
<tr>
<td>Front View</td>
<td><a class="xref" href="../api/Hi.Disp.DispEngine.html#Hi_Disp_DispEngine_SetViewToFrontView">SetViewToFrontView()</a></td>
</tr>
<tr>
<td>Back View</td>
<td><a class="xref" href="../api/Hi.Disp.DispEngine.html#Hi_Disp_DispEngine_SetViewToFrontView">SetViewToFrontView()</a> + <a class="xref" href="../api/Hi.Disp.DispEngine.html#Hi_Disp_DispEngine_TurnBackView">TurnBackView()</a></td>
</tr>
<tr>
<td>Right View</td>
<td><a class="xref" href="../api/Hi.Disp.DispEngine.html#Hi_Disp_DispEngine_SetViewToRightView">SetViewToRightView()</a></td>
</tr>
<tr>
<td>Left View</td>
<td><a class="xref" href="../api/Hi.Disp.DispEngine.html#Hi_Disp_DispEngine_SetViewToRightView">SetViewToRightView()</a> + <a class="xref" href="../api/Hi.Disp.DispEngine.html#Hi_Disp_DispEngine_TurnBackView">TurnBackView()</a></td>
</tr>
<tr>
<td>Top View</td>
<td><a class="xref" href="../api/Hi.Disp.DispEngine.html#Hi_Disp_DispEngine_SetViewToTopView">SetViewToTopView()</a></td>
</tr>
<tr>
<td>Bottom View</td>
<td><a class="xref" href="../api/Hi.Disp.DispEngine.html#Hi_Disp_DispEngine_SetViewToTopView">SetViewToTopView()</a> + <a class="xref" href="../api/Hi.Disp.DispEngine.html#Hi_Disp_DispEngine_TurnBackView">TurnBackView()</a></td>
</tr>
<tr>
<td>Isometric View</td>
<td><a class="xref" href="../api/Hi.Disp.DispEngine.html#Hi_Disp_DispEngine_SetViewToIsometricView">SetViewToIsometricView()</a></td>
</tr>
</tbody>
</table>
<h3 id="back-view-implementation">Back View Implementation</h3>
<p>Back / Left / Bottom views are composed by first calling the corresponding forward-view method (<code>SetViewToFrontView</code> / <code>SetViewToRightView</code> / <code>SetViewToTopView</code>) and then invoking <a class="xref" href="../api/Hi.Disp.DispEngine.html#Hi_Disp_DispEngine_TurnBackView">TurnBackView()</a> to flip the camera about the view plane.</p>
<h2 id="display-options-dropdown">Display Options Dropdown</h2>
<p>Pages that sit next to a <code>RenderingCanvas</code> surface a per-page <code>Display Options ▾</code> menu button that toggles visibility / rendering-mode flags on the engine's current <code>Displayee</code>. The dropdown's layout (header + checkboxes + radio rows) is shared across four callers — Workpiece, Fixture, ToolHouse, and the Player extended toolbar — so it is implemented once as a generic, schema-driven component.</p>
<h3 id="schema">Schema</h3>
<p>Each dropdown consumes a <code>DisplayGroup[]</code> array. A group has an optional header and a flat list of items:</p>
<ul>
<li><code>{ kind: 'check', label, modelValue, disable?, onUpdate }</code> — a checkbox row.</li>
<li><code>{ kind: 'radio', label, groupValue, value, disable?, onUpdate }</code> — a radio row inside an implicit radio-group keyed by <code>groupValue</code>.</li>
</ul>
<p>The component is generic over the radio <code>value</code> type, so <code>RenderingMode</code> / <code>HolderRenderingMode</code> / etc. stay fully typed at the call site.</p>
<h3 id="hinc-2025-webservice-quasar-cli-spa">HiNC-2025-webservice (Quasar CLI SPA)</h3>
<ul>
<li><code>wwwroot-src/src/components/widgets/DisplayOptionsMenu.vue</code> — the shared <code>&lt;q-btn-dropdown&gt;</code> + <code>&lt;q-list&gt;</code> implementation. Replaces the previously-inlined markup in all four callers.</li>
<li>Callers (each reads a <code>DisplayGroup[]</code> computed from its page-local state and forwards <code>onUpdate</code> to its existing handlers):
<ul>
<li><code>wwwroot-src/src/pages/WorkpiecePage.vue</code></li>
<li><code>wwwroot-src/src/pages/FixturePage.vue</code></li>
<li><code>wwwroot-src/src/pages/ToolHousePage.vue</code></li>
<li><code>wwwroot-src/src/components/player/PlayerExtendedToolBar.vue</code></li>
</ul>
</li>
<li>Backends: the existing per-page display controllers (<code>WorkpieceDisplayController.cs</code>, <code>FixtureDisplayController.cs</code>, <code>ToolHouseDisplayController.cs</code>, <code>Players/*DisplayController.cs</code>, and the shared <code>/api/rendering-flags</code> surface) drive the underlying <code>DispEngine.RenderingFlag</code> state. <code>DisplayOptionsMenu.vue</code> is UI-only; it does no REST work itself — the page owns the <code>onUpdate</code> handlers.</li>
</ul>
<h3 id="wpf">WPF</h3>
<ul>
<li><code>Common/DisplayOptionsMenu</code> — each page owns its own <code>&lt;MenuItem&gt;</code>-based dropdown; no shared component. Behaviour parity only (no schema-driven reuse).</li>
</ul>
<h2 id="source-code-locations">Source Code Locations</h2>
<p>See <a href="index.html">HiNC GUI Architecture</a> for git repository links.</p>
<h3 id="wpf-application">WPF Application</h3>
<ul>
<li><code>Disp/RenderingCanvasToolBar</code></li>
</ul>
<h3 id="web-application">Web Application</h3>
<p>HiNC-2025-webservice (Quasar CLI SPA):</p>
<ul>
<li><code>wwwroot-src/src/components/widgets/RenderingCanvasToolBar.vue</code> — View dropdown (Isometric / Front / Back / Right / Left / Top / Bottom). Shared across Workpiece / Fixture / ToolHouse / Controller / Player viewer sections.</li>
<li><code>wwwroot-src/src/components/widgets/DisplayOptionsMenu.vue</code> — schema-driven dropdown described above.</li>
<li><code>wwwroot-src/src/components/widgets/RenderingCanvas.vue</code> — SignalR-hosted WebSocket canvas (see <a href="hinc-web-service/disp-web-service.html">Rendering Canvas on Web Service</a>).</li>
<li>Backends:
<ul>
<li><code>Disp/RenderingHub.cs</code> — handles view changes from the toolbar.</li>
<li><code>Disp/RenderingService.cs</code> — manages <code>DispEngine</code> instances.</li>
<li><code>Disp/RenderingFlagsController.cs</code> — the shared <code>/api/rendering-flags</code> surface consumed by <code>DisplayOptionsMenu.vue</code> callers.</li>
</ul>
</li>
</ul>
</article>
<div class="contribution d-print-none">
</div>
<div class="next-article d-print-none border-top" id="nextArticle"></div>
</div>
<div class="affix">
<nav id="affix"></nav>
</div>
</main>
<div class="container-xxl search-results" id="search-results"></div>
<footer class="border-top text-secondary">
<div class="container-xxl">
<div class="flex-fill">
<span> Copyright © 2025 <a href='https://superhightech.com.tw'>Tech Coordinate</a>. All rights reserved. <a href='https://superhightech.com.tw'>超級高科技股份有限公司</a> © 2025 版權所有 </span>
</div>
</div>
</footer>
</body>
</html>